Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 51a588657e | |||
| 73716c28e2 | |||
| a3b7bd7df5 | |||
| 11025b5466 | |||
| eba36b8492 | |||
| 55854f5c0d | |||
| 12a181c1ff | |||
| b131f56f5e | |||
| 24aac6a00d | |||
| 45a92b362f | |||
| 2085d9ec9e | |||
| 7b4826cb44 | |||
| 28d412f5c7 | |||
| 0e5f6da9a9 | |||
| 42b52a6766 | |||
| 9c2e459e0c | |||
| 8299b99e2f | |||
| c708f1582c | |||
| 782c1a388a | |||
| a188a3f7fa | |||
| ed7d00c1d8 | |||
| 53cae25eb2 | |||
| 7054822be2 | |||
| 0c97ce7a4a | |||
| 8bcafc1151 | |||
| 97cbc55223 |
+1
-1
Submodule assets updated: 091ad5c01b...c4898d8281
@@ -9,9 +9,9 @@
|
|||||||
class CollidableOctreeSystem : public ImpureSystem, public PureSystem
|
class CollidableOctreeSystem : public ImpureSystem, public PureSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CollidableOctreeSystem(World* world, EventBroker* eventBroker, Octree<EntityAABB>* octree)
|
CollidableOctreeSystem(World* world, EventBroker* eventBroker, Octree<EntityAABB>* octree, const std::string& componentType)
|
||||||
: System(world, eventBroker)
|
: System(world, eventBroker)
|
||||||
, PureSystem("Collidable")
|
, PureSystem(componentType)
|
||||||
, m_Octree(octree)
|
, m_Octree(octree)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ template<typename T>
|
|||||||
template<typename Box>
|
template<typename Box>
|
||||||
void Octree<T>::ObjectsInSameRegion(const Box& box, std::vector<T>& outObjects)
|
void Octree<T>::ObjectsInSameRegion(const Box& box, std::vector<T>& outObjects)
|
||||||
{
|
{
|
||||||
//static_assert(std::is_base_of<AABB, Box>::value, "template argument type Box in Octree<T>::ObjectsInSameRegion must be a subclass of AABB.");
|
static_assert(std::is_base_of<AABB, Box>::value, "template argument type Box in Octree<T>::ObjectsInSameRegion must be a subclass of AABB.");
|
||||||
falsifyObjectChecks();
|
falsifyObjectChecks();
|
||||||
m_Root->ObjectsInSameRegion(box, outObjects);
|
m_Root->ObjectsInSameRegion(box, outObjects);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,11 @@ 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 DoubleJumping() const { return m_DoubleJumping; }
|
||||||
|
virtual void SetDoubleJumping(bool isDoubleJumping) {
|
||||||
|
m_DoubleJumping = isDoubleJumping;
|
||||||
|
}
|
||||||
|
|
||||||
void LockMouse();
|
void LockMouse();
|
||||||
void UnlockMouse();
|
void UnlockMouse();
|
||||||
virtual bool OnCommand(const Events::InputCommand& e) override;
|
virtual bool OnCommand(const Events::InputCommand& e) override;
|
||||||
@@ -27,8 +31,9 @@ protected:
|
|||||||
glm::vec3 m_Rotation;
|
glm::vec3 m_Rotation;
|
||||||
glm::vec3 m_Movement;
|
glm::vec3 m_Movement;
|
||||||
bool m_Jumping = false;
|
bool m_Jumping = false;
|
||||||
|
bool m_DoubleJumping = false;
|
||||||
bool m_Crouching = false;
|
bool m_Crouching = false;
|
||||||
|
|
||||||
EventRelay<EventContext, Events::LockMouse> m_ELockMouse;
|
EventRelay<EventContext, Events::LockMouse> m_ELockMouse;
|
||||||
bool OnLockMouse(const Events::LockMouse& e);
|
bool OnLockMouse(const Events::LockMouse& e);
|
||||||
EventRelay<EventContext, Events::UnlockMouse> m_EUnlockMouse;
|
EventRelay<EventContext, Events::UnlockMouse> m_EUnlockMouse;
|
||||||
@@ -36,7 +41,7 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <typename EventContext>
|
template <typename EventContext>
|
||||||
FirstPersonInputController<EventContext>::FirstPersonInputController(EventBroker* eventBroker, int playerID)
|
FirstPersonInputController<EventContext>::FirstPersonInputController(EventBroker* eventBroker, int playerID)
|
||||||
: InputController(eventBroker)
|
: InputController(eventBroker)
|
||||||
, m_PlayerID(playerID)
|
, m_PlayerID(playerID)
|
||||||
{
|
{
|
||||||
@@ -113,14 +118,14 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
|
|||||||
template <typename EventContext>
|
template <typename EventContext>
|
||||||
bool FirstPersonInputController<EventContext>::OnUnlockMouse(const Events::UnlockMouse& e)
|
bool FirstPersonInputController<EventContext>::OnUnlockMouse(const Events::UnlockMouse& e)
|
||||||
{
|
{
|
||||||
m_MouseLocked = false;
|
m_MouseLocked = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename EventContext>
|
template <typename EventContext>
|
||||||
bool FirstPersonInputController<EventContext>::OnLockMouse(const Events::LockMouse& e)
|
bool FirstPersonInputController<EventContext>::OnLockMouse(const Events::LockMouse& e)
|
||||||
{
|
{
|
||||||
m_MouseLocked = true;
|
m_MouseLocked = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include "ShaderProgram.h"
|
#include "ShaderProgram.h"
|
||||||
//#include "Util/UnorderedMapVec2.h"
|
//#include "Util/UnorderedMapVec2.h"
|
||||||
#include "Texture.h"
|
#include "Texture.h"
|
||||||
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
class DrawColorCorrectionPass
|
class DrawColorCorrectionPass
|
||||||
{
|
{
|
||||||
@@ -16,14 +17,13 @@ public:
|
|||||||
void InitializeFrameBuffers();
|
void InitializeFrameBuffers();
|
||||||
void InitializeShaderPrograms();
|
void InitializeShaderPrograms();
|
||||||
|
|
||||||
void Draw(GLuint sceneTexture, GLuint bloomTexture);
|
void Draw(GLuint sceneTexture, GLuint bloomTexture, GLfloat gamma, GLfloat exposure);
|
||||||
private:
|
private:
|
||||||
const IRenderer* m_Renderer;
|
const IRenderer* m_Renderer;
|
||||||
|
|
||||||
ShaderProgram* m_ColorCorrectionProgram;
|
ShaderProgram* m_ColorCorrectionProgram;
|
||||||
|
|
||||||
Model* m_ScreenQuad;
|
Model* m_ScreenQuad;
|
||||||
GLfloat m_Exposure;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -26,6 +26,7 @@ struct RenderScene
|
|||||||
std::list<std::shared_ptr<RenderJob>> DirectionalLightJobs;
|
std::list<std::shared_ptr<RenderJob>> DirectionalLightJobs;
|
||||||
Rectangle Viewport;
|
Rectangle Viewport;
|
||||||
bool ClearDepth = false;
|
bool ClearDepth = false;
|
||||||
|
glm::vec4 AmbientColor;
|
||||||
|
|
||||||
void Clear()
|
void Clear()
|
||||||
{
|
{
|
||||||
@@ -40,6 +41,9 @@ struct RenderScene
|
|||||||
struct RenderFrame
|
struct RenderFrame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
//TODO: Getters
|
||||||
|
GLfloat Gamma = 2.2f;
|
||||||
|
GLfloat Exposure = 1.f;
|
||||||
|
|
||||||
void Add(RenderScene &scene)
|
void Add(RenderScene &scene)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ inline bool _GLERROR(const char* info, const char* file, const char* func, unsig
|
|||||||
GLenum error = glGetError();
|
GLenum error = glGetError();
|
||||||
if (error != GL_NO_ERROR)
|
if (error != GL_NO_ERROR)
|
||||||
{
|
{
|
||||||
_LOG(LOG_LEVEL_ERROR, file, func, line, "GL Error: %s, %i, %s", info, error, gluErrorString(error));
|
_LOG(LOG_LEVEL_ERROR, file, func, line, "GL Error: %s\nError code: %i, %s\n", info, error, gluErrorString(error));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ private:
|
|||||||
GUI::Frame* m_FrameStack;
|
GUI::Frame* m_FrameStack;
|
||||||
World* m_World;
|
World* m_World;
|
||||||
Octree<EntityAABB>* m_OctreeCollision;
|
Octree<EntityAABB>* m_OctreeCollision;
|
||||||
|
Octree<EntityAABB>* m_OctreeTrigger;
|
||||||
Octree<EntityAABB>* m_OctreeFrustrumCulling;
|
Octree<EntityAABB>* m_OctreeFrustrumCulling;
|
||||||
SystemPipeline* m_SystemPipeline;
|
SystemPipeline* m_SystemPipeline;
|
||||||
RenderFrame* m_RenderFrame;
|
RenderFrame* m_RenderFrame;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
<xs:include schemaLocation="Components/AABB.xsd"/>
|
<xs:include schemaLocation="Components/AABB.xsd"/>
|
||||||
<xs:include schemaLocation="Components/PointLight.xsd"/>
|
<xs:include schemaLocation="Components/PointLight.xsd"/>
|
||||||
<xs:include schemaLocation="Components/DirectionalLight.xsd"/>
|
<xs:include schemaLocation="Components/DirectionalLight.xsd"/>
|
||||||
|
<xs:include schemaLocation="Components/SceneLight.xsd"/>
|
||||||
<xs:include schemaLocation="Components/Trigger.xsd"/>
|
<xs:include schemaLocation="Components/Trigger.xsd"/>
|
||||||
<xs:include schemaLocation="Components/ExplosionEffect.xsd"/>
|
<xs:include schemaLocation="Components/ExplosionEffect.xsd"/>
|
||||||
<xs:include schemaLocation="Components/Health.xsd"/>
|
<xs:include schemaLocation="Components/Health.xsd"/>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<xs:element name="CapturePoint">
|
<xs:element name="CapturePoint">
|
||||||
<xs:annotation>
|
<xs:annotation>
|
||||||
<xs:documentation>A Capture Point. Add a Team Component to specify who currently owns it</xs:documentation>
|
<xs:documentation>A Capture Point. Make sure to update the HomePoint,CapturePointNumber,Team for each</xs:documentation>
|
||||||
</xs:annotation>
|
</xs:annotation>
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:all>
|
<xs:all>
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<SceneLight xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SceneLight.xsd">
|
||||||
|
<AmbientColor R="0.2" G="0.2" B="0.2" A="1"/>
|
||||||
|
<Visible>true</Visible>
|
||||||
|
<Gamma>2.2</Gamma>
|
||||||
|
<Exposure>1</Exposure>
|
||||||
|
</SceneLight>
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="types">
|
||||||
|
<xs:import schemaLocation="../Types.xsd" namespace="types"/>
|
||||||
|
<xs:element name="SceneLight">
|
||||||
|
<xs:annotation>
|
||||||
|
<xs:documentation>Some settings for the scene lighting</xs:documentation>
|
||||||
|
</xs:annotation>
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:all>
|
||||||
|
<xs:element name="AmbientColor" type="t:Color" minOccurs="0">
|
||||||
|
<xs:annotation><xs:documentation>Color of the ambient light</xs:documentation></xs:annotation>
|
||||||
|
</xs:element>
|
||||||
|
<xs:element name="Visible" type="t:bool" minOccurs="0">
|
||||||
|
<xs:annotation><xs:documentation>Wether the ambient light should be applied or not</xs:documentation></xs:annotation>
|
||||||
|
</xs:element>
|
||||||
|
<xs:element name="Gamma" type="t:double" minOccurs="0">
|
||||||
|
<xs:annotation><xs:documentation>Gamma correction for the scene</xs:documentation></xs:annotation>
|
||||||
|
</xs:element>
|
||||||
|
<xs:element name="Exposure" type="t:double" minOccurs="0">
|
||||||
|
<xs:annotation><xs:documentation>The exposure of the camera</xs:documentation></xs:annotation>
|
||||||
|
</xs:element>
|
||||||
|
</xs:all>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:schema>
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity name="AssetBase" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Core/UnitCylinder.mesh</Resource>
|
||||||
|
<Color A="1" B="1.56862748" G="1.56862748" R="1.56862748"/>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="-0.231354833" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children>
|
||||||
|
<Entity name="Light">
|
||||||
|
<Components>
|
||||||
|
<c:PointLight/>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.663784981" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="RotationOrigin">
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>0.5</Speed>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:Transform>
|
||||||
|
<Orientation X="0" Y="28.7916641" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Asset">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/AssaultWeaponBlue.mesh</Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="1" Z="0"/>
|
||||||
|
<Orientation X="0.524000049" Y="0" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:AABB/>
|
||||||
|
<c:CapturePoint/>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>C:\Users\123456\Workspace\TacticalZ\assets\Models\Core\UnitSphere.mesh</Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Team/>
|
||||||
|
<c:Transform/>
|
||||||
|
<c:Trigger/>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children/>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.340887427" Y="0" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:AABB/>
|
||||||
|
<c:CapturePoint>
|
||||||
|
<HomePointForTeam>
|
||||||
|
<Red/>
|
||||||
|
</HomePointForTeam>
|
||||||
|
</c:CapturePoint>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>C:\Users\123456\Workspace\TacticalZ\assets\Models\Core\UnitSphere.mesh</Resource>
|
||||||
|
<Color A="1" B="0" G="0.200000003" R="1"/>
|
||||||
|
</c:Model>
|
||||||
|
<c:Team>
|
||||||
|
<Team>
|
||||||
|
<Red/>
|
||||||
|
</Team>
|
||||||
|
</c:Team>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="6.60000038" Y="0" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
<c:Trigger/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:AABB/>
|
||||||
|
<c:CapturePoint>
|
||||||
|
<CapturePointNumber>1</CapturePointNumber>
|
||||||
|
</c:CapturePoint>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>C:\Users\123456\Workspace\TacticalZ\assets\Models\Core\UnitSphere.mesh</Resource>
|
||||||
|
<Color A="1" B="1" G="1" R="0"/>
|
||||||
|
</c:Model>
|
||||||
|
<c:Team/>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="4.46673203" Y="0" Z="3.50259304"/>
|
||||||
|
</c:Transform>
|
||||||
|
<c:Trigger/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:AABB/>
|
||||||
|
<c:CapturePoint>
|
||||||
|
<CapturePointNumber>2</CapturePointNumber>
|
||||||
|
</c:CapturePoint>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>C:\Users\123456\Workspace\TacticalZ\assets\Models\Core\UnitSphere.mesh</Resource>
|
||||||
|
<Color A="1" B="1" G="0.200000003" R="0"/>
|
||||||
|
</c:Model>
|
||||||
|
<c:Team>
|
||||||
|
<Team>
|
||||||
|
<Blue/>
|
||||||
|
</Team>
|
||||||
|
</c:Team>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="3.00000024" Y="0" Z="0.113596022"/>
|
||||||
|
</c:Transform>
|
||||||
|
<c:Trigger/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:AABB/>
|
||||||
|
<c:CapturePoint>
|
||||||
|
<CapturePointNumber>3</CapturePointNumber>
|
||||||
|
</c:CapturePoint>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>C:\Users\123456\Workspace\TacticalZ\assets\Models\Core\UnitSphere.mesh</Resource>
|
||||||
|
<Color A="1" B="1" G="0.200000003" R="0"/>
|
||||||
|
</c:Model>
|
||||||
|
<c:Team>
|
||||||
|
<Team>
|
||||||
|
<Blue/>
|
||||||
|
</Team>
|
||||||
|
</c:Team>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="1.75382805" Y="0" Z="0.0895374417"/>
|
||||||
|
</c:Transform>
|
||||||
|
<c:Trigger/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:AABB/>
|
||||||
|
<c:CapturePoint>
|
||||||
|
<HomePointForTeam>
|
||||||
|
<Blue/>
|
||||||
|
</HomePointForTeam>
|
||||||
|
<CapturePointNumber>4</CapturePointNumber>
|
||||||
|
</c:CapturePoint>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>C:\Users\123456\Workspace\TacticalZ\assets\Models\Core\UnitSphere.mesh</Resource>
|
||||||
|
<Color A="1" B="1" G="0.200000003" R="0"/>
|
||||||
|
</c:Model>
|
||||||
|
<c:Team>
|
||||||
|
<Team>
|
||||||
|
<Blue/>
|
||||||
|
</Team>
|
||||||
|
</c:Team>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.56674248" Y="0" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
<c:Trigger/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:AABB/>
|
||||||
|
<c:Health/>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>C:\Users\123456\Workspace\TacticalZ\assets\Models\Core\UnitCube.mesh</Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Player/>
|
||||||
|
<c:Team>
|
||||||
|
<Team>
|
||||||
|
<Blue/>
|
||||||
|
</Team>
|
||||||
|
</c:Team>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="4.29100037" Y="-0.08556436" Z="1.29717529"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:AABB/>
|
||||||
|
<c:Health/>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>C:\Users\123456\Workspace\TacticalZ\assets\Models\Core\UnitCube.mesh</Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Player/>
|
||||||
|
<c:Team>
|
||||||
|
<Team>
|
||||||
|
<Red/>
|
||||||
|
</Team>
|
||||||
|
</c:Team>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="5.43557501" Y="0.888866663" Z="1.55849135"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>C:\Users\123456\Workspace\TacticalZ\assets\Models\DummyScene.mesh</Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.600000024" Y="0" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -2,7 +2,9 @@
|
|||||||
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
<Components>
|
<Components>
|
||||||
<c:Transform/>
|
<c:Transform>
|
||||||
|
<Position X="0" Y="-1" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
|
|
||||||
<Children>
|
<Children>
|
||||||
@@ -18,7 +20,7 @@
|
|||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity>
|
<Entity name="Listener">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Camera/>
|
<c:Camera/>
|
||||||
<c:Listener/>
|
<c:Listener/>
|
||||||
@@ -38,18 +40,27 @@
|
|||||||
<Resource>Models/DirectionalLightWidget.mesh</Resource>
|
<Resource>Models/DirectionalLightWidget.mesh</Resource>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:RaptorCopter>
|
<c:RaptorCopter>
|
||||||
<Speed>1.0499999523162842</Speed>
|
<Speed>1</Speed>
|
||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="2.1529963" Y="6.59221172" Z="0.169116676"/>
|
<Position X="2.1529963" Y="6.59221172" Z="0.169116676"/>
|
||||||
<Orientation X="4.16300011" Y="1422.89319" Z="0"/>
|
<Orientation X="4.16300011" Y="7875.41211" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="AssaultTPose">
|
<Entity name="AssaultTPose">
|
||||||
<Components>
|
<Components>
|
||||||
|
<c:ExplosionEffect>
|
||||||
|
<ColorByDistance>true</ColorByDistance>
|
||||||
|
<Velocity X="0" Y="0" Z="0.300000012"/>
|
||||||
|
<ExplosionOrigin X="0" Y="1.30000007" Z="0"/>
|
||||||
|
<TimeSinceDeath>5.0498686575577523</TimeSinceDeath>
|
||||||
|
<ExplosionDuration>5</ExplosionDuration>
|
||||||
|
<EndColor A="1" B="1" G="0" R="0"/>
|
||||||
|
<RandomnessScalar>3</RandomnessScalar>
|
||||||
|
</c:ExplosionEffect>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/Assault.mesh</Resource>
|
<Resource>Models/Assault.mesh</Resource>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
@@ -62,11 +73,26 @@
|
|||||||
<Entity name="SecondaryWeapon">
|
<Entity name="SecondaryWeapon">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/SecondaryWeapon.mesh</Resource>
|
<Resource>Models/AssaultWeaponRed.mesh</Resource>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="-0.546139359" Y="0.853016734" Z="0.177482292"/>
|
<Position X="-0.560000002" Y="0.754308224" Z="0.181485131"/>
|
||||||
<Orientation X="1.47266471" Y="0.524984181" Z="1.243698"/>
|
<Orientation X="0.989000022" Y="0" Z="6.10900021"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="SecondaryWeaponRed">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/DefenderGunRed.mesh</Resource>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
<NormalMap>false</NormalMap>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.515922487" Y="0.787437975" Z="0.132855967"/>
|
||||||
|
<Orientation X="0.989000022" Y="0" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
@@ -85,7 +111,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Animation>
|
<c:Animation>
|
||||||
<Name>Run</Name>
|
<Name>Run</Name>
|
||||||
<Time>0.62051775215976157</Time>
|
<Time>0.17818245776980568</Time>
|
||||||
<Speed>1</Speed>
|
<Speed>1</Speed>
|
||||||
</c:Animation>
|
</c:Animation>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
@@ -101,7 +127,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Animation>
|
<c:Animation>
|
||||||
<Name>Walk</Name>
|
<Name>Walk</Name>
|
||||||
<Time>0.28779680073140668</Time>
|
<Time>0.34546191187031372</Time>
|
||||||
<Speed>1</Speed>
|
<Speed>1</Speed>
|
||||||
</c:Animation>
|
</c:Animation>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
@@ -147,70 +173,6 @@
|
|||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
<Entity name="NormalSphere">
|
|
||||||
<Components>
|
|
||||||
<c:Model>
|
|
||||||
<Resource>Models/NormalMapSphere.mesh</Resource>
|
|
||||||
</c:Model>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="1.82700014" Y="0" Z="-0.166000009"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
<Entity name="SpecularSphere">
|
|
||||||
<Components>
|
|
||||||
<c:Model>
|
|
||||||
<Resource>Models/SpecularMapSphere.mesh</Resource>
|
|
||||||
</c:Model>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="-1.06487739" Y="0" Z="1.52336037"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children>
|
|
||||||
<Entity name="Rotationpoint">
|
|
||||||
<Components>
|
|
||||||
<c:RaptorCopter>
|
|
||||||
<Speed>1</Speed>
|
|
||||||
<Axis X="0.699999988" Y="1" Z="0.300000012"/>
|
|
||||||
</c:RaptorCopter>
|
|
||||||
<c:Transform>
|
|
||||||
<Orientation X="404.200684" Y="577.428955" Z="173.228897"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children>
|
|
||||||
<Entity name="PointLight">
|
|
||||||
<Components>
|
|
||||||
<c:Model>
|
|
||||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
|
||||||
<Color A="1" B="0" G="3.92156863" R="3.92156863"/>
|
|
||||||
</c:Model>
|
|
||||||
<c:PointLight>
|
|
||||||
<Radius>3</Radius>
|
|
||||||
<Intensity>1.1399998664855957</Intensity>
|
|
||||||
</c:PointLight>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="0.600000024" Y="0.5" Z="0"/>
|
|
||||||
<Scale X="0.100000001" Y="0.100000001" Z="0.100000001"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
|
||||||
</Entity>
|
|
||||||
<Entity name="GlowMap">
|
|
||||||
<Components>
|
|
||||||
<c:Model>
|
|
||||||
<Resource>Models/IncandescenceMapSphere.mesh</Resource>
|
|
||||||
</c:Model>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="-1.10000002" Y="0" Z="-1.80000007"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
<Entity name="CombinedSpheres">
|
<Entity name="CombinedSpheres">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
@@ -227,7 +189,7 @@
|
|||||||
<Axis X="1" Y="1" Z="1"/>
|
<Axis X="1" Y="1" Z="1"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="53.9495354" Y="53.9495354" Z="53.9495354"/>
|
<Orientation X="6484.80273" Y="6484.80273" Z="6484.80273"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -284,8 +246,94 @@
|
|||||||
</Entity>
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
|
<Entity name="SphereRotationOrigin">
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>1</Speed>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:Transform>
|
||||||
|
<Orientation X="0" Y="6281.02246" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="NormalSphere">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/NormalMapSphere.mesh</Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="1.82700014" Y="0" Z="-0.166000009"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="SpecularSphere">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/SpecularMapSphere.mesh</Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-1.06487739" Y="0" Z="1.52336037"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Rotationpoint">
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>1</Speed>
|
||||||
|
<Axis X="0.699999988" Y="1" Z="0.300000012"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:Transform>
|
||||||
|
<Orientation X="4905.44824" Y="7008.50781" Z="2103.03223"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="PointLight">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||||
|
<Color A="1" B="0" G="3.92156863" R="3.92156863"/>
|
||||||
|
</c:Model>
|
||||||
|
<c:PointLight>
|
||||||
|
<Radius>3</Radius>
|
||||||
|
<Intensity>1.1399998664855957</Intensity>
|
||||||
|
</c:PointLight>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.600000024" Y="0.5" Z="0"/>
|
||||||
|
<Scale X="0.100000001" Y="0.100000001" Z="0.100000001"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="GlowMap">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/IncandescenceMapSphere.mesh</Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-1.10000002" Y="0" Z="-1.80000007"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
|
<Entity name="SceneColors">
|
||||||
|
<Components>
|
||||||
|
<c:SceneLight>
|
||||||
|
<Gamma>1.3999999761581421</Gamma>
|
||||||
|
</c:SceneLight>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
|
|
||||||
</Entity>
|
</Entity>
|
||||||
|
|||||||
@@ -84,15 +84,6 @@
|
|||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="Light">
|
|
||||||
<Components>
|
|
||||||
<c:PointLight/>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="0.400000006" Y="0.400000006" Z="0.400000006"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
</Children>
|
||||||
|
|
||||||
</Entity>
|
</Entity>
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
<Entity name="Player" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
<Entity name="Player" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
<Components>
|
<Components>
|
||||||
<c:Health/>
|
|
||||||
<c:AABB>
|
<c:AABB>
|
||||||
<Origin X="0" Y="0.772000015" Z="0"/>
|
<Origin X="0" Y="0.772000015" Z="0"/>
|
||||||
<Size X="1" Y="1.60000002" Z="1"/>
|
<Size X="1" Y="1.60000002" Z="1"/>
|
||||||
</c:AABB>
|
</c:AABB>
|
||||||
<c:Collidable/>
|
<c:Collidable/>
|
||||||
|
<c:Health/>
|
||||||
<c:Physics>
|
<c:Physics>
|
||||||
<Velocity X="2.30999646e-23" Y="0" Z="1.05272533e-23"/>
|
<Velocity X="2.30999646e-23" Y="0" Z="1.05272533e-23"/>
|
||||||
</c:Physics>
|
</c:Physics>
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
</Team>
|
</Team>
|
||||||
</c:Team>
|
</c:Team>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="8.60201447e-23" Y="0" Z="3.9201616e-23"/>
|
<Position X="9.56501799e-22" Y="-0.471999973" Z="4.35902473e-22"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
|
|
||||||
@@ -101,12 +101,19 @@
|
|||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="Weapon">
|
<Entity name="Weapon">
|
||||||
<Components>
|
<Components>
|
||||||
|
<c:ExplosionEffect>
|
||||||
|
<ColorByDistance>true</ColorByDistance>
|
||||||
|
<Velocity X="0.800000012" Y="0.0379999988" Z="0"/>
|
||||||
|
<ExplosionDuration>3.7999999523162842</ExplosionDuration>
|
||||||
|
<EndColor A="0" B="23.5294113" G="11.7647057" R="0"/>
|
||||||
|
<Randomness>true</Randomness>
|
||||||
|
</c:ExplosionEffect>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/AssaultWeapon.mesh</Resource>
|
<Resource>Models/AssaultWeaponRed.mesh</Resource>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0.180000007" Y="-0.183000013" Z="0"/>
|
<Position X="0.180000007" Y="-0.183000013" Z="0"/>
|
||||||
<Orientation X="0" Y="4.64700031" Z="0"/>
|
<Orientation X="0" Y="3.08300018" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
@@ -141,7 +148,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Animation>
|
<c:Animation>
|
||||||
<Name>Hold Pos</Name>
|
<Name>Hold Pos</Name>
|
||||||
<Time>0.73515426169631848</Time>
|
<Time>0.73506627647571587</Time>
|
||||||
<Speed>1</Speed>
|
<Speed>1</Speed>
|
||||||
</c:Animation>
|
</c:Animation>
|
||||||
<c:HiddenForLocalPlayer/>
|
<c:HiddenForLocalPlayer/>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,8 @@
|
|||||||
</c:Lifetime>
|
</c:Lifetime>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/CylinderBullet.mesh</Resource>
|
<Resource>Models/CylinderBullet.mesh</Resource>
|
||||||
<Color A="1" B="39.2156868" G="7.84313726" R="0"/>
|
<Color A="0.156862751" B="39.2156868" G="7.84313726" R="0"/>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Scale X="0.0109999999" Y="0.0289999992" Z="100"/>
|
<Scale X="0.0109999999" Y="0.0289999992" Z="100"/>
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
</c:Lifetime>
|
</c:Lifetime>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/CylinderBullet.mesh</Resource>
|
<Resource>Models/CylinderBullet.mesh</Resource>
|
||||||
<Color A="1" B="0" G="0.525490224" R="39.2156868"/>
|
<Color A="0.156862751" B="0" G="0.525490224" R="39.2156868"/>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Scale X="0.0110000009" Y="0.029000001" Z="100"/>
|
<Scale X="0.0110000009" Y="0.029000001" Z="100"/>
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity name="SoundEmitter" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:SoundEmitter/>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children>
|
||||||
|
<Entity name="SoundEmitterText">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>SoundEmitter</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Scale X="0.5" Y="0.5" Z="0.5"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity name="SpawnerRedTeam" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:PlayerSpawn/>
|
||||||
|
<c:Spawner>
|
||||||
|
<EntityFile>Schema/Entities/Player.xml</EntityFile>
|
||||||
|
</c:Spawner>
|
||||||
|
<c:Team>
|
||||||
|
<Team>
|
||||||
|
<Red/>
|
||||||
|
</Team>
|
||||||
|
</c:Team>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children>
|
||||||
|
<Entity name="SpawnPointRedTeam">
|
||||||
|
<Components>
|
||||||
|
<c:SpawnPoint/>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Assault.mesh</Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="1" Y="0" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="SpawnPointRedTeam">
|
||||||
|
<Components>
|
||||||
|
<c:SpawnPoint/>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Assault.mesh</Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-1" Y="0" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="SpawnPointRedTeam">
|
||||||
|
<Components>
|
||||||
|
<c:SpawnPoint/>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Assault.mesh</Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="SpawnPointRedTeam">
|
||||||
|
<Components>
|
||||||
|
<c:SpawnPoint/>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Assault.mesh</Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="-1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity name="SpawnPointRedTeam" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:SpawnPoint/>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Assault.mesh</Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="1.31625879" Y="0" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children/>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -31,6 +31,7 @@
|
|||||||
<xs:element ref="c:PlayerSpawn" minOccurs="0"/>
|
<xs:element ref="c:PlayerSpawn" minOccurs="0"/>
|
||||||
<xs:element ref="c:Team" minOccurs="0"/>
|
<xs:element ref="c:Team" minOccurs="0"/>
|
||||||
<xs:element ref="c:DirectionalLight" minOccurs="0"/>
|
<xs:element ref="c:DirectionalLight" minOccurs="0"/>
|
||||||
|
<xs:element ref="c:SceneLight" minOccurs="0"/>
|
||||||
<xs:element ref="c:UniformScale" minOccurs="0"/>
|
<xs:element ref="c:UniformScale" minOccurs="0"/>
|
||||||
<xs:element ref="c:EditorWidget" minOccurs="0"/>
|
<xs:element ref="c:EditorWidget" minOccurs="0"/>
|
||||||
<xs:element ref="c:Lifetime" minOccurs="0"/>
|
<xs:element ref="c:Lifetime" minOccurs="0"/>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
layout (binding = 0) uniform sampler2D SceneTexture;
|
layout (binding = 0) uniform sampler2D SceneTexture;
|
||||||
layout (binding = 1) uniform sampler2D BloomTexture;
|
layout (binding = 1) uniform sampler2D BloomTexture;
|
||||||
uniform float Exposure;
|
uniform float Exposure;
|
||||||
|
uniform float Gamma;
|
||||||
|
|
||||||
in VertexData{
|
in VertexData{
|
||||||
vec2 TextureCoordinate;
|
vec2 TextureCoordinate;
|
||||||
@@ -12,7 +13,6 @@ out vec4 fragmentColor;
|
|||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
const float gamma = 2.2;
|
|
||||||
vec4 hdrColor = texture(SceneTexture, Input.TextureCoordinate);
|
vec4 hdrColor = texture(SceneTexture, Input.TextureCoordinate);
|
||||||
vec4 bloomColor = texture(BloomTexture, Input.TextureCoordinate);
|
vec4 bloomColor = texture(BloomTexture, Input.TextureCoordinate);
|
||||||
hdrColor += bloomColor;
|
hdrColor += bloomColor;
|
||||||
@@ -21,7 +21,7 @@ void main()
|
|||||||
vec3 result = vec3(1.0) - exp(-hdrColor.rgb * Exposure);
|
vec3 result = vec3(1.0) - exp(-hdrColor.rgb * Exposure);
|
||||||
|
|
||||||
//gamme correction
|
//gamme correction
|
||||||
result = pow(result, vec3(1.0 / gamma));
|
result = pow(result, vec3(1.0 / Gamma));
|
||||||
|
|
||||||
fragmentColor = vec4(result, 1.0);
|
fragmentColor = vec4(result, 1.0);
|
||||||
//fragmentColor = hdrColor;
|
//fragmentColor = hdrColor;
|
||||||
|
|||||||
@@ -17,15 +17,21 @@ uniform bool ExponentialAccelaration;
|
|||||||
in VertexData{
|
in VertexData{
|
||||||
vec3 Position;
|
vec3 Position;
|
||||||
vec3 Normal;
|
vec3 Normal;
|
||||||
|
vec3 Tangent;
|
||||||
|
vec3 BiTangent;
|
||||||
vec2 TextureCoordinate;
|
vec2 TextureCoordinate;
|
||||||
vec4 ExplosionColor;
|
vec4 ExplosionColor;
|
||||||
|
float ExplosionPercentageElapsed;
|
||||||
}Input[];
|
}Input[];
|
||||||
|
|
||||||
out VertexData{
|
out VertexData{
|
||||||
vec3 Position;
|
vec3 Position;
|
||||||
vec3 Normal;
|
vec3 Normal;
|
||||||
|
vec3 Tangent;
|
||||||
|
vec3 BiTangent;
|
||||||
vec2 TextureCoordinate;
|
vec2 TextureCoordinate;
|
||||||
vec4 ExplosionColor;
|
vec4 ExplosionColor;
|
||||||
|
float ExplosionPercentageElapsed;
|
||||||
}Output;
|
}Output;
|
||||||
|
|
||||||
layout(triangles) in;
|
layout(triangles) in;
|
||||||
@@ -114,12 +120,17 @@ void main()
|
|||||||
{
|
{
|
||||||
// calculate the max distance (s) the triangle will move
|
// calculate the max distance (s) the triangle will move
|
||||||
float s = (randomVelocity.x * ExplosionDuration) + (0.5 * a * pow(ExplosionDuration, 2));
|
float s = (randomVelocity.x * ExplosionDuration) + (0.5 * a * pow(ExplosionDuration, 2));
|
||||||
|
float te = (length(triangleCenter2ExplosionRadius) / s);
|
||||||
|
|
||||||
Output.ExplosionColor = EndColor * (length(triangleCenter2ExplosionRadius) / s);
|
Output.ExplosionColor = EndColor;
|
||||||
|
Output.ExplosionPercentageElapsed = te;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Output.ExplosionColor = EndColor * timePercetage;
|
Output.ExplosionColor = EndColor;
|
||||||
|
Output.ExplosionPercentageElapsed = timePercetage;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// for every vertex on the triangle...
|
// for every vertex on the triangle...
|
||||||
@@ -132,6 +143,8 @@ void main()
|
|||||||
Output.Normal = Input[i].Normal;
|
Output.Normal = Input[i].Normal;
|
||||||
Output.Position = Input[i].Position;
|
Output.Position = Input[i].Position;
|
||||||
Output.TextureCoordinate = Input[i].TextureCoordinate;
|
Output.TextureCoordinate = Input[i].TextureCoordinate;
|
||||||
|
Output.Tangent = Input[i].Tangent;
|
||||||
|
Output.BiTangent = Input[i].BiTangent;
|
||||||
|
|
||||||
// convert to model space for the gravity to always be in -y
|
// convert to model space for the gravity to always be in -y
|
||||||
vec4 ExplodedPositionInModelSpace = M * vec4(ExplodedPosition, 1.0);
|
vec4 ExplodedPositionInModelSpace = M * vec4(ExplodedPosition, 1.0);
|
||||||
@@ -154,11 +167,14 @@ void main()
|
|||||||
// if explosion color should be affected by distance instead of time...
|
// if explosion color should be affected by distance instead of time...
|
||||||
if (ColorByDistance == true)
|
if (ColorByDistance == true)
|
||||||
{
|
{
|
||||||
Output.ExplosionColor = vec4(0.0);
|
Output.ExplosionColor = EndColor;
|
||||||
|
Output.ExplosionPercentageElapsed = 0.0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Output.ExplosionColor = EndColor * timePercetage;
|
Output.ExplosionColor = EndColor;
|
||||||
|
Output.ExplosionPercentageElapsed = timePercetage;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// for every vertex on the triangle...
|
// for every vertex on the triangle...
|
||||||
@@ -168,7 +184,9 @@ void main()
|
|||||||
Output.Normal = Input[i].Normal;
|
Output.Normal = Input[i].Normal;
|
||||||
Output.Position = Input[i].Position;
|
Output.Position = Input[i].Position;
|
||||||
Output.TextureCoordinate = Input[i].TextureCoordinate;
|
Output.TextureCoordinate = Input[i].TextureCoordinate;
|
||||||
|
Output.Tangent = Input[i].Tangent;
|
||||||
|
Output.BiTangent = Input[i].BiTangent;
|
||||||
|
|
||||||
// no change in position, pass through vertex
|
// no change in position, pass through vertex
|
||||||
gl_Position = gl_in[i].gl_Position;
|
gl_Position = gl_in[i].gl_Position;
|
||||||
EmitVertex();
|
EmitVertex();
|
||||||
|
|||||||
@@ -7,13 +7,13 @@ uniform vec4 Color;
|
|||||||
uniform vec4 DiffuseColor;
|
uniform vec4 DiffuseColor;
|
||||||
uniform vec2 ScreenDimensions;
|
uniform vec2 ScreenDimensions;
|
||||||
uniform vec4 FillColor;
|
uniform vec4 FillColor;
|
||||||
|
uniform vec4 AmbientColor;
|
||||||
uniform float FillPercentage;
|
uniform float FillPercentage;
|
||||||
layout (binding = 0) uniform sampler2D DiffuseTexture;
|
layout (binding = 0) uniform sampler2D DiffuseTexture;
|
||||||
layout (binding = 1) uniform sampler2D NormalMapTexture;
|
layout (binding = 1) uniform sampler2D NormalMapTexture;
|
||||||
layout (binding = 2) uniform sampler2D SpecularMapTexture;
|
layout (binding = 2) uniform sampler2D SpecularMapTexture;
|
||||||
layout (binding = 3) uniform sampler2D GlowMapTexture;
|
layout (binding = 3) uniform sampler2D GlowMapTexture;
|
||||||
|
|
||||||
|
|
||||||
#define TILE_SIZE 16
|
#define TILE_SIZE 16
|
||||||
|
|
||||||
struct LightSource {
|
struct LightSource {
|
||||||
@@ -55,13 +55,12 @@ in VertexData{
|
|||||||
vec3 BiTangent;
|
vec3 BiTangent;
|
||||||
vec2 TextureCoordinate;
|
vec2 TextureCoordinate;
|
||||||
vec4 ExplosionColor;
|
vec4 ExplosionColor;
|
||||||
|
float ExplosionPercentageElapsed;
|
||||||
}Input;
|
}Input;
|
||||||
|
|
||||||
out vec4 sceneColor;
|
out vec4 sceneColor;
|
||||||
out vec4 bloomColor;
|
out vec4 bloomColor;
|
||||||
|
|
||||||
vec4 scene_ambient = vec4(0.3,0.3,0.3,1);
|
|
||||||
|
|
||||||
struct LightResult {
|
struct LightResult {
|
||||||
vec4 Diffuse;
|
vec4 Diffuse;
|
||||||
vec4 Specular;
|
vec4 Specular;
|
||||||
@@ -120,6 +119,7 @@ void main()
|
|||||||
vec4 specularTexel = texture2D(SpecularMapTexture, Input.TextureCoordinate);
|
vec4 specularTexel = texture2D(SpecularMapTexture, Input.TextureCoordinate);
|
||||||
vec4 position = V * M * vec4(Input.Position, 1.0);
|
vec4 position = V * M * vec4(Input.Position, 1.0);
|
||||||
vec4 normal = V * CalcNormalMappedValue(Input.Normal, Input.Tangent, Input.BiTangent, Input.TextureCoordinate, NormalMapTexture);
|
vec4 normal = V * CalcNormalMappedValue(Input.Normal, Input.Tangent, Input.BiTangent, Input.TextureCoordinate, NormalMapTexture);
|
||||||
|
normal = normalize(normal);
|
||||||
//vec4 normal = normalize(V * vec4(Input.Normal, 0.0));
|
//vec4 normal = normalize(V * vec4(Input.Normal, 0.0));
|
||||||
vec4 viewVec = normalize(-position);
|
vec4 viewVec = normalize(-position);
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ void main()
|
|||||||
tilePos.y = int(gl_FragCoord.y/TILE_SIZE);
|
tilePos.y = int(gl_FragCoord.y/TILE_SIZE);
|
||||||
|
|
||||||
LightResult totalLighting;
|
LightResult totalLighting;
|
||||||
totalLighting.Diffuse = scene_ambient;
|
totalLighting.Diffuse = vec4(AmbientColor.rgb, 1.0);
|
||||||
int currentTile = int(floor(gl_FragCoord.x/TILE_SIZE) + (floor(gl_FragCoord.y/TILE_SIZE) * int(ScreenDimensions.x/TILE_SIZE)));
|
int currentTile = int(floor(gl_FragCoord.x/TILE_SIZE) + (floor(gl_FragCoord.y/TILE_SIZE) * int(ScreenDimensions.x/TILE_SIZE)));
|
||||||
|
|
||||||
int start = int(LightGrids.Data[currentTile].Start);
|
int start = int(LightGrids.Data[currentTile].Start);
|
||||||
@@ -150,8 +150,9 @@ void main()
|
|||||||
totalLighting.Specular += light_result.Specular;
|
totalLighting.Specular += light_result.Specular;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vec4 color_result = mix((Color * diffuseTexel * DiffuseColor), Input.ExplosionColor, Input.ExplosionPercentageElapsed);
|
||||||
vec4 color_result = (DiffuseColor + Input.ExplosionColor) * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)) * diffuseTexel * Color;
|
color_result = color_result * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel));
|
||||||
|
//vec4 color_result = (DiffuseColor + Input.ExplosionColor) * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)) * diffuseTexel * Color;
|
||||||
|
|
||||||
|
|
||||||
float pos = ((P * vec4(Input.Position, 1)).y + 1.0)/2.0;
|
float pos = ((P * vec4(Input.Position, 1)).y + 1.0)/2.0;
|
||||||
@@ -160,7 +161,7 @@ void main()
|
|||||||
color_result += FillColor;
|
color_result += FillColor;
|
||||||
}
|
}
|
||||||
sceneColor = vec4(color_result.xyz, clamp(color_result.a, 0, 1));
|
sceneColor = vec4(color_result.xyz, clamp(color_result.a, 0, 1));
|
||||||
color_result += glowTexel;
|
color_result += glowTexel*3;
|
||||||
|
|
||||||
bloomColor = vec4(clamp(color_result.xyz - 1.0, 0, 100), 1.0);
|
bloomColor = vec4(clamp(color_result.xyz - 1.0, 0, 100), 1.0);
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ out VertexData{
|
|||||||
vec3 BiTangent;
|
vec3 BiTangent;
|
||||||
vec2 TextureCoordinate;
|
vec2 TextureCoordinate;
|
||||||
vec4 ExplosionColor;
|
vec4 ExplosionColor;
|
||||||
|
float ExplosionPercentageElapsed;
|
||||||
}Output;
|
}Output;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
@@ -41,5 +42,6 @@ void main()
|
|||||||
Output.Normal = vec3(M * vec4(Normal, 0.0));
|
Output.Normal = vec3(M * vec4(Normal, 0.0));
|
||||||
Output.Tangent = vec3(M * vec4(Tangent, 0.0));
|
Output.Tangent = vec3(M * vec4(Tangent, 0.0));
|
||||||
Output.BiTangent = vec3(M * vec4(BiTangent, 0.0));
|
Output.BiTangent = vec3(M * vec4(BiTangent, 0.0));
|
||||||
Output.ExplosionColor = vec4(0.0);
|
Output.ExplosionColor = vec4(1.0);
|
||||||
|
Output.ExplosionPercentageElapsed = 0.0;
|
||||||
}
|
}
|
||||||
@@ -76,18 +76,18 @@ bool TriggerSystem::throwLeaveIfWasInTrigger(std::unordered_set<EntityWrapper>&
|
|||||||
|
|
||||||
bool TriggerSystem::OnTouch(const Events::TriggerTouch &event)
|
bool TriggerSystem::OnTouch(const Events::TriggerTouch &event)
|
||||||
{
|
{
|
||||||
LOG_INFO("Player entity %i touched trigger entity %i.", event.Entity, event.Trigger);
|
LOG_INFO("Player entity %i touched trigger entity %i.", event.Entity.ID, event.Trigger.ID);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TriggerSystem::OnEnter(const Events::TriggerEnter &event)
|
bool TriggerSystem::OnEnter(const Events::TriggerEnter &event)
|
||||||
{
|
{
|
||||||
LOG_INFO("Player entity %i entered trigger entity %i.", event.Entity, event.Trigger);
|
LOG_INFO("Player entity %i entered trigger entity %i.", event.Entity.ID, event.Trigger.ID);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TriggerSystem::OnLeave(const Events::TriggerLeave &event)
|
bool TriggerSystem::OnLeave(const Events::TriggerLeave &event)
|
||||||
{
|
{
|
||||||
LOG_INFO("Player entity %i left trigger entity %i.", event.Entity, event.Trigger);
|
LOG_INFO("Player entity %i left trigger entity %i.", event.Entity.ID, event.Trigger.ID);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -23,6 +23,12 @@ void EditorRenderSystem::Update(double dt)
|
|||||||
scene.Camera = m_EditorCamera;
|
scene.Camera = m_EditorCamera;
|
||||||
scene.Viewport = Rectangle(1920, 1080);
|
scene.Viewport = Rectangle(1920, 1080);
|
||||||
|
|
||||||
|
auto cSceneLight = m_World->GetComponents("SceneLight");
|
||||||
|
if (cSceneLight != nullptr) {
|
||||||
|
//these are hardcoded since they want special light treatment and a component just for widgets is stupid.
|
||||||
|
scene.AmbientColor = glm::vec4(0.8, 0.8, 0.8, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
auto models = m_World->GetComponents("Model");
|
auto models = m_World->GetComponents("Model");
|
||||||
if (models != nullptr) {
|
if (models != nullptr) {
|
||||||
for (auto& cModel : *models) {
|
for (auto& cModel : *models) {
|
||||||
@@ -49,7 +55,7 @@ void EditorRenderSystem::Update(double dt)
|
|||||||
glm::mat4 modelMatrix = Transform::ModelMatrix(entity.ID, entity.World);
|
glm::mat4 modelMatrix = Transform::ModelMatrix(entity.ID, entity.World);
|
||||||
for (auto matGroup : model->MaterialGroups()) {
|
for (auto matGroup : model->MaterialGroups()) {
|
||||||
std::shared_ptr<ModelJob> modelJob = std::make_shared<ModelJob>(model, scene.Camera, modelMatrix, matGroup, cModel, entity.World, glm::vec4(0), 0.f);
|
std::shared_ptr<ModelJob> modelJob = std::make_shared<ModelJob>(model, scene.Camera, modelMatrix, matGroup, cModel, entity.World, glm::vec4(0), 0.f);
|
||||||
if(cModel["Transparent"]) {
|
if (cModel["Transparent"]) {
|
||||||
scene.TransparentObjects.push_back(modelJob);
|
scene.TransparentObjects.push_back(modelJob);
|
||||||
} else {
|
} else {
|
||||||
scene.OpaqueObjects.push_back(modelJob);
|
scene.OpaqueObjects.push_back(modelJob);
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ DrawColorCorrectionPass::DrawColorCorrectionPass(IRenderer* renderer)
|
|||||||
m_Renderer = renderer;
|
m_Renderer = renderer;
|
||||||
|
|
||||||
m_ScreenQuad = ResourceManager::Load<Model>("Models/Core/ScreenQuad.mesh");
|
m_ScreenQuad = ResourceManager::Load<Model>("Models/Core/ScreenQuad.mesh");
|
||||||
m_Exposure = 0.4; //TODO: Renderer: Fixa så att denna går att ändra på genom komponent eller setting.
|
|
||||||
|
//m_Exposure = 0.4; //TODO: Renderer: Fixa så att denna går att ändra på genom komponent eller setting.
|
||||||
|
|
||||||
InitializeShaderPrograms();
|
InitializeShaderPrograms();
|
||||||
}
|
}
|
||||||
@@ -19,15 +20,16 @@ void DrawColorCorrectionPass::InitializeShaderPrograms()
|
|||||||
m_ColorCorrectionProgram->Link();
|
m_ColorCorrectionProgram->Link();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawColorCorrectionPass::Draw(GLuint sceneTexture, GLuint bloomTexture)
|
void DrawColorCorrectionPass::Draw(GLuint sceneTexture, GLuint bloomTexture, GLfloat gamma, GLfloat exposure)
|
||||||
{
|
{
|
||||||
//glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
//glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||||
GLERROR("DrawScreenQuadPass::Draw: Pre");
|
GLERROR("DrawScreenQuadPass::Draw: Pre");
|
||||||
|
|
||||||
DrawScreenQuadPassState state = DrawScreenQuadPassState();
|
DrawScreenQuadPassState state = DrawScreenQuadPassState();
|
||||||
m_ColorCorrectionProgram->Bind();
|
m_ColorCorrectionProgram->Bind();
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
//glClear(GL_COLOR_BUFFER_BIT);
|
||||||
glUniform1f(glGetUniformLocation(m_ColorCorrectionProgram->GetHandle(), "Exposure"), m_Exposure);
|
glUniform1f(glGetUniformLocation(m_ColorCorrectionProgram->GetHandle(), "Exposure"), exposure);
|
||||||
|
glUniform1f(glGetUniformLocation(m_ColorCorrectionProgram->GetHandle(), "Gamma"), gamma);
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
glBindTexture(GL_TEXTURE_2D, sceneTexture);
|
glBindTexture(GL_TEXTURE_2D, sceneTexture);
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ void DrawFinalPass::InitializeShaderPrograms()
|
|||||||
m_ForwardPlusProgram->BindFragDataLocation(0, "sceneColor");
|
m_ForwardPlusProgram->BindFragDataLocation(0, "sceneColor");
|
||||||
m_ForwardPlusProgram->BindFragDataLocation(1, "bloomColor");
|
m_ForwardPlusProgram->BindFragDataLocation(1, "bloomColor");
|
||||||
m_ForwardPlusProgram->Link();
|
m_ForwardPlusProgram->Link();
|
||||||
|
GLERROR("Creating forward+ program");
|
||||||
|
|
||||||
m_ExplosionEffectProgram = ResourceManager::Load<ShaderProgram>("#ExplosionEffectProgram");
|
m_ExplosionEffectProgram = ResourceManager::Load<ShaderProgram>("#ExplosionEffectProgram");
|
||||||
m_ExplosionEffectProgram->AddShader(std::shared_ptr<Shader>(new VertexShader("Shaders/ForwardPlus.vert.glsl")));
|
m_ExplosionEffectProgram->AddShader(std::shared_ptr<Shader>(new VertexShader("Shaders/ForwardPlus.vert.glsl")));
|
||||||
@@ -53,11 +54,12 @@ void DrawFinalPass::InitializeShaderPrograms()
|
|||||||
m_ExplosionEffectProgram->BindFragDataLocation(0, "sceneColor");
|
m_ExplosionEffectProgram->BindFragDataLocation(0, "sceneColor");
|
||||||
m_ExplosionEffectProgram->BindFragDataLocation(1, "bloomColor");
|
m_ExplosionEffectProgram->BindFragDataLocation(1, "bloomColor");
|
||||||
m_ExplosionEffectProgram->Link();
|
m_ExplosionEffectProgram->Link();
|
||||||
|
GLERROR("Creating explosion program");
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawFinalPass::Draw(RenderScene& scene)
|
void DrawFinalPass::Draw(RenderScene& scene)
|
||||||
{
|
{
|
||||||
GLERROR("DrawFinalPass::Draw: Pre");
|
GLERROR("Pre");
|
||||||
|
|
||||||
DrawFinalPassState* state = new DrawFinalPassState(m_FinalPassFrameBuffer.GetHandle());
|
DrawFinalPassState* state = new DrawFinalPassState(m_FinalPassFrameBuffer.GetHandle());
|
||||||
if (scene.ClearDepth) {
|
if (scene.ClearDepth) {
|
||||||
@@ -65,12 +67,12 @@ void DrawFinalPass::Draw(RenderScene& scene)
|
|||||||
}
|
}
|
||||||
|
|
||||||
DrawModelRenderQueues(scene.OpaqueObjects, scene);
|
DrawModelRenderQueues(scene.OpaqueObjects, scene);
|
||||||
GLERROR("DrawFinalPass::Draw: OpaqueObjects");
|
GLERROR("OpaqueObjects");
|
||||||
DrawModelRenderQueues(scene.TransparentObjects, scene);
|
DrawModelRenderQueues(scene.TransparentObjects, scene);
|
||||||
GLERROR("DrawFinalPass::Draw: TransparentObjects");
|
GLERROR("TransparentObjects");
|
||||||
|
|
||||||
GLERROR("DrawFinalPass::Draw: END");
|
|
||||||
delete state;
|
delete state;
|
||||||
|
GLERROR("END");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -111,7 +113,9 @@ void DrawFinalPass::GenerateMipMapTexture(GLuint* texture, GLenum wrapping, glm:
|
|||||||
void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>& job, RenderScene& scene)
|
void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>& job, RenderScene& scene)
|
||||||
{
|
{
|
||||||
GLuint forwardHandle = m_ForwardPlusProgram->GetHandle();
|
GLuint forwardHandle = m_ForwardPlusProgram->GetHandle();
|
||||||
|
GLERROR("forwardHandle");
|
||||||
GLuint explosionHandle = m_ExplosionEffectProgram->GetHandle();
|
GLuint explosionHandle = m_ExplosionEffectProgram->GetHandle();
|
||||||
|
GLERROR("explosionHandle");
|
||||||
|
|
||||||
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 1, m_LightCullingPass->LightSSBO());
|
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 1, m_LightCullingPass->LightSSBO());
|
||||||
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 2, m_LightCullingPass->LightGridSSBO());
|
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 2, m_LightCullingPass->LightGridSSBO());
|
||||||
@@ -122,10 +126,21 @@ void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>&
|
|||||||
auto explosionEffectJob = std::dynamic_pointer_cast<ExplosionEffectJob>(job);
|
auto explosionEffectJob = std::dynamic_pointer_cast<ExplosionEffectJob>(job);
|
||||||
if(explosionEffectJob) {
|
if(explosionEffectJob) {
|
||||||
//Bind program
|
//Bind program
|
||||||
|
if(GLERROR("Prebind")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
m_ExplosionEffectProgram->Bind();
|
m_ExplosionEffectProgram->Bind();
|
||||||
|
if(GLERROR("BindProgram")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
glDisable(GL_CULL_FACE);
|
||||||
|
|
||||||
//Bind uniforms
|
//Bind uniforms
|
||||||
BindExplosionUniforms(explosionHandle, explosionEffectJob, scene);
|
BindExplosionUniforms(explosionHandle, explosionEffectJob, scene);
|
||||||
|
if(GLERROR("BindExplosionUniforms")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (explosionEffectJob->Model->m_RawModel->m_Skeleton != nullptr) {
|
if (explosionEffectJob->Model->m_RawModel->m_Skeleton != nullptr) {
|
||||||
|
|
||||||
@@ -134,13 +149,23 @@ void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>&
|
|||||||
glUniformMatrix4fv(glGetUniformLocation(explosionHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
glUniformMatrix4fv(glGetUniformLocation(explosionHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(GLERROR("Animation")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
//bind textures
|
//bind textures
|
||||||
BindExplosionTextures(explosionEffectJob);
|
BindExplosionTextures(explosionEffectJob);
|
||||||
|
if(GLERROR("BindExplosionTextures")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
//draw
|
//draw
|
||||||
glBindVertexArray(explosionEffectJob->Model->VAO);
|
glBindVertexArray(explosionEffectJob->Model->VAO);
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, explosionEffectJob->Model->ElementBuffer);
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, explosionEffectJob->Model->ElementBuffer);
|
||||||
glDrawElements(GL_TRIANGLES, explosionEffectJob->EndIndex - explosionEffectJob->StartIndex + 1, GL_UNSIGNED_INT, (void*)(explosionEffectJob->StartIndex*sizeof(unsigned int)));
|
glDrawElements(GL_TRIANGLES, explosionEffectJob->EndIndex - explosionEffectJob->StartIndex + 1, GL_UNSIGNED_INT, (void*)(explosionEffectJob->StartIndex*sizeof(unsigned int)));
|
||||||
|
glEnable(GL_CULL_FACE);
|
||||||
|
if(GLERROR("explosion effect end")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
auto modelJob = std::dynamic_pointer_cast<ModelJob>(job);
|
auto modelJob = std::dynamic_pointer_cast<ModelJob>(job);
|
||||||
@@ -167,7 +192,9 @@ void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>&
|
|||||||
glBindVertexArray(modelJob->Model->VAO);
|
glBindVertexArray(modelJob->Model->VAO);
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, modelJob->Model->ElementBuffer);
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, modelJob->Model->ElementBuffer);
|
||||||
glDrawElements(GL_TRIANGLES, modelJob->EndIndex - modelJob->StartIndex + 1, GL_UNSIGNED_INT, (void*)(modelJob->StartIndex*sizeof(unsigned int)));
|
glDrawElements(GL_TRIANGLES, modelJob->EndIndex - modelJob->StartIndex + 1, GL_UNSIGNED_INT, (void*)(modelJob->StartIndex*sizeof(unsigned int)));
|
||||||
GLERROR("DrawFinalPass::Model: END");
|
if(GLERROR("models end")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -176,36 +203,46 @@ void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>&
|
|||||||
|
|
||||||
void DrawFinalPass::BindExplosionUniforms(GLuint shaderHandle, std::shared_ptr<ExplosionEffectJob>& job, RenderScene& scene)
|
void DrawFinalPass::BindExplosionUniforms(GLuint shaderHandle, std::shared_ptr<ExplosionEffectJob>& job, RenderScene& scene)
|
||||||
{
|
{
|
||||||
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(job->Matrix));
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||||
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()));
|
||||||
|
|
||||||
glUniform2f(glGetUniformLocation(shaderHandle, "ScreenDimensions"), m_Renderer->Resolution().Width, m_Renderer->Resolution().Height);
|
glUniform2f(glGetUniformLocation(shaderHandle, "ScreenDimensions"), m_Renderer->Resolution().Width, m_Renderer->Resolution().Height);
|
||||||
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(job->Matrix));
|
|
||||||
glUniform4fv(glGetUniformLocation(shaderHandle, "Color"), 1, glm::value_ptr(job->Color));
|
|
||||||
glUniform3fv(glGetUniformLocation(shaderHandle, "ExplosionOrigin"), 1, glm::value_ptr(job->ExplosionOrigin));
|
glUniform3fv(glGetUniformLocation(shaderHandle, "ExplosionOrigin"), 1, glm::value_ptr(job->ExplosionOrigin));
|
||||||
glUniform1f(glGetUniformLocation(shaderHandle, "TimeSinceDeath"), job->TimeSinceDeath);
|
glUniform1f(glGetUniformLocation(shaderHandle, "TimeSinceDeath"), job->TimeSinceDeath);
|
||||||
glUniform1f(glGetUniformLocation(shaderHandle, "ExplosionDuration"), job->ExplosionDuration);
|
glUniform1f(glGetUniformLocation(shaderHandle, "ExplosionDuration"), job->ExplosionDuration);
|
||||||
glUniform4fv(glGetUniformLocation(shaderHandle, "EndColor"), 1, glm::value_ptr(job->EndColor));
|
glUniform4fv(glGetUniformLocation(shaderHandle, "EndColor"), 1, glm::value_ptr(job->EndColor));
|
||||||
glUniform1i(glGetUniformLocation(shaderHandle, "Randomness"), job->Randomness);
|
glUniform1i(glGetUniformLocation(shaderHandle, "Randomness"), job->Randomness);
|
||||||
|
glUniform1fv(glGetUniformLocation(shaderHandle, "RandomNumbers"), 50, job->RandomNumbers.data());
|
||||||
glUniform1f(glGetUniformLocation(shaderHandle, "RandomnessScalar"), job->RandomnessScalar);
|
glUniform1f(glGetUniformLocation(shaderHandle, "RandomnessScalar"), job->RandomnessScalar);
|
||||||
glUniform2fv(glGetUniformLocation(shaderHandle, "Velocity"), 1, glm::value_ptr(job->Velocity));
|
glUniform2fv(glGetUniformLocation(shaderHandle, "Velocity"), 1, glm::value_ptr(job->Velocity));
|
||||||
glUniform1i(glGetUniformLocation(shaderHandle, "ColorByDistance"), job->ColorByDistance);
|
glUniform1i(glGetUniformLocation(shaderHandle, "ColorByDistance"), job->ColorByDistance);
|
||||||
glUniform1i(glGetUniformLocation(shaderHandle, "ExponentialAccelaration"), job->ExponentialAccelaration);
|
glUniform1i(glGetUniformLocation(shaderHandle, "ExponentialAccelaration"), job->ExponentialAccelaration);
|
||||||
glUniform4fv(glGetUniformLocation(shaderHandle, "DiffuseColor"), 1, glm::value_ptr(job->DiffuseColor));
|
|
||||||
glUniform1fv(glGetUniformLocation(shaderHandle, "RandomNumbers"), 50, job->RandomNumbers.data());
|
|
||||||
}
|
|
||||||
|
|
||||||
void DrawFinalPass::BindModelUniforms(GLuint shaderHandle, std::shared_ptr<ModelJob>& job, RenderScene& scene)
|
|
||||||
{
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
|
||||||
glUniform2f(glGetUniformLocation(shaderHandle, "ScreenDimensions"), m_Renderer->Resolution().Width, m_Renderer->Resolution().Height);
|
|
||||||
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(job->Matrix));
|
|
||||||
glUniform4fv(glGetUniformLocation(shaderHandle, "Color"), 1, glm::value_ptr(job->Color));
|
glUniform4fv(glGetUniformLocation(shaderHandle, "Color"), 1, glm::value_ptr(job->Color));
|
||||||
glUniform4fv(glGetUniformLocation(shaderHandle, "DiffuseColor"), 1, glm::value_ptr(job->DiffuseColor));
|
glUniform4fv(glGetUniformLocation(shaderHandle, "DiffuseColor"), 1, glm::value_ptr(job->DiffuseColor));
|
||||||
glUniform4fv(glGetUniformLocation(shaderHandle, "FillColor"), 1, glm::value_ptr(job->FillColor));
|
glUniform4fv(glGetUniformLocation(shaderHandle, "FillColor"), 1, glm::value_ptr(job->FillColor));
|
||||||
glUniform1f(glGetUniformLocation(shaderHandle, "FillPercentage"), job->FillPercentage);
|
glUniform1f(glGetUniformLocation(shaderHandle, "FillPercentage"), job->FillPercentage);
|
||||||
|
glUniform4fv(glGetUniformLocation(shaderHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||||
|
GLERROR("END");
|
||||||
|
}
|
||||||
|
|
||||||
|
void DrawFinalPass::BindModelUniforms(GLuint shaderHandle, std::shared_ptr<ModelJob>& job, RenderScene& scene)
|
||||||
|
{
|
||||||
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(job->Matrix));
|
||||||
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||||
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||||
|
|
||||||
|
glUniform2f(glGetUniformLocation(shaderHandle, "ScreenDimensions"), m_Renderer->Resolution().Width, m_Renderer->Resolution().Height);
|
||||||
|
|
||||||
|
glUniform4fv(glGetUniformLocation(shaderHandle, "Color"), 1, glm::value_ptr(job->Color));
|
||||||
|
glUniform4fv(glGetUniformLocation(shaderHandle, "DiffuseColor"), 1, glm::value_ptr(job->DiffuseColor));
|
||||||
|
glUniform4fv(glGetUniformLocation(shaderHandle, "FillColor"), 1, glm::value_ptr(job->FillColor));
|
||||||
|
glUniform1f(glGetUniformLocation(shaderHandle, "FillPercentage"), job->FillPercentage);
|
||||||
|
glUniform4fv(glGetUniformLocation(shaderHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||||
|
|
||||||
|
GLERROR("END");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -217,7 +254,22 @@ void DrawFinalPass::BindExplosionTextures(std::shared_ptr<ExplosionEffectJob>& j
|
|||||||
} else {
|
} else {
|
||||||
glBindTexture(GL_TEXTURE_2D, m_WhiteTexture->m_Texture);
|
glBindTexture(GL_TEXTURE_2D, m_WhiteTexture->m_Texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE1);
|
glActiveTexture(GL_TEXTURE1);
|
||||||
|
if (job->NormalTexture != nullptr) {
|
||||||
|
glBindTexture(GL_TEXTURE_2D, job->NormalTexture->m_Texture);
|
||||||
|
} else {
|
||||||
|
glBindTexture(GL_TEXTURE_2D, m_NeutralNormalTexture->m_Texture);
|
||||||
|
}
|
||||||
|
|
||||||
|
glActiveTexture(GL_TEXTURE2);
|
||||||
|
if (job->SpecularTexture != nullptr) {
|
||||||
|
glBindTexture(GL_TEXTURE_2D, job->SpecularTexture->m_Texture);
|
||||||
|
} else {
|
||||||
|
glBindTexture(GL_TEXTURE_2D, m_GreyTexture->m_Texture);
|
||||||
|
}
|
||||||
|
|
||||||
|
glActiveTexture(GL_TEXTURE3);
|
||||||
if (job->IncandescenceTexture != nullptr) {
|
if (job->IncandescenceTexture != nullptr) {
|
||||||
glBindTexture(GL_TEXTURE_2D, job->IncandescenceTexture->m_Texture);
|
glBindTexture(GL_TEXTURE_2D, job->IncandescenceTexture->m_Texture);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -54,13 +54,6 @@ void FrameBuffer::Generate()
|
|||||||
case GL_RENDERBUFFER:
|
case GL_RENDERBUFFER:
|
||||||
glFramebufferRenderbuffer(GL_FRAMEBUFFER, (*it)->m_Attachment, (*it)->m_ResourceType, *(*it)->m_ResourceHandle);
|
glFramebufferRenderbuffer(GL_FRAMEBUFFER, (*it)->m_Attachment, (*it)->m_ResourceType, *(*it)->m_ResourceHandle);
|
||||||
GLERROR("FrameBuffer generate: glFramebufferRenderbuffer");
|
GLERROR("FrameBuffer generate: glFramebufferRenderbuffer");
|
||||||
if ( (*it)->m_Attachment != GL_COLOR_ATTACHMENT0 ||
|
|
||||||
(*it)->m_Attachment != GL_COLOR_ATTACHMENT1 ||
|
|
||||||
(*it)->m_Attachment != GL_DEPTH_ATTACHMENT ||
|
|
||||||
(*it)->m_Attachment != GL_STENCIL_ATTACHMENT) //TODO: Viktor: Fixa detta
|
|
||||||
{
|
|
||||||
LOG_ERROR("RenderBuffer Attachment not valid.");
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -75,9 +75,9 @@ void PickingPass::Draw(RenderScene& scene)
|
|||||||
m_EntityColors[std::make_tuple(pickInfo.Entity, pickInfo.World, pickInfo.Camera)] = glm::ivec2(pickColor[0], pickColor[1]);
|
m_EntityColors[std::make_tuple(pickInfo.Entity, pickInfo.World, pickInfo.Camera)] = glm::ivec2(pickColor[0], pickColor[1]);
|
||||||
if (m_ColorCounter[0] > 255) {
|
if (m_ColorCounter[0] > 255) {
|
||||||
m_ColorCounter[0] = 0;
|
m_ColorCounter[0] = 0;
|
||||||
m_ColorCounter[1] += 5;
|
m_ColorCounter[1] += 1;
|
||||||
} else {
|
} else {
|
||||||
m_ColorCounter[0] += 50;
|
m_ColorCounter[0] += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,9 +121,9 @@ void PickingPass::Draw(RenderScene& scene)
|
|||||||
m_EntityColors[std::make_tuple(pickInfo.Entity, pickInfo.World, pickInfo.Camera)] = glm::ivec2(pickColor[0], pickColor[1]);
|
m_EntityColors[std::make_tuple(pickInfo.Entity, pickInfo.World, pickInfo.Camera)] = glm::ivec2(pickColor[0], pickColor[1]);
|
||||||
if (m_ColorCounter[0] > 255) {
|
if (m_ColorCounter[0] > 255) {
|
||||||
m_ColorCounter[0] = 0;
|
m_ColorCounter[0] = 0;
|
||||||
m_ColorCounter[1] += 5;
|
m_ColorCounter[1] += 1;
|
||||||
} else {
|
} else {
|
||||||
m_ColorCounter[0] += 50;
|
m_ColorCounter[0] += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -240,10 +240,17 @@ void RenderSystem::Update(double dt)
|
|||||||
m_Camera->SetOrientation(Transform::AbsoluteOrientation(m_CurrentCamera));
|
m_Camera->SetOrientation(Transform::AbsoluteOrientation(m_CurrentCamera));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RenderScene scene;
|
RenderScene scene;
|
||||||
scene.Camera = m_Camera;
|
scene.Camera = m_Camera;
|
||||||
scene.Viewport = Rectangle(1280, 720);
|
scene.Viewport = Rectangle(1280, 720);
|
||||||
|
|
||||||
|
auto cSceneLight = m_World->GetComponents("SceneLight");
|
||||||
|
if (cSceneLight != nullptr && cSceneLight->begin() != cSceneLight->end()) {
|
||||||
|
m_RenderFrame->Gamma = (double)(*cSceneLight->begin())["Gamma"];
|
||||||
|
m_RenderFrame->Exposure = (double)(*cSceneLight->begin())["Exposure"];
|
||||||
|
scene.AmbientColor = (glm::vec4)(*cSceneLight->begin())["AmbientColor"];
|
||||||
|
}
|
||||||
|
|
||||||
fillModels(scene.OpaqueObjects, scene.TransparentObjects);
|
fillModels(scene.OpaqueObjects, scene.TransparentObjects);
|
||||||
fillPointLights(scene.PointLightJobs, m_World);
|
fillPointLights(scene.PointLightJobs, m_World);
|
||||||
fillDirectionalLights(scene.DirectionalLightJobs, m_World);
|
fillDirectionalLights(scene.DirectionalLightJobs, m_World);
|
||||||
|
|||||||
@@ -119,8 +119,8 @@ void Renderer::Draw(RenderFrame& frame)
|
|||||||
|
|
||||||
}
|
}
|
||||||
m_DrawBloomPass->Draw(m_DrawFinalPass->BloomTexture());
|
m_DrawBloomPass->Draw(m_DrawFinalPass->BloomTexture());
|
||||||
if(m_DebugTextureToDraw == 0) {
|
if (m_DebugTextureToDraw == 0) {
|
||||||
m_DrawColorCorrectionPass->Draw(m_DrawFinalPass->SceneTexture(), m_DrawBloomPass->GaussianTexture());
|
m_DrawColorCorrectionPass->Draw(m_DrawFinalPass->SceneTexture(), m_DrawBloomPass->GaussianTexture(), frame.Gamma, frame.Exposure);
|
||||||
}
|
}
|
||||||
if (m_DebugTextureToDraw == 1) {
|
if (m_DebugTextureToDraw == 1) {
|
||||||
m_DrawScreenQuadPass->Draw(m_DrawFinalPass->SceneTexture());
|
m_DrawScreenQuadPass->Draw(m_DrawFinalPass->SceneTexture());
|
||||||
|
|||||||
+5
-2
@@ -74,6 +74,7 @@ Game::Game(int argc, char* argv[])
|
|||||||
|
|
||||||
// Create Octrees
|
// Create Octrees
|
||||||
m_OctreeCollision = new Octree<EntityAABB>(AABB(glm::vec3(-100), glm::vec3(100)), 4);
|
m_OctreeCollision = new Octree<EntityAABB>(AABB(glm::vec3(-100), glm::vec3(100)), 4);
|
||||||
|
m_OctreeTrigger = new Octree<EntityAABB>(AABB(glm::vec3(-100), glm::vec3(100)), 4);
|
||||||
m_OctreeFrustrumCulling = new Octree<EntityAABB>(AABB(glm::vec3(-100), glm::vec3(100)), 4);
|
m_OctreeFrustrumCulling = new Octree<EntityAABB>(AABB(glm::vec3(-100), glm::vec3(100)), 4);
|
||||||
// Create system pipeline
|
// Create system pipeline
|
||||||
m_SystemPipeline = new SystemPipeline(m_World, m_EventBroker);
|
m_SystemPipeline = new SystemPipeline(m_World, m_EventBroker);
|
||||||
@@ -92,14 +93,15 @@ Game::Game(int argc, char* argv[])
|
|||||||
m_SystemPipeline->AddSystem<CapturePointSystem>(updateOrderLevel);
|
m_SystemPipeline->AddSystem<CapturePointSystem>(updateOrderLevel);
|
||||||
// Populate Octree with collidables
|
// Populate Octree with collidables
|
||||||
++updateOrderLevel;
|
++updateOrderLevel;
|
||||||
m_SystemPipeline->AddSystem<CollidableOctreeSystem>(updateOrderLevel, m_OctreeCollision);
|
m_SystemPipeline->AddSystem<CollidableOctreeSystem>(updateOrderLevel, m_OctreeCollision, "Collidable");
|
||||||
|
m_SystemPipeline->AddSystem<CollidableOctreeSystem>(updateOrderLevel, m_OctreeTrigger, "Player");
|
||||||
m_SystemPipeline->AddSystem<PlayerHUD>(updateOrderLevel);
|
m_SystemPipeline->AddSystem<PlayerHUD>(updateOrderLevel);
|
||||||
m_SystemPipeline->AddSystem<AnimationSystem>(updateOrderLevel);
|
m_SystemPipeline->AddSystem<AnimationSystem>(updateOrderLevel);
|
||||||
|
|
||||||
// Collision and TriggerSystem should update after player.
|
// Collision and TriggerSystem should update after player.
|
||||||
++updateOrderLevel;
|
++updateOrderLevel;
|
||||||
m_SystemPipeline->AddSystem<CollisionSystem>(updateOrderLevel, m_OctreeCollision);
|
m_SystemPipeline->AddSystem<CollisionSystem>(updateOrderLevel, m_OctreeCollision);
|
||||||
m_SystemPipeline->AddSystem<TriggerSystem>(updateOrderLevel, m_OctreeCollision);
|
m_SystemPipeline->AddSystem<TriggerSystem>(updateOrderLevel, m_OctreeTrigger);
|
||||||
++updateOrderLevel;
|
++updateOrderLevel;
|
||||||
m_SystemPipeline->AddSystem<RenderSystem>(updateOrderLevel, m_Renderer, m_RenderFrame);
|
m_SystemPipeline->AddSystem<RenderSystem>(updateOrderLevel, m_Renderer, m_RenderFrame);
|
||||||
++updateOrderLevel;
|
++updateOrderLevel;
|
||||||
@@ -123,6 +125,7 @@ Game::~Game()
|
|||||||
delete m_SoundSystem;
|
delete m_SoundSystem;
|
||||||
delete m_OctreeFrustrumCulling;
|
delete m_OctreeFrustrumCulling;
|
||||||
delete m_OctreeCollision;
|
delete m_OctreeCollision;
|
||||||
|
delete m_OctreeTrigger;
|
||||||
delete m_World;
|
delete m_World;
|
||||||
delete m_FrameStack;
|
delete m_FrameStack;
|
||||||
delete m_InputProxy;
|
delete m_InputProxy;
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ void CapturePointSystem::UpdateComponent(EntityWrapper& capturePointEntity, Comp
|
|||||||
nextPossibleCapturePoint["Blue"] = -1;
|
nextPossibleCapturePoint["Blue"] = -1;
|
||||||
for (int i = 0; i < m_NumberOfCapturePoints; i++)
|
for (int i = 0; i < m_NumberOfCapturePoints; i++)
|
||||||
{
|
{
|
||||||
if (m_CapturePointNumberToEntityMap[i].HasComponent("Team")) {
|
if (!m_CapturePointNumberToEntityMap[i].HasComponent("Team")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ComponentWrapper& capturePointOwnedBy = m_CapturePointNumberToEntityMap[i]["Team"];
|
ComponentWrapper& capturePointOwnedBy = m_CapturePointNumberToEntityMap[i]["Team"];
|
||||||
@@ -119,6 +119,7 @@ void CapturePointSystem::UpdateComponent(EntityWrapper& capturePointEntity, Comp
|
|||||||
if (std::get<1>(triggerTouched) == capturePointEntity) {
|
if (std::get<1>(triggerTouched) == capturePointEntity) {
|
||||||
//some player has touched this - lets figure out: what team, health
|
//some player has touched this - lets figure out: what team, health
|
||||||
EntityWrapper player = std::get<0>(triggerTouched);
|
EntityWrapper player = std::get<0>(triggerTouched);
|
||||||
|
//check if its really a player that has triggered the touch
|
||||||
if (!player.HasComponent("Player")) {
|
if (!player.HasComponent("Player")) {
|
||||||
//if a non-player has entered the capturePoint, just erase that event and continue
|
//if a non-player has entered the capturePoint, just erase that event and continue
|
||||||
m_ETriggerTouchVector.erase(m_ETriggerTouchVector.begin() + i - 1);
|
m_ETriggerTouchVector.erase(m_ETriggerTouchVector.begin() + i - 1);
|
||||||
|
|||||||
@@ -76,7 +76,13 @@ void PlayerMovementSystem::Update(double dt)
|
|||||||
ImGui::Text("velocity: (%f, %f, %f) |%f|", velocity.x, velocity.y, velocity.z, glm::length(velocity));
|
ImGui::Text("velocity: (%f, %f, %f) |%f|", velocity.x, velocity.y, velocity.z, glm::length(velocity));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (controller->Jumping() && !controller->Crouching() && velocity.y == 0.f) {
|
if (controller->Jumping() && !controller->Crouching() && (velocity.y == 0.f || !controller->DoubleJumping())) {
|
||||||
|
if (velocity.y == 0.f) {
|
||||||
|
controller->SetDoubleJumping(false);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
controller->SetDoubleJumping(true);
|
||||||
|
}
|
||||||
velocity.y += 4.f;
|
velocity.y += 4.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user