Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e0a1550acd | |||
| 7d4b9927d8 | |||
| 0ee3385e96 | |||
| d7f166b8ae |
+1
-1
Submodule assets updated: 33455a9d10...3af64d8b1f
@@ -84,18 +84,6 @@ bool AABBvsTriangles(const AABB& box,
|
|||||||
const std::vector<unsigned int>& modelIndices,
|
const std::vector<unsigned int>& modelIndices,
|
||||||
const glm::mat4& modelMatrix);
|
const glm::mat4& modelMatrix);
|
||||||
|
|
||||||
enum Output
|
|
||||||
{
|
|
||||||
OutContained,
|
|
||||||
OutSeparated,
|
|
||||||
OutIntersecting
|
|
||||||
};
|
|
||||||
//Detects intersection and containment.
|
|
||||||
Output AABBvsTrianglesWContainment(const AABB& box,
|
|
||||||
const RawModel::Vertex* modelVertices,
|
|
||||||
const std::vector<unsigned int>& modelIndices,
|
|
||||||
const glm::mat4& modelMatrix);
|
|
||||||
|
|
||||||
//Return true if the boxes are intersecting.
|
//Return true if the boxes are intersecting.
|
||||||
bool AABBVsAABB(const AABB& a, const AABB& b);
|
bool AABBVsAABB(const AABB& a, const AABB& b);
|
||||||
//Return true if the boxes are intersecting.
|
//Return true if the boxes are intersecting.
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ public:
|
|||||||
virtual const glm::vec3 Rotation() const { return m_Rotation; }
|
virtual const glm::vec3 Rotation() const { return m_Rotation; }
|
||||||
virtual bool Jumping() const { return m_Jumping; }
|
virtual bool Jumping() const { return m_Jumping; }
|
||||||
virtual bool Crouching() const { return m_Crouching; }
|
virtual bool Crouching() const { return m_Crouching; }
|
||||||
virtual bool CrouchingLastFrame() const { return m_CrouchingLastFrame; }
|
|
||||||
virtual bool DoubleJumping() const { return m_DoubleJumping; }
|
virtual bool DoubleJumping() const { return m_DoubleJumping; }
|
||||||
virtual void SetDoubleJumping(bool isDoubleJumping) {
|
virtual void SetDoubleJumping(bool isDoubleJumping) {
|
||||||
m_DoubleJumping = isDoubleJumping;
|
m_DoubleJumping = isDoubleJumping;
|
||||||
@@ -45,7 +44,6 @@ protected:
|
|||||||
bool m_Jumping = false;
|
bool m_Jumping = false;
|
||||||
bool m_DoubleJumping = false;
|
bool m_DoubleJumping = false;
|
||||||
bool m_Crouching = false;
|
bool m_Crouching = false;
|
||||||
bool m_CrouchingLastFrame = false;
|
|
||||||
//assault dash membervariables - needed to calculate the doubletap- and dashlogic
|
//assault dash membervariables - needed to calculate the doubletap- and dashlogic
|
||||||
double m_AssaultDashDoubleTapDeltaTime = 0.0;
|
double m_AssaultDashDoubleTapDeltaTime = 0.0;
|
||||||
//i will let m_AssaultDashDoubleTapSensitivityTimer stay hardcoded, its not really a gamevariable (more an inputvariable),
|
//i will let m_AssaultDashDoubleTapSensitivityTimer stay hardcoded, its not really a gamevariable (more an inputvariable),
|
||||||
@@ -84,7 +82,6 @@ void FirstPersonInputController<EventContext>::Reset()
|
|||||||
{
|
{
|
||||||
m_Rotation = glm::vec3(0.f, 0.f, 0.f);
|
m_Rotation = glm::vec3(0.f, 0.f, 0.f);
|
||||||
m_Jumping = false;
|
m_Jumping = false;
|
||||||
m_CrouchingLastFrame = m_Crouching;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename EventContext>
|
template <typename EventContext>
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
#ifndef Events_BecomeServerOrClient_h__
|
||||||
|
#define Events_BecomeServerOrClient_h__
|
||||||
|
|
||||||
|
#include "Core/EventBroker.h"
|
||||||
|
|
||||||
|
namespace Events
|
||||||
|
{
|
||||||
|
|
||||||
|
struct BecomeServer : public Event { };
|
||||||
|
|
||||||
|
struct BecomeClient : public Event { };
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -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;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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,7 +16,7 @@ inline bool _GLERROR(const char* info, const char* file, const char* func, unsig
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifndef DEBUG
|
||||||
#define GLERROR(function) \
|
#define GLERROR(function) \
|
||||||
_GLERROR(function, __BASE_FILE__, __func__, __LINE__)
|
_GLERROR(function, __BASE_FILE__, __func__, __LINE__)
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
#include "Network/Network.h"
|
#include "Network/Network.h"
|
||||||
#include "Network/Server.h"
|
#include "Network/Server.h"
|
||||||
#include "Network/Client.h"
|
#include "Network/Client.h"
|
||||||
|
#include "Network/EBecomeServerOrClient.h"
|
||||||
|
|
||||||
// Sound
|
// Sound
|
||||||
#include "Sound/SoundManager.h"
|
#include "Sound/SoundManager.h"
|
||||||
@@ -70,6 +71,11 @@ private:
|
|||||||
bool m_IsServer = false;
|
bool m_IsServer = false;
|
||||||
|
|
||||||
int parseArgs(int argc, char* argv[]);
|
int parseArgs(int argc, char* argv[]);
|
||||||
|
|
||||||
|
EventRelay<Game, Events::BecomeServer> m_EBecomeServer;
|
||||||
|
bool OnBecomeServer(const Events::BecomeServer& e);
|
||||||
|
EventRelay<Game, Events::BecomeClient> m_EBecomeClient;
|
||||||
|
bool OnBecomeClient(const Events::BecomeClient& e);
|
||||||
};
|
};
|
||||||
|
|
||||||
#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!
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#include "Input/EInputCommand.h"
|
#include "Input/EInputCommand.h"
|
||||||
#include "Network/ESearchForServers.h"
|
#include "Network/ESearchForServers.h"
|
||||||
#include "Network/EConnectRequest.h"
|
#include "Network/EConnectRequest.h"
|
||||||
|
#include "Network/EBecomeServerOrClient.h"
|
||||||
|
|
||||||
|
|
||||||
class MainMenuSystem : public ImpureSystem
|
class MainMenuSystem : public ImpureSystem
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#include "Core/System.h"
|
#include "Core/System.h"
|
||||||
#include "Input/EInputCommand.h"
|
#include "Input/EInputCommand.h"
|
||||||
#include "Network/EPlayerDisconnected.h"
|
|
||||||
|
|
||||||
class SpectatorCameraSystem : public ImpureSystem
|
class SpectatorCameraSystem : public ImpureSystem
|
||||||
{
|
{
|
||||||
@@ -18,8 +17,6 @@ private:
|
|||||||
|
|
||||||
EventRelay<SpectatorCameraSystem, Events::InputCommand> m_EInputCommand;
|
EventRelay<SpectatorCameraSystem, Events::InputCommand> m_EInputCommand;
|
||||||
bool OnInputCommand(const Events::InputCommand& e);
|
bool OnInputCommand(const Events::InputCommand& e);
|
||||||
EventRelay<SpectatorCameraSystem, Events::PlayerDisconnected> m_EDisconnect;
|
|
||||||
bool OnDisconnect(const Events::PlayerDisconnected& e);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -30,5 +30,3 @@ F2=PerformanceTimingResetAllTimers
|
|||||||
F3=PerformanceTimingCreateExcelData
|
F3=PerformanceTimingCreateExcelData
|
||||||
Comma=SwapToClassPick
|
Comma=SwapToClassPick
|
||||||
Period=SwapToTeamPick
|
Period=SwapToTeamPick
|
||||||
Enter=PickClass,1
|
|
||||||
F5=DisconnectFromServer
|
|
||||||
@@ -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>
|
||||||
@@ -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>
|
||||||
|
|||||||
@@ -319,23 +319,80 @@
|
|||||||
</Entity>
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
</Children>
|
<Entity name="ButtonPos_5">
|
||||||
</Entity>
|
|
||||||
<Entity name="Popup_Origin">
|
|
||||||
<Components>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="-0.103822395" Y="0" Z="0"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children>
|
|
||||||
<Entity name="PlaySpawner">
|
|
||||||
<Components>
|
<Components>
|
||||||
<c:Spawner>
|
<c:Transform>
|
||||||
<EntityFile>Schema/Entities/ServerList.xml</EntityFile>
|
<Position X="0" Y="-0.280000001" Z="0"/>
|
||||||
</c:Spawner>
|
</c:Transform>
|
||||||
<c:Transform/>
|
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children>
|
||||||
|
<Entity name="Button_5">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
<BlurBackground>true</BlurBackground>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
<Color A="0.392156869" B="0" G="0" R="0"/>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Scale X="0.200000003" Y="0.0500000007" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Text">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Host</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Alignment>
|
||||||
|
<Right/>
|
||||||
|
</Alignment>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.0920000002" Y="-0.0150000006" Z="0.00499999989"/>
|
||||||
|
<Scale X="0.0199999996" Y="0.0199999996" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="ButtonCorner_Origin">
|
||||||
|
<Components>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="TopRight">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/HUD/ButtonCorner_16.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.0970000029" Y="0.0220000017" Z="0.00499999989"/>
|
||||||
|
<Scale X="0.00499999989" Y="0.00499999989" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="BottomRight">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/HUD/ButtonCorner_16.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.0970000029" Y="-0.0219999999" Z="0.00499999989"/>
|
||||||
|
<Orientation X="0" Y="0" Z="4.71199989"/>
|
||||||
|
<Scale X="0.00499999989" Y="0.00499999989" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</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>
|
||||||
|
|||||||
+6087
-6008
File diff suppressed because it is too large
Load Diff
@@ -13,7 +13,6 @@
|
|||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>models/core/unitcube.mesh</Resource>
|
<Resource>models/core/unitcube.mesh</Resource>
|
||||||
<Color A="1" B="0.980392158" G="1" R="1"/>
|
<Color A="1" B="0.980392158" G="1" R="1"/>
|
||||||
<Shadow>false</Shadow>
|
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="-0.100000001" Y="0" Z="0"/>
|
<Position X="-0.100000001" Y="0" Z="0"/>
|
||||||
@@ -29,7 +28,6 @@
|
|||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>models/core/unitcube.mesh</Resource>
|
<Resource>models/core/unitcube.mesh</Resource>
|
||||||
<Color A="1" B="0" G="0" R="1"/>
|
<Color A="1" B="0" G="0" R="1"/>
|
||||||
<Shadow>false</Shadow>
|
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="-14.500001" Y="1.50000012" Z="16.9222012"/>
|
<Position X="-14.500001" Y="1.50000012" Z="16.9222012"/>
|
||||||
@@ -54,7 +52,6 @@
|
|||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>models/core/unitcube.mesh</Resource>
|
<Resource>models/core/unitcube.mesh</Resource>
|
||||||
<Color A="1" B="1" G="0" R="0"/>
|
<Color A="1" B="1" G="0" R="0"/>
|
||||||
<Shadow>false</Shadow>
|
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="-14.500001" Y="1.50000012" Z="-17.6888409"/>
|
<Position X="-14.500001" Y="1.50000012" Z="-17.6888409"/>
|
||||||
@@ -70,7 +67,6 @@
|
|||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>models/core/unitcube.mesh</Resource>
|
<Resource>models/core/unitcube.mesh</Resource>
|
||||||
<Color A="1" B="0" G="0" R="1"/>
|
<Color A="1" B="0" G="0" R="1"/>
|
||||||
<Shadow>false</Shadow>
|
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="12.1000004" Y="1.50000012" Z="16.9222012"/>
|
<Position X="12.1000004" Y="1.50000012" Z="16.9222012"/>
|
||||||
@@ -86,7 +82,6 @@
|
|||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>models/core/unitcube.mesh</Resource>
|
<Resource>models/core/unitcube.mesh</Resource>
|
||||||
<Color A="1" B="1" G="0" R="0"/>
|
<Color A="1" B="1" G="0" R="0"/>
|
||||||
<Shadow>false</Shadow>
|
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="12.1228638" Y="1.50000012" Z="-17.9642811"/>
|
<Position X="12.1228638" Y="1.50000012" Z="-17.9642811"/>
|
||||||
@@ -104,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>
|
||||||
@@ -203,7 +198,6 @@
|
|||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>models/core/unitcube.mesh</Resource>
|
<Resource>models/core/unitcube.mesh</Resource>
|
||||||
<Color A="1" B="39.2156868" G="0" R="3.13725495"/>
|
<Color A="1" B="39.2156868" G="0" R="3.13725495"/>
|
||||||
<Shadow>false</Shadow>
|
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Scale X="-70" Y="-70" Z="-70"/>
|
<Scale X="-70" Y="-70" Z="-70"/>
|
||||||
@@ -216,7 +210,7 @@
|
|||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
<Entity name="CapP">
|
<Entity name="-">
|
||||||
<Components>
|
<Components>
|
||||||
<c:AABB/>
|
<c:AABB/>
|
||||||
<c:CapturePoint>
|
<c:CapturePoint>
|
||||||
@@ -231,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>
|
||||||
@@ -250,24 +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>
|
|
||||||
<Entity>
|
|
||||||
<Components>
|
|
||||||
<c:PointLight/>
|
|
||||||
<c:Transform/>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="Blue">
|
<Entity name="Blue">
|
||||||
<Components>
|
<Components>
|
||||||
@@ -278,25 +250,7 @@
|
|||||||
<Scale X="3.4000001" Y="4.70000029" Z="0.700000048"/>
|
<Scale X="3.4000001" Y="4.70000029" Z="0.700000048"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children/>
|
||||||
<Entity>
|
|
||||||
<Components>
|
|
||||||
<c:Model>
|
|
||||||
<Resource></Resource>
|
|
||||||
</c:Model>
|
|
||||||
<c:Transform/>
|
|
||||||
</Components>
|
|
||||||
<Children>
|
|
||||||
<Entity>
|
|
||||||
<Components>
|
|
||||||
<c:PointLight/>
|
|
||||||
<c:Transform/>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="Spectator">
|
<Entity name="Spectator">
|
||||||
<Components>
|
<Components>
|
||||||
@@ -307,43 +261,7 @@
|
|||||||
<Scale X="1" Y="5.70000029" Z="1"/>
|
<Scale X="1" Y="5.70000029" Z="1"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children/>
|
||||||
<Entity>
|
|
||||||
<Components>
|
|
||||||
<c:PointLight/>
|
|
||||||
<c:Transform/>
|
|
||||||
</Components>
|
|
||||||
<Children>
|
|
||||||
<Entity>
|
|
||||||
<Components>
|
|
||||||
<c:Model>
|
|
||||||
<Resource></Resource>
|
|
||||||
</c:Model>
|
|
||||||
<c:Transform/>
|
|
||||||
</Components>
|
|
||||||
<Children>
|
|
||||||
<Entity>
|
|
||||||
<Components>
|
|
||||||
<c:PointLight/>
|
|
||||||
<c:Transform/>
|
|
||||||
</Components>
|
|
||||||
<Children>
|
|
||||||
<Entity>
|
|
||||||
<Components>
|
|
||||||
<c:Model>
|
|
||||||
<Resource></Resource>
|
|
||||||
</c:Model>
|
|
||||||
<c:Transform/>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
|
||||||
</Entity>
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
@@ -354,11 +272,11 @@
|
|||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
<Entity name="CapP">
|
<Entity name="-">
|
||||||
<Components>
|
<Components>
|
||||||
<c:AABB/>
|
<c:AABB/>
|
||||||
<c:CapturePoint>
|
<c:CapturePoint>
|
||||||
<CaptureTimer>12</CaptureTimer>
|
<CaptureTimer>-15</CaptureTimer>
|
||||||
<HomePointForTeam>
|
<HomePointForTeam>
|
||||||
<Blue/>
|
<Blue/>
|
||||||
</HomePointForTeam>
|
</HomePointForTeam>
|
||||||
@@ -384,38 +302,7 @@
|
|||||||
<Scale X="4.4000001" Y="2" Z="3.70000029"/>
|
<Scale X="4.4000001" Y="2" Z="3.70000029"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children/>
|
||||||
<Entity>
|
|
||||||
<Components>
|
|
||||||
<c:Model>
|
|
||||||
<Resource></Resource>
|
|
||||||
</c:Model>
|
|
||||||
<c:Transform/>
|
|
||||||
</Components>
|
|
||||||
<Children>
|
|
||||||
<Entity>
|
|
||||||
<Components>
|
|
||||||
<c:Transform/>
|
|
||||||
</Components>
|
|
||||||
<Children>
|
|
||||||
<Entity>
|
|
||||||
<Components>
|
|
||||||
<c:Transform/>
|
|
||||||
</Components>
|
|
||||||
<Children>
|
|
||||||
<Entity>
|
|
||||||
<Components>
|
|
||||||
<c:Transform/>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="Blue">
|
<Entity name="Blue">
|
||||||
<Components>
|
<Components>
|
||||||
|
|||||||
@@ -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));
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -360,14 +360,7 @@ constexpr bool FaceIsGround(float faceNormalY)
|
|||||||
//An array containing 3 int pairs { 0, 2 }, { 0, 1 }, { 1, 2 }
|
//An array containing 3 int pairs { 0, 2 }, { 0, 1 }, { 1, 2 }
|
||||||
constexpr std::array<std::pair<int, int>, 3> dimensionPairs({ std::pair<int, int>(0, 2), std::pair<int, int>(0, 1), std::pair<int, int>(1, 2) });
|
constexpr std::array<std::pair<int, int>, 3> dimensionPairs({ std::pair<int, int>(0, 2), std::pair<int, int>(0, 1), std::pair<int, int>(1, 2) });
|
||||||
|
|
||||||
enum class BoxTriRes
|
bool AABBvsTriangle(const AABB& box,
|
||||||
{
|
|
||||||
Front,
|
|
||||||
Behind,
|
|
||||||
Intersect
|
|
||||||
};
|
|
||||||
|
|
||||||
BoxTriRes AABBvsTriangle(const AABB& box,
|
|
||||||
const std::array<glm::vec3, 3>& triPos,
|
const std::array<glm::vec3, 3>& triPos,
|
||||||
const glm::vec3& originalBoxVelocity,
|
const glm::vec3& originalBoxVelocity,
|
||||||
float verticalStepHeight,
|
float verticalStepHeight,
|
||||||
@@ -381,7 +374,7 @@ BoxTriRes AABBvsTriangle(const AABB& box,
|
|||||||
//Less checks, and we should be able to walk out from models if we are trapped inside.
|
//Less checks, and we should be able to walk out from models if we are trapped inside.
|
||||||
glm::vec3 triNormal = glm::cross(triPos[1] - triPos[0], triPos[2] - triPos[0]);
|
glm::vec3 triNormal = glm::cross(triPos[1] - triPos[0], triPos[2] - triPos[0]);
|
||||||
if (!vectorHasLength(triNormal) || (glm::dot(triNormal, originalBoxVelocity) > 0)) {
|
if (!vectorHasLength(triNormal) || (glm::dot(triNormal, originalBoxVelocity) > 0)) {
|
||||||
return BoxTriRes::Behind;
|
return false;
|
||||||
}
|
}
|
||||||
triNormal = glm::normalize(triNormal);
|
triNormal = glm::normalize(triNormal);
|
||||||
|
|
||||||
@@ -416,9 +409,6 @@ BoxTriRes AABBvsTriangle(const AABB& box,
|
|||||||
const glm::vec3& min = box.MinCorner();
|
const glm::vec3& min = box.MinCorner();
|
||||||
const glm::vec3& max = box.MaxCorner();
|
const glm::vec3& max = box.MaxCorner();
|
||||||
|
|
||||||
// If there is no intersection, whether the box center is in front of or behind the triangle.
|
|
||||||
BoxTriRes noIntersection = glm::dot(triNormal, origin - triPos[0]) > 0 ? BoxTriRes::Front : BoxTriRes::Behind;
|
|
||||||
|
|
||||||
//For each projection in xy-, xz-, and yx-planes.
|
//For each projection in xy-, xz-, and yx-planes.
|
||||||
for (std::pair<int, int> dim : dimensionPairs) {
|
for (std::pair<int, int> dim : dimensionPairs) {
|
||||||
//2D Triangle.
|
//2D Triangle.
|
||||||
@@ -436,7 +426,7 @@ BoxTriRes AABBvsTriangle(const AABB& box,
|
|||||||
bool pushedFromTriangleLine;
|
bool pushedFromTriangleLine;
|
||||||
//if projections don't overlap, return false.
|
//if projections don't overlap, return false.
|
||||||
if (!rectangleVsTriangle(boxMin, boxMax, t2D, resolutionVector, resolutionDist, pushedFromTriangleLine)) {
|
if (!rectangleVsTriangle(boxMin, boxMax, t2D, resolutionVector, resolutionDist, pushedFromTriangleLine)) {
|
||||||
return noIntersection;
|
return false;
|
||||||
} else if (resolveCollision) {
|
} else if (resolveCollision) {
|
||||||
//Overwrite the smallest resolution if this is smaller.
|
//Overwrite the smallest resolution if this is smaller.
|
||||||
if (resolutionDist < resolveShortest.DistanceSq) {
|
if (resolutionDist < resolveShortest.DistanceSq) {
|
||||||
@@ -472,15 +462,14 @@ BoxTriRes AABBvsTriangle(const AABB& box,
|
|||||||
float t = glm::dot(triNormal, triPos[0] - origin) / glm::dot(triNormal, diagonal);
|
float t = glm::dot(triNormal, triPos[0] - origin) / glm::dot(triNormal, diagonal);
|
||||||
//If intersection point between plane and diagonal is within the box.
|
//If intersection point between plane and diagonal is within the box.
|
||||||
if (glm::abs(t) > 1) {
|
if (glm::abs(t) > 1) {
|
||||||
return noIntersection;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!resolveCollision) {
|
if (!resolveCollision) {
|
||||||
return BoxTriRes::Intersect;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
glm::vec3 cornerResolution = (1+t) * diagonal;
|
glm::vec3 cornerResolution = (1+t) * diagonal;
|
||||||
cornerResolution = glm::dot(cornerResolution, triNormal) * triNormal;
|
|
||||||
//Overwrite the smallest resolution if cornerResolution is smaller.
|
//Overwrite the smallest resolution if cornerResolution is smaller.
|
||||||
float lenSq = glm::length2(cornerResolution);
|
float lenSq = glm::length2(cornerResolution);
|
||||||
if (lenSq < resolveShortest.DistanceSq) {
|
if (lenSq < resolveShortest.DistanceSq) {
|
||||||
@@ -509,7 +498,7 @@ BoxTriRes AABBvsTriangle(const AABB& box,
|
|||||||
case ResolveDimZ:
|
case ResolveDimZ:
|
||||||
//If we get here, the resolution is along one coordinate axis.
|
//If we get here, the resolution is along one coordinate axis.
|
||||||
//set velocity to 0 in y if it is along y-axis.
|
//set velocity to 0 in y if it is along y-axis.
|
||||||
return BoxTriRes::Intersect;
|
return true;
|
||||||
case Line:
|
case Line:
|
||||||
projNorm = glm::normalize(outResolution);
|
projNorm = glm::normalize(outResolution);
|
||||||
break;
|
break;
|
||||||
@@ -544,10 +533,10 @@ BoxTriRes AABBvsTriangle(const AABB& box,
|
|||||||
boxVelocity = boxVelocity - glm::dot(boxVelocity, projNorm) * projNorm;
|
boxVelocity = boxVelocity - glm::dot(boxVelocity, projNorm) * projNorm;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return BoxTriRes::Intersect;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Output AABBvsTriangles(const AABB& box,
|
bool AABBvsTriangles(const AABB& box,
|
||||||
const RawModel::Vertex* modelVertices,
|
const RawModel::Vertex* modelVertices,
|
||||||
const std::vector<unsigned int>& modelIndices,
|
const std::vector<unsigned int>& modelIndices,
|
||||||
const glm::mat4& modelMatrix,
|
const glm::mat4& modelMatrix,
|
||||||
@@ -557,8 +546,8 @@ Output AABBvsTriangles(const AABB& box,
|
|||||||
glm::vec3& outResolutionVector,
|
glm::vec3& outResolutionVector,
|
||||||
bool resolveCollision)
|
bool resolveCollision)
|
||||||
{
|
{
|
||||||
bool intersect = false;
|
bool hit = false;
|
||||||
Output out = Output::OutContained;
|
|
||||||
bool everHitTheGround = false;
|
bool everHitTheGround = false;
|
||||||
AABB newBox = box;
|
AABB newBox = box;
|
||||||
outResolutionVector = glm::vec3(0.f);
|
outResolutionVector = glm::vec3(0.f);
|
||||||
@@ -571,27 +560,20 @@ Output AABBvsTriangles(const AABB& box,
|
|||||||
};
|
};
|
||||||
glm::vec3 outVec;
|
glm::vec3 outVec;
|
||||||
bool collideWithGround = isOnGround;
|
bool collideWithGround = isOnGround;
|
||||||
switch (AABBvsTriangle(newBox, triVertices, originalBoxVelocity, verticalStepHeight, collideWithGround, boxVelocity, outVec, resolveCollision)) {
|
if (AABBvsTriangle(newBox, triVertices, originalBoxVelocity, verticalStepHeight, collideWithGround, boxVelocity, outVec, resolveCollision)) {
|
||||||
case Collision::BoxTriRes::Front:
|
hit = true;
|
||||||
out = Output::OutSeparated;
|
|
||||||
break;
|
|
||||||
case Collision::BoxTriRes::Intersect:
|
|
||||||
intersect = true;
|
|
||||||
outResolutionVector += outVec;
|
outResolutionVector += outVec;
|
||||||
newBox = AABB::FromOriginSize(newBox.Origin() + outVec, newBox.Size());
|
newBox = AABB::FromOriginSize(newBox.Origin() + outVec, newBox.Size());
|
||||||
if (collideWithGround) {
|
if (collideWithGround) {
|
||||||
everHitTheGround = isOnGround = true;
|
everHitTheGround = isOnGround = true;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!everHitTheGround) {
|
if (!everHitTheGround) {
|
||||||
isOnGround = false;
|
isOnGround = false;
|
||||||
}
|
}
|
||||||
return intersect ? Output::OutIntersecting : out;
|
return hit;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AABBvsTriangles(const AABB& box,
|
bool AABBvsTriangles(const AABB& box,
|
||||||
@@ -611,31 +593,13 @@ bool AABBvsTriangles(const AABB& box,
|
|||||||
verticalStepHeight,
|
verticalStepHeight,
|
||||||
isOnGround,
|
isOnGround,
|
||||||
outResolutionVector,
|
outResolutionVector,
|
||||||
true) == Output::OutIntersecting;
|
true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AABBvsTriangles(const AABB& box,
|
bool AABBvsTriangles(const AABB& box,
|
||||||
const RawModel::Vertex* modelVertices,
|
const RawModel::Vertex* modelVertices,
|
||||||
const std::vector<unsigned int>& modelIndices,
|
const std::vector<unsigned int>& modelIndices,
|
||||||
const glm::mat4& modelMatrix)
|
const glm::mat4& modelMatrix)
|
||||||
{
|
|
||||||
glm::vec3 vel, outres;
|
|
||||||
bool g;
|
|
||||||
return AABBvsTriangles(box,
|
|
||||||
modelVertices,
|
|
||||||
modelIndices,
|
|
||||||
modelMatrix,
|
|
||||||
vel,
|
|
||||||
0.f,
|
|
||||||
g,
|
|
||||||
outres,
|
|
||||||
false) == Output::OutIntersecting;
|
|
||||||
}
|
|
||||||
|
|
||||||
Output AABBvsTrianglesWContainment(const AABB& box,
|
|
||||||
const RawModel::Vertex* modelVertices,
|
|
||||||
const std::vector<unsigned int>& modelIndices,
|
|
||||||
const glm::mat4& modelMatrix)
|
|
||||||
{
|
{
|
||||||
glm::vec3 vel, outres;
|
glm::vec3 vel, outres;
|
||||||
bool g;
|
bool g;
|
||||||
|
|||||||
@@ -37,10 +37,6 @@ void CollisionSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& c
|
|||||||
bool hit;
|
bool hit;
|
||||||
float dist;
|
float dist;
|
||||||
if (boxB.Entity.HasComponent("Model")) {
|
if (boxB.Entity.HasComponent("Model")) {
|
||||||
if (!((bool)boxB.Entity["Model"]["Visible"])) {
|
|
||||||
// Don't collide against invisible models.
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
RawModel* model;
|
RawModel* model;
|
||||||
std::string res = (std::string)boxB.Entity["Model"]["Resource"];
|
std::string res = (std::string)boxB.Entity["Model"]["Resource"];
|
||||||
try {
|
try {
|
||||||
@@ -81,11 +77,7 @@ void CollisionSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& c
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (boxB.Entity.HasComponent("Model") && Collision::AABBVsAABB(boxA, boxB)) {
|
if (boxB.Entity.HasComponent("Model") && Collision::AABBVsAABB(boxA, boxB)) {
|
||||||
// Here we know boxB is a entity with Collideable, AABB, and Model.
|
//Here we know boxB is a entity with Collideable, AABB, and Model.
|
||||||
if (!((bool)boxB.Entity["Model"]["Visible"])) {
|
|
||||||
// Don't collide against invisible models.
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
RawModel* model;
|
RawModel* model;
|
||||||
try {
|
try {
|
||||||
model = ResourceManager::Load<RawModel, true>(boxB.Entity["Model"]["Resource"]);
|
model = ResourceManager::Load<RawModel, true>(boxB.Entity["Model"]["Resource"]);
|
||||||
@@ -96,11 +88,12 @@ void CollisionSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& c
|
|||||||
glm::mat4 modelMatrix = Transform::ModelMatrix(boxB.Entity);
|
glm::mat4 modelMatrix = Transform::ModelMatrix(boxB.Entity);
|
||||||
|
|
||||||
glm::vec3 inOutVelocity = (glm::vec3)cPhysics["Velocity"];
|
glm::vec3 inOutVelocity = (glm::vec3)cPhysics["Velocity"];
|
||||||
|
bool notMovingxz = glm::all(glm::lessThan(glm::abs(glm::vec2(inOutVelocity.x, inOutVelocity.z)), glm::vec2(0.01f))) && prevPosIt != m_PrevPositions.end();
|
||||||
bool isOnGround = (bool)cPhysics["IsOnGround"];
|
bool isOnGround = (bool)cPhysics["IsOnGround"];
|
||||||
float verticalStepHeight = (float)(double)cPhysics["VerticalStepHeight"];
|
float verticalStepHeight = (float)(double)cPhysics["VerticalStepHeight"];
|
||||||
if (Collision::AABBvsTriangles(boxA, model->Vertices(), model->m_Indices, modelMatrix, inOutVelocity, verticalStepHeight, isOnGround, resolutionVector)) {
|
if (Collision::AABBvsTriangles(boxA, model->Vertices(), model->m_Indices, modelMatrix, inOutVelocity, verticalStepHeight, isOnGround, resolutionVector)) {
|
||||||
//Move the position to previous position if it is not moving in the xz-plane, else resolve with the resolution vector.
|
//Move the position to previous position if it is not moving in the xz-plane, else resolve with the resolution vector.
|
||||||
(glm::vec3&)cTransform["Position"] += resolutionVector;
|
(glm::vec3&)cTransform["Position"] += notMovingxz ? prevPosIt->second - boxA.Origin() : resolutionVector;
|
||||||
boxA = *Collision::EntityAbsoluteAABB(entity);
|
boxA = *Collision::EntityAbsoluteAABB(entity);
|
||||||
cPhysics["Velocity"] = inOutVelocity;
|
cPhysics["Velocity"] = inOutVelocity;
|
||||||
if (isOnGround) {
|
if (isOnGround) {
|
||||||
|
|||||||
@@ -10,16 +10,6 @@ void TriggerSystem::UpdateComponent(EntityWrapper& triggerEntity, ComponentWrapp
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RawModel* triggerModel = nullptr;
|
|
||||||
glm::mat4 triggerModelMat;
|
|
||||||
if (triggerEntity.HasComponent("Model")) {
|
|
||||||
try {
|
|
||||||
triggerModel = ResourceManager::Load<RawModel, true>(triggerEntity["Model"]["Resource"]);
|
|
||||||
triggerModelMat = Transform::ModelMatrix(triggerEntity);
|
|
||||||
} catch (const std::exception&) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_OctreeOut.clear();
|
m_OctreeOut.clear();
|
||||||
m_Octree->ObjectsInSameRegion(*triggerBox, m_OctreeOut);
|
m_Octree->ObjectsInSameRegion(*triggerBox, m_OctreeOut);
|
||||||
|
|
||||||
@@ -32,17 +22,7 @@ void TriggerSystem::UpdateComponent(EntityWrapper& triggerEntity, ComponentWrapp
|
|||||||
if (colliderFitsInTrigger) {
|
if (colliderFitsInTrigger) {
|
||||||
completelyInsideBox = AABB::FromOriginSize((*triggerBox).Origin(), (*triggerBox).Size() - 2.0f * colliderBox.Size());
|
completelyInsideBox = AABB::FromOriginSize((*triggerBox).Origin(), (*triggerBox).Size() - 2.0f * colliderBox.Size());
|
||||||
}
|
}
|
||||||
|
if (colliderFitsInTrigger && Collision::AABBVsAABB(completelyInsideBox, colliderBox)) {
|
||||||
// We know the entity is inside the trigger box, but perhaps not the model yet.
|
|
||||||
Collision::Output out = triggerModel == nullptr
|
|
||||||
? Collision::Output::OutContained
|
|
||||||
: Collision::AABBvsTrianglesWContainment(
|
|
||||||
colliderBox,
|
|
||||||
triggerModel->Vertices(),
|
|
||||||
triggerModel->m_Indices,
|
|
||||||
triggerModelMat);
|
|
||||||
|
|
||||||
if (colliderFitsInTrigger && Collision::AABBVsAABB(completelyInsideBox, colliderBox) && out == Collision::Output::OutContained) {
|
|
||||||
// Entity is completely inside the trigger.
|
// Entity is completely inside the trigger.
|
||||||
// If it was only touching before, it is erased.
|
// If it was only touching before, it is erased.
|
||||||
m_EntitiesTouchingTrigger[triggerEntity].erase(colliderEntity);
|
m_EntitiesTouchingTrigger[triggerEntity].erase(colliderEntity);
|
||||||
@@ -52,8 +32,7 @@ void TriggerSystem::UpdateComponent(EntityWrapper& triggerEntity, ComponentWrapp
|
|||||||
completeSet.insert(colliderEntity);
|
completeSet.insert(colliderEntity);
|
||||||
publish<Events::TriggerEnter>(colliderEntity, triggerEntity);
|
publish<Events::TriggerEnter>(colliderEntity, triggerEntity);
|
||||||
}
|
}
|
||||||
continue;
|
} else {
|
||||||
} else if (out != Collision::Output::OutSeparated) {
|
|
||||||
// Entity is only touching the trigger.
|
// Entity is only touching the trigger.
|
||||||
auto& touchSet = m_EntitiesTouchingTrigger[triggerEntity];
|
auto& touchSet = m_EntitiesTouchingTrigger[triggerEntity];
|
||||||
auto& completeSet = m_EntitiesCompletelyInTrigger[triggerEntity];
|
auto& completeSet = m_EntitiesCompletelyInTrigger[triggerEntity];
|
||||||
@@ -68,17 +47,17 @@ void TriggerSystem::UpdateComponent(EntityWrapper& triggerEntity, ComponentWrapp
|
|||||||
touchSet.insert(colliderEntity);
|
touchSet.insert(colliderEntity);
|
||||||
}
|
}
|
||||||
// Else, it was touching the trigger last frame too and nothing is done.
|
// Else, it was touching the trigger last frame too and nothing is done.
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Entity is not touching the trigger,
|
||||||
|
// Throw event if it was previously.
|
||||||
|
if (throwLeaveIfWasInTrigger(m_EntitiesTouchingTrigger[triggerEntity], colliderEntity, triggerEntity)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
// This only occurs if the entity was completely inside the trigger one frame,
|
||||||
|
// then completely outside the trigger, e.g. when dying and respawning.
|
||||||
|
throwLeaveIfWasInTrigger(m_EntitiesCompletelyInTrigger[triggerEntity], colliderEntity, triggerEntity);
|
||||||
}
|
}
|
||||||
// Only get here if entity is not touching the trigger,
|
|
||||||
// throw event if it was touching previously.
|
|
||||||
if (throwLeaveIfWasInTrigger(m_EntitiesTouchingTrigger[triggerEntity], colliderEntity, triggerEntity)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// This only occurs if the entity was completely inside the trigger one frame,
|
|
||||||
// then completely outside the trigger, e.g. when dying and respawning.
|
|
||||||
throwLeaveIfWasInTrigger(m_EntitiesCompletelyInTrigger[triggerEntity], colliderEntity, triggerEntity);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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"]);
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ EditorSystem::EditorSystem(SystemParams params, IRenderer* renderer, RenderFrame
|
|||||||
Enable();
|
Enable();
|
||||||
} else {
|
} else {
|
||||||
Disable();
|
Disable();
|
||||||
m_EventBroker->Publish(Events::UnlockMouse());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#include "Network/Client.h"
|
#include "Network/Client.h"
|
||||||
#include "Network/EPlayerDisconnected.h"
|
|
||||||
using namespace boost::asio::ip;
|
using namespace boost::asio::ip;
|
||||||
|
|
||||||
Client::Client(World* world, EventBroker* eventBroker)
|
Client::Client(World* world, EventBroker* eventBroker)
|
||||||
@@ -225,7 +224,7 @@ void Client::parseServerlist(Packet& packet)
|
|||||||
void Client::parseKick()
|
void Client::parseKick()
|
||||||
{
|
{
|
||||||
LOG_WARNING("You have been kicked from the server.");
|
LOG_WARNING("You have been kicked from the server.");
|
||||||
disconnect();
|
m_IsConnected = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::parseSpawnEvents()
|
void Client::parseSpawnEvents()
|
||||||
@@ -465,10 +464,6 @@ void Client::disconnect()
|
|||||||
Packet packet(MessageType::Disconnect, m_SendPacketID);
|
Packet packet(MessageType::Disconnect, m_SendPacketID);
|
||||||
m_Reliable.Send(packet);
|
m_Reliable.Send(packet);
|
||||||
m_Reliable.Disconnect();
|
m_Reliable.Disconnect();
|
||||||
Events::PlayerDisconnected e;
|
|
||||||
e.Entity = m_LocalPlayer.ID;
|
|
||||||
e.PlayerID = -1;
|
|
||||||
m_EventBroker->Publish(e);
|
|
||||||
createMainMenu();
|
createMainMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ Server::Server(World* world, EventBroker* eventBroker, int port)
|
|||||||
port = config->Get<float>("Networking.Port", 27666);
|
port = config->Get<float>("Networking.Port", 27666);
|
||||||
}
|
}
|
||||||
m_Port = port;
|
m_Port = port;
|
||||||
LOG_INFO("Server initialized and bound to port %i", port);
|
printf("Server initialized and bound to port %i\n", port);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Server::~Server()
|
Server::~Server()
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
@@ -311,8 +311,6 @@ void DrawFinalPass::Draw(RenderScene& scene, BlurHUD* blurHUDPass)
|
|||||||
GLERROR("TransparentObjects");
|
GLERROR("TransparentObjects");
|
||||||
//state->BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
//state->BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
stateSprite->Enable(GL_DEPTH_TEST);
|
stateSprite->Enable(GL_DEPTH_TEST);
|
||||||
//stateSprite->AlphaFunc(GL_GEQUAL, 0.05f);
|
|
||||||
//stateSprite->Enable(GL_ALPHA_TEST);
|
|
||||||
DrawSprites(scene.Jobs.SpriteJob, scene);
|
DrawSprites(scene.Jobs.SpriteJob, scene);
|
||||||
GLERROR("SpriteJobs");
|
GLERROR("SpriteJobs");
|
||||||
|
|
||||||
@@ -345,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");
|
||||||
@@ -1271,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);
|
||||||
}
|
}
|
||||||
@@ -1316,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:
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ 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"]);
|
||||||
|
|||||||
@@ -122,7 +122,6 @@ void Renderer::InputUpdate(double dt)
|
|||||||
|
|
||||||
void Renderer::setWindowSize(Rectangle size)
|
void Renderer::setWindowSize(Rectangle size)
|
||||||
{
|
{
|
||||||
m_Resolution = size;
|
|
||||||
glfwSetWindowSize(m_Window, size.Width, size.Height);
|
glfwSetWindowSize(m_Window, size.Width, size.Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
@@ -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");
|
||||||
|
|||||||
+44
-17
@@ -58,7 +58,6 @@ Game::Game(int argc, char* argv[])
|
|||||||
ResourceManager::RegisterType<EntityFile>("EntityFile");
|
ResourceManager::RegisterType<EntityFile>("EntityFile");
|
||||||
ResourceManager::RegisterType<EntityXMLFile>("EntityXMLFile");
|
ResourceManager::RegisterType<EntityXMLFile>("EntityXMLFile");
|
||||||
ResourceManager::RegisterType<Font>("FontFile");
|
ResourceManager::RegisterType<Font>("FontFile");
|
||||||
|
|
||||||
m_Config = ResourceManager::Load<ConfigFile>("Config.ini");
|
m_Config = ResourceManager::Load<ConfigFile>("Config.ini");
|
||||||
ResourceManager::UseThreading = m_Config->Get<bool>("Multithreading.ResourceLoading", true);
|
ResourceManager::UseThreading = m_Config->Get<bool>("Multithreading.ResourceLoading", true);
|
||||||
DisableMemoryPool::Value = m_Config->Get<bool>("Debug.DisableMemoryPool", false);
|
DisableMemoryPool::Value = m_Config->Get<bool>("Debug.DisableMemoryPool", false);
|
||||||
@@ -66,6 +65,8 @@ Game::Game(int argc, char* argv[])
|
|||||||
|
|
||||||
// Create the core event broker
|
// Create the core event broker
|
||||||
m_EventBroker = new EventBroker();
|
m_EventBroker = new EventBroker();
|
||||||
|
EVENT_SUBSCRIBE_MEMBER(m_EBecomeServer, &Game::OnBecomeServer);
|
||||||
|
EVENT_SUBSCRIBE_MEMBER(m_EBecomeClient, &Game::OnBecomeClient);
|
||||||
|
|
||||||
// Create the renderer
|
// Create the renderer
|
||||||
m_Renderer = new Renderer(m_EventBroker, m_Config);
|
m_Renderer = new Renderer(m_EventBroker, m_Config);
|
||||||
@@ -76,7 +77,7 @@ Game::Game(int argc, char* argv[])
|
|||||||
0,
|
0,
|
||||||
m_Config->Get<int>("Video.Width", 1280),
|
m_Config->Get<int>("Video.Width", 1280),
|
||||||
m_Config->Get<int>("Video.Height", 720)
|
m_Config->Get<int>("Video.Height", 720)
|
||||||
));
|
));
|
||||||
m_Renderer->Initialize();
|
m_Renderer->Initialize();
|
||||||
//m_Renderer->Camera()->SetFOV(glm::radians(m_Config->Get<float>("Video.FOV", 90.f)));
|
//m_Renderer->Camera()->SetFOV(glm::radians(m_Config->Get<float>("Video.FOV", 90.f)));
|
||||||
m_RenderFrame = new RenderFrame();
|
m_RenderFrame = new RenderFrame();
|
||||||
@@ -99,21 +100,7 @@ Game::Game(int argc, char* argv[])
|
|||||||
// Create the sound manager
|
// Create the sound manager
|
||||||
m_SoundManager = new SoundManager(m_World, m_EventBroker);
|
m_SoundManager = new SoundManager(m_World, m_EventBroker);
|
||||||
|
|
||||||
// Initialize network
|
|
||||||
if (m_Config->Get<bool>("Networking.StartNetwork", false)) {
|
|
||||||
if (m_IsServer) {
|
|
||||||
m_NetworkServer = new Server(m_World, m_EventBroker, m_NetworkPort);
|
|
||||||
m_Renderer->SetWindowTitle(m_Renderer->WindowTitle() + " SERVER");
|
|
||||||
} else if (m_IsClient) {
|
|
||||||
m_NetworkClient = new Client(m_World, m_EventBroker, std::make_unique<MultiplayerSnapshotFilter>(m_EventBroker));
|
|
||||||
m_NetworkClient->Connect(m_NetworkAddress, m_NetworkPort);
|
|
||||||
m_Renderer->SetWindowTitle(m_Renderer->WindowTitle() + " CLIENT");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// If network is disabled, pretend we're a server
|
|
||||||
m_IsClient = true;
|
|
||||||
m_IsServer = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create Octrees
|
// Create Octrees
|
||||||
// TODO: Perhaps the world bounds should be set in some non-arbitrary way instead of this.
|
// TODO: Perhaps the world bounds should be set in some non-arbitrary way instead of this.
|
||||||
@@ -188,6 +175,8 @@ Game::~Game()
|
|||||||
delete m_OctreeCollision;
|
delete m_OctreeCollision;
|
||||||
delete m_OctreeTrigger;
|
delete m_OctreeTrigger;
|
||||||
delete m_SoundManager;
|
delete m_SoundManager;
|
||||||
|
m_EventBroker->Unsubscribe(m_EBecomeServer);
|
||||||
|
m_EventBroker->Unsubscribe(m_EBecomeClient);
|
||||||
if (m_NetworkClient != nullptr) {
|
if (m_NetworkClient != nullptr) {
|
||||||
delete m_NetworkClient;
|
delete m_NetworkClient;
|
||||||
}
|
}
|
||||||
@@ -210,6 +199,7 @@ void Game::Tick()
|
|||||||
double dt = currentTime - m_LastTime;
|
double dt = currentTime - m_LastTime;
|
||||||
m_LastTime = currentTime;
|
m_LastTime = currentTime;
|
||||||
|
|
||||||
|
m_EventBroker->Process<Game>();
|
||||||
// Handle input in a weird looking but responsive way
|
// Handle input in a weird looking but responsive way
|
||||||
m_EventBroker->Process<InputManager>();
|
m_EventBroker->Process<InputManager>();
|
||||||
m_EventBroker->Swap();
|
m_EventBroker->Swap();
|
||||||
@@ -284,3 +274,40 @@ int Game::parseArgs(int argc, char* argv[])
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Game::OnBecomeServer(const Events::BecomeServer& e)
|
||||||
|
{
|
||||||
|
|
||||||
|
// if (m_IsServer) {
|
||||||
|
// m_NetworkServer = new Server(m_World, m_EventBroker, m_NetworkPort);
|
||||||
|
// m_Renderer->SetWindowTitle(m_Renderer->WindowTitle() + " SERVER");
|
||||||
|
// } else if (m_IsClient) {
|
||||||
|
// m_NetworkClient = new Client(m_World, m_EventBroker, std::make_unique<MultiplayerSnapshotFilter>(m_EventBroker));
|
||||||
|
// m_NetworkClient->Connect(m_NetworkAddress, m_NetworkPort);
|
||||||
|
// m_Renderer->SetWindowTitle(m_Renderer->WindowTitle() + " CLIENT");
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (m_NetworkServer != nullptr) {
|
||||||
|
delete m_NetworkServer;
|
||||||
|
}
|
||||||
|
if (m_NetworkClient != nullptr) {
|
||||||
|
delete m_NetworkClient;
|
||||||
|
}
|
||||||
|
m_NetworkServer = new Server(m_World, m_EventBroker, m_NetworkPort);
|
||||||
|
m_Renderer->SetWindowTitle(m_Renderer->WindowTitle() + " SERVER");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Game::OnBecomeClient(const Events::BecomeClient& e)
|
||||||
|
{
|
||||||
|
if (m_NetworkServer != nullptr) {
|
||||||
|
delete m_NetworkServer;
|
||||||
|
}
|
||||||
|
if (m_NetworkClient != nullptr) {
|
||||||
|
delete m_NetworkClient;
|
||||||
|
}
|
||||||
|
m_NetworkClient = new Client(m_World, m_EventBroker, std::make_unique<MultiplayerSnapshotFilter>(m_EventBroker));
|
||||||
|
m_NetworkClient->Connect(m_NetworkAddress, m_NetworkPort);
|
||||||
|
m_Renderer->SetWindowTitle(m_Renderer->WindowTitle() + " CLIENT");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|||||||
@@ -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,19 +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("Transform"))
|
|
||||||
{
|
|
||||||
if (capModel.HasComponent("Model")) {
|
|
||||||
(bool&)capModel["Model"]["Visible"] = isOwner;
|
|
||||||
}
|
|
||||||
if (capModel.HasComponent("PointLight")) {
|
|
||||||
(bool&)capModel["PointLight"]["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
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ bool MainMenuSystem::OnButtonClick(const Events::ButtonClicked& e)
|
|||||||
if (e.EntityName == "ServerIdentityConnect") {
|
if (e.EntityName == "ServerIdentityConnect") {
|
||||||
EntityWrapper entity = e.Entity;
|
EntityWrapper entity = e.Entity;
|
||||||
EntityWrapper serverIdentityEntity = entity.FirstParentWithComponent("ServerIdentity");
|
EntityWrapper serverIdentityEntity = entity.FirstParentWithComponent("ServerIdentity");
|
||||||
if(serverIdentityEntity.Valid()) {
|
if (serverIdentityEntity.Valid()) {
|
||||||
Events::ConnectRequest event;
|
Events::ConnectRequest event;
|
||||||
event.IP = (std::string)serverIdentityEntity["ServerIdentity"]["IP"];
|
event.IP = (std::string)serverIdentityEntity["ServerIdentity"]["IP"];
|
||||||
event.Port = (int)serverIdentityEntity["ServerIdentity"]["Port"];
|
event.Port = (int)serverIdentityEntity["ServerIdentity"]["Port"];
|
||||||
@@ -44,7 +44,13 @@ bool MainMenuSystem::OnButtonPress(const Events::ButtonPressed& e)
|
|||||||
|
|
||||||
bool MainMenuSystem::OnInputCommand(const Events::InputCommand& e)
|
bool MainMenuSystem::OnInputCommand(const Events::InputCommand& e)
|
||||||
{
|
{
|
||||||
if(e.Command == "Play" && e.Value == 1) {
|
if (e.Command == "Host" && e.Value == 1) {
|
||||||
|
printf("Sending event...\n");
|
||||||
|
m_EventBroker->Publish(Events::BecomeServer());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (e.Command == "Play" && e.Value == 1) {
|
||||||
|
m_EventBroker->Publish(Events::BecomeClient());
|
||||||
auto menus = m_World->GetComponents("Menu");
|
auto menus = m_World->GetComponents("Menu");
|
||||||
if (menus == nullptr) {
|
if (menus == nullptr) {
|
||||||
return 0;
|
return 0;
|
||||||
@@ -64,7 +70,7 @@ bool MainMenuSystem::OnInputCommand(const Events::InputCommand& e)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if(!m_OpenSubMenu.HasComponent("ServerList")) {
|
} else if (!m_OpenSubMenu.HasComponent("ServerList")) {
|
||||||
//Menu is open, but not the right one, delete the old one and open a new one.
|
//Menu is open, but not the right one, delete the old one and open a new one.
|
||||||
m_World->DeleteEntity(m_OpenSubMenu.ID);
|
m_World->DeleteEntity(m_OpenSubMenu.ID);
|
||||||
m_OpenSubMenu = EntityWrapper::Invalid;
|
m_OpenSubMenu = EntityWrapper::Invalid;
|
||||||
@@ -85,7 +91,7 @@ bool MainMenuSystem::OnInputCommand(const Events::InputCommand& e)
|
|||||||
m_World->DeleteEntity(m_OpenSubMenu.ID);
|
m_World->DeleteEntity(m_OpenSubMenu.ID);
|
||||||
m_OpenSubMenu = EntityWrapper::Invalid;
|
m_OpenSubMenu = EntityWrapper::Invalid;
|
||||||
}
|
}
|
||||||
} else if (e.Command == "RefreshServerList" && e.Value == 1){
|
} else if (e.Command == "RefreshServerList" && e.Value == 1) {
|
||||||
Events::SearchForServers event;
|
Events::SearchForServers event;
|
||||||
m_EventBroker->Publish(event);
|
m_EventBroker->Publish(event);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -264,11 +264,6 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
|||||||
size = glm::vec3(1.f, 1.f, 1.f);
|
size = glm::vec3(1.f, 1.f, 1.f);
|
||||||
} else {
|
} else {
|
||||||
size = glm::vec3(1.f, 1.6f, 1.f);
|
size = glm::vec3(1.f, 1.6f, 1.f);
|
||||||
if (controller->CrouchingLastFrame() && isOnGround) {
|
|
||||||
// The collision should resolve this anyway, but
|
|
||||||
// this is more reliable, since the box gets larger.
|
|
||||||
((glm::vec3&)cTransform["Position"]).y += 0.3f;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ SpectatorCameraSystem::SpectatorCameraSystem(SystemParams params)
|
|||||||
, m_PickedTeam(-1)
|
, m_PickedTeam(-1)
|
||||||
{
|
{
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &SpectatorCameraSystem::OnInputCommand);
|
EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &SpectatorCameraSystem::OnInputCommand);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EDisconnect, &SpectatorCameraSystem::OnDisconnect);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpectatorCameraSystem::Update(double dt)
|
void SpectatorCameraSystem::Update(double dt)
|
||||||
@@ -89,16 +88,3 @@ bool SpectatorCameraSystem::OnInputCommand(const Events::InputCommand& e)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SpectatorCameraSystem::OnDisconnect(const Events::PlayerDisconnected& e)
|
|
||||||
{
|
|
||||||
// If local player gets disconnected, they should be set to
|
|
||||||
// the spectator camera next time a map loads that has one.
|
|
||||||
if (e.Entity == LocalPlayer.ID) {
|
|
||||||
m_CamSetToTeamPick = false;
|
|
||||||
// They will also be set to menu, so unlock mouse just in case they were in game with locked mouse.
|
|
||||||
Events::UnlockMouse unlock;
|
|
||||||
m_EventBroker->Publish(unlock);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user