Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c5e0a1566e | |||
| 167f78951e | |||
| 4b6d4e581f | |||
| 123fbf5633 | |||
| 4c054d5b8c |
+1
-1
Submodule assets updated: 007b54bd67...3af64d8b1f
@@ -2,14 +2,14 @@
|
|||||||
#define EEntityDeleted_h__
|
#define EEntityDeleted_h__
|
||||||
|
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
#include "Entity.h"
|
#include "EntityWrapper.h"
|
||||||
|
|
||||||
namespace Events
|
namespace Events
|
||||||
{
|
{
|
||||||
|
|
||||||
struct EntityDeleted : Event
|
struct EntityDeleted : Event
|
||||||
{
|
{
|
||||||
EntityID DeletedEntity;
|
EntityWrapper DeletedEntity;
|
||||||
// True if the entity deletion was triggered because the entity's parent was deleted before it
|
// True if the entity deletion was triggered because the entity's parent was deleted before it
|
||||||
bool Cascaded;
|
bool Cascaded;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
#ifndef RespawnSystem_h__
|
||||||
|
#define RespawnSystem_h__
|
||||||
|
|
||||||
|
#include "System.h"
|
||||||
|
#include "SpawnerSystem.h"
|
||||||
|
#include "EEntityDeleted.h"
|
||||||
|
#include "EPause.h"
|
||||||
|
|
||||||
|
class RespawnSystem : public PureSystem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
RespawnSystem(SystemParams params);
|
||||||
|
|
||||||
|
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& cRespawn, double dt) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::unordered_map<EntityWrapper, EntityWrapper> m_LastRespawnedEntity;
|
||||||
|
bool m_Paused = false;
|
||||||
|
|
||||||
|
EventRelay<RespawnSystem, Events::EntityDeleted> m_EEntityDeleted;
|
||||||
|
bool OnEntityDeleted(const Events::EntityDeleted& e);
|
||||||
|
EventRelay<RespawnSystem, Events::Pause> m_EPause;
|
||||||
|
bool OnPause(const Events::Pause& e);
|
||||||
|
EventRelay<RespawnSystem, Events::Resume> m_EResume;
|
||||||
|
bool OnResume(const Events::Resume& e);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "GLM.h"
|
#include "GLM.h"
|
||||||
#include "Core/System.h"
|
#include "Core/System.h"
|
||||||
#include "Events/ESpawnerSpawn.h"
|
#include "Core/ESpawnerSpawn.h"
|
||||||
#include "Core/Transform.h"
|
#include "Core/Transform.h"
|
||||||
#include "Core/EntityFile.h"
|
#include "Core/EntityFile.h"
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ protected:
|
|||||||
|
|
||||||
const std::string m_ComponentType;
|
const std::string m_ComponentType;
|
||||||
|
|
||||||
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& scoreScreen, double dt) = 0;
|
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& cComponent, double dt) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ImpureSystem : public virtual System
|
class ImpureSystem : public virtual System
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#include "../Core/ELockMouse.h"
|
#include "../Core/ELockMouse.h"
|
||||||
#include "../Core/EFileDropped.h"
|
#include "../Core/EFileDropped.h"
|
||||||
#include "../Rendering/Texture.h"
|
#include "../Rendering/Texture.h"
|
||||||
#include "Game/Events/ESpawnerSpawn.h"
|
#include "../Core/ESpawnerSpawn.h"
|
||||||
|
|
||||||
class EditorGUI
|
class EditorGUI
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -33,14 +33,12 @@ public:
|
|||||||
if (m_Quality == 0) {
|
if (m_Quality == 0) {
|
||||||
return m_BlackTexture->m_Texture;
|
return m_BlackTexture->m_Texture;
|
||||||
} else {
|
} else {
|
||||||
return m_FinalGaussianTexture;
|
return m_GaussianTexture_vert;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void GaussianLodPass(GLuint mipMap, GLuint texture);
|
|
||||||
void CombineGaussianBlur();
|
|
||||||
Texture* m_BlackTexture;
|
Texture* m_BlackTexture;
|
||||||
Model* m_ScreenQuad;
|
Model* m_ScreenQuad;
|
||||||
|
|
||||||
@@ -49,19 +47,15 @@ private:
|
|||||||
//const LightCullingPass* m_LightCullingPass
|
//const LightCullingPass* m_LightCullingPass
|
||||||
int m_Iterations;
|
int m_Iterations;
|
||||||
int m_Quality = 0;
|
int m_Quality = 0;
|
||||||
int m_BloomLod = 5;
|
|
||||||
|
|
||||||
GLuint m_GaussianTexture_horiz = 0;
|
GLuint m_GaussianTexture_horiz = 0;
|
||||||
GLuint m_GaussianTexture_vert = 0;
|
GLuint m_GaussianTexture_vert = 0;
|
||||||
GLuint m_FinalGaussianTexture = 0;
|
|
||||||
|
|
||||||
FrameBuffer* m_GaussianFrameBuffer_horiz = nullptr;
|
FrameBuffer m_GaussianFrameBuffer_horiz;
|
||||||
FrameBuffer* m_GaussianFrameBuffer_vert = nullptr;
|
FrameBuffer m_GaussianFrameBuffer_vert;
|
||||||
FrameBuffer m_GaussianCombineBuffer;
|
|
||||||
|
|
||||||
ShaderProgram* m_GaussianProgram_horiz;
|
ShaderProgram* m_GaussianProgram_horiz;
|
||||||
ShaderProgram* m_GaussianProgram_vert;
|
ShaderProgram* m_GaussianProgram_vert;
|
||||||
ShaderProgram* m_GaussianCombineProgram;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
#include "Texture.h"
|
#include "Texture.h"
|
||||||
#include "ShadowPass.h"
|
#include "ShadowPass.h"
|
||||||
#include "BlurHUD.h"
|
#include "BlurHUD.h"
|
||||||
#include "TextPass.h"
|
|
||||||
|
|
||||||
class DrawFinalPass
|
class DrawFinalPass
|
||||||
{
|
{
|
||||||
@@ -23,7 +22,7 @@ public:
|
|||||||
void InitializeTextures();
|
void InitializeTextures();
|
||||||
void InitializeFrameBuffers();
|
void InitializeFrameBuffers();
|
||||||
void InitializeShaderPrograms();
|
void InitializeShaderPrograms();
|
||||||
void Draw(RenderScene& scene, BlurHUD* blurHUDPass, TextPass* textPass);
|
void Draw(RenderScene& scene, BlurHUD* blurHUDPass);
|
||||||
void ClearBuffer();
|
void ClearBuffer();
|
||||||
void OnWindowResize();
|
void OnWindowResize();
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
#ifndef EResolutionChanged_h__
|
|
||||||
#define EResolutionChanged_h__
|
|
||||||
|
|
||||||
#include "../Core/Event.h"
|
|
||||||
#include "../Core/Util/Rectangle.h"
|
|
||||||
|
|
||||||
namespace Events
|
|
||||||
{
|
|
||||||
|
|
||||||
// Fired when the framebuffer size changes
|
|
||||||
struct ResolutionChanged : Event
|
|
||||||
{
|
|
||||||
Rectangle OldResolution;
|
|
||||||
Rectangle NewResolution;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -7,12 +7,11 @@
|
|||||||
class BufferResource
|
class BufferResource
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BufferResource(GLuint* resourceHandle, GLenum resourceType, GLenum attachment, GLuint mipMapLod);
|
BufferResource(GLuint* resourceHandle, GLenum resourceType, GLenum attachment);
|
||||||
|
|
||||||
GLuint* m_ResourceHandle;
|
GLuint* m_ResourceHandle;
|
||||||
GLenum m_ResourceType;
|
GLenum m_ResourceType;
|
||||||
GLenum m_Attachment;
|
GLenum m_Attachment;
|
||||||
GLuint m_MipMapLod = 0;
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -21,15 +20,15 @@ template <GLenum RESOURCETYPE>
|
|||||||
class ResourceType : public BufferResource
|
class ResourceType : public BufferResource
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ResourceType(GLuint* resourceHandle, GLenum attachment, GLuint mipMapLod)
|
ResourceType(GLuint* resourceHandle, GLenum attachment)
|
||||||
: BufferResource(resourceHandle, RESOURCETYPE, attachment, mipMapLod) { }
|
: BufferResource(resourceHandle, RESOURCETYPE, attachment) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
class Texture2D : public ResourceType<GL_TEXTURE_2D>
|
class Texture2D : public ResourceType<GL_TEXTURE_2D>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Texture2D(GLuint* resourceHandle, GLenum attachment, GLuint mipMapLod = 0)
|
Texture2D(GLuint* resourceHandle, GLenum attachment)
|
||||||
: ResourceType(resourceHandle, attachment, mipMapLod) { };
|
: ResourceType(resourceHandle, attachment) { };
|
||||||
|
|
||||||
~Texture2D();
|
~Texture2D();
|
||||||
};
|
};
|
||||||
@@ -38,7 +37,7 @@ class RenderBuffer : public ResourceType<GL_RENDERBUFFER>
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RenderBuffer(GLuint* resourceHandle, GLenum attachment)
|
RenderBuffer(GLuint* resourceHandle, GLenum attachment)
|
||||||
: ResourceType(resourceHandle, attachment, 0)
|
: ResourceType(resourceHandle, attachment)
|
||||||
{ };
|
{ };
|
||||||
|
|
||||||
~RenderBuffer();
|
~RenderBuffer();
|
||||||
@@ -48,7 +47,7 @@ class Texture2DArray : public ResourceType<GL_TEXTURE_2D_ARRAY>
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Texture2DArray(GLuint* resourceHandle, GLenum attachment)
|
Texture2DArray(GLuint* resourceHandle, GLenum attachment)
|
||||||
: ResourceType(resourceHandle, attachment, 0)
|
: ResourceType(resourceHandle, attachment)
|
||||||
{ };
|
{ };
|
||||||
|
|
||||||
~Texture2DArray();
|
~Texture2DArray();
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ private:
|
|||||||
struct Frustum {
|
struct Frustum {
|
||||||
Plane Planes[4];
|
Plane Planes[4];
|
||||||
};
|
};
|
||||||
Frustum* m_Frustums = nullptr;
|
Frustum* m_Frustums;
|
||||||
|
|
||||||
//This should be a component
|
//This should be a component
|
||||||
struct LightSource {
|
struct LightSource {
|
||||||
@@ -74,11 +74,11 @@ private:
|
|||||||
glm::vec2 Padding = glm::vec2(1.f, 2.f);
|
glm::vec2 Padding = glm::vec2(1.f, 2.f);
|
||||||
};
|
};
|
||||||
|
|
||||||
LightGrid* m_LightGrid = nullptr;
|
LightGrid* m_LightGrid;
|
||||||
|
|
||||||
int m_LightOffset = 0;
|
int m_LightOffset = 0;
|
||||||
|
|
||||||
float* m_LightIndex = nullptr;
|
float* m_LightIndex;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
#include "../Core/Octree.h"
|
#include "../Core/Octree.h"
|
||||||
#include "../Collision/EntityAABB.h"
|
#include "../Collision/EntityAABB.h"
|
||||||
#include "../Core/ConfigFile.h"
|
#include "../Core/ConfigFile.h"
|
||||||
#include "EResolutionChanged.h"
|
|
||||||
|
|
||||||
class RenderSystem : public ImpureSystem
|
class RenderSystem : public ImpureSystem
|
||||||
{
|
{
|
||||||
@@ -37,8 +36,6 @@ private:
|
|||||||
EntityWrapper m_LocalPlayer = EntityWrapper::Invalid;
|
EntityWrapper m_LocalPlayer = EntityWrapper::Invalid;
|
||||||
Octree<EntityAABB>* m_Octree;
|
Octree<EntityAABB>* m_Octree;
|
||||||
|
|
||||||
EventRelay<RenderSystem, Events::ResolutionChanged> m_EResolutionChanged;
|
|
||||||
bool OnResolutionChanged(Events::ResolutionChanged &event);
|
|
||||||
EventRelay<RenderSystem, Events::SetCamera> m_ESetCamera;
|
EventRelay<RenderSystem, Events::SetCamera> m_ESetCamera;
|
||||||
bool OnSetCamera(Events::SetCamera &event);
|
bool OnSetCamera(Events::SetCamera &event);
|
||||||
EventRelay<RenderSystem, Events::InputCommand> m_EInputCommand;
|
EventRelay<RenderSystem, Events::InputCommand> m_EInputCommand;
|
||||||
|
|||||||
@@ -28,12 +28,10 @@
|
|||||||
#include "Util/CommonFunctions.h"
|
#include "Util/CommonFunctions.h"
|
||||||
#include "Core/PerformanceTimer.h"
|
#include "Core/PerformanceTimer.h"
|
||||||
#include "ShadowPass.h"
|
#include "ShadowPass.h"
|
||||||
#include "EResolutionChanged.h"
|
|
||||||
|
|
||||||
class Renderer : public IRenderer
|
class Renderer : public IRenderer
|
||||||
{
|
{
|
||||||
static void glfwFrameBufferCallback(GLFWwindow* window, int width, int height);
|
static void glfwFrameBufferCallback(GLFWwindow* window, int width, int height);
|
||||||
static void glfwWindowSizeCallback(GLFWwindow* window, int width, int height);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Renderer(EventBroker* eventBroker, ConfigFile* config)
|
Renderer(EventBroker* eventBroker, ConfigFile* config)
|
||||||
@@ -42,14 +40,13 @@ public:
|
|||||||
{ }
|
{ }
|
||||||
~Renderer();
|
~Renderer();
|
||||||
|
|
||||||
virtual void SetResolution(const Rectangle& resolution) override;
|
|
||||||
|
|
||||||
virtual void Initialize() override;
|
virtual void Initialize() override;
|
||||||
virtual void Update(double dt) override;
|
virtual void Update(double dt) override;
|
||||||
virtual void Draw(RenderFrame& frame) override;
|
virtual void Draw(RenderFrame& frame) override;
|
||||||
|
|
||||||
virtual PickData Pick(glm::vec2 screenCoord) override;
|
virtual PickData Pick(glm::vec2 screenCoord) override;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//----------------------Variables----------------------//
|
//----------------------Variables----------------------//
|
||||||
|
|
||||||
@@ -93,14 +90,11 @@ private:
|
|||||||
void InputUpdate(double dt);
|
void InputUpdate(double dt);
|
||||||
//void PickingPass(RenderQueueCollection& rq);
|
//void PickingPass(RenderQueueCollection& rq);
|
||||||
//void DrawScreenQuad(GLuint textureToDraw);
|
//void DrawScreenQuad(GLuint textureToDraw);
|
||||||
void setWindowSize(Rectangle size);
|
|
||||||
void updateFramebufferSize();
|
|
||||||
|
|
||||||
static bool DepthSort(const std::shared_ptr<RenderJob> &i, const std::shared_ptr<RenderJob> &j) { return (i->Depth < j->Depth); }
|
static bool DepthSort(const std::shared_ptr<RenderJob> &i, const std::shared_ptr<RenderJob> &j) { return (i->Depth < j->Depth); }
|
||||||
void SortRenderJobsByDepth(RenderScene &scene);
|
void SortRenderJobsByDepth(RenderScene &scene);
|
||||||
void GenerateTexture(GLuint* texture, GLenum wrapping, GLenum filtering, glm::vec2 dimensions, GLint internalFormat, GLint format, GLenum type);
|
void GenerateTexture(GLuint* texture, GLenum wrapping, GLenum filtering, glm::vec2 dimensions, GLint internalFormat, GLint format, GLenum type);
|
||||||
|
//--------------------ShaderPrograms-------------------//
|
||||||
//--------------------ShaderPrograms-------------------//
|
|
||||||
ShaderProgram* m_BasicForwardProgram;
|
ShaderProgram* m_BasicForwardProgram;
|
||||||
ShaderProgram* m_ExplosionEffectProgram;
|
ShaderProgram* m_ExplosionEffectProgram;
|
||||||
|
|
||||||
|
|||||||
@@ -63,8 +63,7 @@ private:
|
|||||||
|
|
||||||
GLuint m_DepthMap;
|
GLuint m_DepthMap;
|
||||||
FrameBuffer m_DepthBuffer;
|
FrameBuffer m_DepthBuffer;
|
||||||
ShaderProgram* m_ShadowProgram;
|
ShaderProgram* m_ShadowProgram;
|
||||||
ShaderProgram* m_ShadowProgramSkinned;
|
|
||||||
|
|
||||||
std::array<glm::mat4, MAX_SPLITS> m_LightProjection;
|
std::array<glm::mat4, MAX_SPLITS> m_LightProjection;
|
||||||
std::array<glm::mat4, MAX_SPLITS> m_LightView;
|
std::array<glm::mat4, MAX_SPLITS> m_LightView;
|
||||||
|
|||||||
@@ -21,14 +21,13 @@ struct SpriteJob : RenderJob
|
|||||||
SpriteJob(ComponentWrapper cSprite, Camera* camera, glm::mat4 matrix, World* world, glm::vec4 fillColor, float fillPercentage, bool depthSorted, bool isIndicator)
|
SpriteJob(ComponentWrapper cSprite, Camera* camera, glm::mat4 matrix, World* world, glm::vec4 fillColor, float fillPercentage, bool depthSorted, bool isIndicator)
|
||||||
: RenderJob()
|
: RenderJob()
|
||||||
{
|
{
|
||||||
Model = ResourceManager::Load<::Model>((std::string)cSprite["Model"]);
|
Model = ResourceManager::Load<::Model>("Models/Core/UnitQuad.mesh");
|
||||||
::RawModel::MaterialProperties matProp = Model->MaterialGroups().front();
|
::RawModel::MaterialProperties matProp = Model->MaterialGroups().front();
|
||||||
TextureID = 0;
|
TextureID = 0;
|
||||||
|
|
||||||
DiffuseTexture = CommonFunctions::TryLoadResource<TextureSprite, true>(cSprite["DiffuseTexture"]);
|
DiffuseTexture = CommonFunctions::TryLoadResource<TextureSprite, true>(cSprite["DiffuseTexture"]);
|
||||||
IncandescenceTexture = CommonFunctions::TryLoadResource<TextureSprite, true>(cSprite["GlowMap"]);
|
|
||||||
|
|
||||||
Linear = (bool)cSprite["Linear"];
|
IncandescenceTexture = CommonFunctions::TryLoadResource<TextureSprite, true>(cSprite["GlowMap"]);
|
||||||
|
|
||||||
StartIndex = matProp.material->StartIndex;
|
StartIndex = matProp.material->StartIndex;
|
||||||
EndIndex = matProp.material->EndIndex;
|
EndIndex = matProp.material->EndIndex;
|
||||||
@@ -49,26 +48,6 @@ struct SpriteJob : RenderJob
|
|||||||
|
|
||||||
FillColor = fillColor;
|
FillColor = fillColor;
|
||||||
FillPercentage = fillPercentage;
|
FillPercentage = fillPercentage;
|
||||||
|
|
||||||
glm::vec3 scale = Transform::AbsoluteScale(world, cSprite.EntityID);
|
|
||||||
|
|
||||||
if((bool)cSprite["KeepRatio"] == true) {
|
|
||||||
if(scale.y >= scale.x) {
|
|
||||||
ScaleY = (scale.x)/(scale.y);
|
|
||||||
ScaleX = 1.f;
|
|
||||||
} else {
|
|
||||||
ScaleY = 1.f;
|
|
||||||
ScaleX = (scale.x)/(scale.y);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ((bool)cSprite["KeepRatioX"] == true) {
|
|
||||||
ScaleX = scale.x;
|
|
||||||
}
|
|
||||||
if ((bool)cSprite["KeepRatioY"] == true) {
|
|
||||||
ScaleY = scale.y;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned int TextureID;
|
unsigned int TextureID;
|
||||||
@@ -90,9 +69,6 @@ struct SpriteJob : RenderJob
|
|||||||
bool Pickable;
|
bool Pickable;
|
||||||
bool IsIndicator = false;
|
bool IsIndicator = false;
|
||||||
bool BlurBackground = false;
|
bool BlurBackground = false;
|
||||||
float ScaleX = 1;
|
|
||||||
float ScaleY = 1;
|
|
||||||
bool Linear = false;
|
|
||||||
|
|
||||||
glm::vec4 FillColor = glm::vec4(0);
|
glm::vec4 FillColor = glm::vec4(0);
|
||||||
float FillPercentage = 0.0;
|
float FillPercentage = 0.0;
|
||||||
|
|||||||
@@ -16,11 +16,7 @@ inline bool _GLERROR(const char* info, const char* file, const char* func, unsig
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
#define GLERROR(function) \
|
#define GLERROR(function) \
|
||||||
_GLERROR(function, __BASE_FILE__, __func__, __LINE__)
|
_GLERROR(function, __BASE_FILE__, __func__, __LINE__)
|
||||||
#else
|
|
||||||
#define GLERROR(function) false
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -30,7 +30,6 @@ private:
|
|||||||
bool CapturePointSystem::OnTriggerLeave(const Events::TriggerLeave& e);
|
bool CapturePointSystem::OnTriggerLeave(const Events::TriggerLeave& e);
|
||||||
EventRelay<CapturePointSystem, Events::Captured> m_ECaptured;
|
EventRelay<CapturePointSystem, Events::Captured> m_ECaptured;
|
||||||
bool CapturePointSystem::OnCaptured(const Events::Captured& e);
|
bool CapturePointSystem::OnCaptured(const Events::Captured& e);
|
||||||
void ChangeCapturePointModelsVisibility(EntityWrapper &capturePointModels, bool isOwner);
|
|
||||||
|
|
||||||
bool m_WinnerWasFound = false;
|
bool m_WinnerWasFound = false;
|
||||||
//need to track these variables for the captureSystem to work as per design!
|
//need to track these variables for the captureSystem to work as per design!
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include "Rendering/IRenderer.h"
|
#include "Rendering/IRenderer.h"
|
||||||
#include "Core/ResourceManager.h"
|
#include "Core/ResourceManager.h"
|
||||||
#include "Core/Event.h"
|
#include "Core/Event.h"
|
||||||
#include "Systems/SpawnerSystem.h"
|
#include "Core/SpawnerSystem.h"
|
||||||
|
|
||||||
|
|
||||||
#include "GUI/EButtonClicked.h"
|
#include "GUI/EButtonClicked.h"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "Core/System.h"
|
#include "Core/System.h"
|
||||||
#include "Input/EInputCommand.h"
|
#include "Input/EInputCommand.h"
|
||||||
#include "Systems/SpawnerSystem.h"
|
#include "Core/SpawnerSystem.h"
|
||||||
#include "Events/ESpawnerSpawn.h"
|
#include "Core/ESpawnerSpawn.h"
|
||||||
#include "Core/EPlayerSpawned.h"
|
#include "Core/EPlayerSpawned.h"
|
||||||
#include "Core/EPlayerDeath.h"
|
#include "Core/EPlayerDeath.h"
|
||||||
#include "Rendering/ESetCamera.h"
|
#include "Rendering/ESetCamera.h"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include "Rendering/IRenderer.h"
|
#include "Rendering/IRenderer.h"
|
||||||
#include "Core/ResourceManager.h"
|
#include "Core/ResourceManager.h"
|
||||||
#include "Core/Event.h"
|
#include "Core/Event.h"
|
||||||
#include "Systems/SpawnerSystem.h"
|
#include "Core/SpawnerSystem.h"
|
||||||
#include "Core/EventBroker.h"
|
#include "Core/EventBroker.h"
|
||||||
|
|
||||||
#include "Network/ESearchForServers.h"
|
#include "Network/ESearchForServers.h"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include "Core/Octree.h"
|
#include "Core/Octree.h"
|
||||||
#include "Collision/EntityAABB.h"
|
#include "Collision/EntityAABB.h"
|
||||||
#include "Input/EInputCommand.h"
|
#include "Input/EInputCommand.h"
|
||||||
#include "Systems/SpawnerSystem.h"
|
#include "Core/SpawnerSystem.h"
|
||||||
#include "Rendering/ESetCamera.h"
|
#include "Rendering/ESetCamera.h"
|
||||||
#include "Core/ConfigFile.h"
|
#include "Core/ConfigFile.h"
|
||||||
#include "Rendering/EAutoAnimationBlend.h"
|
#include "Rendering/EAutoAnimationBlend.h"
|
||||||
|
|||||||
@@ -68,4 +68,5 @@
|
|||||||
<xs:include schemaLocation="Components/NetworkComponent.xsd"/>
|
<xs:include schemaLocation="Components/NetworkComponent.xsd"/>
|
||||||
<xs:include schemaLocation="Components/ServerIdentity.xsd"/>
|
<xs:include schemaLocation="Components/ServerIdentity.xsd"/>
|
||||||
<xs:include schemaLocation="Components/ServerList.xsd"/>
|
<xs:include schemaLocation="Components/ServerList.xsd"/>
|
||||||
|
<xs:include schemaLocation="Components/Respawn.xsd"/>
|
||||||
</xs:schema>
|
</xs:schema>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
<Camera xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Camera.xsd">
|
<Camera xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Camera.xsd">
|
||||||
<FOV>59</FOV> <!-- 90 horizontal FOV at 1080p -->
|
<FOV>45</FOV>
|
||||||
<NearClip>0.01</NearClip>
|
<NearClip>0.01</NearClip>
|
||||||
<FarClip>5000</FarClip>
|
<FarClip>5000</FarClip>
|
||||||
</Camera>
|
</Camera>
|
||||||
@@ -9,5 +9,5 @@
|
|||||||
<SpecularMap>true</SpecularMap>
|
<SpecularMap>true</SpecularMap>
|
||||||
<GlowMap>true</GlowMap>
|
<GlowMap>true</GlowMap>
|
||||||
<Shadow>true</Shadow>
|
<Shadow>true</Shadow>
|
||||||
<GlowIntensity>1.0</GlowIntensity>
|
<GlowIntensity>3.0</GlowIntensity>
|
||||||
</Model>
|
</Model>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Respawn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Respawn.xsd">
|
||||||
|
<Delay>0</Delay>
|
||||||
|
<_RespawnCountdown>0</_RespawnCountdown>
|
||||||
|
</Respawn>
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="types">
|
||||||
|
<xs:import schemaLocation="../Types.xsd" namespace="types"/>
|
||||||
|
|
||||||
|
<xs:element name="Respawn">
|
||||||
|
<xs:annotation>
|
||||||
|
<xs:documentation>Triggers a Spawner component after its last spawned entity is destroyed with an optional delay.</xs:documentation>
|
||||||
|
</xs:annotation>
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:all>
|
||||||
|
<xs:element name="Delay" type="t:double" minOccurs="0"/>
|
||||||
|
<xs:element name="_RespawnCountdown" type="t:double" minOccurs="0"/>
|
||||||
|
</xs:all>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:schema>
|
||||||
@@ -1,14 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
<Sprite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Sprite.xsd">
|
<Sprite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Sprite.xsd">
|
||||||
<Model>Models/Core/UnitQuad.mesh</Model>
|
|
||||||
<DiffuseTexture></DiffuseTexture>
|
<DiffuseTexture></DiffuseTexture>
|
||||||
<GlowMap></GlowMap>
|
<GlowMap></GlowMap>
|
||||||
<Color R="1" G="1" B="1" A="1"/>
|
<Color R="1" G="1" B="1" A="1"/>
|
||||||
<Visible>true</Visible>
|
<Visible>true</Visible>
|
||||||
<DepthSort>true</DepthSort>
|
<DepthSort>true</DepthSort>
|
||||||
<KeepRatioX>false</KeepRatioX>
|
|
||||||
<KeepRatioY>false</KeepRatioY>
|
|
||||||
<KeepRatio>false</KeepRatio>
|
|
||||||
<Linear>false</Linear>
|
|
||||||
<BlurBackground>false</BlurBackground>
|
<BlurBackground>false</BlurBackground>
|
||||||
</Sprite>
|
</Sprite>
|
||||||
|
|||||||
@@ -9,17 +9,14 @@
|
|||||||
</xs:annotation>
|
</xs:annotation>
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:all>
|
<xs:all>
|
||||||
<xs:element name="Model" type="t:string" minOccurs="0">
|
|
||||||
<xs:annotation><xs:documentation>The model the sprite will use.</xs:documentation></xs:annotation>
|
|
||||||
</xs:element>
|
|
||||||
<xs:element name="DiffuseTexture" type="t:string" minOccurs="0">
|
<xs:element name="DiffuseTexture" type="t:string" minOccurs="0">
|
||||||
<xs:annotation><xs:documentation>Diffuse Texture file.</xs:documentation></xs:annotation>
|
<xs:annotation><xs:documentation>Diffuse Texture file</xs:documentation></xs:annotation>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element name="GlowMap" type="t:string" minOccurs="0">
|
<xs:element name="GlowMap" type="t:string" minOccurs="0">
|
||||||
<xs:annotation><xs:documentation>GlowMap file.</xs:documentation></xs:annotation>
|
<xs:annotation><xs:documentation>GlowMap file</xs:documentation></xs:annotation>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element name="Color" type="t:Color" minOccurs="0">
|
<xs:element name="Color" type="t:Color" minOccurs="0">
|
||||||
<xs:annotation><xs:documentation>Color tint.</xs:documentation></xs:annotation>
|
<xs:annotation><xs:documentation>Color tint</xs:documentation></xs:annotation>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element name="Visible" type="t:bool" minOccurs="0">
|
<xs:element name="Visible" type="t:bool" minOccurs="0">
|
||||||
<xs:annotation><xs:documentation>Whether the model is visible or not</xs:documentation></xs:annotation>
|
<xs:annotation><xs:documentation>Whether the model is visible or not</xs:documentation></xs:annotation>
|
||||||
@@ -27,18 +24,6 @@
|
|||||||
<xs:element name="DepthSort" type="t:bool" minOccurs="0">
|
<xs:element name="DepthSort" type="t:bool" minOccurs="0">
|
||||||
<xs:annotation><xs:documentation>Whether the sprite should be sorted with depth or not. Only use false for textures that are on HUD</xs:documentation></xs:annotation>
|
<xs:annotation><xs:documentation>Whether the sprite should be sorted with depth or not. Only use false for textures that are on HUD</xs:documentation></xs:annotation>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element name="KeepRatioX" type="t:bool" minOccurs="0">
|
|
||||||
<xs:annotation><xs:documentation>Wether the sprite should repeat in x instead of stretch when scaled.</xs:documentation></xs:annotation>
|
|
||||||
</xs:element>
|
|
||||||
<xs:element name="KeepRatioY" type="t:bool" minOccurs="0">
|
|
||||||
<xs:annotation><xs:documentation>Wether the sprite should repeat in y instead of stretch when scaled.</xs:documentation></xs:annotation>
|
|
||||||
</xs:element>
|
|
||||||
<xs:element name="KeepRatio" type="t:bool" minOccurs="0">
|
|
||||||
<xs:annotation><xs:documentation>Keep a 1:1 ratio between X and Y.</xs:documentation></xs:annotation>
|
|
||||||
</xs:element>
|
|
||||||
<xs:element name="Linear" type="t:bool" minOccurs="0">
|
|
||||||
<xs:annotation><xs:documentation>If it should use Linear or Nearest sampling method.</xs:documentation></xs:annotation>
|
|
||||||
</xs:element>
|
|
||||||
<xs:element name="BlurBackground" type="t:bool" minOccurs="0">
|
<xs:element name="BlurBackground" type="t:bool" minOccurs="0">
|
||||||
<xs:annotation><xs:documentation>Wether the background should be blurred begind this sprite.</xs:documentation></xs:annotation>
|
<xs:annotation><xs:documentation>Wether the background should be blurred begind this sprite.</xs:documentation></xs:annotation>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
|||||||
@@ -2,19 +2,13 @@
|
|||||||
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
<Components>
|
<Components>
|
||||||
<c:NetworkComponent/>
|
|
||||||
<c:HealthPickup/>
|
<c:HealthPickup/>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/Props/PickUps/HealthPickUp.mesh</Resource>
|
<Resource>Models/Props/PickUps/HealthPickUp.mesh</Resource>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:RaptorCopter>
|
<c:NetworkComponent/>
|
||||||
<Speed>8</Speed>
|
|
||||||
<Axis X="0" Y="0.100000001" Z="0"/>
|
|
||||||
</c:RaptorCopter>
|
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="2.36784196" Z="0"/>
|
<Scale X="0.25" Y="0.25" Z="0.25"/>
|
||||||
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
|
||||||
<Orientation X="0" Y="18767.0273" Z="0"/>
|
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
<c:Trigger/>
|
<c:Trigger/>
|
||||||
</Components>
|
</Components>
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="-0.871185362" Z="1.77631724"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Props/PickUps/PickUpHolder.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Scale X="0.479999989" Y="0.479999989" Z="0.479999989"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="1.41138339" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Respawn>
|
||||||
|
<Delay>3</Delay>
|
||||||
|
</c:Respawn>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>1</Speed>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:FloatingEffect>
|
||||||
|
<Period>2</Period>
|
||||||
|
<Time>75.797556530109119</Time>
|
||||||
|
<Axis X="0" Y="0.200000003" Z="0"/>
|
||||||
|
</c:FloatingEffect>
|
||||||
|
<c:Spawner>
|
||||||
|
<EntityFile>Schema/Entities/HealthPickup.xml</EntityFile>
|
||||||
|
</c:Spawner>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0" Y="-0.118795805" Z="-0"/>
|
||||||
|
<Orientation X="0" Y="13.0735149" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="-4" Z="0"/>
|
<Position X="0" Y="-4" Z="0"/>
|
||||||
<Orientation X="0" Y="58.3794823" Z="0"/>
|
<Orientation X="0" Y="55.3495064" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
|
|
||||||
@@ -34,49 +34,13 @@
|
|||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
<Entity name="AssaultClassPick">
|
|
||||||
<Components>
|
|
||||||
<c:Button/>
|
|
||||||
<c:Sprite>
|
|
||||||
<DepthSort>false</DepthSort>
|
|
||||||
<Model>Models/Core/UnitQuad.mesh</Model>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DiffuseTexture>Textures/Icons/Classes/Assault-01.png</DiffuseTexture>
|
|
||||||
</c:Sprite>
|
|
||||||
<c:InputCmdButton>
|
|
||||||
<Command>PickClass</Command>
|
|
||||||
<PressValue>1</PressValue>
|
|
||||||
</c:InputCmdButton>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="-0.150000006" Y="-0.0500000007" Z="0"/>
|
|
||||||
<Scale X="0.0799999982" Y="0.0799999982" Z="1"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children>
|
|
||||||
<Entity name="AssaultText">
|
|
||||||
<Components>
|
|
||||||
<c:Text>
|
|
||||||
<Content>Assault</Content>
|
|
||||||
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
|
||||||
<Color A="1" B="0" G="1" R="0.784313738"/>
|
|
||||||
</c:Text>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="0" Y="0.800000012" Z="0"/>
|
|
||||||
<Scale X="0.310000002" Y="0.310000002" Z="1"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
|
||||||
</Entity>
|
|
||||||
<Entity name="DefenderClassPick">
|
<Entity name="DefenderClassPick">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Button/>
|
<c:Button/>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DepthSort>false</DepthSort>
|
|
||||||
<Model>Models/Core/UnitQuad.mesh</Model>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DiffuseTexture>Textures/Icons/Classes/Defender-01.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Icons/Classes/Defender-01.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:InputCmdButton>
|
<c:InputCmdButton>
|
||||||
<Command>PickClass</Command>
|
<Command>PickClass</Command>
|
||||||
@@ -108,10 +72,9 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Button/>
|
<c:Button/>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DepthSort>false</DepthSort>
|
|
||||||
<Model>Models/Core/UnitQuad.mesh</Model>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DiffuseTexture>Textures/Icons/Classes/Sniper-01.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Icons/Classes/Sniper-01.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:InputCmdButton>
|
<c:InputCmdButton>
|
||||||
<Command>PickClass</Command>
|
<Command>PickClass</Command>
|
||||||
@@ -139,6 +102,40 @@
|
|||||||
</Entity>
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
|
<Entity name="AssaultClassPick">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Icons/Classes/Assault-01.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:InputCmdButton>
|
||||||
|
<Command>PickClass</Command>
|
||||||
|
<PressValue>1</PressValue>
|
||||||
|
</c:InputCmdButton>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.150000006" Y="-0.0500000007" Z="0"/>
|
||||||
|
<Scale X="0.0799999982" Y="0.0799999982" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="AssaultText">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Assault</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="0" G="1" R="0.784313738"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.800000012" Z="0"/>
|
||||||
|
<Scale X="0.310000002" Y="0.310000002" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
<Entity name="ClassPickText">
|
<Entity name="ClassPickText">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Text>
|
<c:Text>
|
||||||
@@ -157,10 +154,9 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Button/>
|
<c:Button/>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DepthSort>false</DepthSort>
|
|
||||||
<Model>Models/Core/UnitQuad.mesh</Model>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
<Color A="1" B="0" G="1" R="0.509803951"/>
|
<Color A="1" B="0" G="1" R="0.509803951"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:InputCmdButton>
|
<c:InputCmdButton>
|
||||||
@@ -236,10 +232,9 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Button/>
|
<c:Button/>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DepthSort>false</DepthSort>
|
|
||||||
<Model>Models/Core/UnitQuad.mesh</Model>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
<Color A="1" B="0" G="1" R="0.509803951"/>
|
<Color A="1" B="0" G="1" R="0.509803951"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:InputCmdButton>
|
<c:InputCmdButton>
|
||||||
@@ -271,11 +266,10 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Button/>
|
<c:Button/>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<Model>Models/Core/UnitQuad.mesh</Model>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
<Color A="1" B="0" G="0.294117659" R="0.980392158"/>
|
<Color A="1" B="0" G="0.294117659" R="0.980392158"/>
|
||||||
<Linear>true</Linear>
|
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:InputCmdButton>
|
<c:InputCmdButton>
|
||||||
<Command>PickTeam</Command>
|
<Command>PickTeam</Command>
|
||||||
@@ -306,12 +300,10 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Button/>
|
<c:Button/>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DepthSort>false</DepthSort>
|
|
||||||
<Model>Models/Core/UnitQuad.mesh</Model>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
<Color A="1" B="0.980392158" G="0.294117659" R="0"/>
|
<Color A="1" B="0.980392158" G="0.294117659" R="0"/>
|
||||||
<Linear>true</Linear>
|
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:InputCmdButton>
|
<c:InputCmdButton>
|
||||||
<Command>PickTeam</Command>
|
<Command>PickTeam</Command>
|
||||||
@@ -342,10 +334,9 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Button/>
|
<c:Button/>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DepthSort>false</DepthSort>
|
|
||||||
<Model>Models/Core/UnitQuad.mesh</Model>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
<Color A="1" B="0" G="1" R="0.509803951"/>
|
<Color A="1" B="0" G="1" R="0.509803951"/>
|
||||||
<Visible>false</Visible>
|
<Visible>false</Visible>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
@@ -431,10 +422,9 @@
|
|||||||
<Entity name="BackgroundHexagon">
|
<Entity name="BackgroundHexagon">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DepthSort>false</DepthSort>
|
|
||||||
<Model>Models/Core/UnitQuad.mesh</Model>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
<Color A="0.300000012" B="1" G="1" R="1"/>
|
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -451,10 +441,9 @@
|
|||||||
<CapturePointNumber>3</CapturePointNumber>
|
<CapturePointNumber>3</CapturePointNumber>
|
||||||
</c:CapturePointHUD>
|
</c:CapturePointHUD>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DepthSort>false</DepthSort>
|
|
||||||
<Model>Models/Core/UnitQuad.mesh</Model>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
@@ -469,10 +458,9 @@
|
|||||||
<Entity name="BackgroundHexagon">
|
<Entity name="BackgroundHexagon">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DepthSort>false</DepthSort>
|
|
||||||
<Model>Models/Core/UnitQuad.mesh</Model>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -489,10 +477,9 @@
|
|||||||
<CapturePointNumber>4</CapturePointNumber>
|
<CapturePointNumber>4</CapturePointNumber>
|
||||||
</c:CapturePointHUD>
|
</c:CapturePointHUD>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DepthSort>false</DepthSort>
|
|
||||||
<Model>Models/Core/UnitQuad.mesh</Model>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
@@ -507,10 +494,9 @@
|
|||||||
<Entity name="BackgroundHexagon">
|
<Entity name="BackgroundHexagon">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DepthSort>false</DepthSort>
|
|
||||||
<Model>Models/Core/UnitQuad.mesh</Model>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
<Color A="0.300000012" B="1" G="1" R="1"/>
|
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -527,10 +513,9 @@
|
|||||||
<CapturePointNumber>2</CapturePointNumber>
|
<CapturePointNumber>2</CapturePointNumber>
|
||||||
</c:CapturePointHUD>
|
</c:CapturePointHUD>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DepthSort>false</DepthSort>
|
|
||||||
<Model>Models/Core/UnitQuad.mesh</Model>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
@@ -545,10 +530,9 @@
|
|||||||
<Entity name="BackgroundHexagon">
|
<Entity name="BackgroundHexagon">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DepthSort>false</DepthSort>
|
|
||||||
<Model>Models/Core/UnitQuad.mesh</Model>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
<Color A="0.300000012" B="1" G="1" R="1"/>
|
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -566,10 +550,9 @@
|
|||||||
<CapturePointNumber>1</CapturePointNumber>
|
<CapturePointNumber>1</CapturePointNumber>
|
||||||
</c:CapturePointHUD>
|
</c:CapturePointHUD>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DepthSort>false</DepthSort>
|
|
||||||
<Model>Models/Core/UnitQuad.mesh</Model>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
@@ -584,10 +567,9 @@
|
|||||||
<Entity name="BackgroundHexagon">
|
<Entity name="BackgroundHexagon">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DepthSort>false</DepthSort>
|
|
||||||
<Model>Models/Core/UnitQuad.mesh</Model>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
<Color A="0.699999988" B="0" G="0" R="1"/>
|
<Color A="0.699999988" B="0" G="0" R="1"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -602,10 +584,9 @@
|
|||||||
</c:Fill>
|
</c:Fill>
|
||||||
<c:CapturePointHUD/>
|
<c:CapturePointHUD/>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DepthSort>false</DepthSort>
|
|
||||||
<Model>Models/Core/UnitQuad.mesh</Model>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
@@ -623,10 +604,9 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Button/>
|
<c:Button/>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DepthSort>false</DepthSort>
|
|
||||||
<Model>Models/Core/UnitQuad.mesh</Model>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
<Color A="1" B="0" G="1" R="0.509803951"/>
|
<Color A="1" B="0" G="1" R="0.509803951"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:InputCmdButton>
|
<c:InputCmdButton>
|
||||||
@@ -671,10 +651,9 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Button/>
|
<c:Button/>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DepthSort>false</DepthSort>
|
|
||||||
<Model>Models/Core/UnitQuad.mesh</Model>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
<Color A="1" B="0" G="1" R="0.509803951"/>
|
<Color A="1" B="0" G="1" R="0.509803951"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:InputCmdButton>
|
<c:InputCmdButton>
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
</c:Team>
|
</c:Team>
|
||||||
<c:PlayerSpawn/>
|
<c:PlayerSpawn/>
|
||||||
<c:Spawner>
|
<c:Spawner>
|
||||||
<EntityFile>Schema/Entities/PlayerRed.xml</EntityFile>
|
<EntityFile>Schema/Entities/Player.xml</EntityFile>
|
||||||
</c:Spawner>
|
</c:Spawner>
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -225,11 +225,6 @@
|
|||||||
</Team>
|
</Team>
|
||||||
</c:Team>
|
</c:Team>
|
||||||
<c:Trigger/>
|
<c:Trigger/>
|
||||||
<c:Model>
|
|
||||||
<Resource></Resource>
|
|
||||||
<Color A="0.300000012" B="0" G="0" R="1"/>
|
|
||||||
<Visible>false</Visible>
|
|
||||||
</c:Model>
|
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="-4.10000038"/>
|
<Position X="0" Y="0" Z="-4.10000038"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
@@ -244,17 +239,7 @@
|
|||||||
<Scale X="2.70000005" Y="3.4000001" Z="4.60000038"/>
|
<Scale X="2.70000005" Y="3.4000001" Z="4.60000038"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children/>
|
||||||
<Entity>
|
|
||||||
<Components>
|
|
||||||
<c:Model>
|
|
||||||
<Resource></Resource>
|
|
||||||
</c:Model>
|
|
||||||
<c:Transform/>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="Blue">
|
<Entity name="Blue">
|
||||||
<Components>
|
<Components>
|
||||||
|
|||||||
@@ -71,6 +71,7 @@
|
|||||||
<xs:element ref="c:NetworkComponent" minOccurs="0"/>
|
<xs:element ref="c:NetworkComponent" minOccurs="0"/>
|
||||||
<xs:element ref="c:ServerIdentity" minOccurs="0"/>
|
<xs:element ref="c:ServerIdentity" minOccurs="0"/>
|
||||||
<xs:element ref="c:ServerList" minOccurs="0"/>
|
<xs:element ref="c:ServerList" minOccurs="0"/>
|
||||||
|
<xs:element ref="c:Respawn" minOccurs="0"/>
|
||||||
</xs:all>
|
</xs:all>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
#version 430
|
|
||||||
|
|
||||||
layout (binding = 0) uniform sampler2D Texture;
|
|
||||||
uniform int MaxMipMap;
|
|
||||||
|
|
||||||
|
|
||||||
in VertexData{
|
|
||||||
vec2 TextureCoordinate;
|
|
||||||
}Input;
|
|
||||||
|
|
||||||
out vec4 fragmentColor;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
vec4 result = vec4(0.0, 0.0, 0.0, 0.0);
|
|
||||||
|
|
||||||
for(int i = 0; i < MaxMipMap; i++) {
|
|
||||||
result += textureLod(Texture, Input.TextureCoordinate, i);
|
|
||||||
}
|
|
||||||
fragmentColor = result;
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#version 430
|
|
||||||
|
|
||||||
layout (location = 0) in vec3 Position;
|
|
||||||
|
|
||||||
out VertexData{
|
|
||||||
vec2 TextureCoordinate;
|
|
||||||
}Output;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
gl_Position = vec4(Position, 1.0);
|
|
||||||
Output.TextureCoordinate = (vec2(Position) + 1) / 2;
|
|
||||||
}
|
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
|
||||||
layout (binding = 0) uniform sampler2D Texture;
|
layout (binding = 0) uniform sampler2D Texture;
|
||||||
uniform int Lod;
|
|
||||||
|
|
||||||
in VertexData{
|
in VertexData{
|
||||||
vec2 TextureCoordinate;
|
vec2 TextureCoordinate;
|
||||||
@@ -11,14 +10,12 @@ in VertexData{
|
|||||||
out vec4 fragmentColor;
|
out vec4 fragmentColor;
|
||||||
|
|
||||||
uniform float weight[5] = float[](0.227027, 0.1945946, 0.1216216, 0.054054, 0.016216);
|
uniform float weight[5] = float[](0.227027, 0.1945946, 0.1216216, 0.054054, 0.016216);
|
||||||
//uniform float weight[3] = float[](0.265495, 0.226535, 0.140718);
|
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec2 tex_offset = 1.0 / textureSize(Texture, Lod);
|
vec2 tex_offset = 1.0 / textureSize2D(Texture, 0);
|
||||||
vec3 center = texture(Texture, Input.TextureCoordinate).rgb;
|
vec3 center = texture(Texture, Input.TextureCoordinate).rgb;
|
||||||
vec3 result = center * weight[0];
|
vec3 result = center * weight[0];
|
||||||
|
|
||||||
for(int i = 1; i < 5; ++i) {
|
for(int i = 1; i < 5; ++i) {
|
||||||
vec4 eastFragments = texture(Texture, Input.TextureCoordinate + vec2(tex_offset.x * i, 0.0));
|
vec4 eastFragments = texture(Texture, Input.TextureCoordinate + vec2(tex_offset.x * i, 0.0));
|
||||||
vec4 westFragments = texture(Texture, Input.TextureCoordinate - vec2(tex_offset.x * i, 0.0));
|
vec4 westFragments = texture(Texture, Input.TextureCoordinate - vec2(tex_offset.x * i, 0.0));
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
|
||||||
layout (binding = 0) uniform sampler2D Texture;
|
layout (binding = 0) uniform sampler2D Texture;
|
||||||
uniform int Lod;
|
|
||||||
|
|
||||||
in VertexData{
|
in VertexData{
|
||||||
vec2 TextureCoordinate;
|
vec2 TextureCoordinate;
|
||||||
@@ -11,14 +10,12 @@ in VertexData{
|
|||||||
out vec4 fragmentColor;
|
out vec4 fragmentColor;
|
||||||
|
|
||||||
uniform float weight[5] = float[](0.227027, 0.1945946, 0.1216216, 0.054054, 0.016216);
|
uniform float weight[5] = float[](0.227027, 0.1945946, 0.1216216, 0.054054, 0.016216);
|
||||||
//uniform float weight[3] = float[](0.265495, 0.226535, 0.140718);
|
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec2 tex_offset = 1.0 / textureSize(Texture, Lod);
|
vec2 tex_offset = 1.0 / textureSize2D(Texture, 0);
|
||||||
vec3 center = texture(Texture, Input.TextureCoordinate).rgb;
|
vec3 center = texture(Texture, Input.TextureCoordinate).rgb;
|
||||||
vec3 result = center * weight[0];
|
vec3 result = center * weight[0];
|
||||||
|
|
||||||
for(int i = 1; i < 5; ++i) {
|
for(int i = 1; i < 5; ++i) {
|
||||||
vec4 northFragments = texture(Texture, Input.TextureCoordinate + vec2(0.0, tex_offset.y * i));
|
vec4 northFragments = texture(Texture, Input.TextureCoordinate + vec2(0.0, tex_offset.y * i));
|
||||||
vec4 southFragments = texture(Texture, Input.TextureCoordinate - vec2(0.0, tex_offset.y * i));
|
vec4 southFragments = texture(Texture, Input.TextureCoordinate - vec2(0.0, tex_offset.y * i));
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
#version 430
|
|
||||||
|
|
||||||
uniform mat4 M;
|
|
||||||
uniform mat4 V;
|
|
||||||
uniform mat4 P;
|
|
||||||
uniform mat4 Bones[100];
|
|
||||||
|
|
||||||
layout (location = 0) in vec3 Position;
|
|
||||||
layout (location = 4) in vec2 TextureCoords;
|
|
||||||
layout(location = 5) in vec4 BoneIndices;
|
|
||||||
layout(location = 6) in vec4 BoneWeights;
|
|
||||||
|
|
||||||
out VertexData{
|
|
||||||
vec2 TextureCoordinate;
|
|
||||||
}Output;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
mat4 boneTransform = mat4(1);
|
|
||||||
if(BoneWeights[0] > 0.0f){
|
|
||||||
boneTransform = BoneWeights[0] * Bones[int(BoneIndices[0])]
|
|
||||||
+ BoneWeights[1] * Bones[int(BoneIndices[1])]
|
|
||||||
+ BoneWeights[2] * Bones[int(BoneIndices[2])]
|
|
||||||
+ BoneWeights[3] * Bones[int(BoneIndices[3])];
|
|
||||||
}
|
|
||||||
|
|
||||||
gl_Position = P * V * M * boneTransform * vec4(Position, 1.0);
|
|
||||||
Output.TextureCoordinate = TextureCoords;
|
|
||||||
}
|
|
||||||
@@ -3,8 +3,6 @@
|
|||||||
uniform vec4 Color;
|
uniform vec4 Color;
|
||||||
uniform vec4 FillColor;
|
uniform vec4 FillColor;
|
||||||
uniform float FillPercentage;
|
uniform float FillPercentage;
|
||||||
uniform float ScaleX;
|
|
||||||
uniform float ScaleY;
|
|
||||||
uniform mat4 P;
|
uniform mat4 P;
|
||||||
|
|
||||||
layout (binding = 1) uniform sampler2D DiffuseTexture;
|
layout (binding = 1) uniform sampler2D DiffuseTexture;
|
||||||
@@ -23,16 +21,15 @@ out vec4 bloomColor;
|
|||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec4 diffuseTexel = texture2D(DiffuseTexture, vec2(Input.TextureCoordinate.x*ScaleX, Input.TextureCoordinate.y*ScaleY));
|
vec4 diffuseTexel = texture2D(DiffuseTexture, Input.TextureCoordinate);
|
||||||
vec4 glowTexel = texture2D(GlowMapTexture, vec2(Input.TextureCoordinate.x*ScaleX, Input.TextureCoordinate.y*ScaleY));
|
vec4 glowTexel = texture2D(GlowMapTexture, Input.TextureCoordinate);
|
||||||
|
|
||||||
vec4 color_result = Color * diffuseTexel;
|
vec4 color_result = Color * diffuseTexel;
|
||||||
|
|
||||||
float pos = ((P * vec4(Input.Position, 1)).y + 1.0)/2.0;
|
float pos = ((P * vec4(Input.Position, 1)).y + 1.0)/2.0;
|
||||||
float fillResult = floor(pos*FillPercentage);
|
if(pos <= FillPercentage) {
|
||||||
|
color_result = FillColor*diffuseTexel.a;
|
||||||
color_result = FillColor*diffuseTexel.a*fillResult + color_result*(1-fillResult);
|
}
|
||||||
|
|
||||||
sceneColor = vec4(color_result.xyz, clamp(color_result.a, 0, 1));
|
sceneColor = vec4(color_result.xyz, clamp(color_result.a, 0, 1));
|
||||||
|
|
||||||
//bloomColor = vec4(clamp((glowTexel.xyz*3) - 1.0, 0, 100), 1.0);
|
//bloomColor = vec4(clamp((glowTexel.xyz*3) - 1.0, 0, 100), 1.0);
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
#include "Core/RespawnSystem.h"
|
||||||
|
|
||||||
|
RespawnSystem::RespawnSystem(SystemParams params)
|
||||||
|
: System(params)
|
||||||
|
, PureSystem("Respawn")
|
||||||
|
{
|
||||||
|
EVENT_SUBSCRIBE_MEMBER(m_EEntityDeleted, &RespawnSystem::OnEntityDeleted);
|
||||||
|
EVENT_SUBSCRIBE_MEMBER(m_EPause, &RespawnSystem::OnPause);
|
||||||
|
EVENT_SUBSCRIBE_MEMBER(m_EResume, &RespawnSystem::OnResume);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RespawnSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& cRespawn, double dt)
|
||||||
|
{
|
||||||
|
if (m_Paused) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!entity.HasComponent("Spawner")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
EntityWrapper& lastRespawnedEntity = m_LastRespawnedEntity[entity];
|
||||||
|
if (!lastRespawnedEntity.Valid()) {
|
||||||
|
double& _respawnCountdown = cRespawn["_RespawnCountdown"];
|
||||||
|
_respawnCountdown -= dt;
|
||||||
|
if (_respawnCountdown <= 0) {
|
||||||
|
lastRespawnedEntity = SpawnerSystem::Spawn(entity, entity);
|
||||||
|
_respawnCountdown = cRespawn["Delay"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RespawnSystem::OnEntityDeleted(const Events::EntityDeleted& e)
|
||||||
|
{
|
||||||
|
m_LastRespawnedEntity.erase(e.DeletedEntity);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RespawnSystem::OnPause(const Events::Pause& e)
|
||||||
|
{
|
||||||
|
if (e.World == m_World) {
|
||||||
|
m_Paused = true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RespawnSystem::OnResume(const Events::Resume& e)
|
||||||
|
{
|
||||||
|
if (e.World == m_World) {
|
||||||
|
m_Paused = false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "Systems/SpawnerSystem.h"
|
#include "Core/SpawnerSystem.h"
|
||||||
#include "Collision/Collision.h"
|
#include "Collision/Collision.h"
|
||||||
|
|
||||||
SpawnerSystem::SpawnerSystem(SystemParams params)
|
SpawnerSystem::SpawnerSystem(SystemParams params)
|
||||||
@@ -223,7 +223,7 @@ void World::deleteEntityRecursive(EntityID entity, bool cascaded /*= false*/)
|
|||||||
|
|
||||||
if (m_EventBroker != nullptr) {
|
if (m_EventBroker != nullptr) {
|
||||||
Events::EntityDeleted e;
|
Events::EntityDeleted e;
|
||||||
e.DeletedEntity = entity;
|
e.DeletedEntity = EntityWrapper(this, entity);
|
||||||
e.Cascaded = cascaded;
|
e.Cascaded = cascaded;
|
||||||
m_EventBroker->Publish(e);
|
m_EventBroker->Publish(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ bool EditorRenderSystem::OnSetCamera(Events::SetCamera& e)
|
|||||||
{
|
{
|
||||||
ComponentWrapper cTransform = e.CameraEntity["Transform"];
|
ComponentWrapper cTransform = e.CameraEntity["Transform"];
|
||||||
ComponentWrapper cCamera = e.CameraEntity["Camera"];
|
ComponentWrapper cCamera = e.CameraEntity["Camera"];
|
||||||
m_EditorCamera->SetFOV(glm::radians(static_cast<float>((double)cCamera["FOV"])));
|
m_EditorCamera->SetFOV(static_cast<float>((double)cCamera["FOV"]));
|
||||||
m_EditorCamera->SetNearClip(static_cast<float>((double)cCamera["NearClip"]));
|
m_EditorCamera->SetNearClip(static_cast<float>((double)cCamera["NearClip"]));
|
||||||
m_EditorCamera->SetFarClip(static_cast<float>((double)cCamera["FarClip"]));
|
m_EditorCamera->SetFarClip(static_cast<float>((double)cCamera["FarClip"]));
|
||||||
m_EditorCamera->SetPosition(cTransform["Position"]);
|
m_EditorCamera->SetPosition(cTransform["Position"]);
|
||||||
|
|||||||
@@ -494,7 +494,7 @@ bool Server::OnEntityDeleted(const Events::EntityDeleted & e)
|
|||||||
{
|
{
|
||||||
if (!e.Cascaded) {
|
if (!e.Cascaded) {
|
||||||
Packet packet = Packet(MessageType::EntityDeleted);
|
Packet packet = Packet(MessageType::EntityDeleted);
|
||||||
packet.WritePrimitive<EntityID>(e.DeletedEntity);
|
packet.WritePrimitive<EntityID>(e.DeletedEntity.ID);
|
||||||
reliableBroadcast(packet);
|
reliableBroadcast(packet);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -127,12 +127,12 @@ void AnimationSystem::UpdateAnimations(double dt)
|
|||||||
void AnimationSystem::UpdateWeights(double dt)
|
void AnimationSystem::UpdateWeights(double dt)
|
||||||
{
|
{
|
||||||
for (auto it = m_AutoBlendQueues.begin(); it != m_AutoBlendQueues.end(); ) {
|
for (auto it = m_AutoBlendQueues.begin(); it != m_AutoBlendQueues.end(); ) {
|
||||||
/* LOG_INFO("%s", it->first.Name().c_str());
|
LOG_INFO("%s", it->first.Name().c_str());
|
||||||
it->second.PrintQueue();*/
|
it->second.PrintQueue();
|
||||||
|
|
||||||
if(it->second.HasActiveBlendJob()) {
|
if(it->second.HasActiveBlendJob()) {
|
||||||
AutoBlendQueue::AutoBlendJob& blendJob = it->second.GetActiveBlendJob();
|
AutoBlendQueue::AutoBlendJob& blendJob = it->second.GetActiveBlendJob();
|
||||||
//LOG_INFO("%s", blendJob.RootNode.Name().c_str());
|
LOG_INFO("%s", blendJob.RootNode.Name().c_str());
|
||||||
std::shared_ptr<BlendTree> blendTree = it->second.GetBlendTree();
|
std::shared_ptr<BlendTree> blendTree = it->second.GetBlendTree();
|
||||||
if (blendTree != nullptr) {
|
if (blendTree != nullptr) {
|
||||||
if (blendJob.Duration != 0.0) {
|
if (blendJob.Duration != 0.0) {
|
||||||
@@ -283,7 +283,7 @@ bool AnimationSystem::OnAutoAnimationBlend(Events::AutoAnimationBlend& e)
|
|||||||
|
|
||||||
bool AnimationSystem::OnEntityDeleted(Events::EntityDeleted& e)
|
bool AnimationSystem::OnEntityDeleted(Events::EntityDeleted& e)
|
||||||
{
|
{
|
||||||
EntityWrapper entity = EntityWrapper(m_World, e.DeletedEntity);
|
EntityWrapper entity = e.DeletedEntity;
|
||||||
|
|
||||||
if (entity.HasComponent("Model")) {
|
if (entity.HasComponent("Model")) {
|
||||||
Model* model;
|
Model* model;
|
||||||
|
|||||||
@@ -97,14 +97,14 @@ void BlurHUD::ClearBuffer()
|
|||||||
glClearStencil(0x00);
|
glClearStencil(0x00);
|
||||||
glStencilMask(~0);
|
glStencilMask(~0);
|
||||||
glDisable(GL_SCISSOR_TEST);
|
glDisable(GL_SCISSOR_TEST);
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||||
m_GaussianFrameBuffer_horiz.Unbind();
|
m_GaussianFrameBuffer_horiz.Unbind();
|
||||||
m_GaussianFrameBuffer_vert.Bind();
|
m_GaussianFrameBuffer_vert.Bind();
|
||||||
glClearColor(0.f, 0.f, 0.f, 0.f);
|
glClearColor(0.f, 0.f, 0.f, 0.f);
|
||||||
glClearStencil(0x00);
|
glClearStencil(0x00);
|
||||||
glStencilMask(~0);
|
glStencilMask(~0);
|
||||||
glDisable(GL_SCISSOR_TEST);
|
glDisable(GL_SCISSOR_TEST);
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||||
m_GaussianFrameBuffer_vert.Unbind();
|
m_GaussianFrameBuffer_vert.Unbind();
|
||||||
|
|
||||||
m_CombinedTextureBuffer.Bind();
|
m_CombinedTextureBuffer.Bind();
|
||||||
@@ -211,16 +211,12 @@ void BlurHUD::FillStencil(RenderScene& scene)
|
|||||||
RenderState state;
|
RenderState state;
|
||||||
|
|
||||||
state.BindFramebuffer(m_GaussianFrameBuffer_horiz.GetHandle());
|
state.BindFramebuffer(m_GaussianFrameBuffer_horiz.GetHandle());
|
||||||
state.Enable(GL_DEPTH_TEST);
|
state.Disable(GL_DEPTH_TEST);
|
||||||
state.Enable(GL_CULL_FACE);
|
state.Enable(GL_CULL_FACE);
|
||||||
state.Enable(GL_STENCIL_TEST);
|
state.Enable(GL_STENCIL_TEST);
|
||||||
state.StencilFunc(GL_ALWAYS, 1, 0xFF);
|
state.StencilFunc(GL_ALWAYS, 1, 0xFF);
|
||||||
state.StencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
state.StencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
||||||
state.StencilMask(0xFF);
|
state.StencilMask(0xFF);
|
||||||
|
|
||||||
state.AlphaFunc(GL_GEQUAL, 0.95f);
|
|
||||||
state.Enable(GL_ALPHA_TEST);
|
|
||||||
|
|
||||||
glViewport(0, 0, m_Renderer->GetViewportSize().Width/m_BlurQuality, m_Renderer->GetViewportSize().Height/m_BlurQuality);
|
glViewport(0, 0, m_Renderer->GetViewportSize().Width/m_BlurQuality, m_Renderer->GetViewportSize().Height/m_BlurQuality);
|
||||||
|
|
||||||
m_FillDepthStencilProgram->Bind();
|
m_FillDepthStencilProgram->Bind();
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ DrawBloomPass::DrawBloomPass(IRenderer* renderer, ConfigFile* config)
|
|||||||
DrawBloomPass::~DrawBloomPass() {
|
DrawBloomPass::~DrawBloomPass() {
|
||||||
CommonFunctions::DeleteTexture(&m_GaussianTexture_horiz);
|
CommonFunctions::DeleteTexture(&m_GaussianTexture_horiz);
|
||||||
CommonFunctions::DeleteTexture(&m_GaussianTexture_vert);
|
CommonFunctions::DeleteTexture(&m_GaussianTexture_vert);
|
||||||
CommonFunctions::DeleteTexture(&m_FinalGaussianTexture);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawBloomPass::InitializeTextures()
|
void DrawBloomPass::InitializeTextures()
|
||||||
@@ -31,8 +30,9 @@ void DrawBloomPass::ChangeQuality(int quality)
|
|||||||
|
|
||||||
if (m_Quality == 0) {
|
if (m_Quality == 0) {
|
||||||
CommonFunctions::DeleteTexture(&m_GaussianTexture_horiz);
|
CommonFunctions::DeleteTexture(&m_GaussianTexture_horiz);
|
||||||
CommonFunctions::DeleteTexture(&m_GaussianTexture_vert);
|
CommonFunctions::DeleteTexture(&m_GaussianTexture_vert);
|
||||||
CommonFunctions::DeleteTexture(&m_FinalGaussianTexture);
|
m_GaussianTexture_horiz = 0;
|
||||||
|
m_GaussianTexture_vert = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
InitializeTextures();
|
InitializeTextures();
|
||||||
@@ -62,50 +62,22 @@ void DrawBloomPass::InitializeShaderPrograms()
|
|||||||
m_GaussianProgram_vert->BindFragDataLocation(0, "fragmentColor");
|
m_GaussianProgram_vert->BindFragDataLocation(0, "fragmentColor");
|
||||||
m_GaussianProgram_vert->Link();
|
m_GaussianProgram_vert->Link();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_GaussianCombineProgram = ResourceManager::Load<ShaderProgram>("#GaussianCombineProgram");
|
|
||||||
if (m_GaussianCombineProgram->GetHandle() == 0) {
|
|
||||||
m_GaussianCombineProgram->AddShader(std::shared_ptr<Shader>(new VertexShader("Shaders/CombineGaussianTexture.vert.glsl")));
|
|
||||||
m_GaussianCombineProgram->AddShader(std::shared_ptr<Shader>(new FragmentShader("Shaders/CombineGaussianTexture.frag.glsl")));
|
|
||||||
m_GaussianCombineProgram->Compile();
|
|
||||||
m_GaussianCombineProgram->BindFragDataLocation(0, "fragmentColor");
|
|
||||||
m_GaussianCombineProgram->Link();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawBloomPass::InitializeBuffers()
|
void DrawBloomPass::InitializeBuffers()
|
||||||
{
|
{
|
||||||
CommonFunctions::GenerateMipMapTexture(
|
CommonFunctions::GenerateTexture(&m_GaussianTexture_horiz, GL_CLAMP_TO_EDGE, GL_LINEAR, glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height), GL_RGB16F, GL_RGB, GL_FLOAT);
|
||||||
&m_GaussianTexture_horiz, GL_CLAMP_TO_BORDER, glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height)
|
|
||||||
, GL_RGB, GL_FLOAT, m_BloomLod);
|
|
||||||
CommonFunctions::GenerateMipMapTexture(
|
|
||||||
&m_GaussianTexture_vert, GL_CLAMP_TO_BORDER, glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height)
|
|
||||||
, GL_RGB, GL_FLOAT, m_BloomLod);
|
|
||||||
CommonFunctions::GenerateTexture(&m_FinalGaussianTexture, GL_CLAMP_TO_BORDER, GL_LINEAR, glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height), GL_RGB16F, GL_RGB, GL_FLOAT);
|
|
||||||
|
|
||||||
if (m_GaussianCombineBuffer.GetHandle() == 0) {
|
if (m_GaussianFrameBuffer_horiz.GetHandle() == 0) {
|
||||||
m_GaussianCombineBuffer.AddResource(std::shared_ptr<BufferResource>(new Texture2D(&m_FinalGaussianTexture, GL_COLOR_ATTACHMENT0)));
|
m_GaussianFrameBuffer_horiz.AddResource(std::shared_ptr<BufferResource>(new Texture2D(&m_GaussianTexture_horiz, GL_COLOR_ATTACHMENT0)));
|
||||||
}
|
}
|
||||||
m_GaussianCombineBuffer.Generate();
|
m_GaussianFrameBuffer_horiz.Generate();
|
||||||
|
|
||||||
if(m_GaussianFrameBuffer_horiz == nullptr) {
|
CommonFunctions::GenerateTexture(&m_GaussianTexture_vert, GL_CLAMP_TO_EDGE, GL_LINEAR, glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height), GL_RGB16F, GL_RGB, GL_FLOAT);
|
||||||
m_GaussianFrameBuffer_horiz = new FrameBuffer[m_BloomLod];
|
if (m_GaussianFrameBuffer_vert.GetHandle() == 0) {
|
||||||
}
|
m_GaussianFrameBuffer_vert.AddResource(std::shared_ptr<BufferResource>(new Texture2D(&m_GaussianTexture_vert, GL_COLOR_ATTACHMENT0)));
|
||||||
if (m_GaussianFrameBuffer_vert == nullptr) {
|
}
|
||||||
m_GaussianFrameBuffer_vert = new FrameBuffer[m_BloomLod];
|
m_GaussianFrameBuffer_vert.Generate();
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < m_BloomLod; i++) {
|
|
||||||
if(m_GaussianFrameBuffer_horiz[i].GetHandle() == 0) {
|
|
||||||
m_GaussianFrameBuffer_horiz[i].AddResource(std::shared_ptr<BufferResource>(new Texture2D(&m_GaussianTexture_horiz, GL_COLOR_ATTACHMENT0, i)));
|
|
||||||
}
|
|
||||||
m_GaussianFrameBuffer_horiz[i].Generate();
|
|
||||||
|
|
||||||
if (m_GaussianFrameBuffer_vert[i].GetHandle() == 0) {
|
|
||||||
m_GaussianFrameBuffer_vert[i].AddResource(std::shared_ptr<BufferResource>(new Texture2D(&m_GaussianTexture_vert, GL_COLOR_ATTACHMENT0, i)));
|
|
||||||
}
|
|
||||||
m_GaussianFrameBuffer_vert[i].Generate();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -115,75 +87,33 @@ void DrawBloomPass::ClearBuffer()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GLERROR("PRE");
|
GLERROR("PRE");
|
||||||
for (int i = 0; i < m_BloomLod; i++) {
|
m_GaussianFrameBuffer_horiz.Bind();
|
||||||
m_GaussianFrameBuffer_horiz[i].Bind();
|
|
||||||
glClearColor(0.f, 0.f, 0.f, 0.f);
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
|
||||||
m_GaussianFrameBuffer_horiz[i].Unbind();
|
|
||||||
m_GaussianFrameBuffer_vert[i].Bind();
|
|
||||||
glClearColor(0.f, 0.f, 0.f, 0.f);
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
|
||||||
m_GaussianFrameBuffer_vert[i].Unbind();
|
|
||||||
|
|
||||||
}
|
|
||||||
m_GaussianCombineBuffer.Bind();
|
|
||||||
glClearColor(0.f, 0.f, 0.f, 0.f);
|
glClearColor(0.f, 0.f, 0.f, 0.f);
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
m_GaussianCombineBuffer.Unbind();
|
m_GaussianFrameBuffer_horiz.Unbind();
|
||||||
|
m_GaussianFrameBuffer_vert.Bind();
|
||||||
|
glClearColor(0.f, 0.f, 0.f, 0.f);
|
||||||
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
m_GaussianFrameBuffer_vert.Unbind();
|
||||||
GLERROR("END");
|
GLERROR("END");
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawBloomPass::Draw(GLuint texture)
|
void DrawBloomPass::Draw(GLuint texture)
|
||||||
{
|
|
||||||
if (m_Quality == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < m_BloomLod; i++) {
|
|
||||||
GaussianLodPass(i, texture);
|
|
||||||
}
|
|
||||||
CombineGaussianBlur();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void DrawBloomPass::OnWindowResize()
|
|
||||||
{
|
{
|
||||||
if (m_Quality == 0) {
|
if (m_Quality == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CommonFunctions::GenerateMipMapTexture(
|
|
||||||
&m_GaussianTexture_vert, GL_CLAMP_TO_BORDER, glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height)
|
|
||||||
, GL_RGB, GL_FLOAT, m_BloomLod);
|
|
||||||
CommonFunctions::GenerateMipMapTexture(
|
|
||||||
&m_GaussianTexture_horiz, GL_CLAMP_TO_BORDER, glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height)
|
|
||||||
, GL_RGB, GL_FLOAT, m_BloomLod);
|
|
||||||
for (int i = 0; i < m_BloomLod; i++) {
|
|
||||||
m_GaussianFrameBuffer_vert[i].Generate();
|
|
||||||
m_GaussianFrameBuffer_horiz[i].Generate();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void DrawBloomPass::GaussianLodPass(GLuint mipMap, GLuint texture)
|
|
||||||
{
|
|
||||||
GLERROR("DrawBloomPass::Draw: Pre");
|
GLERROR("DrawBloomPass::Draw: Pre");
|
||||||
glViewport(0, 0, m_Renderer->GetViewportSize().Width/(glm::pow(2, mipMap)), m_Renderer->GetViewportSize().Height/(glm::pow(2, mipMap)));
|
|
||||||
DrawBloomPassState state;
|
DrawBloomPassState state;
|
||||||
|
|
||||||
GLuint shaderHandle_horiz = m_GaussianProgram_horiz->GetHandle();
|
GLuint shaderHandle_horiz = m_GaussianProgram_horiz->GetHandle();
|
||||||
GLuint shaderHandle_vert = m_GaussianProgram_vert->GetHandle();
|
GLuint shaderHandle_vert = m_GaussianProgram_vert->GetHandle();
|
||||||
|
|
||||||
m_GaussianProgram_vert->Bind();
|
|
||||||
glUniform1i(glGetUniformLocation(shaderHandle_vert, "Lod"), mipMap);
|
|
||||||
m_GaussianProgram_horiz->Bind();
|
|
||||||
glUniform1i(glGetUniformLocation(shaderHandle_horiz, "Lod"), mipMap);
|
|
||||||
|
|
||||||
|
|
||||||
//Horizontal pass, first use the given texture then save it to the horizontal framebuffer.
|
//Horizontal pass, first use the given texture then save it to the horizontal framebuffer.
|
||||||
m_GaussianFrameBuffer_horiz[mipMap].Bind();
|
m_GaussianFrameBuffer_horiz.Bind();
|
||||||
|
m_GaussianProgram_horiz->Bind();
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
glBindTexture(GL_TEXTURE_2D, texture);
|
glBindTexture(GL_TEXTURE_2D, texture);
|
||||||
glBindVertexArray(m_ScreenQuad->VAO);
|
glBindVertexArray(m_ScreenQuad->VAO);
|
||||||
@@ -193,56 +123,55 @@ void DrawBloomPass::GaussianLodPass(GLuint mipMap, GLuint texture)
|
|||||||
//Iterate some times to make it more gaussian.
|
//Iterate some times to make it more gaussian.
|
||||||
for (int i = 1; i < m_Iterations; i++) {
|
for (int i = 1; i < m_Iterations; i++) {
|
||||||
//Vertical pass
|
//Vertical pass
|
||||||
m_GaussianFrameBuffer_vert[mipMap].Bind();
|
m_GaussianFrameBuffer_vert.Bind();
|
||||||
m_GaussianProgram_vert->Bind();
|
m_GaussianProgram_vert->Bind();
|
||||||
|
|
||||||
|
glActiveTexture(GL_TEXTURE0);
|
||||||
glActiveTexture(GL_TEXTURE0);
|
|
||||||
glBindTexture(GL_TEXTURE_2D, m_GaussianTexture_horiz);
|
glBindTexture(GL_TEXTURE_2D, m_GaussianTexture_horiz);
|
||||||
|
|
||||||
|
glBindVertexArray(m_ScreenQuad->VAO);
|
||||||
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_ScreenQuad->ElementBuffer);
|
||||||
glDrawElementsBaseVertex(GL_TRIANGLES, m_ScreenQuad->MaterialGroups()[0].material->EndIndex - m_ScreenQuad->MaterialGroups()[0].material->StartIndex +1
|
glDrawElementsBaseVertex(GL_TRIANGLES, m_ScreenQuad->MaterialGroups()[0].material->EndIndex - m_ScreenQuad->MaterialGroups()[0].material->StartIndex +1
|
||||||
, GL_UNSIGNED_INT, 0, m_ScreenQuad->MaterialGroups()[0].material->StartIndex);
|
, GL_UNSIGNED_INT, 0, m_ScreenQuad->MaterialGroups()[0].material->StartIndex);
|
||||||
//horizontal pass
|
//horizontal pass
|
||||||
m_GaussianFrameBuffer_vert[mipMap].Unbind();
|
m_GaussianFrameBuffer_vert.Unbind();
|
||||||
|
|
||||||
m_GaussianFrameBuffer_horiz[mipMap].Bind();
|
m_GaussianFrameBuffer_horiz.Bind();
|
||||||
m_GaussianProgram_horiz->Bind();
|
m_GaussianProgram_horiz->Bind();
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
glBindTexture(GL_TEXTURE_2D, m_GaussianTexture_vert);
|
glBindTexture(GL_TEXTURE_2D, m_GaussianTexture_vert);
|
||||||
|
|
||||||
|
glBindVertexArray(m_ScreenQuad->VAO);
|
||||||
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_ScreenQuad->ElementBuffer);
|
||||||
glDrawElementsBaseVertex(GL_TRIANGLES, m_ScreenQuad->MaterialGroups()[0].material->EndIndex - m_ScreenQuad->MaterialGroups()[0].material->StartIndex +1
|
glDrawElementsBaseVertex(GL_TRIANGLES, m_ScreenQuad->MaterialGroups()[0].material->EndIndex - m_ScreenQuad->MaterialGroups()[0].material->StartIndex +1
|
||||||
, GL_UNSIGNED_INT, 0, m_ScreenQuad->MaterialGroups()[0].material->StartIndex);
|
, GL_UNSIGNED_INT, 0, m_ScreenQuad->MaterialGroups()[0].material->StartIndex);
|
||||||
m_GaussianFrameBuffer_horiz[mipMap].Unbind();
|
m_GaussianFrameBuffer_horiz.Unbind();
|
||||||
}
|
}
|
||||||
|
|
||||||
//final vertical gaussian after the iterations are done
|
//final vertical gaussian after the iterations are done
|
||||||
|
|
||||||
m_GaussianFrameBuffer_vert[mipMap].Bind();
|
m_GaussianFrameBuffer_vert.Bind();
|
||||||
m_GaussianProgram_vert->Bind();
|
m_GaussianProgram_vert->Bind();
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
glBindTexture(GL_TEXTURE_2D, m_GaussianTexture_horiz);
|
glBindTexture(GL_TEXTURE_2D, m_GaussianTexture_horiz);
|
||||||
|
|
||||||
glDrawElementsBaseVertex(GL_TRIANGLES, m_ScreenQuad->MaterialGroups()[0].material->EndIndex - m_ScreenQuad->MaterialGroups()[0].material->StartIndex +1
|
|
||||||
, GL_UNSIGNED_INT, 0, m_ScreenQuad->MaterialGroups()[0].material->StartIndex);
|
|
||||||
|
|
||||||
GLERROR("DrawBloomPass::Draw: END");
|
|
||||||
glViewport(0, 0, m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
|
||||||
m_GaussianFrameBuffer_vert[mipMap].Unbind();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void DrawBloomPass::CombineGaussianBlur()
|
|
||||||
{
|
|
||||||
m_GaussianCombineBuffer.Bind();
|
|
||||||
m_GaussianCombineProgram->Bind();
|
|
||||||
glUniform1i(glGetUniformLocation(m_GaussianCombineProgram->GetHandle(), "MaxMipMap"), m_BloomLod);
|
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0);
|
|
||||||
glBindTexture(GL_TEXTURE_2D, m_GaussianTexture_vert);
|
|
||||||
glBindVertexArray(m_ScreenQuad->VAO);
|
glBindVertexArray(m_ScreenQuad->VAO);
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_ScreenQuad->ElementBuffer);
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_ScreenQuad->ElementBuffer);
|
||||||
glDrawElementsBaseVertex(GL_TRIANGLES, m_ScreenQuad->MaterialGroups()[0].material->EndIndex - m_ScreenQuad->MaterialGroups()[0].material->StartIndex +1
|
glDrawElementsBaseVertex(GL_TRIANGLES, m_ScreenQuad->MaterialGroups()[0].material->EndIndex - m_ScreenQuad->MaterialGroups()[0].material->StartIndex +1
|
||||||
, GL_UNSIGNED_INT, 0, m_ScreenQuad->MaterialGroups()[0].material->StartIndex);
|
, GL_UNSIGNED_INT, 0, m_ScreenQuad->MaterialGroups()[0].material->StartIndex);
|
||||||
|
|
||||||
|
GLERROR("DrawBloomPass::Draw: END");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DrawBloomPass::OnWindowResize()
|
||||||
|
{
|
||||||
|
if (m_Quality == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
CommonFunctions::GenerateTexture(&m_GaussianTexture_vert, GL_CLAMP_TO_EDGE, GL_LINEAR, glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height), GL_RGB16F, GL_RGB, GL_FLOAT);
|
||||||
|
m_GaussianFrameBuffer_vert.Generate();
|
||||||
|
CommonFunctions::GenerateTexture(&m_GaussianTexture_horiz, GL_CLAMP_TO_EDGE, GL_LINEAR, glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height), GL_RGB16F, GL_RGB, GL_FLOAT);
|
||||||
|
m_GaussianFrameBuffer_horiz.Generate();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ void DrawFinalPass::InitializeTextures()
|
|||||||
|
|
||||||
void DrawFinalPass::InitializeFrameBuffers()
|
void DrawFinalPass::InitializeFrameBuffers()
|
||||||
{
|
{
|
||||||
CommonFunctions::GenerateTexture(&m_SceneTexture, GL_CLAMP_TO_BORDER, GL_LINEAR, glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height), GL_RGB16F, GL_RGB, GL_FLOAT);
|
CommonFunctions::GenerateTexture(&m_SceneTexture, GL_CLAMP_TO_EDGE, GL_LINEAR, glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height), GL_RGB16F, GL_RGB, GL_FLOAT);
|
||||||
//GenerateTexture(&m_BloomTexture, GL_CLAMP_TO_EDGE, GL_LINEAR, glm::vec2(m_Renderer->GetViewPortSize().Width, m_Renderer->GetViewPortSize().Height), GL_RGB16F, GL_RGB, GL_FLOAT);
|
//GenerateTexture(&m_BloomTexture, GL_CLAMP_TO_EDGE, GL_LINEAR, glm::vec2(m_Renderer->GetViewPortSize().Width, m_Renderer->GetViewPortSize().Height), GL_RGB16F, GL_RGB, GL_FLOAT);
|
||||||
CommonFunctions::GenerateTexture(&m_BloomTexture, GL_CLAMP_TO_BORDER, GL_LINEAR, glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height), GL_RGB16F, GL_RGB, GL_FLOAT);
|
CommonFunctions::GenerateTexture(&m_BloomTexture, GL_CLAMP_TO_EDGE, GL_LINEAR, glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height), GL_RGB16F, GL_RGB, GL_FLOAT);
|
||||||
//GenerateMipMapTexture(&m_BloomTexture, GL_CLAMP_TO_EDGE, glm::vec2(m_Renderer->GetViewPortSize().Width, m_Renderer->GetViewPortSize().Height), GL_RGB16F, GL_FLOAT, 4);
|
//GenerateMipMapTexture(&m_BloomTexture, GL_CLAMP_TO_EDGE, glm::vec2(m_Renderer->GetViewPortSize().Width, m_Renderer->GetViewPortSize().Height), GL_RGB16F, GL_FLOAT, 4);
|
||||||
//GenerateTexture(&m_StencilTexture, GL_CLAMP_TO_EDGE, GL_LINEAR, glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height), GL_STENCIL, GL_STENCIL_INDEX8, GL_INT);
|
//GenerateTexture(&m_StencilTexture, GL_CLAMP_TO_EDGE, GL_LINEAR, glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height), GL_STENCIL, GL_STENCIL_INDEX8, GL_INT);
|
||||||
|
|
||||||
@@ -242,7 +242,7 @@ void DrawFinalPass::InitializeShaderPrograms()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawFinalPass::Draw(RenderScene& scene, BlurHUD* blurHUDPass, TextPass* textPass)
|
void DrawFinalPass::Draw(RenderScene& scene, BlurHUD* blurHUDPass)
|
||||||
{
|
{
|
||||||
GLERROR("Pre");
|
GLERROR("Pre");
|
||||||
DrawFinalPassState* stateDethp = new DrawFinalPassState(m_ShieldDepthFrameBuffer.GetHandle());
|
DrawFinalPassState* stateDethp = new DrawFinalPassState(m_ShieldDepthFrameBuffer.GetHandle());
|
||||||
@@ -282,36 +282,10 @@ void DrawFinalPass::Draw(RenderScene& scene, BlurHUD* blurHUDPass, TextPass* tex
|
|||||||
//state->StencilMask(0x00);
|
//state->StencilMask(0x00);
|
||||||
DrawModelRenderQueues(scene.Jobs.OpaqueObjects, scene);
|
DrawModelRenderQueues(scene.Jobs.OpaqueObjects, scene);
|
||||||
GLERROR("OpaqueObjects");
|
GLERROR("OpaqueObjects");
|
||||||
delete state;
|
|
||||||
|
|
||||||
DrawFinalPassState* stateSprite = new DrawFinalPassState(m_FinalPassFrameBuffer.GetHandle());
|
|
||||||
if (scene.ShouldBlur) {
|
|
||||||
//Combine nonblur and blur texture
|
|
||||||
stateSprite->Disable(GL_DEPTH_TEST);
|
|
||||||
stateSprite->Disable(GL_STENCIL_TEST);
|
|
||||||
m_CombinedTexture = blurHUDPass->CombineTextures(m_SceneTexture, m_FullBlurredTexture);
|
|
||||||
|
|
||||||
}
|
|
||||||
//Draw Transparen objects
|
|
||||||
//state->BlendFunc(GL_ONE, GL_ONE);
|
|
||||||
//state->StencilFunc(GL_EQUAL, 1, 0xFF);
|
|
||||||
//DrawModelRenderQueues(scene.Jobs.TransparentObjects, scene);
|
|
||||||
GLERROR("TransparentObjects");
|
|
||||||
//state->BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
|
||||||
stateSprite->Enable(GL_DEPTH_TEST);
|
|
||||||
//stateSprite->AlphaFunc(GL_GEQUAL, 0.05f);
|
|
||||||
//stateSprite->Enable(GL_ALPHA_TEST);
|
|
||||||
DrawSprites(scene.Jobs.SpriteJob, scene);
|
|
||||||
GLERROR("SpriteJobs");
|
|
||||||
|
|
||||||
delete stateSprite;
|
|
||||||
|
|
||||||
state = new DrawFinalPassState(m_FinalPassFrameBuffer.GetHandle());
|
|
||||||
|
|
||||||
//state->Disable(GL_STENCIL_TEST);
|
//state->Disable(GL_STENCIL_TEST);
|
||||||
//Draw Transparen Shielded objects
|
//Draw Transparen Shielded objects
|
||||||
state->BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
state->BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
textPass->Draw(scene, m_FinalPassFrameBuffer);
|
|
||||||
DrawModelRenderQueuesWithShieldCheck(scene.Jobs.TransparentObjects, scene); //might need changing
|
DrawModelRenderQueuesWithShieldCheck(scene.Jobs.TransparentObjects, scene); //might need changing
|
||||||
GLERROR("Shielded Transparent objects");
|
GLERROR("Shielded Transparent objects");
|
||||||
|
|
||||||
@@ -322,7 +296,25 @@ void DrawFinalPass::Draw(RenderScene& scene, BlurHUD* blurHUDPass, TextPass* tex
|
|||||||
m_FullBlurredTexture = blurHUDPass->Draw(m_SceneTexture, scene);
|
m_FullBlurredTexture = blurHUDPass->Draw(m_SceneTexture, scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DrawFinalPassState* stateSprite = new DrawFinalPassState(m_FinalPassFrameBuffer.GetHandle());
|
||||||
|
if(scene.ShouldBlur) {
|
||||||
|
//Combine nonblur and blur texture
|
||||||
|
stateSprite->Disable(GL_DEPTH_TEST);
|
||||||
|
stateSprite->Disable(GL_STENCIL_TEST);
|
||||||
|
m_CombinedTexture = blurHUDPass->CombineTextures(m_SceneTexture, m_FullBlurredTexture);
|
||||||
|
|
||||||
|
}
|
||||||
|
//Draw Transparen objects
|
||||||
|
//state->BlendFunc(GL_ONE, GL_ONE);
|
||||||
|
//state->StencilFunc(GL_EQUAL, 1, 0xFF);
|
||||||
|
//DrawModelRenderQueues(scene.Jobs.TransparentObjects, scene);
|
||||||
|
GLERROR("TransparentObjects");
|
||||||
|
//state->BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
stateSprite->Enable(GL_DEPTH_TEST);
|
||||||
|
DrawSprites(scene.Jobs.SpriteJob, scene);
|
||||||
|
GLERROR("SpriteJobs");
|
||||||
|
|
||||||
|
delete stateSprite;
|
||||||
GLERROR("END");
|
GLERROR("END");
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -351,8 +343,8 @@ void DrawFinalPass::OnWindowResize()
|
|||||||
//InitializeFrameBuffers();
|
//InitializeFrameBuffers();
|
||||||
CommonFunctions::GenerateTexture(&m_DepthBuffer, GL_CLAMP_TO_BORDER, GL_NEAREST,
|
CommonFunctions::GenerateTexture(&m_DepthBuffer, GL_CLAMP_TO_BORDER, GL_NEAREST,
|
||||||
glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height), GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8);
|
glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height), GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8);
|
||||||
CommonFunctions::GenerateTexture(&m_SceneTexture, GL_CLAMP_TO_BORDER, GL_LINEAR, glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height), GL_RGB16F, GL_RGB, GL_FLOAT);
|
CommonFunctions::GenerateTexture(&m_SceneTexture, GL_CLAMP_TO_EDGE, GL_LINEAR, glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height), GL_RGB16F, GL_RGB, GL_FLOAT);
|
||||||
CommonFunctions::GenerateTexture(&m_BloomTexture, GL_CLAMP_TO_BORDER, GL_LINEAR, glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height), GL_RGB16F, GL_RGB, GL_FLOAT);
|
CommonFunctions::GenerateTexture(&m_BloomTexture, GL_CLAMP_TO_EDGE, GL_LINEAR, glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height), GL_RGB16F, GL_RGB, GL_FLOAT);
|
||||||
m_FinalPassFrameBuffer.Generate();
|
m_FinalPassFrameBuffer.Generate();
|
||||||
|
|
||||||
GLERROR("Error changing texture resolutions");
|
GLERROR("Error changing texture resolutions");
|
||||||
@@ -1277,34 +1269,23 @@ void DrawFinalPass::DrawSprites(std::list<std::shared_ptr<RenderJob>>&jobs, Rend
|
|||||||
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||||
glUniform3fv(glGetUniformLocation(shaderHandle, "CameraPos"), 1, glm::value_ptr(scene.Camera->Position()));
|
glUniform3fv(glGetUniformLocation(shaderHandle, "CameraPos"), 1, glm::value_ptr(scene.Camera->Position()));
|
||||||
RenderState* jobState = new RenderState();
|
|
||||||
|
|
||||||
|
|
||||||
for(auto& job : jobs) {
|
for(auto& job : jobs) {
|
||||||
auto spriteJob = std::dynamic_pointer_cast<SpriteJob>(job);
|
auto spriteJob = std::dynamic_pointer_cast<SpriteJob>(job);
|
||||||
|
RenderState jobState;
|
||||||
|
|
||||||
if (spriteJob) {
|
if (spriteJob) {
|
||||||
if(spriteJob->Depth == 0) {
|
if(spriteJob->Depth == 0) {
|
||||||
jobState->Disable(GL_DEPTH_TEST);
|
jobState.Disable(GL_DEPTH_TEST);
|
||||||
}
|
}
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "PVM"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix() * scene.Camera->ViewMatrix() * spriteJob->Matrix));
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "PVM"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix() * scene.Camera->ViewMatrix() * spriteJob->Matrix));
|
||||||
glUniform4fv(glGetUniformLocation(shaderHandle, "Color"), 1, glm::value_ptr(spriteJob->Color));
|
glUniform4fv(glGetUniformLocation(shaderHandle, "Color"), 1, glm::value_ptr(spriteJob->Color));
|
||||||
glUniform4fv(glGetUniformLocation(shaderHandle, "FillColor"), 1, glm::value_ptr(spriteJob->FillColor));
|
glUniform4fv(glGetUniformLocation(shaderHandle, "FillColor"), 1, glm::value_ptr(spriteJob->FillColor));
|
||||||
glUniform1f(glGetUniformLocation(shaderHandle, "FillPercentage"), spriteJob->FillPercentage);
|
glUniform1f(glGetUniformLocation(shaderHandle, "FillPercentage"), spriteJob->FillPercentage);
|
||||||
glUniform1f(glGetUniformLocation(shaderHandle, "ScaleX"), spriteJob->ScaleX);
|
|
||||||
glUniform1f(glGetUniformLocation(shaderHandle, "ScaleY"), spriteJob->ScaleY);
|
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE1);
|
glActiveTexture(GL_TEXTURE1);
|
||||||
if (spriteJob->DiffuseTexture != nullptr) {
|
if (spriteJob->DiffuseTexture != nullptr) {
|
||||||
glBindTexture(GL_TEXTURE_2D, spriteJob->DiffuseTexture->m_Texture);
|
glBindTexture(GL_TEXTURE_2D, spriteJob->DiffuseTexture->m_Texture);
|
||||||
if (spriteJob->Linear) {
|
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
|
||||||
} else {
|
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
|
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
glBindTexture(GL_TEXTURE_2D, m_ErrorTexture->m_Texture);
|
glBindTexture(GL_TEXTURE_2D, m_ErrorTexture->m_Texture);
|
||||||
}
|
}
|
||||||
@@ -1322,7 +1303,6 @@ void DrawFinalPass::DrawSprites(std::list<std::shared_ptr<RenderJob>>&jobs, Rend
|
|||||||
glDrawElements(GL_TRIANGLES, spriteJob->EndIndex - spriteJob->StartIndex + 1, GL_UNSIGNED_INT, (void*)(spriteJob->StartIndex*sizeof(unsigned int)));
|
glDrawElements(GL_TRIANGLES, spriteJob->EndIndex - spriteJob->StartIndex + 1, GL_UNSIGNED_INT, (void*)(spriteJob->StartIndex*sizeof(unsigned int)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete jobState;
|
|
||||||
// m_SpriteProgram->Unbind();
|
// m_SpriteProgram->Unbind();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ DrawFinalPassState::DrawFinalPassState(GLuint frameBuffer)
|
|||||||
Enable(GL_DEPTH_TEST);
|
Enable(GL_DEPTH_TEST);
|
||||||
DepthMask(GL_TRUE);
|
DepthMask(GL_TRUE);
|
||||||
Enable(GL_CULL_FACE);
|
Enable(GL_CULL_FACE);
|
||||||
Enable(GL_ALPHA_TEST);
|
|
||||||
AlphaFunc(GL_GEQUAL, 0.05f);
|
|
||||||
// Enable(GL_STENCIL_TEST);
|
// Enable(GL_STENCIL_TEST);
|
||||||
// StencilFunc(GL_NOTEQUAL, 1, 0xFF);
|
// StencilFunc(GL_NOTEQUAL, 1, 0xFF);
|
||||||
// StencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
// StencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
||||||
|
|||||||
@@ -2,12 +2,11 @@
|
|||||||
#include "Rendering/FrameBuffer.h"
|
#include "Rendering/FrameBuffer.h"
|
||||||
|
|
||||||
|
|
||||||
BufferResource::BufferResource(GLuint* resourceHandle, GLenum resourceType, GLenum attachment, GLuint mipMapLod)
|
BufferResource::BufferResource(GLuint* resourceHandle, GLenum resourceType, GLenum attachment)
|
||||||
{
|
{
|
||||||
m_ResourceHandle = resourceHandle;
|
m_ResourceHandle = resourceHandle;
|
||||||
m_ResourceType = resourceType;
|
m_ResourceType = resourceType;
|
||||||
m_Attachment = attachment;
|
m_Attachment = attachment;
|
||||||
m_MipMapLod = mipMapLod;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Texture2D::~Texture2D()
|
Texture2D::~Texture2D()
|
||||||
@@ -59,7 +58,7 @@ void FrameBuffer::Generate()
|
|||||||
for (auto it = m_Resources.begin(); it != m_Resources.end(); it++) {
|
for (auto it = m_Resources.begin(); it != m_Resources.end(); it++) {
|
||||||
switch ((*it)->m_ResourceType) {
|
switch ((*it)->m_ResourceType) {
|
||||||
case GL_TEXTURE_2D:
|
case GL_TEXTURE_2D:
|
||||||
glFramebufferTexture(GL_FRAMEBUFFER, (*it)->m_Attachment, *(*it)->m_ResourceHandle, (*it)->m_MipMapLod);
|
glFramebufferTexture2D(GL_FRAMEBUFFER, (*it)->m_Attachment, (*it)->m_ResourceType, *(*it)->m_ResourceHandle, 0);
|
||||||
GLERROR("FrameBuffer generate: glFramebufferTexture2D");
|
GLERROR("FrameBuffer generate: glFramebufferTexture2D");
|
||||||
break;
|
break;
|
||||||
case GL_RENDERBUFFER:
|
case GL_RENDERBUFFER:
|
||||||
|
|||||||
@@ -42,15 +42,6 @@ void LightCullingPass::SetSSBOSizes()
|
|||||||
{
|
{
|
||||||
m_NumberOfTiles = (int)(m_Renderer->GetViewportSize().Width/TILE_SIZE) * (int)(m_Renderer->GetViewportSize().Height/TILE_SIZE);
|
m_NumberOfTiles = (int)(m_Renderer->GetViewportSize().Width/TILE_SIZE) * (int)(m_Renderer->GetViewportSize().Height/TILE_SIZE);
|
||||||
|
|
||||||
if (m_Frustums != nullptr) {
|
|
||||||
delete[] m_Frustums;
|
|
||||||
}
|
|
||||||
if (m_LightGrid != nullptr) {
|
|
||||||
delete[] m_LightGrid;
|
|
||||||
}
|
|
||||||
if (m_LightIndex != nullptr) {
|
|
||||||
delete[] m_LightIndex;
|
|
||||||
}
|
|
||||||
m_Frustums = new Frustum[m_NumberOfTiles];
|
m_Frustums = new Frustum[m_NumberOfTiles];
|
||||||
m_LightGrid = new LightGrid[m_NumberOfTiles];
|
m_LightGrid = new LightGrid[m_NumberOfTiles];
|
||||||
m_LightIndex = new float[m_NumberOfTiles*MAX_LIGHTS_PER_TILE];
|
m_LightIndex = new float[m_NumberOfTiles*MAX_LIGHTS_PER_TILE];
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ void PickingPass::InitializeTextures()
|
|||||||
glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height), GL_RG8, GL_RG, GL_UNSIGNED_BYTE);
|
glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height), GL_RG8, GL_RG, GL_UNSIGNED_BYTE);
|
||||||
|
|
||||||
CommonFunctions::GenerateTexture(&m_DepthBuffer, GL_CLAMP_TO_BORDER, GL_NEAREST,
|
CommonFunctions::GenerateTexture(&m_DepthBuffer, GL_CLAMP_TO_BORDER, GL_NEAREST,
|
||||||
glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height), GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT);
|
glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height), GL_DEPTH_COMPONENT32, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PickingPass::InitializeFrameBuffers()
|
void PickingPass::InitializeFrameBuffers()
|
||||||
@@ -219,7 +219,7 @@ void PickingPass::Draw(RenderScene& scene)
|
|||||||
m_PickingSkinnedProgram->Bind();
|
m_PickingSkinnedProgram->Bind();
|
||||||
lastShader = m_PickingSkinnedProgram->GetHandle();
|
lastShader = m_PickingSkinnedProgram->GetHandle();
|
||||||
}
|
}
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "PVM"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix() * scene.Camera->ViewMatrix() * modelJob->Matrix));
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "PVM"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix() * scene.Camera->ViewMatrix() * modelJob->Matrix));
|
||||||
glUniform2fv(glGetUniformLocation(shaderSkinnedHandle, "PickingColor"), 1, glm::value_ptr(glm::vec2(pickColor[0], pickColor[1])));
|
glUniform2fv(glGetUniformLocation(shaderSkinnedHandle, "PickingColor"), 1, glm::value_ptr(glm::vec2(pickColor[0], pickColor[1])));
|
||||||
|
|
||||||
std::vector<glm::mat4> frameBones;
|
std::vector<glm::mat4> frameBones;
|
||||||
|
|||||||
@@ -9,11 +9,10 @@ RenderSystem::RenderSystem(SystemParams params, const IRenderer* renderer, Rende
|
|||||||
, m_Octree(frustumCullOctree)
|
, m_Octree(frustumCullOctree)
|
||||||
{
|
{
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_ESetCamera, &RenderSystem::OnSetCamera);
|
EVENT_SUBSCRIBE_MEMBER(m_ESetCamera, &RenderSystem::OnSetCamera);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EResolutionChanged, &RenderSystem::OnResolutionChanged);
|
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &RenderSystem::OnInputCommand);
|
EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &RenderSystem::OnInputCommand);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EPlayerSpawned, &RenderSystem::OnPlayerSpawned);
|
EVENT_SUBSCRIBE_MEMBER(m_EPlayerSpawned, &RenderSystem::OnPlayerSpawned);
|
||||||
|
|
||||||
m_Camera = new Camera((float)m_Renderer->GetViewportSize().Width / m_Renderer->GetViewportSize().Height, glm::radians(45.f), 0.01f, 5000.f);
|
m_Camera = new Camera((float)m_Renderer->Resolution().Width / m_Renderer->Resolution().Height, glm::radians(45.f), 0.01f, 5000.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderSystem::~RenderSystem()
|
RenderSystem::~RenderSystem()
|
||||||
@@ -21,18 +20,11 @@ RenderSystem::~RenderSystem()
|
|||||||
delete m_Camera;
|
delete m_Camera;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RenderSystem::OnResolutionChanged(Events::ResolutionChanged& e)
|
|
||||||
{
|
|
||||||
// Update camera aspect ration on resolution change
|
|
||||||
m_Camera->SetAspectRatio((float)e.NewResolution.Width / e.NewResolution.Height);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool RenderSystem::OnSetCamera(Events::SetCamera& e)
|
bool RenderSystem::OnSetCamera(Events::SetCamera& e)
|
||||||
{
|
{
|
||||||
ComponentWrapper cTransform = e.CameraEntity["Transform"];
|
ComponentWrapper cTransform = e.CameraEntity["Transform"];
|
||||||
ComponentWrapper cCamera = e.CameraEntity["Camera"];
|
ComponentWrapper cCamera = e.CameraEntity["Camera"];
|
||||||
m_Camera->SetFOV(glm::radians((double)cCamera["FOV"]));
|
m_Camera->SetFOV((double)cCamera["FOV"]);
|
||||||
m_Camera->SetNearClip((double)cCamera["NearClip"]);
|
m_Camera->SetNearClip((double)cCamera["NearClip"]);
|
||||||
m_Camera->SetFarClip((double)cCamera["FarClip"]);
|
m_Camera->SetFarClip((double)cCamera["FarClip"]);
|
||||||
m_Camera->SetPosition(cTransform["Position"]);
|
m_Camera->SetPosition(cTransform["Position"]);
|
||||||
|
|||||||
@@ -36,24 +36,16 @@ void Renderer::Initialize()
|
|||||||
m_ImGuiRenderPass = new ImGuiRenderPass(this, m_EventBroker);
|
m_ImGuiRenderPass = new ImGuiRenderPass(this, m_EventBroker);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Renderer::glfwWindowSizeCallback(GLFWwindow* window, int width, int height)
|
|
||||||
{
|
|
||||||
m_WindowToRenderer[window]->setWindowSize(Rectangle(width, height));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Renderer::glfwFrameBufferCallback(GLFWwindow* window, int width, int height)
|
void Renderer::glfwFrameBufferCallback(GLFWwindow* window, int width, int height)
|
||||||
{
|
{
|
||||||
m_WindowToRenderer[window]->updateFramebufferSize();
|
glViewport(0, 0, width, height);
|
||||||
}
|
Renderer* currentRenderer = m_WindowToRenderer[window];
|
||||||
|
currentRenderer->m_ViewportSize = Rectangle(width, height);
|
||||||
void Renderer::SetResolution(const Rectangle& resolution)
|
currentRenderer->m_PickingPass->OnWindowResize();
|
||||||
{
|
currentRenderer->m_DrawFinalPass->OnWindowResize();
|
||||||
m_Resolution = resolution;
|
currentRenderer->m_LightCullingPass->OnWindowResize();
|
||||||
|
currentRenderer->m_DrawBloomPass->OnWindowResize();
|
||||||
if (m_Window != nullptr) {
|
currentRenderer->m_SSAOPass->OnWindowResize();
|
||||||
setWindowSize(resolution);
|
|
||||||
updateFramebufferSize();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Renderer::InitializeWindow()
|
void Renderer::InitializeWindow()
|
||||||
@@ -75,7 +67,6 @@ void Renderer::InitializeWindow()
|
|||||||
LOG_ERROR("GLFW: Failed to create window");
|
LOG_ERROR("GLFW: Failed to create window");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
glfwSetWindowSizeCallback(m_Window, &glfwWindowSizeCallback);
|
|
||||||
glfwSetFramebufferSizeCallback(m_Window, &glfwFrameBufferCallback);
|
glfwSetFramebufferSizeCallback(m_Window, &glfwFrameBufferCallback);
|
||||||
glfwMakeContextCurrent(m_Window);
|
glfwMakeContextCurrent(m_Window);
|
||||||
|
|
||||||
@@ -120,31 +111,6 @@ void Renderer::InputUpdate(double dt)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Renderer::setWindowSize(Rectangle size)
|
|
||||||
{
|
|
||||||
m_Resolution = size;
|
|
||||||
glfwSetWindowSize(m_Window, size.Width, size.Height);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Renderer::updateFramebufferSize()
|
|
||||||
{
|
|
||||||
Events::ResolutionChanged e;
|
|
||||||
e.OldResolution = m_ViewportSize;
|
|
||||||
|
|
||||||
int width, height;
|
|
||||||
glfwGetFramebufferSize(m_Window, &width, &height);
|
|
||||||
glViewport(0, 0, width, height);
|
|
||||||
m_ViewportSize = Rectangle(width, height);
|
|
||||||
m_PickingPass->OnWindowResize();
|
|
||||||
m_DrawFinalPass->OnWindowResize();
|
|
||||||
m_LightCullingPass->OnWindowResize();
|
|
||||||
m_DrawBloomPass->OnWindowResize();
|
|
||||||
m_SSAOPass->OnWindowResize();
|
|
||||||
|
|
||||||
e.NewResolution = m_ViewportSize;
|
|
||||||
m_EventBroker->Publish(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Renderer::Update(double dt)
|
void Renderer::Update(double dt)
|
||||||
{
|
{
|
||||||
m_EventBroker->Process<Renderer>();
|
m_EventBroker->Process<Renderer>();
|
||||||
@@ -210,15 +176,14 @@ void Renderer::Draw(RenderFrame& frame)
|
|||||||
PerformanceTimer::StartTimerAndStopPrevious("Renderer-Light Culling");
|
PerformanceTimer::StartTimerAndStopPrevious("Renderer-Light Culling");
|
||||||
m_LightCullingPass->CullLights(*scene);
|
m_LightCullingPass->CullLights(*scene);
|
||||||
GLERROR("LightCulling");
|
GLERROR("LightCulling");
|
||||||
PerformanceTimer::StartTimerAndStopPrevious("Renderer-Draw Text");
|
|
||||||
//m_TextPass->Draw(*scene, *m_DrawFinalPass->FinalPassFrameBuffer());
|
|
||||||
GLERROR("Draw Text");
|
|
||||||
PerformanceTimer::StartTimerAndStopPrevious("Renderer-Draw Geometry+Light");
|
PerformanceTimer::StartTimerAndStopPrevious("Renderer-Draw Geometry+Light");
|
||||||
m_DrawFinalPass->Draw(*scene, m_BlurHUDPass, m_TextPass);
|
m_DrawFinalPass->Draw(*scene, m_BlurHUDPass);
|
||||||
GLERROR("Draw Geometry+Light");
|
GLERROR("Draw Geometry+Light");
|
||||||
//m_DrawScenePass->Draw(*scene);
|
//m_DrawScenePass->Draw(*scene);
|
||||||
|
|
||||||
|
PerformanceTimer::StartTimerAndStopPrevious("Renderer-Draw Text");
|
||||||
|
m_TextPass->Draw(*scene, *m_DrawFinalPass->FinalPassFrameBuffer());
|
||||||
|
GLERROR("Draw Text");
|
||||||
PerformanceTimer::StopTimer("Renderer-Draw Text");
|
PerformanceTimer::StopTimer("Renderer-Draw Text");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,7 +263,6 @@ void Renderer::GenerateTexture(GLuint* texture, GLenum wrapping, GLenum filterin
|
|||||||
GLERROR("Texture initialization failed");
|
GLERROR("Texture initialization failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Renderer::InitializeRenderPasses()
|
void Renderer::InitializeRenderPasses()
|
||||||
{
|
{
|
||||||
m_PickingPass = new PickingPass(this, m_EventBroker);
|
m_PickingPass = new PickingPass(this, m_EventBroker);
|
||||||
|
|||||||
@@ -233,11 +233,6 @@ void SSAOPass::Draw(GLuint depthBuffer, Camera* camera)
|
|||||||
GLuint shaderHandle_horiz = m_GaussianProgram_horiz->GetHandle();
|
GLuint shaderHandle_horiz = m_GaussianProgram_horiz->GetHandle();
|
||||||
GLuint shaderHandle_vert = m_GaussianProgram_vert->GetHandle();
|
GLuint shaderHandle_vert = m_GaussianProgram_vert->GetHandle();
|
||||||
|
|
||||||
m_GaussianProgram_vert->Bind();
|
|
||||||
glUniform1i(glGetUniformLocation(shaderHandle_vert, "Lod"), 0);
|
|
||||||
m_GaussianProgram_horiz->Bind();
|
|
||||||
glUniform1i(glGetUniformLocation(shaderHandle_horiz, "Lod"), 0);
|
|
||||||
|
|
||||||
m_GaussianFrameBuffer_horiz.Bind();
|
m_GaussianFrameBuffer_horiz.Bind();
|
||||||
m_GaussianProgram_horiz->Bind();
|
m_GaussianProgram_horiz->Bind();
|
||||||
|
|
||||||
@@ -257,6 +252,8 @@ void SSAOPass::Draw(GLuint depthBuffer, Camera* camera)
|
|||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
glBindTexture(GL_TEXTURE_2D, m_Gaussian_horiz);
|
glBindTexture(GL_TEXTURE_2D, m_Gaussian_horiz);
|
||||||
|
|
||||||
|
glBindVertexArray(m_ScreenQuad->VAO);
|
||||||
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_ScreenQuad->ElementBuffer);
|
||||||
glDrawElementsBaseVertex(GL_TRIANGLES, m_ScreenQuad->MaterialGroups()[0].material->EndIndex - m_ScreenQuad->MaterialGroups()[0].material->StartIndex + 1
|
glDrawElementsBaseVertex(GL_TRIANGLES, m_ScreenQuad->MaterialGroups()[0].material->EndIndex - m_ScreenQuad->MaterialGroups()[0].material->StartIndex + 1
|
||||||
, GL_UNSIGNED_INT, 0, m_ScreenQuad->MaterialGroups()[0].material->StartIndex);
|
, GL_UNSIGNED_INT, 0, m_ScreenQuad->MaterialGroups()[0].material->StartIndex);
|
||||||
//horizontal pass
|
//horizontal pass
|
||||||
@@ -268,6 +265,8 @@ void SSAOPass::Draw(GLuint depthBuffer, Camera* camera)
|
|||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
glBindTexture(GL_TEXTURE_2D, m_Gaussian_vert);
|
glBindTexture(GL_TEXTURE_2D, m_Gaussian_vert);
|
||||||
|
|
||||||
|
glBindVertexArray(m_ScreenQuad->VAO);
|
||||||
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_ScreenQuad->ElementBuffer);
|
||||||
glDrawElementsBaseVertex(GL_TRIANGLES, m_ScreenQuad->MaterialGroups()[0].material->EndIndex - m_ScreenQuad->MaterialGroups()[0].material->StartIndex + 1
|
glDrawElementsBaseVertex(GL_TRIANGLES, m_ScreenQuad->MaterialGroups()[0].material->EndIndex - m_ScreenQuad->MaterialGroups()[0].material->StartIndex + 1
|
||||||
, GL_UNSIGNED_INT, 0, m_ScreenQuad->MaterialGroups()[0].material->StartIndex);
|
, GL_UNSIGNED_INT, 0, m_ScreenQuad->MaterialGroups()[0].material->StartIndex);
|
||||||
m_GaussianFrameBuffer_horiz.Unbind();
|
m_GaussianFrameBuffer_horiz.Unbind();
|
||||||
@@ -280,7 +279,8 @@ void SSAOPass::Draw(GLuint depthBuffer, Camera* camera)
|
|||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
glBindTexture(GL_TEXTURE_2D, m_Gaussian_horiz);
|
glBindTexture(GL_TEXTURE_2D, m_Gaussian_horiz);
|
||||||
|
glBindVertexArray(m_ScreenQuad->VAO);
|
||||||
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_ScreenQuad->ElementBuffer);
|
||||||
glDrawElementsBaseVertex(GL_TRIANGLES, m_ScreenQuad->MaterialGroups()[0].material->EndIndex - m_ScreenQuad->MaterialGroups()[0].material->StartIndex + 1
|
glDrawElementsBaseVertex(GL_TRIANGLES, m_ScreenQuad->MaterialGroups()[0].material->EndIndex - m_ScreenQuad->MaterialGroups()[0].material->StartIndex + 1
|
||||||
, GL_UNSIGNED_INT, 0, m_ScreenQuad->MaterialGroups()[0].material->StartIndex);
|
, GL_UNSIGNED_INT, 0, m_ScreenQuad->MaterialGroups()[0].material->StartIndex);
|
||||||
|
|
||||||
|
|||||||
@@ -156,12 +156,7 @@ void ShadowPass::InitializeShaderPrograms()
|
|||||||
m_ShadowProgram->BindFragDataLocation(0, "ShadowMap");
|
m_ShadowProgram->BindFragDataLocation(0, "ShadowMap");
|
||||||
m_ShadowProgram->Link();
|
m_ShadowProgram->Link();
|
||||||
|
|
||||||
m_ShadowProgramSkinned = ResourceManager::Load<ShaderProgram>("#ShadowProgramSkinned");
|
|
||||||
m_ShadowProgramSkinned->AddShader(std::shared_ptr<Shader>(new VertexShader("Shaders/ShadowSkinned.vert.glsl")));
|
|
||||||
m_ShadowProgramSkinned->AddShader(std::shared_ptr<Shader>(new FragmentShader("Shaders/Shadow.frag.glsl")));
|
|
||||||
m_ShadowProgramSkinned->Compile();
|
|
||||||
m_ShadowProgramSkinned->BindFragDataLocation(0, "ShadowMap");
|
|
||||||
m_ShadowProgramSkinned->Link();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShadowPass::ClearBuffer()
|
void ShadowPass::ClearBuffer()
|
||||||
@@ -217,7 +212,8 @@ void ShadowPass::Draw(RenderScene & scene)
|
|||||||
|
|
||||||
ShadowPassState* state = new ShadowPassState(m_DepthBuffer.GetHandle());
|
ShadowPassState* state = new ShadowPassState(m_DepthBuffer.GetHandle());
|
||||||
|
|
||||||
|
m_ShadowProgram->Bind();
|
||||||
|
GLuint shaderHandle = m_ShadowProgram->GetHandle();
|
||||||
glViewport(0, 0, m_ResolutionSizeWidth, m_ResolutionSizeHeight);
|
glViewport(0, 0, m_ResolutionSizeWidth, m_ResolutionSizeHeight);
|
||||||
|
|
||||||
for (int i = 0; i < m_CurrentNrOfSplits; i++) {
|
for (int i = 0; i < m_CurrentNrOfSplits; i++) {
|
||||||
@@ -225,11 +221,7 @@ void ShadowPass::Draw(RenderScene & scene)
|
|||||||
|
|
||||||
glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, m_DepthMap, 0, i);
|
glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, m_DepthMap, 0, i);
|
||||||
|
|
||||||
|
|
||||||
GLuint shaderHandle;
|
|
||||||
|
|
||||||
for (auto &job : scene.Jobs.DirectionalLight) {
|
for (auto &job : scene.Jobs.DirectionalLight) {
|
||||||
|
|
||||||
auto directionalLightJob = std::dynamic_pointer_cast<DirectionalLightJob>(job);
|
auto directionalLightJob = std::dynamic_pointer_cast<DirectionalLightJob>(job);
|
||||||
|
|
||||||
if (directionalLightJob) {
|
if (directionalLightJob) {
|
||||||
@@ -240,19 +232,9 @@ void ShadowPass::Draw(RenderScene & scene)
|
|||||||
//RadiusToLightspace(m_shadowFrusta[i]);
|
//RadiusToLightspace(m_shadowFrusta[i]);
|
||||||
m_LightProjection[i] = glm::ortho(m_shadowFrusta[i].LRBT[LEFT], m_shadowFrusta[i].LRBT[RIGHT], m_shadowFrusta[i].LRBT[BOTTOM], m_shadowFrusta[i].LRBT[TOP], m_NearFarPlane[NEAR], m_NearFarPlane[FAR]);
|
m_LightProjection[i] = glm::ortho(m_shadowFrusta[i].LRBT[LEFT], m_shadowFrusta[i].LRBT[RIGHT], m_shadowFrusta[i].LRBT[BOTTOM], m_shadowFrusta[i].LRBT[TOP], m_NearFarPlane[NEAR], m_NearFarPlane[FAR]);
|
||||||
|
|
||||||
|
|
||||||
m_ShadowProgram->Bind();
|
|
||||||
shaderHandle = m_ShadowProgram->GetHandle();
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "P"), 1, GL_FALSE, glm::value_ptr(m_LightProjection[i]));
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "P"), 1, GL_FALSE, glm::value_ptr(m_LightProjection[i]));
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "V"), 1, GL_FALSE, glm::value_ptr(m_LightView[i]));
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "V"), 1, GL_FALSE, glm::value_ptr(m_LightView[i]));
|
||||||
|
|
||||||
m_ShadowProgramSkinned->Bind();
|
|
||||||
shaderHandle = m_ShadowProgramSkinned->GetHandle();
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "P"), 1, GL_FALSE, glm::value_ptr(m_LightProjection[i]));
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "V"), 1, GL_FALSE, glm::value_ptr(m_LightView[i]));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GLERROR("ShadowLight ERROR");
|
GLERROR("ShadowLight ERROR");
|
||||||
|
|
||||||
for (auto &objectJob : scene.Jobs.OpaqueObjects) {
|
for (auto &objectJob : scene.Jobs.OpaqueObjects) {
|
||||||
@@ -263,23 +245,6 @@ void ShadowPass::Draw(RenderScene & scene)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(modelJob->Model->IsSkinned()) {
|
|
||||||
m_ShadowProgramSkinned->Bind();
|
|
||||||
shaderHandle = m_ShadowProgramSkinned->GetHandle();
|
|
||||||
|
|
||||||
std::vector<glm::mat4> frameBones;
|
|
||||||
if (modelJob->BlendTree != nullptr) {
|
|
||||||
frameBones = modelJob->BlendTree->GetFinalPose();
|
|
||||||
} else {
|
|
||||||
frameBones = modelJob->Skeleton->GetTPose();
|
|
||||||
}
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
|
||||||
|
|
||||||
} else {
|
|
||||||
m_ShadowProgram->Bind();
|
|
||||||
shaderHandle = m_ShadowProgram->GetHandle();
|
|
||||||
}
|
|
||||||
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(modelJob->Matrix));
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(modelJob->Matrix));
|
||||||
glUniform1f(glGetUniformLocation(shaderHandle, "Alpha"), 1.f);
|
glUniform1f(glGetUniformLocation(shaderHandle, "Alpha"), 1.f);
|
||||||
|
|
||||||
@@ -300,23 +265,6 @@ void ShadowPass::Draw(RenderScene & scene)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (modelJob->Model->IsSkinned()) {
|
|
||||||
m_ShadowProgramSkinned->Bind();
|
|
||||||
shaderHandle = m_ShadowProgramSkinned->GetHandle();
|
|
||||||
|
|
||||||
std::vector<glm::mat4> frameBones;
|
|
||||||
if (modelJob->BlendTree != nullptr) {
|
|
||||||
frameBones = modelJob->BlendTree->GetFinalPose();
|
|
||||||
} else {
|
|
||||||
frameBones = modelJob->Skeleton->GetTPose();
|
|
||||||
}
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
|
||||||
|
|
||||||
} else {
|
|
||||||
m_ShadowProgram->Bind();
|
|
||||||
shaderHandle = m_ShadowProgram->GetHandle();
|
|
||||||
}
|
|
||||||
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(modelJob->Matrix));
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(modelJob->Matrix));
|
||||||
glUniform1f(glGetUniformLocation(shaderHandle, "Alpha"), modelJob->Color.a);
|
glUniform1f(glGetUniformLocation(shaderHandle, "Alpha"), modelJob->Color.a);
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ void TextPass::Update()
|
|||||||
void TextPass::Draw(RenderScene& scene, FrameBuffer& frameBuffer)
|
void TextPass::Draw(RenderScene& scene, FrameBuffer& frameBuffer)
|
||||||
{
|
{
|
||||||
GLERROR("Derp1");
|
GLERROR("Derp1");
|
||||||
//TextPassState* state = new TextPassState(frameBuffer.GetHandle());
|
TextPassState* state = new TextPassState(frameBuffer.GetHandle());
|
||||||
for (auto &job : scene.Jobs.Text) {
|
for (auto &job : scene.Jobs.Text) {
|
||||||
auto textJob = std::dynamic_pointer_cast<TextJob>(job);
|
auto textJob = std::dynamic_pointer_cast<TextJob>(job);
|
||||||
if (textJob) {
|
if (textJob) {
|
||||||
@@ -43,7 +43,7 @@ void TextPass::Draw(RenderScene& scene, FrameBuffer& frameBuffer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
GLERROR("Derp2");
|
GLERROR("Derp2");
|
||||||
// delete state;
|
delete state;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextPass::renderText(std::string text, Font* font, TextJob::AlignmentEnum alignment, glm::vec4 color, glm::mat4 modelMatrix, glm::mat4 projectionMatrix, glm::mat4 viewMatrix)
|
void TextPass::renderText(std::string text, Font* font, TextJob::AlignmentEnum alignment, glm::vec4 color, glm::mat4 modelMatrix, glm::mat4 projectionMatrix, glm::mat4 viewMatrix)
|
||||||
|
|||||||
@@ -4,13 +4,10 @@
|
|||||||
TextPassState::TextPassState(GLuint frameBuffer)
|
TextPassState::TextPassState(GLuint frameBuffer)
|
||||||
{
|
{
|
||||||
BindFramebuffer(frameBuffer);
|
BindFramebuffer(frameBuffer);
|
||||||
Enable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
Disable(GL_CULL_FACE);
|
glDisable(GL_CULL_FACE);
|
||||||
Enable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
Enable(GL_ALPHA_TEST);
|
|
||||||
AlphaFunc(GL_GEQUAL, 0.05f);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TextPassState::~TextPassState()
|
TextPassState::~TextPassState()
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
TextureSprite::TextureSprite(std::string path)
|
TextureSprite::TextureSprite(std::string path)
|
||||||
:Texture(path)
|
:Texture(path)
|
||||||
{
|
{
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
|
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST_MIPMAP_NEAREST);
|
||||||
GLERROR("Texture load");
|
GLERROR("Texture load");
|
||||||
}
|
}
|
||||||
@@ -25,12 +25,10 @@ void CommonFunctions::GenerateMultiSampleTexture(GLuint* texture, int numSamples
|
|||||||
|
|
||||||
void CommonFunctions::GenerateMipMapTexture(GLuint* texture, GLenum wrapping, glm::vec2 dimensions, GLint format, GLenum type, GLint numMipMaps)
|
void CommonFunctions::GenerateMipMapTexture(GLuint* texture, GLenum wrapping, glm::vec2 dimensions, GLint format, GLenum type, GLint numMipMaps)
|
||||||
{
|
{
|
||||||
glDeleteTextures(1, texture);
|
|
||||||
glGenTextures(1, texture);
|
glGenTextures(1, texture);
|
||||||
glBindTexture(GL_TEXTURE_2D, *texture);
|
glBindTexture(GL_TEXTURE_2D, *texture);
|
||||||
glTexStorage2D(GL_TEXTURE_2D, numMipMaps, GL_RGBA8, dimensions.x, dimensions.y);
|
glTexStorage2D(GL_TEXTURE_2D, numMipMaps, GL_RGBA8, dimensions.x, dimensions.y);
|
||||||
//glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, dimensions.x, dimensions.y, format, type, NULL);
|
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, dimensions.x, dimensions.y, format, type, texture);
|
||||||
GLERROR("MipMap Texture glTexSubImage2D failed");
|
|
||||||
glGenerateMipmap(GL_TEXTURE_2D);
|
glGenerateMipmap(GL_TEXTURE_2D);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrapping);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrapping);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrapping);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrapping);
|
||||||
|
|||||||
@@ -36,6 +36,10 @@ ScreenCoords::PixelData ScreenCoords::ToPixelData(float x, float y, FrameBuffer*
|
|||||||
unsigned char pdata[3];
|
unsigned char pdata[3];
|
||||||
glReadPixels(x, y, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, &pdata);
|
glReadPixels(x, y, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, &pdata);
|
||||||
GLERROR("glReadPixels(pdata) Error");
|
GLERROR("glReadPixels(pdata) Error");
|
||||||
|
PickDataBuffer->Unbind();
|
||||||
|
GLERROR("Unbind Error");
|
||||||
|
glBindFramebuffer(GL_FRAMEBUFFER, DepthBuffer);
|
||||||
|
GLERROR("glBindFramebuffer(DepthBuffer) Error");
|
||||||
float depthData;
|
float depthData;
|
||||||
glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depthData);
|
glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depthData);
|
||||||
GLERROR("glReadPixels(depthData) Error");
|
GLERROR("glReadPixels(depthData) Error");
|
||||||
|
|||||||
+3
-1
@@ -7,7 +7,7 @@
|
|||||||
#include "Systems/RaptorCopterSystem.h"
|
#include "Systems/RaptorCopterSystem.h"
|
||||||
#include "Systems/HealthSystem.h"
|
#include "Systems/HealthSystem.h"
|
||||||
#include "Systems/PlayerMovementSystem.h"
|
#include "Systems/PlayerMovementSystem.h"
|
||||||
#include "Systems/SpawnerSystem.h"
|
#include "Core/SpawnerSystem.h"
|
||||||
#include "Systems/PlayerSpawnSystem.h"
|
#include "Systems/PlayerSpawnSystem.h"
|
||||||
#include "Systems/PlayerDeathSystem.h"
|
#include "Systems/PlayerDeathSystem.h"
|
||||||
#include "Systems/FloatingEffectSystem.h"
|
#include "Systems/FloatingEffectSystem.h"
|
||||||
@@ -40,6 +40,7 @@
|
|||||||
#include "Game/Systems/MainMenuSystem.h"
|
#include "Game/Systems/MainMenuSystem.h"
|
||||||
#include "Game/Systems/ServerListSystem.h"
|
#include "Game/Systems/ServerListSystem.h"
|
||||||
#include "Game/Systems/StartSystem.h"
|
#include "Game/Systems/StartSystem.h"
|
||||||
|
#include "Core/RespawnSystem.h"
|
||||||
#include "Rendering/TextureSprite.h"
|
#include "Rendering/TextureSprite.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -135,6 +136,7 @@ Game::Game(int argc, char* argv[])
|
|||||||
m_SystemPipeline->AddSystem<HealthSystem>(updateOrderLevel);
|
m_SystemPipeline->AddSystem<HealthSystem>(updateOrderLevel);
|
||||||
m_SystemPipeline->AddSystem<PlayerMovementSystem>(updateOrderLevel);
|
m_SystemPipeline->AddSystem<PlayerMovementSystem>(updateOrderLevel);
|
||||||
m_SystemPipeline->AddSystem<SpawnerSystem>(updateOrderLevel);
|
m_SystemPipeline->AddSystem<SpawnerSystem>(updateOrderLevel);
|
||||||
|
m_SystemPipeline->AddSystem<RespawnSystem>(updateOrderLevel);
|
||||||
m_SystemPipeline->AddSystem<PlayerSpawnSystem>(updateOrderLevel);
|
m_SystemPipeline->AddSystem<PlayerSpawnSystem>(updateOrderLevel);
|
||||||
m_SystemPipeline->AddSystem<AssaultWeaponBehaviour>(updateOrderLevel, m_Renderer, m_OctreeCollision);
|
m_SystemPipeline->AddSystem<AssaultWeaponBehaviour>(updateOrderLevel, m_Renderer, m_OctreeCollision);
|
||||||
m_SystemPipeline->AddSystem<DefenderWeaponBehaviour>(updateOrderLevel, m_Renderer, m_OctreeCollision);
|
m_SystemPipeline->AddSystem<DefenderWeaponBehaviour>(updateOrderLevel, m_Renderer, m_OctreeCollision);
|
||||||
|
|||||||
@@ -108,10 +108,10 @@ void CapturePointSystem::UpdateComponent(EntityWrapper& capturePointEntity, Comp
|
|||||||
//change what model is displaying (change all in case 2 capturepoints has been captured on the same frame)
|
//change what model is displaying (change all in case 2 capturepoints has been captured on the same frame)
|
||||||
for (int i = 0; i < m_NumberOfCapturePoints; i++) {
|
for (int i = 0; i < m_NumberOfCapturePoints; i++) {
|
||||||
auto owner = (int)m_CapturePointNumberToEntityMap[i]["Team"]["Team"];
|
auto owner = (int)m_CapturePointNumberToEntityMap[i]["Team"]["Team"];
|
||||||
if (m_CapturePointNumberToEntityMap[i].FirstChildByName("Red").Valid()) {
|
if (m_CapturePointNumberToEntityMap[i].FirstChildByName("Red").ID != EntityID_Invalid) {
|
||||||
ChangeCapturePointModelsVisibility(m_CapturePointNumberToEntityMap[i].FirstChildByName("Red"), owner == redTeam);
|
(bool&)m_CapturePointNumberToEntityMap[i].FirstChildByName("Red")["Model"]["Visible"] = owner == redTeam ? true : false;
|
||||||
ChangeCapturePointModelsVisibility(m_CapturePointNumberToEntityMap[i].FirstChildByName("Blue"), owner == blueTeam);
|
(bool&)m_CapturePointNumberToEntityMap[i].FirstChildByName("Blue")["Model"]["Visible"] = owner == blueTeam ? true : false;
|
||||||
ChangeCapturePointModelsVisibility(m_CapturePointNumberToEntityMap[i].FirstChildByName("Spectator"), owner == spectatorTeam);
|
(bool&)m_CapturePointNumberToEntityMap[i].FirstChildByName("Spectator")["Model"]["Visible"] = owner == spectatorTeam ? true : false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//save the next cap points and publish the captured event
|
//save the next cap points and publish the captured event
|
||||||
@@ -232,14 +232,6 @@ void CapturePointSystem::UpdateComponent(EntityWrapper& capturePointEntity, Comp
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CapturePointSystem::ChangeCapturePointModelsVisibility(EntityWrapper &capturePointModels, bool isOwner) {
|
|
||||||
(bool&)capturePointModels["Model"]["Visible"] = isOwner;
|
|
||||||
for (auto& capModel : capturePointModels.ChildrenWithComponent("Model"))
|
|
||||||
{
|
|
||||||
(bool&)capModel["Model"]["Visible"] = isOwner;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CapturePointSystem::OnTriggerTouch(const Events::TriggerTouch& e)
|
bool CapturePointSystem::OnTriggerTouch(const Events::TriggerTouch& e)
|
||||||
{
|
{
|
||||||
//personEntered = e.Entity, thingEntered = e.Trigger
|
//personEntered = e.Entity, thingEntered = e.Trigger
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ void PlayerDeathSystem::createDeathEffect(EntityWrapper player)
|
|||||||
bool PlayerDeathSystem::OnEntityDeleted(Events::EntityDeleted& e)
|
bool PlayerDeathSystem::OnEntityDeleted(Events::EntityDeleted& e)
|
||||||
{
|
{
|
||||||
// We only care about when the local players death effect is removed.
|
// We only care about when the local players death effect is removed.
|
||||||
if (m_LocalPlayerDeathEffect.ID != e.DeletedEntity) {
|
if (m_LocalPlayerDeathEffect != e.DeletedEntity) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user