Merge branch 'master' into Menu
This commit is contained in:
+1
-1
Submodule assets updated: 2bf82ffb6e...3af64d8b1f
@@ -23,7 +23,7 @@ struct EntityWrapper
|
||||
|
||||
static const EntityWrapper Invalid;
|
||||
|
||||
const std::string Name();
|
||||
const std::string Name() const;
|
||||
bool HasComponent(const std::string& componentType);
|
||||
void AttachComponent(const char* componentName);
|
||||
EntityWrapper Parent();
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "../Game/Events/EDashAbility.h"
|
||||
#include "InputHandler.h"
|
||||
#include "Rendering/EAutoAnimationBlend.h"
|
||||
#include "Rendering/ESetBlendWeight.h"
|
||||
|
||||
template <typename EventContext>
|
||||
class FirstPersonInputController : public InputController<EventContext>
|
||||
@@ -45,7 +46,6 @@ protected:
|
||||
bool m_Crouching = false;
|
||||
//assault dash membervariables - needed to calculate the doubletap- and dashlogic
|
||||
double m_AssaultDashDoubleTapDeltaTime = 0.0;
|
||||
double m_DashEffectResetTimer = 0.0;
|
||||
//i will let m_AssaultDashDoubleTapSensitivityTimer stay hardcoded, its not really a gamevariable (more an inputvariable),
|
||||
//and its very unlikely that someone wants to change that value
|
||||
const float m_AssaultDashDoubleTapSensitivityTimer = 0.25f;
|
||||
@@ -110,7 +110,6 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
|
||||
if (e.Command == "Pitch") {
|
||||
float val = glm::radians(e.Value);
|
||||
m_Rotation.x += -val;
|
||||
//m_Rotation.x = glm::clamp(m_Rotation.x, -glm::half_pi<float>(), glm::half_pi<float>());
|
||||
}
|
||||
|
||||
if (e.Command == "Yaw") {
|
||||
@@ -123,22 +122,11 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
|
||||
float val = glm::clamp(e.Value, -1.f, 1.f);
|
||||
m_Movement.z = -val;
|
||||
|
||||
//Animation
|
||||
if (m_PlayerEntity.Valid()) {
|
||||
EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel");
|
||||
if (playerModel.Valid()) {
|
||||
if (val > 0) {
|
||||
Events::AutoAnimationBlend aeb;
|
||||
aeb.Duration = 0.1;
|
||||
|
||||
if(m_Crouching) {
|
||||
aeb.NodeName = "Walk";
|
||||
} else {
|
||||
aeb.NodeName = "Run";
|
||||
}
|
||||
aeb.RootNode = playerModel;
|
||||
aeb.Start = true;
|
||||
m_EventBroker->Publish(aeb);
|
||||
} else if (val < 0) {
|
||||
if (val > 0) { // Walk/Run
|
||||
Events::AutoAnimationBlend aeb;
|
||||
aeb.Duration = 0.1;
|
||||
if (m_Crouching) {
|
||||
@@ -148,10 +136,46 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
|
||||
}
|
||||
aeb.RootNode = playerModel;
|
||||
aeb.Start = true;
|
||||
aeb.SingleLevelBlend = true;
|
||||
m_EventBroker->Publish(aeb);
|
||||
} else if (val < 0) { // Walk/run Backwards
|
||||
Events::AutoAnimationBlend aeb;
|
||||
aeb.Duration = 0.1;
|
||||
if (m_Crouching) {
|
||||
aeb.NodeName = "Walk";
|
||||
} else {
|
||||
aeb.NodeName = "Run";
|
||||
}
|
||||
aeb.RootNode = playerModel;
|
||||
aeb.Start = true;
|
||||
aeb.SingleLevelBlend = true;
|
||||
aeb.Reverse = true;
|
||||
m_EventBroker->Publish(aeb);
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
EntityWrapper firstPersonModel = m_PlayerEntity.FirstChildByName("Hands");
|
||||
if (firstPersonModel.Valid()) {
|
||||
if (val > 0) { // Walk/Run
|
||||
if (!m_Crouching) {
|
||||
Events::AutoAnimationBlend aeb;
|
||||
aeb.Duration = 0.1;
|
||||
aeb.NodeName = "Run";
|
||||
aeb.RootNode = firstPersonModel;
|
||||
aeb.Start = true;
|
||||
m_EventBroker->Publish(aeb);
|
||||
}
|
||||
} else if (val < 0) { // Walk/run Backwards
|
||||
if (!m_Crouching) {
|
||||
Events::AutoAnimationBlend aeb;
|
||||
aeb.Duration = 0.1;
|
||||
aeb.NodeName = "Run";
|
||||
aeb.RootNode = firstPersonModel;
|
||||
aeb.Start = true;
|
||||
aeb.Reverse = true;
|
||||
m_EventBroker->Publish(aeb);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -160,49 +184,92 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
|
||||
float val = glm::clamp(e.Value, -1.f, 1.f);
|
||||
m_Movement.x = val;
|
||||
|
||||
|
||||
//Animation
|
||||
if (m_PlayerEntity.Valid()) {
|
||||
EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel");
|
||||
|
||||
if (playerModel.Valid()) {
|
||||
if (playerModel.Valid()) { //Right Strafe
|
||||
if (val > 0) {
|
||||
Events::AutoAnimationBlend aeb;
|
||||
aeb.Duration = 0.1;
|
||||
aeb.NodeName = "Right";
|
||||
aeb.RootNode = playerModel;
|
||||
aeb.SingleLevelBlend = true;
|
||||
aeb.Start = true;
|
||||
m_EventBroker->Publish(aeb);
|
||||
} else if (val < 0) {
|
||||
} else if (val < 0) { //LeftStrafe
|
||||
Events::AutoAnimationBlend aeb;
|
||||
aeb.Duration = 0.1;
|
||||
aeb.NodeName = "Left";
|
||||
aeb.RootNode = playerModel;
|
||||
aeb.SingleLevelBlend = true;
|
||||
aeb.Start = true;
|
||||
m_EventBroker->Publish(aeb);
|
||||
} else {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (glm::length2(m_Movement) > 0) {
|
||||
m_Movement = glm::normalize(m_Movement);
|
||||
} else {
|
||||
if (m_PlayerEntity.Valid()) {
|
||||
EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel");
|
||||
|
||||
if (playerModel.Valid()) {
|
||||
Events::AutoAnimationBlend aeb;
|
||||
aeb.Duration = 0.1;
|
||||
aeb.NodeName = "Idle";
|
||||
aeb.RootNode = playerModel;
|
||||
m_EventBroker->Publish(aeb);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Animation
|
||||
if (glm::length2(m_Movement) < 0.25f) {
|
||||
//Blend to Idle
|
||||
if (m_PlayerEntity.Valid()) {
|
||||
EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel");
|
||||
if (playerModel.Valid()) {
|
||||
Events::AutoAnimationBlend aeb;
|
||||
aeb.Duration = 0.1;
|
||||
aeb.NodeName = "Idle";
|
||||
aeb.RootNode = playerModel;
|
||||
aeb.Start = true;
|
||||
m_EventBroker->Publish(aeb);
|
||||
}
|
||||
EntityWrapper firstPersonModel = m_PlayerEntity.FirstChildByName("Hands");
|
||||
if (firstPersonModel.Valid()) {
|
||||
Events::AutoAnimationBlend aeb;
|
||||
aeb.Duration = 0.1;
|
||||
aeb.NodeName = "Idle";
|
||||
aeb.RootNode = firstPersonModel;
|
||||
aeb.Start = true;
|
||||
m_EventBroker->Publish(aeb);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//Blend to movement
|
||||
if (m_PlayerEntity.Valid()) {
|
||||
EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel");
|
||||
if (playerModel.Valid()) {
|
||||
Events::AutoAnimationBlend aeb;
|
||||
aeb.Duration = 0.1;
|
||||
aeb.NodeName = "DirectionBlend";
|
||||
aeb.RootNode = playerModel;
|
||||
m_EventBroker->Publish(aeb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (glm::length2(m_Movement) > 0) {
|
||||
m_Movement = glm::normalize(m_Movement);
|
||||
|
||||
//Animation
|
||||
// movement direction blend
|
||||
if (m_PlayerEntity.Valid()) {
|
||||
EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel");
|
||||
if (playerModel.Valid()) {
|
||||
glm::vec2 direction = glm::normalize(glm::vec2(m_Movement.x, m_Movement.z));
|
||||
double weight = glm::abs(glm::dot(glm::vec2(1, 0), direction));
|
||||
Events::SetBlendWeight sbw;
|
||||
sbw.NodeName = "DirectionBlend";
|
||||
sbw.Weight = weight;
|
||||
sbw.RootNode = playerModel;
|
||||
m_EventBroker->Publish(sbw);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (e.Command == "Forward" || e.Command == "Right") {
|
||||
if (e.Value != 0) {
|
||||
m_CurrentDirectionVector = e.Command == "Right" ? (e.Value > 0 ? "Right" : "Left") : (e.Value > 0 ? "Forward" : "Backward");
|
||||
@@ -235,6 +302,8 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
|
||||
if (e.Command == "Crouch") {
|
||||
m_Crouching = e.Value > 0;
|
||||
|
||||
|
||||
//Animation
|
||||
if (m_PlayerEntity.Valid()) {
|
||||
EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel");
|
||||
if (playerModel.Valid()) {
|
||||
@@ -288,17 +357,10 @@ bool FirstPersonInputController<EventContext>::OnLockMouse(const Events::LockMou
|
||||
template <typename EventContext>
|
||||
void FirstPersonInputController<EventContext>::AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer, double& assaultDashCoolDownTimer, EntityID playerID) {
|
||||
m_AssaultDashDoubleTapDeltaTime += dt;
|
||||
m_DashEffectResetTimer += dt;
|
||||
assaultDashCoolDownTimer -= dt;
|
||||
//cooldown = assaultDashCoolDownMaxTimer sec, pretend the dash lasts 0.25 sec (for friction to do its work)
|
||||
if (assaultDashCoolDownTimer > (assaultDashCoolDownMaxTimer - 0.25f)) {
|
||||
m_PlayerIsDashing = true;
|
||||
if (m_DashEffectResetTimer > 0.05) {
|
||||
Events::DashAbility e;
|
||||
e.Player = playerID;
|
||||
m_EventBroker->Publish(e);
|
||||
m_DashEffectResetTimer = 0.0;
|
||||
}
|
||||
} else {
|
||||
m_PlayerIsDashing = false;
|
||||
}
|
||||
@@ -310,6 +372,7 @@ void FirstPersonInputController<EventContext>::AssaultDashCheck(double dt, bool
|
||||
assaultDashCoolDownTimer = assaultDashCoolDownMaxTimer;
|
||||
m_AssaultDashDoubleTapped = true;
|
||||
m_AssaultDashDoubleTapDeltaTime = 0.f;
|
||||
|
||||
Events::DashAbility e;
|
||||
e.Player = playerID;
|
||||
m_EventBroker->Publish(e);
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "Network/TCPClient.h"
|
||||
#include "Network/SnapshotDefinitions.h"
|
||||
#include "Core/World.h"
|
||||
#include "Core/EntityFile.h"
|
||||
#include "Core/EventBroker.h"
|
||||
#include "Core/ConfigFile.h"
|
||||
#include "Core/EPlayerDeath.h"
|
||||
@@ -30,7 +31,7 @@
|
||||
#include "Network/ESearchForServers.h"
|
||||
#include "../Game/Events/EDashAbility.h"
|
||||
#include "Network/EDisplayServerlist.h"
|
||||
|
||||
#include "Network/EConnectRequest.h"
|
||||
class Client : public Network
|
||||
{
|
||||
public:
|
||||
@@ -108,6 +109,8 @@ private:
|
||||
void sendLocalPlayerTransform();
|
||||
void becomePlayer();
|
||||
void displayServerlist();
|
||||
void removeWorld();
|
||||
void createMainMenu();
|
||||
// Mapping Logic
|
||||
// Returns if local EntityID exist in map
|
||||
bool clientServerMapsHasEntity(EntityID clientEntityID);
|
||||
@@ -128,6 +131,8 @@ private:
|
||||
bool OnDoubleJump(Events::DoubleJump & e);
|
||||
EventRelay<Client, Events::DashAbility> m_EDashAbility;
|
||||
bool OnDashAbility(const Events::DashAbility& e);
|
||||
EventRelay<Client, Events::ConnectRequest> m_EConnectRequest;
|
||||
bool OnConnectRequest(const Events::ConnectRequest& e);
|
||||
|
||||
bool OnSearchForServers(const Events::SearchForServers& e);
|
||||
UDPClient m_ServerlistRequest;
|
||||
|
||||
@@ -11,7 +11,7 @@ class NetworkClient
|
||||
public:
|
||||
NetworkClient();
|
||||
virtual ~NetworkClient();
|
||||
virtual void Connect(std::string playerName, std::string address, int port) = 0;
|
||||
virtual bool Connect(std::string playerName, std::string address, int port) = 0;
|
||||
virtual void Disconnect() = 0;
|
||||
virtual void Receive(Packet& packet) = 0;
|
||||
virtual void Send(Packet & packet) = 0;
|
||||
|
||||
@@ -60,6 +60,7 @@ private:
|
||||
std::vector<Events::InputCommand> m_InputCommandsToBroadcast;
|
||||
//Timers
|
||||
std::clock_t m_StartPingTime;
|
||||
std::string m_ServerName = "";
|
||||
|
||||
// Packet loss logic
|
||||
PacketID m_PacketID = 0;
|
||||
|
||||
@@ -10,7 +10,7 @@ public:
|
||||
TCPClient();
|
||||
~TCPClient();
|
||||
|
||||
void Connect(std::string playerName, std::string address, int port);
|
||||
bool Connect(std::string playerName, std::string address, int port);
|
||||
void Disconnect();
|
||||
void Receive(Packet& packet);
|
||||
void Send(Packet & packet);
|
||||
|
||||
@@ -10,7 +10,7 @@ public:
|
||||
UDPClient();
|
||||
~UDPClient();
|
||||
|
||||
void Connect(std::string playerName, std::string address, int port);
|
||||
bool Connect(std::string playerName, std::string address, int port);
|
||||
void Disconnect();
|
||||
void Receive(Packet& packet);
|
||||
void Send(Packet & packet);
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#include "../Core/EntityWrapper.h"
|
||||
#include "Rendering/AutoBlendQueue.h"
|
||||
#include "../Input/EInputCommand.h"
|
||||
#include "../Core/EEntityDeleted.h"
|
||||
#include "Rendering/ESetBlendWeight.h"
|
||||
#include "imgui/imgui.h"
|
||||
|
||||
class AnimationSystem : public ImpureSystem
|
||||
@@ -28,6 +30,13 @@ private:
|
||||
|
||||
EventRelay<AnimationSystem, Events::AutoAnimationBlend> m_EAutoAnimationBlend;
|
||||
bool OnAutoAnimationBlend(Events::AutoAnimationBlend& e);
|
||||
|
||||
EventRelay<AnimationSystem, Events::EntityDeleted> m_EEntityDeleted;
|
||||
bool OnEntityDeleted(Events::EntityDeleted& e);
|
||||
|
||||
EventRelay<AnimationSystem, Events::SetBlendWeight> m_ESetBlendWeight;
|
||||
bool OnSetBlendWeight(Events::SetBlendWeight& e);
|
||||
|
||||
std::unordered_map<EntityWrapper, AutoBlendQueue> m_AutoBlendQueues;
|
||||
};
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@ public:
|
||||
std::shared_ptr<BlendTree> GetBlendTree();
|
||||
|
||||
AutoBlendQueue::AutoBlendJob& GetActiveBlendJob();
|
||||
|
||||
bool Empty() { return m_BlendQueue.empty(); }
|
||||
private:
|
||||
std::list<AutoblendNode> m_BlendQueue;
|
||||
|
||||
|
||||
@@ -75,7 +75,6 @@ public:
|
||||
std::vector<glm::mat4> GetFinalPose() { return m_FinalPose; }
|
||||
glm::mat4 GetBoneTransform(int boneID);
|
||||
bool IsValid() { return (m_Root == nullptr ? false : true); }
|
||||
|
||||
void PrintTree();
|
||||
BlendTree::AutoBlendInfo AutoBlendStep(AutoBlendInfo blendInfo);
|
||||
|
||||
@@ -84,16 +83,20 @@ public:
|
||||
|
||||
EntityWrapper GetSubTreeRoot(std::string nodeName);
|
||||
|
||||
std::vector<EntityWrapper> GetSingleLevelRoots(std::string name);
|
||||
std::vector<EntityWrapper> GetEntitesByName(std::string name);
|
||||
|
||||
void SetWeightByName(std::string name, double weight);
|
||||
|
||||
private:
|
||||
Skeleton* m_Skeleton = nullptr;
|
||||
Node* m_Root = nullptr;
|
||||
|
||||
std::vector<glm::mat4> m_FinalPose;
|
||||
std::map<int, glm::mat4> m_FinalBoneTransforms;
|
||||
|
||||
std::vector<BlendTree::Node*> FindNodesByName(std::string name);
|
||||
std::vector<glm::mat4> AccumulateFinalPose();
|
||||
BlendTree::Node* FillTreeByName(Node* parentNode, std::string name, EntityWrapper parentEntity);
|
||||
std::vector<BlendTree::Node*> FindNodesByName(std::string name);
|
||||
|
||||
void Blend(std::map<int, Skeleton::PoseData>& pose);
|
||||
};
|
||||
|
||||
@@ -15,7 +15,7 @@ public:
|
||||
void GenerateCubeMapTexture();
|
||||
|
||||
//GLuint CubeMapTexture() const { return m_CubeMapTexture; }
|
||||
GLuint m_CubeMapTexture = -1;
|
||||
GLuint m_CubeMapTexture = 0;
|
||||
|
||||
private:
|
||||
IRenderer* m_Renderer;
|
||||
|
||||
@@ -13,7 +13,7 @@ class DrawBloomPass
|
||||
{
|
||||
public:
|
||||
DrawBloomPass(IRenderer* renderer, ConfigFile* config);
|
||||
~DrawBloomPass() { }
|
||||
~DrawBloomPass();
|
||||
void InitializeTextures();
|
||||
void InitializeFrameBuffers();
|
||||
void InitializeShaderPrograms();
|
||||
|
||||
@@ -11,13 +11,14 @@
|
||||
#include "Util/UnorderedMapVec2.h"
|
||||
#include "Util/CommonFunctions.h"
|
||||
#include "Texture.h"
|
||||
#include "ShadowPass.h"
|
||||
#include "BlurHUD.h"
|
||||
|
||||
class DrawFinalPass
|
||||
{
|
||||
public:
|
||||
DrawFinalPass(IRenderer* renderer, LightCullingPass* lightCullingPass, CubeMapPass* cubeMapPass, SSAOPass* ssaoPass);
|
||||
~DrawFinalPass() { }
|
||||
DrawFinalPass(IRenderer* renderer, LightCullingPass* lightCullingPass, CubeMapPass* cubeMapPass, SSAOPass* ssaoPass, ShadowPass* shadowPass);
|
||||
~DrawFinalPass();
|
||||
void InitializeTextures();
|
||||
void InitializeFrameBuffers();
|
||||
void InitializeShaderPrograms();
|
||||
@@ -57,11 +58,11 @@ private:
|
||||
|
||||
FrameBuffer m_FinalPassFrameBuffer;
|
||||
FrameBuffer m_ShieldDepthFrameBuffer;
|
||||
GLuint m_BloomTexture;
|
||||
GLuint m_SceneTexture;
|
||||
GLuint m_DepthBuffer;
|
||||
GLuint m_ShieldBuffer;
|
||||
GLuint m_CubeMapTexture;
|
||||
GLuint m_BloomTexture = 0;
|
||||
GLuint m_SceneTexture = 0;
|
||||
GLuint m_DepthBuffer = 0;
|
||||
GLuint m_ShieldBuffer = 0;
|
||||
GLuint m_CubeMapTexture = 0;
|
||||
GLuint m_FullBlurredTexture;
|
||||
GLuint m_CombinedTexture; //This can be removed for less memory usage, just set m_sceneTexture to the return from m_BlurHUDPass.CombineTextures
|
||||
|
||||
@@ -72,6 +73,7 @@ private:
|
||||
const LightCullingPass* m_LightCullingPass;
|
||||
const CubeMapPass* m_CubeMapPass;
|
||||
const SSAOPass* m_SSAOPass;
|
||||
const ShadowPass* m_ShadowPass;
|
||||
|
||||
ShaderProgram* m_ForwardPlusProgram;
|
||||
ShaderProgram* m_ExplosionEffectProgram;
|
||||
|
||||
@@ -18,7 +18,6 @@ struct AutoAnimationBlend : Event
|
||||
bool Reverse = false;
|
||||
bool Restart = false;
|
||||
bool SingleLevelBlend = false;
|
||||
|
||||
double Weight = -1.0;
|
||||
|
||||
EntityWrapper AnimationEntity = EntityWrapper::Invalid;
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef Events_SetBlendWeight_h__
|
||||
#define Events_SetBlendWeight_h__
|
||||
|
||||
#include "../Core/EventBroker.h"
|
||||
#include "../Core/EntityWrapper.h"
|
||||
|
||||
namespace Events
|
||||
{
|
||||
|
||||
//Sets the blend weight for all nodes with "NodeName"
|
||||
struct SetBlendWeight : Event
|
||||
{
|
||||
EntityWrapper RootNode = EntityWrapper::Invalid;
|
||||
std::string NodeName;
|
||||
double Weight;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -15,8 +15,8 @@
|
||||
|
||||
struct ExplosionEffectJob : ModelJob
|
||||
{
|
||||
ExplosionEffectJob(ComponentWrapper explosionEffectComponent, ::Model* model, Camera* camera, glm::mat4 matrix, ::RawModel::MaterialProperties matGroup, ComponentWrapper modelComponent, ::World* world, glm::vec4 fillColor, float fillPercentage, bool isShielded)
|
||||
: ModelJob(model, camera, matrix, matGroup, modelComponent, world, fillColor, fillPercentage, isShielded)
|
||||
ExplosionEffectJob(ComponentWrapper explosionEffectComponent, ::Model* model, Camera* camera, glm::mat4 matrix, ::RawModel::MaterialProperties matGroup, ComponentWrapper modelComponent, ::World* world, glm::vec4 fillColor, float fillPercentage, bool isShielded, bool shadow)
|
||||
: ModelJob(model, camera, matrix, matGroup, modelComponent, world, fillColor, fillPercentage, isShielded, shadow)
|
||||
{
|
||||
ExplosionOrigin = (glm::vec3)explosionEffectComponent["ExplosionOrigin"];
|
||||
TimeSinceDeath = (double)explosionEffectComponent["TimeSinceDeath"];
|
||||
|
||||
@@ -43,6 +43,16 @@ public:
|
||||
~RenderBuffer();
|
||||
};
|
||||
|
||||
class Texture2DArray : public ResourceType<GL_TEXTURE_2D_ARRAY>
|
||||
{
|
||||
public:
|
||||
Texture2DArray(GLuint* resourceHandle, GLenum attachment)
|
||||
: ResourceType(resourceHandle, attachment)
|
||||
{ };
|
||||
|
||||
~Texture2DArray();
|
||||
};
|
||||
|
||||
class FrameBuffer
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
struct ModelJob : RenderJob
|
||||
{
|
||||
ModelJob(Model* model, Camera* camera, glm::mat4 matrix, ::RawModel::MaterialProperties matProp, ComponentWrapper modelComponent, World* world, glm::vec4 fillColor, float fillPercentage, bool isShielded)
|
||||
ModelJob(Model* model, Camera* camera, glm::mat4 matrix, ::RawModel::MaterialProperties matProp, ComponentWrapper modelComponent, World* world, glm::vec4 fillColor, float fillPercentage, bool isShielded, bool shadow)
|
||||
: RenderJob()
|
||||
{
|
||||
Model = model;
|
||||
@@ -111,10 +111,11 @@ struct ModelJob : RenderJob
|
||||
Color = modelComponent["Color"];
|
||||
GlowIntensity = ((double)modelComponent["GlowIntensity"]);
|
||||
Entity = modelComponent.EntityID;
|
||||
glm::vec3 abspos = Transform::AbsolutePosition(world, modelComponent.EntityID);
|
||||
glm::vec3 abspos = glm::vec3(matrix[3][0], matrix[3][1], matrix[3][2]);
|
||||
glm::vec3 worldpos = glm::vec3(camera->ViewMatrix() * glm::vec4(abspos, 1));
|
||||
Depth = worldpos.z;
|
||||
World = world;
|
||||
Shadow = shadow;
|
||||
|
||||
FillColor = fillColor;
|
||||
FillPercentage = fillPercentage;
|
||||
@@ -162,9 +163,13 @@ struct ModelJob : RenderJob
|
||||
glm::vec4 FillColor = glm::vec4(0);
|
||||
float FillPercentage = 0.0;
|
||||
bool IsShielded;
|
||||
bool Shadow;
|
||||
|
||||
void CalculateHash() override
|
||||
{
|
||||
Hash = ShaderID << 20 + ModelID << 10 + TextureID;
|
||||
Hash = TextureID;
|
||||
Hash += ModelID << 10;
|
||||
Hash += ShaderID << 20;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -52,8 +52,8 @@ private:
|
||||
|
||||
std::unordered_map<glm::ivec2, PickingInfo> m_PickingColorsToEntity;
|
||||
|
||||
GLuint m_PickingTexture;
|
||||
GLuint m_DepthBuffer;
|
||||
GLuint m_PickingTexture = 0;
|
||||
GLuint m_DepthBuffer = 0;
|
||||
|
||||
FrameBuffer m_PickingBuffer;
|
||||
|
||||
|
||||
@@ -16,16 +16,15 @@ struct RenderJob
|
||||
public:
|
||||
float Depth;
|
||||
|
||||
bool operator<(const RenderJob& rhs)
|
||||
{
|
||||
return this->Hash < rhs.Hash;
|
||||
}
|
||||
|
||||
protected:
|
||||
uint64_t Hash;
|
||||
|
||||
virtual void CalculateHash() = 0;
|
||||
|
||||
bool operator<(const RenderJob& rhs)
|
||||
{
|
||||
return this->Hash < rhs.Hash;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "TextPass.h"
|
||||
#include "Util/CommonFunctions.h"
|
||||
#include "Core/PerformanceTimer.h"
|
||||
#include "ShadowPass.h"
|
||||
|
||||
class Renderer : public IRenderer
|
||||
{
|
||||
@@ -37,6 +38,7 @@ public:
|
||||
: m_EventBroker(eventBroker)
|
||||
, m_Config(config)
|
||||
{ }
|
||||
~Renderer();
|
||||
|
||||
virtual void Initialize() override;
|
||||
virtual void Update(double dt) override;
|
||||
@@ -76,6 +78,7 @@ private:
|
||||
DrawColorCorrectionPass* m_DrawColorCorrectionPass;
|
||||
SSAOPass* m_SSAOPass;
|
||||
CubeMapPass* m_CubeMapPass;
|
||||
ShadowPass* m_ShadowPass;
|
||||
BlurHUD* m_BlurHUDPass;
|
||||
|
||||
//----------------------Functions----------------------//
|
||||
|
||||
@@ -14,7 +14,7 @@ class SSAOPass
|
||||
{
|
||||
public:
|
||||
SSAOPass(IRenderer* renderer, ConfigFile* config);
|
||||
~SSAOPass() { };
|
||||
~SSAOPass();
|
||||
|
||||
void ChangeQuality(int quality);
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ public:
|
||||
std::string GetFileName() const;
|
||||
GLuint GetHandle() const;
|
||||
bool IsCompiled() const;
|
||||
static std::string ReadFile(std::string fileName);
|
||||
private:
|
||||
protected:
|
||||
GLenum m_ShaderType;
|
||||
std::string m_FileName;
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
#ifndef ShadowPass_h__
|
||||
#define ShadowPass_h__
|
||||
|
||||
#include "IRenderer.h"
|
||||
#include "FrameBuffer.h"
|
||||
#include "ShaderProgram.h"
|
||||
#include "../Core/EventBroker.h"
|
||||
#include "../Core/World.h"
|
||||
#include "ShadowPassState.h"
|
||||
#include "imgui/imgui.h"
|
||||
|
||||
#define MAX_SPLITS 4
|
||||
|
||||
enum NearFar { NEAR = 0, FAR = 1 };
|
||||
enum LRBT { LEFT = 0, RIGHT = 1, BOTTOM = 2, TOP = 3 };
|
||||
|
||||
struct ShadowFrustum
|
||||
{
|
||||
float NearClip;
|
||||
float FarClip;
|
||||
float FOV;
|
||||
float AspectRatio;
|
||||
glm::vec3 MiddlePoint;
|
||||
float Radius;
|
||||
std::array<float, 4> LRBT;
|
||||
std::array<glm::vec3, 8> CornerPoint;
|
||||
};
|
||||
|
||||
class ShadowPass
|
||||
{
|
||||
public:
|
||||
ShadowPass(IRenderer* renderer);
|
||||
ShadowPass(IRenderer * renderer, int ShadowResX, int ShadowResY);
|
||||
~ShadowPass();
|
||||
|
||||
void InitializeFrameBuffers();
|
||||
void InitializeShaderPrograms();
|
||||
void ClearBuffer();
|
||||
void Draw(RenderScene& scene);
|
||||
|
||||
void DebugGUI();
|
||||
|
||||
GLuint DepthMap() const { return m_DepthMap; }
|
||||
std::array<glm::mat4, MAX_SPLITS> LightP() const { return m_LightProjection; }
|
||||
std::array<glm::mat4, MAX_SPLITS> LightV() const { return m_LightView; }
|
||||
std::array<float, MAX_SPLITS> FarDistance() const { std::array<float, MAX_SPLITS> f; for (int i = 0; i < MAX_SPLITS; i++) f[i] = m_shadowFrusta[i].FarClip; return f; }
|
||||
int CurrentNrOfSplits() const { return m_CurrentNrOfSplits; }
|
||||
|
||||
void SetSplitWeight(float split_weight) { m_SplitWeight = split_weight; };
|
||||
private:
|
||||
void InitializeCameras(RenderScene & scene);
|
||||
void UpdateSplitDist(std::array<ShadowFrustum, MAX_SPLITS>& frusta, float near_distance, float far_distance);
|
||||
void UpdateFrustumPoints(ShadowFrustum& frustum, glm::vec3 camera_position, glm::vec3 view_dir);
|
||||
void UpdateFrustumPoints(ShadowFrustum& frustum, glm::mat4 p, glm::mat4 v);
|
||||
|
||||
void PointsToLightspace(ShadowFrustum& frustum, glm::mat4 v);
|
||||
|
||||
float FindRadius(ShadowFrustum& frustum);
|
||||
void RadiusToLightspace(ShadowFrustum& frustum);
|
||||
|
||||
EventBroker* m_EventBroker;
|
||||
const IRenderer* m_Renderer;
|
||||
|
||||
GLuint m_DepthMap;
|
||||
FrameBuffer m_DepthBuffer;
|
||||
ShaderProgram* m_ShadowProgram;
|
||||
|
||||
std::array<glm::mat4, MAX_SPLITS> m_LightProjection;
|
||||
std::array<glm::mat4, MAX_SPLITS> m_LightView;
|
||||
|
||||
GLfloat m_NearFarPlane[2] = { -34.f, 27.f };
|
||||
GLuint m_ResolutionSizeWidth = 1024 * 2;
|
||||
GLuint m_ResolutionSizeHeight = 1024 * 2;
|
||||
|
||||
bool m_TransparentObjects = false;
|
||||
bool m_TexturedShadows = false;
|
||||
bool m_EnableShadows = true;
|
||||
|
||||
int m_CurrentNrOfSplits = 4;
|
||||
float m_SplitWeight = 0.962f;
|
||||
|
||||
std::array<ShadowFrustum, MAX_SPLITS> m_shadowFrusta;
|
||||
|
||||
Texture* m_WhiteTexture = ResourceManager::Load<Texture>("Textures/Core/White.png");
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef ShadowPassState_h_
|
||||
#define ShadowPassState_h_
|
||||
|
||||
#include "Rendering/RenderState.h"
|
||||
|
||||
class ShadowPassState : public RenderState
|
||||
{
|
||||
public:
|
||||
ShadowPassState(GLuint frameBuffer);
|
||||
~ShadowPassState();
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -293,10 +293,8 @@ private:
|
||||
firstPersonWeapon = SpawnerSystem::Spawn(firstPersonAttachment, firstPersonAttachment);
|
||||
}
|
||||
}
|
||||
if (IsServer) {
|
||||
if (thirdPersonAttachment.Valid()) {
|
||||
thirdPersonWeapon = SpawnerSystem::Spawn(thirdPersonAttachment, thirdPersonAttachment);
|
||||
}
|
||||
if (thirdPersonAttachment.Valid()) {
|
||||
thirdPersonWeapon = SpawnerSystem::Spawn(thirdPersonAttachment, thirdPersonAttachment);
|
||||
}
|
||||
|
||||
WeaponInfo& wi = m_ActiveWeapons[player];
|
||||
|
||||
@@ -8,5 +8,6 @@
|
||||
<NormalMap>true</NormalMap>
|
||||
<SpecularMap>true</SpecularMap>
|
||||
<GlowMap>true</GlowMap>
|
||||
<Shadow>true</Shadow>
|
||||
<GlowIntensity>3.0</GlowIntensity>
|
||||
</Model>
|
||||
@@ -36,6 +36,9 @@
|
||||
<xs:element name="GlowIntensity" type="t:double" minOccurs="0">
|
||||
<xs:annotation><xs:documentation>Intensity of the glow map</xs:documentation></xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element name="Shadow" type="t:bool" minOccurs="0">
|
||||
<xs:annotation><xs:documentation>Whether the object cast/recieve shadows or not</xs:documentation></xs:annotation>
|
||||
</xs:element>
|
||||
</xs:all>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,17 +2,12 @@
|
||||
<Entity name="DashEffect" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||
|
||||
<Components>
|
||||
<c:Animation/>
|
||||
<c:Lifetime>
|
||||
<Lifetime>0.5</Lifetime>
|
||||
</c:Lifetime>
|
||||
<c:ExplosionEffect>
|
||||
<Velocity X="0" Y="0" Z="0"/>
|
||||
<TimeSinceDeath>0</TimeSinceDeath>
|
||||
<ExplosionDuration>0.5</ExplosionDuration>
|
||||
<EndColor A="0" B="0" G="0" R="0"/>
|
||||
</c:ExplosionEffect>
|
||||
<c:Model/>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
|
||||
<Children/>
|
||||
|
||||
</Entity>
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
<?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:Collidable/>
|
||||
<c:Model>
|
||||
<Resource>Models/Props/Bridges/SciFi_Bridge_Support_Top_Red.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="-6.44986534" Z="-6.68222857"/>
|
||||
<Scale X="1.10000002" Y="1.10000002" Z="1.10000002"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Collidable/>
|
||||
<c:Model>
|
||||
<Resource>Models/Props/Bridges/SciFi_Bridge_Support_Bot_Red.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0.215699792" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:FloatingEffect>
|
||||
<Period>12</Period>
|
||||
<Time>513.93462028501312</Time>
|
||||
<Axis X="0" Y="0.100000001" Z="0"/>
|
||||
</c:FloatingEffect>
|
||||
<c:Transform>
|
||||
<Position X="-0" Y="-0.0882625133" Z="-0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Collidable/>
|
||||
<c:Model>
|
||||
<Resource>Models/Props/Bridges/SciFi_Bridge_Support_Middle_Red.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0.121641584" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
|
||||
</Entity>
|
||||
@@ -245,6 +245,13 @@
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="Ambient">
|
||||
<Components>
|
||||
<c:SceneLight/>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
|
||||
</Entity>
|
||||
|
||||
@@ -2,64 +2,168 @@
|
||||
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||
|
||||
<Components>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0" Z="-0.313012958"/>
|
||||
</c:Transform>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
|
||||
<Children>
|
||||
<Entity>
|
||||
<Entity name="RedSpawn">
|
||||
<Components>
|
||||
<c:Camera/>
|
||||
<c:Listener/>
|
||||
<c:Team>
|
||||
<Team>
|
||||
<Red/>
|
||||
</Team>
|
||||
</c:Team>
|
||||
<c:PlayerSpawn/>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/PlayerAssaultFallbackRed.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Transform>
|
||||
<Position X="2.56531811" Y="0.637967348" Z="0.202344239"/>
|
||||
<Orientation X="2.68780756" Y="1.36143553" Z="3.14159179"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Collidable/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/Tri.obj</Resource>
|
||||
<Color A="1" B="1" G="0.392156869" R="0"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Scale X="2" Y="2" Z="0.200000003"/>
|
||||
<Orientation X="2.70100021" Y="2.37000012" Z="0.266000003"/>
|
||||
<Position X="0.300000012" Y="0.0270000007" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:SpawnPoint/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/Tri.obj</Resource>
|
||||
<Resource>Models/Characters/Assault/AssaultRed.mesh</Resource>
|
||||
<Color A="1" B="0" G="0" R="1"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Orientation X="0" Y="3.14159274" Z="4.71238899"/>
|
||||
<Position X="0.800000012" Y="0" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:SpawnPoint/>
|
||||
<c:Model>
|
||||
<Resource>Models/Characters/Assault/AssaultRed.mesh</Resource>
|
||||
<Color A="1" B="0.0117647061" G="0" R="1"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="-0.600000024" Y="0" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Entity name="DirectionalLight">
|
||||
<Components>
|
||||
<c:AABB/>
|
||||
<c:Collidable/>
|
||||
<c:SceneLight>
|
||||
<Gamma>0.5</Gamma>
|
||||
<Exposure>4</Exposure>
|
||||
</c:SceneLight>
|
||||
<c:DirectionalLight/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitCube.obj</Resource>
|
||||
<Resource>sModels/Widgets/Lights/DirectionalLightWidget.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Physics/>
|
||||
<c:Transform>
|
||||
<Position X="-1.95333278" Y="0.296304941" Z="2.56487775"/>
|
||||
<Position X="-6.00145912" Y="1.42697716" Z="3.04144025"/>
|
||||
<Orientation X="5.69400024" Y="841.179565" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="ObstacleCourse">
|
||||
<Components>
|
||||
<c:Collidable/>
|
||||
<c:Model>
|
||||
<Resource>Models/Test/ObstacleCourse.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="BlueSpawn">
|
||||
<Components>
|
||||
<c:Team>
|
||||
<Team>
|
||||
<Blue/>
|
||||
</Team>
|
||||
</c:Team>
|
||||
<c:PlayerSpawn/>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/Player.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Transform>
|
||||
<Position X="0.300000012" Y="0.0270000007" Z="6.67400026"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:SpawnPoint/>
|
||||
<c:Model>
|
||||
<Resource>Models/Characters/Assault/AssaultBlue.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.254901975" R="0"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="-0.600000024" Y="0" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:SpawnPoint/>
|
||||
<c:Model>
|
||||
<Resource>Models/Characters/Assault/AssaultBlue.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.254901975" R="0"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0.800000012" Y="0" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="Arms">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>ActivateDeactive</Pose1>
|
||||
<Pose2></Pose2>
|
||||
</c:Blend>
|
||||
<c:Model>
|
||||
<Resource>Models/Characters/Defender/FirstPersonDefenderBlue.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="1.30585015" Z="2.01450038"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="ActivateDeactive">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>ActivateDeactiveShieldF</AnimationName>
|
||||
<Time>0.68323420867830964</Time>
|
||||
<Speed>1</Speed>
|
||||
<Play>true</Play>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="Weapon">
|
||||
<Components>
|
||||
<c:BoneAttachment>
|
||||
<BoneName>R_Arm_Weapon_Joint</BoneName>
|
||||
</c:BoneAttachment>
|
||||
<c:Model>
|
||||
<Resource>Models/Weapons/Blue/DefenderWeaponBlue.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="-0.0621522591" Y="-0.169021279" Z="-0.219918266"/>
|
||||
<Orientation X="-0.709758997" Y="1.22785306" Z="-0.154755235"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
|
||||
</Entity>
|
||||
|
||||
@@ -54,7 +54,10 @@
|
||||
</Entity>
|
||||
<Entity name="DirectionalLight">
|
||||
<Components>
|
||||
<c:SceneLight/>
|
||||
<c:SceneLight>
|
||||
<Gamma>0.49999982118606567</Gamma>
|
||||
<Exposure>2.5599997043609619</Exposure>
|
||||
</c:SceneLight>
|
||||
<c:DirectionalLight/>
|
||||
<c:Model>
|
||||
<Resource>sModels/Widgets/Lights/DirectionalLightWidget.mesh</Resource>
|
||||
@@ -120,6 +123,48 @@
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="Arms">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>ActivateDeactive</Pose1>
|
||||
<Pose2></Pose2>
|
||||
</c:Blend>
|
||||
<c:Model>
|
||||
<Resource>Models/Characters/Defender/FirstPersonDefenderBlue.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="1.30585015" Z="2.01450038"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="ActivateDeactive">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>ActivateDeactiveShieldF</AnimationName>
|
||||
<Time>0.44649605185380015</Time>
|
||||
<Play>true</Play>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="Weapon">
|
||||
<Components>
|
||||
<c:BoneAttachment>
|
||||
<BoneName>R_Arm_Weapon_Joint</BoneName>
|
||||
</c:BoneAttachment>
|
||||
<c:Model>
|
||||
<Resource>Models/Weapons/Blue/DefenderWeaponBlue.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0.00681143999" Y="-0.204994932" Z="-0.209244296"/>
|
||||
<Orientation X="-0.581807375" Y="0.562133908" Z="-0.0719003305"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
|
||||
</Entity>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,6 @@
|
||||
<Entity name="PlayerAssault" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||
|
||||
<Components>
|
||||
<c:NetworkComponent/>
|
||||
<c:AABB>
|
||||
<Origin X="0" Y="0.772000015" Z="0"/>
|
||||
<Size X="1" Y="1.60000002" Z="1"/>
|
||||
@@ -22,6 +21,7 @@
|
||||
</c:DefenderWeapon>
|
||||
<c:DoubleJump/>
|
||||
<c:Health/>
|
||||
<c:NetworkComponent/>
|
||||
<c:Physics>
|
||||
<Velocity X="2.30999646e-23" Y="0" Z="1.05272533e-23"/>
|
||||
</c:Physics>
|
||||
@@ -463,7 +463,7 @@
|
||||
<Color A="1" B="0.392156869" G="0.392156869" R="0.392156869"/>
|
||||
</c:Fill>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Icons/Abilities/Superman-01.png</DiffuseTexture>
|
||||
<DiffuseTexture>Textures\Icons\Abilities\Superman-01.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
<DepthSort>false</DepthSort>
|
||||
<Color A="1" B="0.206628323" G="0.78039217" R="0.192802757"/>
|
||||
@@ -504,25 +504,25 @@
|
||||
<Children>
|
||||
<Entity name="PrimaryAttachment">
|
||||
<Components>
|
||||
<c:WeaponAttachment>
|
||||
<Weapon>AssaultWeapon</Weapon>
|
||||
</c:WeaponAttachment>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/WeaponAssaultBlueView.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Transform/>
|
||||
<c:WeaponAttachment>
|
||||
<Weapon>AssaultWeapon</Weapon>
|
||||
</c:WeaponAttachment>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="SecondaryAttachment">
|
||||
<Components>
|
||||
<c:WeaponAttachment>
|
||||
<Weapon>DefenderWeapon</Weapon>
|
||||
</c:WeaponAttachment>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/WeaponDefenderBlueView.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Transform/>
|
||||
<c:WeaponAttachment>
|
||||
<Weapon>DefenderWeapon</Weapon>
|
||||
</c:WeaponAttachment>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
@@ -566,19 +566,19 @@
|
||||
<c:BoneAttachment>
|
||||
<BoneName>R_Arm_Weapon_Joint</BoneName>
|
||||
</c:BoneAttachment>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/WeaponAssaultBlueWorld.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Transform>
|
||||
<Position X="0.17052114" Y="1.03320956" Z="-0.224843055"/>
|
||||
<Orientation X="-0.035638921" Y="-0.0872893855" Z="0.133119702"/>
|
||||
</c:Transform>
|
||||
<c:WeaponAttachment>
|
||||
<Weapon>AssaultWeapon</Weapon>
|
||||
<Person>
|
||||
<ThirdPerson/>
|
||||
</Person>
|
||||
</c:WeaponAttachment>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/WeaponAssaultBlueWorld.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Transform>
|
||||
<Position X="0.153499424" Y="1.04221034" Z="-0.231716871"/>
|
||||
<Orientation X="-0.0108785164" Y="-0.0253766086" Z="0.137640417"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
@@ -587,26 +587,26 @@
|
||||
<c:BoneAttachment>
|
||||
<BoneName>R_Arm_Weapon_Joint</BoneName>
|
||||
</c:BoneAttachment>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/SidearmWeaponWorld.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Transform>
|
||||
<Position X="0.17052114" Y="1.03320956" Z="-0.224843055"/>
|
||||
<Orientation X="-0.035638921" Y="-0.0872893855" Z="0.133119702"/>
|
||||
</c:Transform>
|
||||
<c:WeaponAttachment>
|
||||
<Weapon>SidearmWeapon</Weapon>
|
||||
<Person>
|
||||
<ThirdPerson/>
|
||||
</Person>
|
||||
</c:WeaponAttachment>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/SidearmWeaponWorld.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Transform>
|
||||
<Position X="0.153499424" Y="1.04221034" Z="-0.231716871"/>
|
||||
<Orientation X="-0.0108785164" Y="-0.0253766086" Z="0.137640417"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="BlendTreeLower">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>StandCrouchBlend</Pose1>
|
||||
<Pose1>MovementBlend</Pose1>
|
||||
<Pose2>JumpDashBlend</Pose2>
|
||||
<Weight>2.5146881298480398e-63</Weight>
|
||||
<SubTreeRoot>true</SubTreeRoot>
|
||||
@@ -628,7 +628,7 @@
|
||||
<Entity name="CrouchMovement">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>MovementBlend</Pose1>
|
||||
<Pose1>DirectionBlend</Pose1>
|
||||
<Pose2>Idle</Pose2>
|
||||
<Weight>1</Weight>
|
||||
</c:Blend>
|
||||
@@ -659,7 +659,7 @@
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>CrouchStrafeLeftF</AnimationName>
|
||||
<Time>0.15801023731376773</Time>
|
||||
<Time>0.79179726223533642</Time>
|
||||
<Play>true</Play>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
@@ -670,7 +670,7 @@
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>CrouchStrafeRightF</AnimationName>
|
||||
<Time>0.085331699264550309</Time>
|
||||
<Time>0.719118724186119</Time>
|
||||
<Play>true</Play>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
@@ -683,7 +683,7 @@
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>CrouchWalkF</AnimationName>
|
||||
<Time>0.86370568444195328</Time>
|
||||
<Time>0.49749270936352197</Time>
|
||||
<Play>true</Play>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
@@ -696,7 +696,8 @@
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>CrouchF</AnimationName>
|
||||
<Time>0.99862473341677438</Time>
|
||||
<Time>1.1707202063102131</Time>
|
||||
<Play>true</Play>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
@@ -707,7 +708,7 @@
|
||||
<Entity name="StandMovement">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>MovementBlend</Pose1>
|
||||
<Pose1>DirectionBlend</Pose1>
|
||||
<Pose2>Idle</Pose2>
|
||||
<Weight>1</Weight>
|
||||
</c:Blend>
|
||||
@@ -738,7 +739,7 @@
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>WalkF</AnimationName>
|
||||
<Time>0.36886031385172657</Time>
|
||||
<Time>0.0026473387732952602</Time>
|
||||
<Play>true</Play>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
@@ -749,7 +750,8 @@
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>RunF</AnimationName>
|
||||
<Time>0.64087381787562947</Time>
|
||||
<Time>0.60179430680919843</Time>
|
||||
<Speed>2</Speed>
|
||||
<Play>true</Play>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
@@ -772,7 +774,8 @@
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>StrafeLeftF</AnimationName>
|
||||
<Time>0.55045293488526426</Time>
|
||||
<Time>0.20450294221067544</Time>
|
||||
<Speed>2</Speed>
|
||||
<Play>true</Play>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
@@ -783,7 +786,8 @@
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>StrafeRightF</AnimationName>
|
||||
<Time>0.57396846476537888</Time>
|
||||
<Time>0.28191395104664174</Time>
|
||||
<Speed>2</Speed>
|
||||
<Play>true</Play>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
@@ -798,7 +802,7 @@
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>IdleF</AnimationName>
|
||||
<Time>1.0177411602680451</Time>
|
||||
<Time>0.96819454985941356</Time>
|
||||
<Play>true</Play>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
@@ -856,7 +860,7 @@
|
||||
<c:Animation>
|
||||
<AnimationName>DashForwardF</AnimationName>
|
||||
<Time>1</Time>
|
||||
<Speed>2</Speed>
|
||||
<Speed>1.7999999523162842</Speed>
|
||||
<Loop>false</Loop>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
@@ -868,7 +872,7 @@
|
||||
<c:Animation>
|
||||
<AnimationName>DashBackwardF</AnimationName>
|
||||
<Time>1</Time>
|
||||
<Speed>2</Speed>
|
||||
<Speed>1.7999999523162842</Speed>
|
||||
<Loop>false</Loop>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
@@ -887,24 +891,24 @@
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="DashLeft">
|
||||
<Entity name="DashRight">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>DashLeftF</AnimationName>
|
||||
<AnimationName>DashRightF</AnimationName>
|
||||
<Time>1</Time>
|
||||
<Speed>2</Speed>
|
||||
<Speed>1.7999999523162842</Speed>
|
||||
<Loop>false</Loop>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="DashRight">
|
||||
<Entity name="DashLeft">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>DashRightF</AnimationName>
|
||||
<AnimationName>DashLeftF</AnimationName>
|
||||
<Time>1</Time>
|
||||
<Speed>2</Speed>
|
||||
<Speed>1.7999999523162842</Speed>
|
||||
<Loop>false</Loop>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
@@ -981,7 +985,7 @@
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="MovementBlend">
|
||||
<Entity name="MovementBlend2">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>Idle</Pose1>
|
||||
@@ -995,6 +999,7 @@
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>IdleAssaultRifleU</AnimationName>
|
||||
<Time>1.6337870249215687</Time>
|
||||
<Play>true</Play>
|
||||
<Additive>true</Additive>
|
||||
</c:Animation>
|
||||
@@ -1006,6 +1011,7 @@
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>IdleAssaultRifleU</AnimationName>
|
||||
<Time>1.6337870249215687</Time>
|
||||
<Play>true</Play>
|
||||
<Additive>true</Additive>
|
||||
</c:Animation>
|
||||
|
||||
@@ -553,8 +553,8 @@
|
||||
<Entity name="Cube1">
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||
<Color A="0.505882382" B="0" G="1" R="0"/>
|
||||
<Resource>Models/BushAlive.mesh</Resource>
|
||||
<Color A="1" B="0" G="1" R="0"/>
|
||||
<Transparent>true</Transparent>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Entity name="ShinyStoneCrystalBlueLights" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||
|
||||
<Components>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:PointLight>
|
||||
<Color A="1" B="1" G="0" R="0"/>
|
||||
<Radius>5</Radius>
|
||||
<Intensity>2</Intensity>
|
||||
<Falloff>0.5</Falloff>
|
||||
</c:PointLight>
|
||||
<c:Transform>
|
||||
<Position X="-0.030024644" Y="1.9786495" Z="-0.242380202"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:PointLight>
|
||||
<Color A="1" B="1" G="0.454901963" R="0"/>
|
||||
<Radius>5</Radius>
|
||||
<Intensity>2</Intensity>
|
||||
<Falloff>0.5</Falloff>
|
||||
</c:PointLight>
|
||||
<c:Transform>
|
||||
<Position X="-0.030024644" Y="0.980793118" Z="-0.242380202"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
|
||||
</Entity>
|
||||
@@ -0,0 +1,273 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Entity name="ShootingRange" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||
|
||||
<Components>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0.736272275" Z="-10.0567217"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
|
||||
<Children>
|
||||
<Entity name="TargetBoard">
|
||||
<Components>
|
||||
<c:Transform>
|
||||
<Position X="-2" Y="0" Z="0"/>
|
||||
<Orientation X="1.5" Y="0" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitCylinder.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.392156869" R="0"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Scale X="1" Y="0.100000001" Z="1"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitCylinder.mesh</Resource>
|
||||
<Color A="1" B="0" G="0" R="1"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Scale X="0.850000024" Y="1.10000002" Z="0.850000024"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitCylinder.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.392156869" R="0"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Scale X="0.800000012" Y="1.10000002" Z="0.800000012"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitCylinder.mesh</Resource>
|
||||
<Color A="1" B="0" G="0" R="1"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Scale X="0.699999988" Y="1.10000002" Z="0.699999988"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitCylinder.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.392156869" R="0"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Scale X="0.600000024" Y="1.10000002" Z="0.600000024"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitCylinder.mesh</Resource>
|
||||
<Color A="1" B="0" G="0.00392156886" R="1"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Scale X="0.200000003" Y="1.10000002" Z="0.200000003"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="TargetBoard">
|
||||
<Components>
|
||||
<c:Transform>
|
||||
<Orientation X="1.5" Y="0" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitCylinder.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.392156869" R="0"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Scale X="1" Y="0.100000001" Z="1"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitCylinder.mesh</Resource>
|
||||
<Color A="1" B="0" G="0" R="1"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Scale X="0.850000024" Y="1.10000002" Z="0.850000024"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitCylinder.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.392156869" R="0"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Scale X="0.800000012" Y="1.10000002" Z="0.800000012"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitCylinder.mesh</Resource>
|
||||
<Color A="1" B="0" G="0" R="1"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Scale X="0.699999988" Y="1.10000002" Z="0.699999988"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitCylinder.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.392156869" R="0"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Scale X="0.600000024" Y="1.10000002" Z="0.600000024"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitCylinder.mesh</Resource>
|
||||
<Color A="1" B="0" G="0.00392156886" R="1"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Scale X="0.200000003" Y="1.10000002" Z="0.200000003"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="TargetBoard">
|
||||
<Components>
|
||||
<c:Transform>
|
||||
<Position X="2" Y="0" Z="0"/>
|
||||
<Orientation X="1.5" Y="0" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitCylinder.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.392156869" R="0"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Scale X="1" Y="0.100000001" Z="1"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitCylinder.mesh</Resource>
|
||||
<Color A="1" B="0" G="0" R="1"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Scale X="0.850000024" Y="1.10000002" Z="0.850000024"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitCylinder.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.392156869" R="0"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Scale X="0.800000012" Y="1.10000002" Z="0.800000012"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitCylinder.mesh</Resource>
|
||||
<Color A="1" B="0" G="0" R="1"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Scale X="0.699999988" Y="1.10000002" Z="0.699999988"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitCylinder.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.392156869" R="0"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Scale X="0.600000024" Y="1.10000002" Z="0.600000024"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitCylinder.mesh</Resource>
|
||||
<Color A="1" B="0" G="0.00392156886" R="1"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Scale X="0.200000003" Y="1.10000002" Z="0.200000003"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
|
||||
</Entity>
|
||||
@@ -0,0 +1,528 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Entity name="PlayerModel" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||
|
||||
<Components>
|
||||
<c:BlendAdditive>
|
||||
<Adder>BlendTreeAim</Adder>
|
||||
<Receiver>BlendTreeAssault</Receiver>
|
||||
</c:BlendAdditive>
|
||||
<c:Shielded/>
|
||||
<c:HiddenForLocalPlayer/>
|
||||
<c:Model>
|
||||
<Resource>Models/Characters/Assault/AssaultBlue.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.25" R="0"/>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
|
||||
<Children>
|
||||
<Entity name="PrimaryAttachment">
|
||||
<Components>
|
||||
<c:BoneAttachment>
|
||||
<BoneName>R_Arm_Weapon_Joint</BoneName>
|
||||
</c:BoneAttachment>
|
||||
<c:WeaponAttachment>
|
||||
<Weapon>AssaultWeapon</Weapon>
|
||||
<Person>
|
||||
<ThirdPerson/>
|
||||
</Person>
|
||||
</c:WeaponAttachment>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/WeaponAssaultBlueWorld.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Transform>
|
||||
<Position X="0.158476353" Y="1.07276821" Z="-0.235679001"/>
|
||||
<Orientation X="0.150311232" Y="-0.0436343439" Z="0.10047026"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="SecondaryAttachment">
|
||||
<Components>
|
||||
<c:BoneAttachment>
|
||||
<BoneName>R_Arm_Weapon_Joint</BoneName>
|
||||
</c:BoneAttachment>
|
||||
<c:WeaponAttachment>
|
||||
<Weapon>SidearmWeapon</Weapon>
|
||||
<Person>
|
||||
<ThirdPerson/>
|
||||
</Person>
|
||||
</c:WeaponAttachment>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/SidearmWeaponWorld.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Transform>
|
||||
<Position X="0.158476353" Y="1.07276821" Z="-0.235679001"/>
|
||||
<Orientation X="0.150311232" Y="-0.0436343439" Z="0.10047026"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="BlendTreeAim">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>AimPrimary</Pose1>
|
||||
<Pose2>AimSecondary</Pose2>
|
||||
<Weight>0</Weight>
|
||||
<SubTreeRoot>true</SubTreeRoot>
|
||||
</c:Blend>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="AimSecondary">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>AimSecWepA</AnimationName>
|
||||
<Time>0.57222229242324829</Time>
|
||||
<Loop>false</Loop>
|
||||
<Additive>true</Additive>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="AimPrimary">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>AimRifleA</AnimationName>
|
||||
<Time>0.57222229242324829</Time>
|
||||
<Loop>false</Loop>
|
||||
<Additive>true</Additive>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="BlendTreeAssault">
|
||||
<Components>
|
||||
<c:BlendOverride>
|
||||
<Master>ReloadSwitchBlend</Master>
|
||||
<Slave>FinalMovementBlend</Slave>
|
||||
</c:BlendOverride>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="FinalMovementBlend">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>StandCrouchBlend</Pose1>
|
||||
<Pose2>JumpDashBlend</Pose2>
|
||||
<Weight>2.5146881298480398e-63</Weight>
|
||||
<SubTreeRoot>true</SubTreeRoot>
|
||||
</c:Blend>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="StandCrouchBlend">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>StandMovement</Pose1>
|
||||
<Pose2>CrouchMovement</Pose2>
|
||||
<Weight>0</Weight>
|
||||
<SubTreeRoot>true</SubTreeRoot>
|
||||
</c:Blend>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="CrouchMovement">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>MovementBlend</Pose1>
|
||||
<Pose2>Idle</Pose2>
|
||||
<Weight>1</Weight>
|
||||
</c:Blend>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="MovementBlend">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>Walk</Pose1>
|
||||
<Pose2>StrafeLRBlend</Pose2>
|
||||
<Weight>0</Weight>
|
||||
</c:Blend>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="StrafeLRBlend">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>Left</Pose1>
|
||||
<Pose2>Right</Pose2>
|
||||
<Weight>0.033793529385008014</Weight>
|
||||
</c:Blend>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="Left">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>CrouchStrafeLeftF</AnimationName>
|
||||
<Time>0.37873000664436773</Time>
|
||||
<Play>true</Play>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="Right">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>CrouchStrafeRightF</AnimationName>
|
||||
<Time>0.30605146859515031</Time>
|
||||
<Play>true</Play>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="Walk">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>CrouchWalkF</AnimationName>
|
||||
<Time>0.084425453772553283</Time>
|
||||
<Play>true</Play>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="Idle">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>CrouchF</AnimationName>
|
||||
<Time>0.99862473341677438</Time>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="StandMovement">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>MovementBlend</Pose1>
|
||||
<Pose2>Idle</Pose2>
|
||||
<Weight>1</Weight>
|
||||
</c:Blend>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="MovementBlend">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>RunWalkBlend</Pose1>
|
||||
<Pose2>StrafeLRBlend</Pose2>
|
||||
<Weight>0</Weight>
|
||||
</c:Blend>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="RunWalkBlend">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>Walk</Pose1>
|
||||
<Pose2>Run</Pose2>
|
||||
<Weight>1</Weight>
|
||||
</c:Blend>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="Walk">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>WalkF</AnimationName>
|
||||
<Time>0.58958008318232658</Time>
|
||||
<Play>true</Play>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="Run">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>RunF</AnimationName>
|
||||
<Time>0.45938030142915665</Time>
|
||||
<Play>true</Play>
|
||||
<Reverse>true</Reverse>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="StrafeLRBlend">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>Left</Pose1>
|
||||
<Pose2>Right</Pose2>
|
||||
<Weight>0.033793529385008014</Weight>
|
||||
</c:Blend>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="Left">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>StrafeLeftF</AnimationName>
|
||||
<Time>0.77117270421586426</Time>
|
||||
<Play>true</Play>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="Right">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>StrafeRightF</AnimationName>
|
||||
<Time>0.79468823409597888</Time>
|
||||
<Play>true</Play>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="Idle">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>IdleF</AnimationName>
|
||||
<Time>1.8384679867885865</Time>
|
||||
<Play>true</Play>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="JumpDashBlend">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>Jump</Pose1>
|
||||
<Pose2>DashBlend</Pose2>
|
||||
<Weight>1</Weight>
|
||||
<SubTreeRoot>true</SubTreeRoot>
|
||||
</c:Blend>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="Jump">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>JumpF</AnimationName>
|
||||
<Time>0.5</Time>
|
||||
<Loop>false</Loop>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="DashBlend">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>DashFBBlend</Pose1>
|
||||
<Pose2>DashLRBlend</Pose2>
|
||||
<Weight>0.014621149736541383</Weight>
|
||||
</c:Blend>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="DashFBBlend">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>DashForward</Pose1>
|
||||
<Pose2>DashBackward</Pose2>
|
||||
<Weight>0.014363533804961248</Weight>
|
||||
</c:Blend>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="DashForward">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>DashForwardF</AnimationName>
|
||||
<Time>1</Time>
|
||||
<Speed>2</Speed>
|
||||
<Loop>false</Loop>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="DashBackward">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>DashBackwardF</AnimationName>
|
||||
<Time>1</Time>
|
||||
<Speed>2</Speed>
|
||||
<Loop>false</Loop>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="DashLRBlend">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>DashLeft</Pose1>
|
||||
<Pose2>DashRight</Pose2>
|
||||
<Weight>4.3244885367500671e-16</Weight>
|
||||
</c:Blend>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="DashLeft">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>DashLeftF</AnimationName>
|
||||
<Time>1</Time>
|
||||
<Speed>2</Speed>
|
||||
<Loop>false</Loop>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="DashRight">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>DashRightF</AnimationName>
|
||||
<Time>1</Time>
|
||||
<Speed>2</Speed>
|
||||
<Loop>false</Loop>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="ReloadSwitchBlend">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>ReloadSwitch</Pose1>
|
||||
<Pose2>WeaponActionBlend</Pose2>
|
||||
<Weight>1</Weight>
|
||||
<SubTreeRoot>true</SubTreeRoot>
|
||||
</c:Blend>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="ReloadSwitch">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>ReloadSwitchU</AnimationName>
|
||||
<Time>0.00030848838797092881</Time>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="WeaponActionBlend">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>IdleBlend</Pose1>
|
||||
<Pose2>ShootBlend</Pose2>
|
||||
<Weight>0</Weight>
|
||||
</c:Blend>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="IdleBlend">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>IdlePrimary</Pose1>
|
||||
<Pose2>IdleSecondary</Pose2>
|
||||
<Weight>0</Weight>
|
||||
</c:Blend>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="IdlePrimary">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>IdleAssaultRifleU</AnimationName>
|
||||
<Time>1.0138027682248349</Time>
|
||||
<Play>true</Play>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="IdleSecondary">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>IdleSecWepU</AnimationName>
|
||||
<Time>1.0173278085146222</Time>
|
||||
<Play>true</Play>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="ShootBlend">
|
||||
<Components>
|
||||
<c:Blend>
|
||||
<Pose1>ShootPrimary</Pose1>
|
||||
<Pose2>ShootSecondary</Pose2>
|
||||
<Weight>0</Weight>
|
||||
</c:Blend>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="ShootPrimary">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>ShootFastRifleU</AnimationName>
|
||||
<Time>0.12914212153428517</Time>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="ShootSecondary">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName>ShootSecWepFastU</AnimationName>
|
||||
</c:Animation>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
|
||||
</Entity>
|
||||
@@ -91,8 +91,8 @@
|
||||
<Resource>Models/Weapons/Blue/AssaultWeaponBlue.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0.118469834" Y="-0.231588811" Z="-0.181454763"/>
|
||||
<Orientation X="0.0104042515" Y="-0.00268274755" Z="0.0428440832"/>
|
||||
<Position X="0.120748274" Y="-0.228437141" Z="-0.181454718"/>
|
||||
<Orientation X="0.0102804415" Y="-0.00312523148" Z="0.0428143665"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
@@ -127,9 +127,9 @@
|
||||
<InheritScale>true</InheritScale>
|
||||
</c:BoneAttachment>
|
||||
<c:Transform>
|
||||
<Position X="0.0517482236" Y="-0.0985872298" Z="-0.255526245"/>
|
||||
<Orientation X="0.000683688093" Y="0.0774232447" Z="0.0011862258"/>
|
||||
<Scale X="0.25" Y="0.250000119" Z="0.500000238"/>
|
||||
<Position X="0.0540266186" Y="-0.0954354703" Z="-0.255526125"/>
|
||||
<Orientation X="0.000778362213" Y="0.0774229616" Z="0.00124316185"/>
|
||||
<Scale X="0.25000003" Y="0.250000238" Z="0.500000417"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#version 430
|
||||
|
||||
#define MAX_SPLITS 4
|
||||
|
||||
uniform mat4 M;
|
||||
uniform mat4 V;
|
||||
uniform mat4 P;
|
||||
@@ -22,6 +24,7 @@ in VertexData{
|
||||
vec2 TextureCoordinate;
|
||||
vec4 ExplosionColor;
|
||||
float ExplosionPercentageElapsed;
|
||||
vec4 PositionLightSpace[MAX_SPLITS];
|
||||
}Input[];
|
||||
|
||||
out VertexData{
|
||||
@@ -32,6 +35,7 @@ out VertexData{
|
||||
vec2 TextureCoordinate;
|
||||
vec4 ExplosionColor;
|
||||
float ExplosionPercentageElapsed;
|
||||
vec4 PositionLightSpace[MAX_SPLITS];
|
||||
}Output;
|
||||
|
||||
layout(triangles) in;
|
||||
@@ -145,6 +149,10 @@ void main()
|
||||
Output.TextureCoordinate = Input[i].TextureCoordinate;
|
||||
Output.Tangent = Input[i].Tangent;
|
||||
Output.BiTangent = Input[i].BiTangent;
|
||||
for (int j = 0; j < MAX_SPLITS; j++)
|
||||
{
|
||||
Output.PositionLightSpace[j] = Input[i].PositionLightSpace[j];
|
||||
}
|
||||
|
||||
// convert to model space for the gravity to always be in -y
|
||||
vec4 ExplodedPositionInModelSpace = M * vec4(ExplodedPosition, 1.0);
|
||||
@@ -186,6 +194,10 @@ void main()
|
||||
Output.TextureCoordinate = Input[i].TextureCoordinate;
|
||||
Output.Tangent = Input[i].Tangent;
|
||||
Output.BiTangent = Input[i].BiTangent;
|
||||
for (int j = 0; j < MAX_SPLITS; j++)
|
||||
{
|
||||
Output.PositionLightSpace[j] = Input[i].PositionLightSpace[j];
|
||||
}
|
||||
|
||||
// no change in position, pass through vertex
|
||||
gl_Position = gl_in[i].gl_Position;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#version 430
|
||||
|
||||
uniform mat4 M;
|
||||
uniform mat4 V;
|
||||
uniform mat4 P;
|
||||
uniform mat4 PVM;
|
||||
|
||||
layout(location = 0) in vec3 Position;
|
||||
layout(location = 5) in vec4 BoneIndices;
|
||||
@@ -15,7 +13,7 @@ out VertexData{
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = P * V * M * vec4(Position, 1.0);
|
||||
gl_Position = PVM * vec4(Position, 1.0);
|
||||
|
||||
Output.Position = Position;
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
#version 430
|
||||
|
||||
uniform mat4 M;
|
||||
uniform mat4 V;
|
||||
uniform mat4 P;
|
||||
uniform mat4 PVM;
|
||||
uniform mat4 Bones[100];
|
||||
|
||||
|
||||
@@ -27,7 +25,7 @@ void main()
|
||||
+ BoneWeights[3] * Bones[int(BoneIndices[3])];
|
||||
}
|
||||
|
||||
gl_Position = P*V*M*boneTransform * vec4(Position, 1.0);
|
||||
gl_Position = PVM*boneTransform * vec4(Position, 1.0);
|
||||
|
||||
Output.Position = vec3(0.0);
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
#version 430
|
||||
|
||||
#define MIN_AMBIENT_LIGHT 0.3
|
||||
#define MAX_SPLITS 4
|
||||
|
||||
uniform mat4 VM;
|
||||
uniform mat4 M;
|
||||
uniform mat4 V;
|
||||
uniform mat4 P;
|
||||
@@ -11,9 +13,10 @@ uniform vec2 ScreenDimensions;
|
||||
uniform vec4 FillColor;
|
||||
uniform vec4 AmbientColor;
|
||||
uniform float FillPercentage;
|
||||
uniform float GlowIntensity = 10;
|
||||
uniform float GlowIntensity;
|
||||
uniform vec3 CameraPosition;
|
||||
uniform int SSAOQuality;
|
||||
uniform float FarDistance[MAX_SPLITS];
|
||||
|
||||
uniform vec2 DiffuseUVRepeat;
|
||||
uniform vec2 NormalUVRepeat;
|
||||
@@ -25,6 +28,7 @@ layout (binding = 2) uniform sampler2D NormalMapTexture;
|
||||
layout (binding = 3) uniform sampler2D SpecularMapTexture;
|
||||
layout (binding = 4) uniform sampler2D GlowMapTexture;
|
||||
layout (binding = 5) uniform samplerCube CubeMap;
|
||||
layout (binding = 30) uniform sampler2DArrayShadow DepthMap;
|
||||
|
||||
#define TILE_SIZE 16
|
||||
|
||||
@@ -59,7 +63,6 @@ layout (std430, binding = 4) buffer LightIndexBuffer
|
||||
float LightIndex[];
|
||||
};
|
||||
|
||||
|
||||
in VertexData{
|
||||
vec3 Position;
|
||||
vec3 Normal;
|
||||
@@ -68,6 +71,7 @@ in VertexData{
|
||||
vec2 TextureCoordinate;
|
||||
vec4 ExplosionColor;
|
||||
float ExplosionPercentageElapsed;
|
||||
vec4 PositionLightSpace[MAX_SPLITS];
|
||||
}Input;
|
||||
|
||||
out vec4 sceneColor;
|
||||
@@ -78,6 +82,25 @@ struct LightResult {
|
||||
vec4 Specular;
|
||||
};
|
||||
|
||||
vec2 poissonDisk[16] = vec2[](
|
||||
vec2( -0.94201624, -0.39906216 ),
|
||||
vec2( 0.94558609, -0.76890725 ),
|
||||
vec2( -0.094184101, -0.92938870 ),
|
||||
vec2( 0.34495938, 0.29387760 ),
|
||||
vec2( -0.91588581, 0.45771432 ),
|
||||
vec2( -0.81544232, -0.87912464 ),
|
||||
vec2( -0.38277543, 0.27676845 ),
|
||||
vec2( 0.97484398, 0.75648379 ),
|
||||
vec2( 0.44323325, -0.97511554 ),
|
||||
vec2( 0.53742981, -0.47373420 ),
|
||||
vec2( -0.26496911, -0.41893023 ),
|
||||
vec2( 0.79197514, 0.19090188 ),
|
||||
vec2( -0.24188840, 0.99706507 ),
|
||||
vec2( -0.81409955, 0.91437590 ),
|
||||
vec2( 0.19984126, 0.78641367 ),
|
||||
vec2( 0.14383161, -0.14100790 )
|
||||
);
|
||||
|
||||
float CalcAttenuation(float radius, float dist, float falloff) {
|
||||
return 1.0 - smoothstep(radius * falloff, radius, dist);
|
||||
}
|
||||
@@ -124,6 +147,154 @@ vec4 CalcNormalMappedValue(vec3 normal, vec3 tangent, vec3 bitangent, vec2 textu
|
||||
return vec4(TBN * normalize(NormalMap), 0.0);
|
||||
}
|
||||
|
||||
// Returns a "random" value.
|
||||
float Random(vec3 seed, int i)
|
||||
{
|
||||
vec4 seed4 = vec4(seed, i);
|
||||
float dot_product = dot(seed4, vec4(12.9898, 78.233, 45.164, 94.673));
|
||||
return fract(sin(dot_product) * 43758.5453);
|
||||
}
|
||||
|
||||
int getShadowIndex(float far_distance[1])
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int getShadowIndex(float far_distance[2])
|
||||
{
|
||||
float depth = gl_FragCoord.z / gl_FragCoord.w;
|
||||
|
||||
int index = 1;
|
||||
if ( depth < far_distance[0] )
|
||||
{
|
||||
index = 0;
|
||||
}
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
int getShadowIndex(float far_distance[3])
|
||||
{
|
||||
float depth = gl_FragCoord.z / gl_FragCoord.w;
|
||||
|
||||
int index = 2;
|
||||
if ( depth < far_distance[0] )
|
||||
{
|
||||
index = 0;
|
||||
}
|
||||
else if ( depth < far_distance[1] && depth > far_distance[0] )
|
||||
{
|
||||
index = 1;
|
||||
}
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
int getShadowIndex(float far_distance[4])
|
||||
{
|
||||
float depth = gl_FragCoord.z / gl_FragCoord.w;
|
||||
|
||||
int index = 3;
|
||||
if ( depth < far_distance[0] )
|
||||
{
|
||||
index = 0;
|
||||
}
|
||||
else if ( depth < far_distance[1] && depth > far_distance[0] )
|
||||
{
|
||||
index = 1;
|
||||
}
|
||||
else if ( depth < far_distance[2] && depth > far_distance[1] )
|
||||
{
|
||||
index = 2;
|
||||
}
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
// Standard hardware-calculated PCF method
|
||||
float PCFShadow(sampler2DArrayShadow depth_texture_array, vec3 projection_coords, int layer_index)
|
||||
{
|
||||
return texture(depth_texture_array, vec4(projection_coords.xy, layer_index, projection_coords.z));
|
||||
}
|
||||
|
||||
// PCF + Poisson model method
|
||||
float PoissonShadow(sampler2DArrayShadow depth_texture_array, vec3 projection_coords, int layer_index, int taps, float spread)
|
||||
{
|
||||
int loop;
|
||||
float multiplier = 1.0 / float(taps);
|
||||
float shadowMapDepth;
|
||||
|
||||
for (int i = 0; i < taps; i++)
|
||||
{
|
||||
loop = i;
|
||||
vec3 newProjCoords = projection_coords + vec3(poissonDisk[loop], 0.0) / (spread * (1.0 + layer_index));
|
||||
shadowMapDepth += multiplier * texture(depth_texture_array, vec4(newProjCoords.xy, layer_index, newProjCoords.z));
|
||||
}
|
||||
|
||||
return shadowMapDepth;
|
||||
}
|
||||
|
||||
// PCF + Poisson + RandomSample model method
|
||||
float PoissonDotShadow(sampler2DArrayShadow depth_texture_array, vec3 projection_coords, int layer_index, int taps, float spread)
|
||||
{
|
||||
int loop;
|
||||
float multiplier = 1.0 / float(taps);
|
||||
float shadowMapDepth;
|
||||
|
||||
for (int i = 0; i < taps; i++)
|
||||
{
|
||||
loop = int(16.0 * Random(gl_FragCoord.xyy, i)) % 16;
|
||||
vec3 newProjCoords = projection_coords + vec3(poissonDisk[loop], 0.0) / (spread * (1.0 + layer_index));
|
||||
shadowMapDepth += multiplier * texture(depth_texture_array, vec4(newProjCoords.xy, layer_index, newProjCoords.z));
|
||||
}
|
||||
|
||||
return shadowMapDepth;
|
||||
}
|
||||
|
||||
// Hardware PCF + Additional software PCF method
|
||||
float SoftwarePCF(sampler2DArrayShadow depth_texture_array, vec3 projection_coords, int layer_index, float bias)
|
||||
{
|
||||
float shadow = 0.0;
|
||||
|
||||
vec3 texelSize = 1.0 / textureSize(depth_texture_array, 0);
|
||||
for(int x = -1; x <= 1; x++)
|
||||
{
|
||||
for(int y = -1; y <= 1; y++)
|
||||
{
|
||||
shadow += texture(depth_texture_array, vec4(projection_coords.xy + vec2(x, y) * texelSize.xy / (1.0 + layer_index), layer_index, projection_coords.z));
|
||||
}
|
||||
}
|
||||
|
||||
return shadow / 9.0;
|
||||
}
|
||||
|
||||
float CalcShadowValue(vec4 light_space_pos, vec3 normal, vec3 light_dir, sampler2DArrayShadow depth_texture_array, int layer_index)
|
||||
{
|
||||
float shadowMapDepth;
|
||||
float bias = 0.005;
|
||||
|
||||
// Various bias methods.
|
||||
|
||||
//bias = max(0.05 * (1.0 - dot(normal, light_dir)), bias);
|
||||
//bias = bias * tan(acos(clamp(dot(normal, -light_dir), 0.0, 1.0)));
|
||||
bias = bias + bias * tan(acos(clamp(dot(normal, -light_dir), 0.0, 1.0)));
|
||||
|
||||
// Calculate coordinates in projection space.
|
||||
|
||||
vec3 projCoords = vec3(light_space_pos.xy, light_space_pos.z + bias) / light_space_pos.w;
|
||||
projCoords = projCoords * 0.5 + 0.5;
|
||||
//projCoords = (floor(projCoords * 255.0)) / 255.0;
|
||||
|
||||
// Various methods for shadow calculation in fastest to slowest order.
|
||||
|
||||
//shadowMapDepth = PCFShadow(depth_texture_array, projCoords, layer_index);
|
||||
//shadowMapDepth = PoissonShadow(depth_texture_array, projCoords, layer_index, 4, 25.0 * FarDistance[MAX_SPLITS - 1]);
|
||||
//shadowMapDepth = PoissonDotShadow(depth_texture_array, projCoords, layer_index, 4, 25.0 * FarDistance[MAX_SPLITS - 1]);
|
||||
shadowMapDepth = SoftwarePCF(depth_texture_array, projCoords, layer_index, bias);
|
||||
|
||||
return shadowMapDepth;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
float ao = texelFetch(AOTexture, ivec2(gl_FragCoord.xy) >> int(SSAOQuality), 0).r;
|
||||
@@ -131,7 +302,7 @@ void main()
|
||||
vec4 diffuseTexel = texture2D(DiffuseTexture, Input.TextureCoordinate * DiffuseUVRepeat);
|
||||
vec4 glowTexel = texture2D(GlowMapTexture, Input.TextureCoordinate * GlowUVRepeat);
|
||||
vec4 specularTexel = texture2D(SpecularMapTexture, Input.TextureCoordinate * SpecularUVRepeat);
|
||||
vec4 position = V * M * vec4(Input.Position, 1.0);
|
||||
vec4 position = VM * vec4(Input.Position, 1.0);
|
||||
vec4 normal = V * CalcNormalMappedValue(Input.Normal, Input.Tangent, Input.BiTangent, Input.TextureCoordinate * NormalUVRepeat, NormalMapTexture);
|
||||
normal = normalize(normal);
|
||||
//vec4 normal = normalize(V * vec4(Input.Normal, 0.0));
|
||||
@@ -151,6 +322,8 @@ void main()
|
||||
|
||||
int start = int(LightGrids.Data[currentTile].Start);
|
||||
int amount = int(LightGrids.Data[currentTile].Amount);
|
||||
|
||||
float shadowFactor = 0.0;
|
||||
|
||||
for(int i = start; i < start + amount; i++) {
|
||||
|
||||
@@ -162,11 +335,16 @@ void main()
|
||||
if(light.Type == 1) { // point
|
||||
light_result = CalcPointLightSource(V * light.Position, light.Radius, light.Color, light.Intensity, viewVec, position, normal, light.Falloff);
|
||||
} else if (light.Type == 2) { //Directional
|
||||
int DepthMapIndex = getShadowIndex(FarDistance);
|
||||
light_result = CalcDirectionalLightSource(V * light.Direction, light.Color, light.Intensity, viewVec, normal);
|
||||
shadowFactor = CalcShadowValue(Input.PositionLightSpace[DepthMapIndex], Input.Normal, vec3(light.Direction), DepthMap, DepthMapIndex);
|
||||
}
|
||||
totalLighting.Diffuse += vec4(light_result.Diffuse.rgb * ao, light_result.Diffuse.a);
|
||||
totalLighting.Specular += vec4(light_result.Specular.rgb * ao, light_result.Specular.a);
|
||||
}
|
||||
|
||||
totalLighting.Diffuse *= vec4(min(vec3(shadowFactor) + AmbientColor.xyz, vec3(1.0)), 1.0);
|
||||
totalLighting.Specular *= vec4(min(vec3(shadowFactor) + AmbientColor.xyz, vec3(1.0)), 1.0);
|
||||
|
||||
vec4 color_result = mix((Color * diffuseTexel * DiffuseColor), Input.ExplosionColor, Input.ExplosionPercentageElapsed);
|
||||
color_result = color_result * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel));
|
||||
@@ -182,6 +360,7 @@ void main()
|
||||
color_result += FillColor;
|
||||
}
|
||||
sceneColor = vec4(color_result.xyz, clamp(color_result.a, 0, 1));
|
||||
//sceneColor = CommonUniforms.testColour;
|
||||
//sceneColor = vec4(reflectionColor.xyz, 1);
|
||||
color_result.xyz += glowTexel.xyz*GlowIntensity;
|
||||
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
#version 430
|
||||
uniform mat4 PVM;
|
||||
#define MAX_SPLITS 4
|
||||
uniform mat4 TIM;
|
||||
|
||||
uniform mat4 M;
|
||||
uniform mat4 V;
|
||||
uniform mat4 P;
|
||||
uniform mat4 LightV[MAX_SPLITS];
|
||||
uniform mat4 LightP[MAX_SPLITS];
|
||||
|
||||
layout(location = 0) in vec3 Position;
|
||||
layout(location = 1) in vec3 Normal;
|
||||
@@ -18,12 +23,13 @@ out VertexData{
|
||||
vec2 TextureCoordinate;
|
||||
vec4 ExplosionColor;
|
||||
float ExplosionPercentageElapsed;
|
||||
vec4 PositionLightSpace[MAX_SPLITS];
|
||||
}Output;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = P*V*M * vec4(Position, 1.0);
|
||||
mat4 TIM = transpose(inverse(M));
|
||||
gl_Position = PVM * vec4(Position, 1.0);
|
||||
//mat4 TIM = transpose(inverse(M));
|
||||
Output.Position = Position;
|
||||
Output.TextureCoordinate = TextureCoords;
|
||||
Output.Normal = vec3(TIM * vec4(Normal, 0.0));
|
||||
@@ -31,4 +37,9 @@ void main()
|
||||
Output.BiTangent = vec3(TIM * vec4(BiTangent, 0.0));
|
||||
Output.ExplosionColor = vec4(1.0);
|
||||
Output.ExplosionPercentageElapsed = 0.0;
|
||||
|
||||
for(int i = 0; i < MAX_SPLITS; i++)
|
||||
{
|
||||
Output.PositionLightSpace[i] = LightP[i] * LightV[i] * M * vec4(Position, 1.0);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
#version 430
|
||||
|
||||
#define MIN_AMBIENT_LIGHT 0.3
|
||||
#define MAX_SPLITS 4
|
||||
|
||||
uniform mat4 VM;
|
||||
uniform mat4 M;
|
||||
uniform mat4 V;
|
||||
uniform mat4 P;
|
||||
@@ -11,7 +13,7 @@ uniform vec2 ScreenDimensions;
|
||||
uniform vec4 FillColor;
|
||||
uniform vec4 AmbientColor;
|
||||
uniform float FillPercentage;
|
||||
uniform float GlowIntensity = 10;
|
||||
uniform float GlowIntensity;
|
||||
uniform vec3 CameraPosition;
|
||||
uniform int SSAOQuality;
|
||||
|
||||
@@ -69,6 +71,7 @@ in VertexData{
|
||||
vec2 TextureCoordinate;
|
||||
vec4 ExplosionColor;
|
||||
float ExplosionPercentageElapsed;
|
||||
vec4 PositionLightSpace[MAX_SPLITS];
|
||||
}Input;
|
||||
|
||||
out vec4 sceneColor;
|
||||
@@ -138,7 +141,7 @@ void main()
|
||||
vec4 diffuseTexel = texture2D(DiffuseTexture, Input.TextureCoordinate * DiffuseUVRepeat);
|
||||
vec4 glowTexel = texture2D(GlowMapTexture, Input.TextureCoordinate * GlowUVRepeat);
|
||||
vec4 specularTexel = texture2D(SpecularMapTexture, Input.TextureCoordinate * SpecularUVRepeat);
|
||||
vec4 position = V * M * vec4(Input.Position, 1.0);
|
||||
vec4 position = VM * vec4(Input.Position, 1.0);
|
||||
vec4 normal = V * CalcNormalMappedValue(Input.Normal, Input.Tangent, Input.BiTangent, Input.TextureCoordinate * NormalUVRepeat, NormalMapTexture);
|
||||
normal = normalize(normal);
|
||||
//vec4 normal = normalize(V * vec4(Input.Normal, 0.0));
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
#version 430
|
||||
|
||||
#define MAX_SPLITS 4
|
||||
|
||||
uniform mat4 PVM;
|
||||
uniform mat4 TIM;
|
||||
uniform mat4 M;
|
||||
uniform mat4 V;
|
||||
uniform mat4 P;
|
||||
uniform mat4 Bones[100];
|
||||
uniform mat4 LightV[MAX_SPLITS];
|
||||
uniform mat4 LightP[MAX_SPLITS];
|
||||
|
||||
layout(location = 0) in vec3 Position;
|
||||
layout(location = 1) in vec3 Normal;
|
||||
@@ -21,6 +27,7 @@ out VertexData{
|
||||
vec2 TextureCoordinate;
|
||||
vec4 ExplosionColor;
|
||||
float ExplosionPercentageElapsed;
|
||||
vec4 PositionLightSpace[MAX_SPLITS];
|
||||
}Output;
|
||||
|
||||
void main()
|
||||
@@ -34,7 +41,7 @@ void main()
|
||||
+ BoneWeights[3] * Bones[int(BoneIndices[3])];
|
||||
}
|
||||
|
||||
gl_Position = P*V*M*boneTransform * vec4(Position, 1.0);
|
||||
gl_Position = PVM*boneTransform * vec4(Position, 1.0);
|
||||
|
||||
Output.Position = (boneTransform * vec4(Position, 1.0)).xyz;
|
||||
Output.TextureCoordinate = TextureCoords;
|
||||
@@ -43,4 +50,9 @@ void main()
|
||||
Output.BiTangent = vec3(M * vec4(BiTangent, 0.0));
|
||||
Output.ExplosionColor = vec4(1.0);
|
||||
Output.ExplosionPercentageElapsed = 0.0;
|
||||
|
||||
for(int i = 0; i < MAX_SPLITS; i++)
|
||||
{
|
||||
Output.PositionLightSpace[i] = LightP[i] * LightV[i] * M * boneTransform * vec4(Position, 1.0);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
#version 430
|
||||
|
||||
#define MAX_SPLITS 4
|
||||
|
||||
uniform mat4 M;
|
||||
uniform mat4 V;
|
||||
uniform mat4 P;
|
||||
@@ -95,6 +97,7 @@ in VertexData{
|
||||
vec2 TextureCoordinate;
|
||||
vec4 ExplosionColor;
|
||||
float ExplosionPercentageElapsed;
|
||||
vec4 PositionLightSpace[MAX_SPLITS];
|
||||
}Input;
|
||||
|
||||
out vec4 sceneColor;
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#version 430
|
||||
|
||||
#define MIN_AMBIENT_LIGHT 0.3
|
||||
#define MAX_SPLITS 4
|
||||
|
||||
uniform mat4 VM;
|
||||
uniform mat4 M;
|
||||
uniform mat4 V;
|
||||
uniform mat4 P;
|
||||
@@ -12,6 +14,10 @@ uniform vec4 FillColor;
|
||||
uniform vec4 Color;
|
||||
uniform vec4 AmbientColor;
|
||||
uniform int SSAOQuality;
|
||||
uniform float FarDistance[MAX_SPLITS];
|
||||
|
||||
layout (binding = 0) uniform sampler2D AOTexture;
|
||||
layout (binding = 30) uniform sampler2DArrayShadow DepthMap;
|
||||
|
||||
//Get bineded at the same time as the textures
|
||||
uniform vec2 DiffuseUVRepeat1;
|
||||
@@ -26,7 +32,6 @@ uniform vec2 SpecularUVRepeat3;
|
||||
uniform vec2 GlowUVRepeat1;
|
||||
uniform vec2 GlowUVRepeat2;
|
||||
uniform vec2 GlowUVRepeat3;
|
||||
layout (binding = 0) uniform sampler2D AOTexture;
|
||||
layout (binding = 1) uniform sampler2D SplatMapTexture;
|
||||
layout (binding = 2) uniform sampler2D DiffuseTexture1;
|
||||
layout (binding = 3) uniform sampler2D DiffuseTexture2;
|
||||
@@ -83,6 +88,7 @@ in VertexData{
|
||||
vec2 TextureCoordinate;
|
||||
vec4 ExplosionColor;
|
||||
float ExplosionPercentageElapsed;
|
||||
vec4 PositionLightSpace[MAX_SPLITS];
|
||||
}Input;
|
||||
|
||||
out vec4 sceneColor;
|
||||
@@ -93,6 +99,25 @@ struct LightResult {
|
||||
vec4 Specular;
|
||||
};
|
||||
|
||||
vec2 poissonDisk[16] = vec2[](
|
||||
vec2( -0.94201624, -0.39906216 ),
|
||||
vec2( 0.94558609, -0.76890725 ),
|
||||
vec2( -0.094184101, -0.92938870 ),
|
||||
vec2( 0.34495938, 0.29387760 ),
|
||||
vec2( -0.91588581, 0.45771432 ),
|
||||
vec2( -0.81544232, -0.87912464 ),
|
||||
vec2( -0.38277543, 0.27676845 ),
|
||||
vec2( 0.97484398, 0.75648379 ),
|
||||
vec2( 0.44323325, -0.97511554 ),
|
||||
vec2( 0.53742981, -0.47373420 ),
|
||||
vec2( -0.26496911, -0.41893023 ),
|
||||
vec2( 0.79197514, 0.19090188 ),
|
||||
vec2( -0.24188840, 0.99706507 ),
|
||||
vec2( -0.81409955, 0.91437590 ),
|
||||
vec2( 0.19984126, 0.78641367 ),
|
||||
vec2( 0.14383161, -0.14100790 )
|
||||
);
|
||||
|
||||
float CalcAttenuation(float radius, float dist, float falloff) {
|
||||
return 1.0 - smoothstep(radius * 0.3, radius, dist);
|
||||
}
|
||||
@@ -176,6 +201,154 @@ vec4 CalcBlendedNormal(vec4 blendValue, sampler2D R, sampler2D G, sampler2D B,
|
||||
return vec4(TBN * normalize(Normal_result), 0.0);
|
||||
}
|
||||
|
||||
// Returns a "random" value.
|
||||
float Random(vec3 seed, int i)
|
||||
{
|
||||
vec4 seed4 = vec4(seed, i);
|
||||
float dot_product = dot(seed4, vec4(12.9898, 78.233, 45.164, 94.673));
|
||||
return fract(sin(dot_product) * 43758.5453);
|
||||
}
|
||||
|
||||
int getShadowIndex(float far_distance[1])
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int getShadowIndex(float far_distance[2])
|
||||
{
|
||||
float depth = gl_FragCoord.z / gl_FragCoord.w;
|
||||
|
||||
int index = 1;
|
||||
if ( depth < far_distance[0] )
|
||||
{
|
||||
index = 0;
|
||||
}
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
int getShadowIndex(float far_distance[3])
|
||||
{
|
||||
float depth = gl_FragCoord.z / gl_FragCoord.w;
|
||||
|
||||
int index = 2;
|
||||
if ( depth < far_distance[0] )
|
||||
{
|
||||
index = 0;
|
||||
}
|
||||
else if ( depth < far_distance[1] && depth > far_distance[0] )
|
||||
{
|
||||
index = 1;
|
||||
}
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
int getShadowIndex(float far_distance[4])
|
||||
{
|
||||
float depth = gl_FragCoord.z / gl_FragCoord.w;
|
||||
|
||||
int index = 3;
|
||||
if ( depth < far_distance[0] )
|
||||
{
|
||||
index = 0;
|
||||
}
|
||||
else if ( depth < far_distance[1] && depth > far_distance[0] )
|
||||
{
|
||||
index = 1;
|
||||
}
|
||||
else if ( depth < far_distance[2] && depth > far_distance[1] )
|
||||
{
|
||||
index = 2;
|
||||
}
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
// Standard hardware-calculated PCF method
|
||||
float PCFShadow(sampler2DArrayShadow depth_texture_array, vec3 projection_coords, int layer_index)
|
||||
{
|
||||
return texture(depth_texture_array, vec4(projection_coords.xy, layer_index, projection_coords.z));
|
||||
}
|
||||
|
||||
// PCF + Poisson model method
|
||||
float PoissonShadow(sampler2DArrayShadow depth_texture_array, vec3 projection_coords, int layer_index, int taps, float spread)
|
||||
{
|
||||
int loop;
|
||||
float multiplier = 1.0 / float(taps);
|
||||
float shadowMapDepth;
|
||||
|
||||
for (int i = 0; i < taps; i++)
|
||||
{
|
||||
loop = i;
|
||||
vec3 newProjCoords = projection_coords + vec3(poissonDisk[loop], 0.0) / (spread * (1.0 + layer_index));
|
||||
shadowMapDepth += multiplier * texture(depth_texture_array, vec4(newProjCoords.xy, layer_index, newProjCoords.z));
|
||||
}
|
||||
|
||||
return shadowMapDepth;
|
||||
}
|
||||
|
||||
// PCF + Poisson + RandomSample model method
|
||||
float PoissonDotShadow(sampler2DArrayShadow depth_texture_array, vec3 projection_coords, int layer_index, int taps, float spread)
|
||||
{
|
||||
int loop;
|
||||
float multiplier = 1.0 / float(taps);
|
||||
float shadowMapDepth;
|
||||
|
||||
for (int i = 0; i < taps; i++)
|
||||
{
|
||||
loop = int(16.0 * Random(gl_FragCoord.xyy, i)) % 16;
|
||||
vec3 newProjCoords = projection_coords + vec3(poissonDisk[loop], 0.0) / (spread * (1.0 + layer_index));
|
||||
shadowMapDepth += multiplier * texture(depth_texture_array, vec4(newProjCoords.xy, layer_index, newProjCoords.z));
|
||||
}
|
||||
|
||||
return shadowMapDepth;
|
||||
}
|
||||
|
||||
// Hardware PCF + Additional software PCF method
|
||||
float SoftwarePCF(sampler2DArrayShadow depth_texture_array, vec3 projection_coords, int layer_index, float bias)
|
||||
{
|
||||
float shadow = 0.0;
|
||||
|
||||
vec3 texelSize = 1.0 / textureSize(depth_texture_array, 0);
|
||||
for(int x = -1; x <= 1; x++)
|
||||
{
|
||||
for(int y = -1; y <= 1; y++)
|
||||
{
|
||||
shadow += texture(depth_texture_array, vec4(projection_coords.xy + vec2(x, y) * texelSize.xy / (1.0 + layer_index), layer_index, projection_coords.z));
|
||||
}
|
||||
}
|
||||
|
||||
return shadow / 9.0;
|
||||
}
|
||||
|
||||
float CalcShadowValue(vec4 light_space_pos, vec3 normal, vec3 light_dir, sampler2DArrayShadow depth_texture_array, int layer_index)
|
||||
{
|
||||
float shadowMapDepth;
|
||||
float bias = 0.005;
|
||||
|
||||
// Various bias methods.
|
||||
|
||||
//bias = max(0.05 * (1.0 - dot(normal, light_dir)), bias);
|
||||
//bias = bias * tan(acos(clamp(dot(normal, -light_dir), 0.0, 1.0)));
|
||||
bias = bias + bias * tan(acos(clamp(dot(normal, -light_dir), 0.0, 1.0)));
|
||||
|
||||
// Calculate coordinates in projection space.
|
||||
|
||||
vec3 projCoords = vec3(light_space_pos.xy, light_space_pos.z + bias) / light_space_pos.w;
|
||||
projCoords = projCoords * 0.5 + 0.5;
|
||||
//projCoords = (floor(projCoords * 255.0)) / 255.0;
|
||||
|
||||
// Various methods for shadow calculation in fastest to slowest order.
|
||||
|
||||
//shadowMapDepth = PCFShadow(depth_texture_array, projCoords, layer_index);
|
||||
//shadowMapDepth = PoissonShadow(depth_texture_array, projCoords, layer_index, 4, 25.0 * FarDistance[MAX_SPLITS - 1]);
|
||||
//shadowMapDepth = PoissonDotShadow(depth_texture_array, projCoords, layer_index, 4, 25.0 * FarDistance[MAX_SPLITS - 1]);
|
||||
shadowMapDepth = SoftwarePCF(depth_texture_array, projCoords, layer_index, bias);
|
||||
|
||||
return shadowMapDepth;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
float ao = texelFetch(AOTexture, ivec2(gl_FragCoord.xy) >> int(SSAOQuality), 0).r;
|
||||
@@ -189,7 +362,7 @@ void main()
|
||||
GlowUVRepeat1, GlowUVRepeat2, GlowUVRepeat3);
|
||||
vec4 specularTexel = CalcBlendedTexel(splatTexel, SpecularMapTexture1, SpecularMapTexture2, SpecularMapTexture3,
|
||||
SpecularUVRepeat1, SpecularUVRepeat2, SpecularUVRepeat3);
|
||||
vec4 position = V * M * vec4(Input.Position, 1.0);
|
||||
vec4 position = VM * vec4(Input.Position, 1.0);
|
||||
//vec4 normal = V * CalcNormalMappedValue(Input.Normal, Input.Tangent, Input.BiTangent, Input.TextureCoordinate, SplatMapTexture);
|
||||
vec4 normal = V * CalcBlendedNormal(splatTexel, NormalMapTexture1, NormalMapTexture2, NormalMapTexture3,
|
||||
NormalUVRepeat1, NormalUVRepeat2, NormalUVRepeat3);
|
||||
@@ -208,6 +381,8 @@ void main()
|
||||
int start = int(LightGrids.Data[currentTile].Start);
|
||||
int amount = int(LightGrids.Data[currentTile].Amount);
|
||||
|
||||
float shadowFactor = 0.0;
|
||||
|
||||
for(int i = start; i < start + amount; i++) {
|
||||
|
||||
int l = int(LightIndex[i]);
|
||||
@@ -218,12 +393,17 @@ void main()
|
||||
if(light.Type == 1) { // point
|
||||
light_result = CalcPointLightSource(V * light.Position, light.Radius, light.Color, light.Intensity, viewVec, position, normal, light.Falloff);
|
||||
} else if (light.Type == 2) { //Directional
|
||||
int DepthMapIndex = getShadowIndex(FarDistance);
|
||||
light_result = CalcDirectionalLightSource(V * light.Direction, light.Color, light.Intensity, viewVec, normal);
|
||||
shadowFactor = CalcShadowValue(Input.PositionLightSpace[DepthMapIndex], Input.Normal, vec3(light.Direction), DepthMap, DepthMapIndex);
|
||||
}
|
||||
totalLighting.Diffuse += vec4(light_result.Diffuse.rgb * ao, light_result.Diffuse.a);
|
||||
totalLighting.Specular += vec4(light_result.Specular.rgb * ao, light_result.Specular.a);
|
||||
}
|
||||
|
||||
totalLighting.Diffuse *= vec4(min(vec3(shadowFactor) + AmbientColor.xyz, vec3(1.0)), 1.0);
|
||||
totalLighting.Specular *= vec4(min(vec3(shadowFactor) + AmbientColor.xyz, vec3(1.0)), 1.0);
|
||||
|
||||
vec4 color_result = mix((Color * diffuseTexel * DiffuseColor), Input.ExplosionColor, Input.ExplosionPercentageElapsed);
|
||||
color_result = color_result * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel));
|
||||
//vec4 color_result = (DiffuseColor + Input.ExplosionColor) * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)) * diffuseTexel * Color;
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#version 430
|
||||
|
||||
#define MIN_AMBIENT_LIGHT 0.3
|
||||
#define MAX_SPLITS 4
|
||||
|
||||
uniform mat4 VM;
|
||||
uniform mat4 M;
|
||||
uniform mat4 V;
|
||||
uniform mat4 P;
|
||||
@@ -84,6 +86,7 @@ in VertexData{
|
||||
vec2 TextureCoordinate;
|
||||
vec4 ExplosionColor;
|
||||
float ExplosionPercentageElapsed;
|
||||
vec4 PositionLightSpace[MAX_SPLITS];
|
||||
}Input;
|
||||
|
||||
out vec4 sceneColor;
|
||||
@@ -190,7 +193,7 @@ void main()
|
||||
GlowUVRepeat1, GlowUVRepeat2, GlowUVRepeat3);
|
||||
vec4 specularTexel = CalcBlendedTexel(splatTexel, SpecularMapTexture1, SpecularMapTexture2, SpecularMapTexture3,
|
||||
SpecularUVRepeat1, SpecularUVRepeat2, SpecularUVRepeat3);
|
||||
vec4 position = V * M * vec4(Input.Position, 1.0);
|
||||
vec4 position = VM * vec4(Input.Position, 1.0);
|
||||
//vec4 normal = V * CalcNormalMappedValue(Input.Normal, Input.Tangent, Input.BiTangent, Input.TextureCoordinate, SplatMapTexture);
|
||||
vec4 normal = V * CalcBlendedNormal(splatTexel, NormalMapTexture1, NormalMapTexture2, NormalMapTexture3,
|
||||
NormalUVRepeat1, NormalUVRepeat2, NormalUVRepeat3);
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
#version 430
|
||||
|
||||
uniform mat4 M;
|
||||
uniform mat4 V;
|
||||
uniform mat4 P;
|
||||
uniform mat4 PVM;
|
||||
|
||||
layout(location = 0) in vec3 Position;
|
||||
layout(location = 1) in vec3 Normal;
|
||||
@@ -16,6 +13,6 @@ out VertexData{
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = P*V*M * vec4(Position, 1.0);
|
||||
gl_Position = PVM * vec4(Position, 1.0);
|
||||
Output.Position = Position, 1.0;
|
||||
}
|
||||
@@ -1,8 +1,5 @@
|
||||
#version 430
|
||||
|
||||
uniform mat4 M;
|
||||
uniform mat4 V;
|
||||
uniform mat4 P;
|
||||
uniform mat4 PVM;
|
||||
uniform mat4 Bones[100];
|
||||
|
||||
layout(location = 0) in vec3 Position;
|
||||
@@ -27,6 +24,6 @@ void main()
|
||||
+ BoneWeights[3] * Bones[int(BoneIndices[3])];
|
||||
}
|
||||
|
||||
gl_Position = P*V*M*boneTransform * vec4(Position, 1.0);
|
||||
gl_Position = PVM*boneTransform * vec4(Position, 1.0);
|
||||
Output.Position = (boneTransform * vec4(Position, 1.0)).xyz;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#version 430
|
||||
|
||||
#define ALPHA_CUTOFF 0.3
|
||||
|
||||
layout (binding = 24) uniform sampler2D DiffuseTexture;
|
||||
uniform float Alpha;
|
||||
|
||||
in VertexData{
|
||||
vec2 TextureCoordinate;
|
||||
}Input;
|
||||
|
||||
layout (location = 0) out float ShadowMap;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 diffuseTexel = texture(DiffuseTexture, Input.TextureCoordinate) * Alpha;
|
||||
|
||||
if (diffuseTexel.a < ALPHA_CUTOFF)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#version 430
|
||||
|
||||
uniform mat4 M;
|
||||
uniform mat4 V;
|
||||
uniform mat4 P;
|
||||
|
||||
layout (location = 0) in vec3 Position;
|
||||
layout (location = 4) in vec2 TextureCoords;
|
||||
|
||||
out VertexData{
|
||||
vec2 TextureCoordinate;
|
||||
}Output;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = P * V * M * vec4(Position, 1.0);
|
||||
Output.TextureCoordinate = TextureCoords;
|
||||
}
|
||||
@@ -3,8 +3,6 @@
|
||||
uniform vec4 Color;
|
||||
uniform vec4 FillColor;
|
||||
uniform float FillPercentage;
|
||||
uniform mat4 M;
|
||||
uniform mat4 V;
|
||||
uniform mat4 P;
|
||||
|
||||
layout (binding = 1) uniform sampler2D DiffuseTexture;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#version 430
|
||||
|
||||
uniform mat4 M;
|
||||
uniform mat4 V;
|
||||
uniform mat4 P;
|
||||
uniform mat4 PVM;
|
||||
|
||||
layout(location = 0) in vec3 Position;
|
||||
layout(location = 1) in vec3 Normal;
|
||||
@@ -17,7 +15,7 @@ out VertexData{
|
||||
void main()
|
||||
{
|
||||
|
||||
gl_Position = P * V * M * vec4(Position, 1.0);
|
||||
gl_Position = PVM* vec4(Position, 1.0);
|
||||
|
||||
Output.Position = Position;
|
||||
Output.TextureCoordinate = TextureCoords;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
vec4 CalcNormalMappedValue(vec3 normal, vec3 tangent, vec3 bitangent, vec2 textureCoordinate, sampler2D normalMap)
|
||||
{
|
||||
mat3 TBN = mat3(tangent, bitangent, normal);
|
||||
vec3 NormalMap = texture(normalMap, textureCoordinate).xyz * 2.0 - vec3(1.0);
|
||||
return vec4(TBN * normalize(NormalMap), 0.0);
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
const EntityWrapper EntityWrapper::Invalid = EntityWrapper(nullptr, EntityID_Invalid);
|
||||
|
||||
const std::string EntityWrapper::Name()
|
||||
const std::string EntityWrapper::Name() const
|
||||
{
|
||||
return World->GetName(ID);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ void EditorRenderSystem::Update(double dt)
|
||||
EntityWrapper entity(m_World, cModel.EntityID);
|
||||
glm::mat4 modelMatrix = Transform::ModelMatrix(entity.ID, entity.World);
|
||||
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, false);
|
||||
std::shared_ptr<ModelJob> modelJob = std::make_shared<ModelJob>(model, scene.Camera, modelMatrix, matGroup, cModel, entity.World, glm::vec4(0), 0.f, false, false);
|
||||
if (cModel["Transparent"]) {
|
||||
scene.Jobs.TransparentObjects.push_back(modelJob);
|
||||
} else {
|
||||
|
||||
@@ -35,6 +35,7 @@ void Client::Connect(std::string address, int port)
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EDoubleJump, &Client::OnDoubleJump);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EDashAbility, &Client::OnDashAbility);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_ESearchForServers, &Client::OnSearchForServers);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EConnectRequest, &Client::OnConnectRequest);
|
||||
auto config = ResourceManager::Load<ConfigFile>("Config.ini");
|
||||
m_Address = address;
|
||||
if (address.empty()) {
|
||||
@@ -180,8 +181,8 @@ void Client::parseTCPConnect(Packet& packet)
|
||||
Packet UnreliablePacket(MessageType::Connect, m_SendPacketID);
|
||||
// Add player id and other stuff
|
||||
packet.WritePrimitive(m_PlayerID);
|
||||
// m_Unreliable.Send(packet);
|
||||
// LOG_INFO("Sent UDP Connect Server");
|
||||
// m_Unreliable.Send(packet);
|
||||
// LOG_INFO("Sent UDP Connect Server");
|
||||
}
|
||||
|
||||
void Client::parsePlayerConnected(Packet & packet)
|
||||
@@ -456,12 +457,14 @@ void Client::parseSnapshot(Packet& packet)
|
||||
|
||||
void Client::disconnect()
|
||||
{
|
||||
removeWorld();
|
||||
m_IsConnected = false;
|
||||
m_PreviousPacketID = 0;
|
||||
m_PacketID = 0;
|
||||
Packet packet(MessageType::Disconnect, m_SendPacketID);
|
||||
m_Reliable.Send(packet);
|
||||
m_Reliable.Disconnect();
|
||||
createMainMenu();
|
||||
}
|
||||
|
||||
bool Client::OnInputCommand(const Events::InputCommand & e)
|
||||
@@ -472,7 +475,7 @@ bool Client::OnInputCommand(const Events::InputCommand & e)
|
||||
|
||||
if (e.Command == "ConnectToServer") { // Connect for now
|
||||
if (e.Value > 0) {
|
||||
m_Reliable.Connect(m_PlayerName, m_Address, m_Port);
|
||||
//m_Reliable.Connect(m_PlayerName, m_Address, m_Port);
|
||||
// m_Unreliable.Connect(m_PlayerName, m_Address, m_Port);
|
||||
}
|
||||
//LOG_DEBUG("Client::OnInputCommand: Command is %s. Value is %f. PlayerID is %i.", e.Command.c_str(), e.Value, e.PlayerID);
|
||||
@@ -545,6 +548,23 @@ bool Client::OnDashAbility(const Events::DashAbility& e)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Client::OnConnectRequest(const Events::ConnectRequest& e)
|
||||
{
|
||||
removeWorld();
|
||||
if (m_Reliable.Connect(m_PlayerName, e.IP, e.Port)) {
|
||||
// The client sent a successful connect message
|
||||
return true;
|
||||
|
||||
} else {
|
||||
// The client could not send a successful connect message
|
||||
createMainMenu();
|
||||
// Load the main menu again ?
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Client::OnSearchForServers(const Events::SearchForServers& e)
|
||||
{
|
||||
m_SearchingForServers = true;
|
||||
@@ -671,6 +691,26 @@ void Client::displayServerlist()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Client::removeWorld()
|
||||
{
|
||||
std::vector<EntityID> childrenToBeDeleted;
|
||||
auto rootEntites = m_World->GetDirectChildren(EntityID_Invalid);
|
||||
for (auto it = rootEntites.first; it != rootEntites.second; it++) {
|
||||
childrenToBeDeleted.push_back(it->second);
|
||||
}
|
||||
for (int i = 0; i < childrenToBeDeleted.size(); ++i) {
|
||||
m_World->DeleteEntity(childrenToBeDeleted[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Client::createMainMenu()
|
||||
{
|
||||
auto entityFile = ResourceManager::Load<EntityFile>("Schema/Entities/StartMenu.xml");
|
||||
entityFile->MergeInto(m_World);
|
||||
}
|
||||
|
||||
bool Client::clientServerMapsHasEntity(EntityID clientEntityID)
|
||||
{
|
||||
if (m_ClientIDToServerID.find(clientEntityID) != m_ClientIDToServerID.end()) {
|
||||
|
||||
@@ -7,6 +7,8 @@ Server::Server(World* world, EventBroker* eventBroker, int port)
|
||||
ConfigFile* config = ResourceManager::Load<ConfigFile>("Config.ini");
|
||||
snapshotInterval = 1000 * config->Get<float>("Networking.SnapshotInterval", 0.05f);
|
||||
pingIntervalMs = config->Get<float>("Networking.PingIntervalMs", 1000);
|
||||
m_ServerName = config->Get<std::string>("Networking.Name", "Unnamed");
|
||||
|
||||
// Subscribe to events
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &Server::OnInputCommand);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EPlayerSpawned, &Server::OnPlayerSpawned);
|
||||
@@ -410,7 +412,7 @@ void Server::parseServerlistRequest(boost::asio::ip::udp::endpoint endpoint)
|
||||
Packet packet(MessageType::ServerlistRequest);
|
||||
packet.WriteString(m_Reliable.Address());
|
||||
packet.WritePrimitive<int>(m_Reliable.Port());
|
||||
packet.WriteString("SERVERNAME");
|
||||
packet.WriteString(m_ServerName);
|
||||
packet.WritePrimitive<int>(m_ConnectedPlayers.size());
|
||||
m_ServerlistRequest.Send(packet);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ TCPClient::~TCPClient()
|
||||
{
|
||||
}
|
||||
|
||||
void TCPClient::Connect(std::string playerName, std::string address, int port)
|
||||
bool TCPClient::Connect(std::string playerName, std::string address, int port)
|
||||
{
|
||||
if (m_Socket) {
|
||||
if (m_IsConnected) {
|
||||
@@ -19,6 +19,7 @@ void TCPClient::Connect(std::string playerName, std::string address, int port)
|
||||
Send(packet);
|
||||
LOG_INFO("Connect message sent again!");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if (!m_IsConnected) {
|
||||
boost::system::error_code error = boost::asio::error::host_not_found;
|
||||
@@ -34,11 +35,13 @@ void TCPClient::Connect(std::string playerName, std::string address, int port)
|
||||
packet.WriteString(playerName);
|
||||
Send(packet);
|
||||
LOG_INFO("Connect message sent!");
|
||||
return true;
|
||||
}
|
||||
// If error
|
||||
else {
|
||||
m_Socket->close();
|
||||
m_Socket = nullptr;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,14 +10,15 @@ UDPClient::~UDPClient()
|
||||
{
|
||||
}
|
||||
|
||||
void UDPClient::Connect(std::string playerName, std::string address, int port)
|
||||
bool UDPClient::Connect(std::string playerName, std::string address, int port)
|
||||
{
|
||||
if (m_Socket) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
m_ReceiverEndpoint = udp::endpoint(boost::asio::ip::address().from_string(address), port);
|
||||
m_Socket = boost::shared_ptr<boost::asio::ip::udp::socket>(new boost::asio::ip::udp::socket(m_IOService));
|
||||
m_Socket->open(boost::asio::ip::udp::v4());
|
||||
return true;
|
||||
}
|
||||
|
||||
void UDPClient::Disconnect()
|
||||
|
||||
@@ -4,6 +4,8 @@ AnimationSystem::AnimationSystem(SystemParams params)
|
||||
: System(params)
|
||||
{
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EAutoAnimationBlend, &AnimationSystem::OnAutoAnimationBlend);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EEntityDeleted, &AnimationSystem::OnEntityDeleted);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_ESetBlendWeight, &AnimationSystem::OnSetBlendWeight);
|
||||
}
|
||||
|
||||
void AnimationSystem::Update(double dt)
|
||||
@@ -122,16 +124,16 @@ void AnimationSystem::UpdateAnimations(double dt)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void AnimationSystem::UpdateWeights(double dt)
|
||||
{
|
||||
for (auto& autoBlendQueue : m_AutoBlendQueues) {
|
||||
|
||||
if(autoBlendQueue.second.HasActiveBlendJob()) {
|
||||
AutoBlendQueue::AutoBlendJob& blendJob = autoBlendQueue.second.GetActiveBlendJob();
|
||||
|
||||
std::shared_ptr<BlendTree> blendTree = autoBlendQueue.second.GetBlendTree();
|
||||
|
||||
for (auto it = m_AutoBlendQueues.begin(); it != m_AutoBlendQueues.end(); ) {
|
||||
LOG_INFO("%s", it->first.Name().c_str());
|
||||
it->second.PrintQueue();
|
||||
|
||||
if(it->second.HasActiveBlendJob()) {
|
||||
AutoBlendQueue::AutoBlendJob& blendJob = it->second.GetActiveBlendJob();
|
||||
LOG_INFO("%s", blendJob.RootNode.Name().c_str());
|
||||
std::shared_ptr<BlendTree> blendTree = it->second.GetBlendTree();
|
||||
if (blendTree != nullptr) {
|
||||
if (blendJob.Duration != 0.0) {
|
||||
blendJob.BlendInfo.progress = glm::clamp(blendJob.CurrentTime / blendJob.Duration, 0.0, 1.0);
|
||||
@@ -140,10 +142,17 @@ void AnimationSystem::UpdateWeights(double dt)
|
||||
}
|
||||
|
||||
blendJob.BlendInfo = blendTree->AutoBlendStep(blendJob.BlendInfo);
|
||||
} else {
|
||||
it = m_AutoBlendQueues.erase(it);
|
||||
}
|
||||
it++;
|
||||
} else {
|
||||
if (it->second.Empty()) {
|
||||
it = m_AutoBlendQueues.erase(it);
|
||||
} else {
|
||||
it++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,46 +186,163 @@ bool AnimationSystem::OnAutoAnimationBlend(Events::AutoAnimationBlend& e)
|
||||
return false;
|
||||
}
|
||||
|
||||
EntityWrapper subTreeRoot;
|
||||
|
||||
|
||||
EntityWrapper subTreeRoot = blendTree->GetSubTreeRoot(e.NodeName);
|
||||
if (e.SingleLevelBlend) {
|
||||
subTreeRoot = blendTree->GetSubTreeRoot(e.NodeName);
|
||||
|
||||
if (!subTreeRoot.Valid()) {
|
||||
return false;
|
||||
}
|
||||
if (!subTreeRoot.Valid()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
AutoBlendQueue::AutoBlendJob abj;
|
||||
abj.AnimationEntity = e.AnimationEntity;
|
||||
abj.CurrentTime = 0.0;
|
||||
abj.Delay = e.Delay;
|
||||
abj.Duration = e.Duration;
|
||||
abj.RootNode = e.RootNode;
|
||||
AutoBlendQueue::AutoBlendJob abj;
|
||||
abj.AnimationEntity = e.AnimationEntity;
|
||||
abj.CurrentTime = 0.0;
|
||||
abj.Delay = e.Delay;
|
||||
abj.Duration = e.Duration;
|
||||
abj.RootNode = e.RootNode;
|
||||
|
||||
abj.BlendInfo.NodeName = e.NodeName;
|
||||
abj.BlendInfo.progress = 0.0;
|
||||
abj.BlendInfo.Start = e.Start;
|
||||
abj.BlendInfo.SingleBlend = e.SingleLevelBlend;
|
||||
abj.BlendInfo.Weight = e.Weight;
|
||||
abj.BlendInfo.NodeName = e.NodeName;
|
||||
abj.BlendInfo.progress = 0.0;
|
||||
abj.BlendInfo.Start = e.Start;
|
||||
abj.BlendInfo.SingleBlend = e.SingleLevelBlend;
|
||||
abj.BlendInfo.Weight = e.Weight;
|
||||
|
||||
EntityWrapper nodeEntity = subTreeRoot.FirstChildByName(e.NodeName); // more than one
|
||||
if (nodeEntity.Valid()) {
|
||||
if (nodeEntity.HasComponent("Animation")) {
|
||||
const Skeleton::Animation* animation = skeleton->GetAnimation(nodeEntity["Animation"]["AnimationName"]);
|
||||
(bool&)nodeEntity["Animation"]["Reverse"] = e.Reverse;
|
||||
std::vector<EntityWrapper> animationEntities = blendTree->GetEntitesByName(e.NodeName); // more than one
|
||||
for(auto entity : animationEntities)
|
||||
if (entity.Valid()) {
|
||||
if (entity.HasComponent("Animation")) {
|
||||
const Skeleton::Animation* animation = skeleton->GetAnimation(entity["Animation"]["AnimationName"]);
|
||||
(bool&)entity["Animation"]["Reverse"] = e.Reverse;
|
||||
|
||||
if (e.Restart) {
|
||||
if (animation != nullptr) {
|
||||
if (e.Restart) {
|
||||
if (e.Reverse) {
|
||||
(double&)nodeEntity["Animation"]["Time"] = animation->Duration;
|
||||
} else {
|
||||
(double&)nodeEntity["Animation"]["Time"] = 0.0;
|
||||
if (e.Restart) {
|
||||
if (animation != nullptr) {
|
||||
if (e.Restart) {
|
||||
if (e.Reverse) {
|
||||
(double&)entity["Animation"]["Time"] = animation->Duration;
|
||||
} else {
|
||||
(double&)entity["Animation"]["Time"] = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
m_AutoBlendQueues[subTreeRoot].Insert(abj);
|
||||
} else {
|
||||
std::vector<EntityWrapper> subtreeroots = blendTree->GetSingleLevelRoots(e.NodeName);
|
||||
|
||||
for(auto entity : subtreeroots) {
|
||||
subTreeRoot = entity;
|
||||
|
||||
if (!subTreeRoot.Valid()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
AutoBlendQueue::AutoBlendJob abj;
|
||||
abj.AnimationEntity = e.AnimationEntity;
|
||||
abj.CurrentTime = 0.0;
|
||||
abj.Delay = e.Delay;
|
||||
abj.Duration = e.Duration;
|
||||
abj.RootNode = e.RootNode;
|
||||
|
||||
abj.BlendInfo.NodeName = e.NodeName;
|
||||
abj.BlendInfo.progress = 0.0;
|
||||
abj.BlendInfo.Start = e.Start;
|
||||
abj.BlendInfo.SingleBlend = e.SingleLevelBlend;
|
||||
abj.BlendInfo.Weight = e.Weight;
|
||||
m_AutoBlendQueues[subTreeRoot].Insert(abj);
|
||||
}
|
||||
|
||||
std::vector<EntityWrapper> animationEntities = blendTree->GetEntitesByName(e.NodeName); // more than one
|
||||
for (auto entity : animationEntities)
|
||||
if (entity.Valid()) {
|
||||
if (entity.HasComponent("Animation")) {
|
||||
const Skeleton::Animation* animation = skeleton->GetAnimation(entity["Animation"]["AnimationName"]);
|
||||
(bool&)entity["Animation"]["Reverse"] = e.Reverse;
|
||||
|
||||
if (e.Restart) {
|
||||
if (animation != nullptr) {
|
||||
if (e.Restart) {
|
||||
if (e.Reverse) {
|
||||
(double&)entity["Animation"]["Time"] = animation->Duration;
|
||||
} else {
|
||||
(double&)entity["Animation"]["Time"] = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
m_AutoBlendQueues[subTreeRoot].Insert(abj);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AnimationSystem::OnEntityDeleted(Events::EntityDeleted& e)
|
||||
{
|
||||
EntityWrapper entity = EntityWrapper(m_World, e.DeletedEntity);
|
||||
|
||||
if (entity.HasComponent("Model")) {
|
||||
Model* model;
|
||||
try {
|
||||
model = ResourceManager::Load<::Model, true>(entity["Model"]["Resource"]);
|
||||
} catch (const std::exception&) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Skeleton* skeleton = model->m_RawModel->m_Skeleton;
|
||||
if (skeleton == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (skeleton->BlendTrees.find(entity) != skeleton->BlendTrees.end()) {
|
||||
skeleton->BlendTrees.erase(entity);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool AnimationSystem::OnSetBlendWeight(Events::SetBlendWeight& e)
|
||||
{
|
||||
if (!e.RootNode.Valid()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!e.RootNode.HasComponent("Model")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Model* model;
|
||||
try {
|
||||
model = ResourceManager::Load<::Model, true>((std::string)e.RootNode["Model"]["Resource"]);
|
||||
} catch (const std::exception&) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Skeleton* skeleton = model->m_RawModel->m_Skeleton;
|
||||
if (skeleton == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::shared_ptr<BlendTree> blendTree;
|
||||
if (skeleton->BlendTrees.find(e.RootNode) != skeleton->BlendTrees.end()) {
|
||||
blendTree = skeleton->BlendTrees.at(e.RootNode);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(e.Weight >= 0 && e.Weight <= 1) {
|
||||
|
||||
blendTree->SetWeightByName(e.NodeName, e.Weight);
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -38,11 +38,14 @@ void AutoBlendQueue::Insert(AutoBlendJob autoBlendJob)
|
||||
double animationSpeed = (double)autoBlendJob.AnimationEntity["Animation"]["Speed"];
|
||||
double animationTime = (double)autoBlendJob.AnimationEntity["Animation"]["Time"];
|
||||
|
||||
|
||||
if ((bool)autoBlendJob.AnimationEntity["Animation"]["Reverse"]) {
|
||||
AnimationDuration = (animation->Duration * animationSpeed) - (animation->Duration - animationTime);
|
||||
if (animationSpeed != 0) {
|
||||
if ((bool)autoBlendJob.AnimationEntity["Animation"]["Reverse"]) {
|
||||
AnimationDuration = (animation->Duration / animationSpeed) - (animation->Duration - animationTime);
|
||||
} else {
|
||||
AnimationDuration = (animation->Duration / animationSpeed) - animationTime;
|
||||
}
|
||||
} else {
|
||||
AnimationDuration = (animation->Duration * animationSpeed) - animationTime;
|
||||
return;
|
||||
}
|
||||
|
||||
blendNode.StartTime += AnimationDuration;
|
||||
@@ -75,7 +78,6 @@ void AutoBlendQueue::Insert(AutoBlendJob autoBlendJob)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
m_BlendQueue.clear();
|
||||
m_BlendQueue.push_back(blendNode);
|
||||
}
|
||||
@@ -124,7 +126,7 @@ bool AutoBlendQueue::HasActiveBlendJob()
|
||||
try {
|
||||
model = ResourceManager::Load<::Model, true>(blendJob.RootNode["Model"]["Resource"]);
|
||||
} catch (const std::exception&) {
|
||||
m_BlendQueue.pop_front();
|
||||
//m_BlendQueue.pop_front();
|
||||
return HasActiveBlendJob();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,8 @@
|
||||
|
||||
BlendTree::BlendTree(EntityWrapper ModelEntity, Skeleton* skeleton)
|
||||
{
|
||||
|
||||
m_Skeleton = skeleton;
|
||||
|
||||
|
||||
|
||||
if (ModelEntity.HasComponent("Animation")) {
|
||||
const Skeleton::Animation* animation = skeleton->GetAnimation(ModelEntity["Animation"]["AnimationName"]);
|
||||
if (animation == nullptr) {
|
||||
@@ -217,7 +214,6 @@ BlendTree::AutoBlendInfo BlendTree::AutoBlendStep(AutoBlendInfo blendInfo)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return blendInfo;
|
||||
}
|
||||
|
||||
@@ -270,7 +266,7 @@ BlendTree::AutoBlendInfo BlendTree::AutoBlendStep(AutoBlendInfo blendInfo)
|
||||
currentNode = currentNode->Parent;
|
||||
|
||||
if (blendInfo.SingleBlend) {
|
||||
break;
|
||||
return blendInfo;;
|
||||
}
|
||||
}
|
||||
} else if(goalNodes.size() >= 2) {
|
||||
@@ -331,9 +327,11 @@ BlendTree::AutoBlendInfo BlendTree::AutoBlendStep(AutoBlendInfo blendInfo)
|
||||
|
||||
lastNode = currentNode;
|
||||
currentNode = currentNode->Parent;
|
||||
if (blendInfo.SingleBlend) {
|
||||
return blendInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return blendInfo;
|
||||
@@ -427,6 +425,55 @@ EntityWrapper BlendTree::GetSubTreeRoot(std::string nodeName)
|
||||
return subTreeRoots.front()->Entity;
|
||||
}
|
||||
|
||||
|
||||
std::vector<EntityWrapper> BlendTree::GetSingleLevelRoots(std::string name)
|
||||
{
|
||||
std::vector<Node*> nodes = FindNodesByName(name);
|
||||
std::vector<EntityWrapper> entities;
|
||||
|
||||
for (auto it = nodes.begin(); it != nodes.end(); it++) {
|
||||
Node* currentNode = (*it)->Parent;
|
||||
|
||||
if(currentNode->Entity.Valid()) {
|
||||
entities.push_back(currentNode->Entity);
|
||||
}
|
||||
}
|
||||
|
||||
return entities;
|
||||
}
|
||||
|
||||
|
||||
std::vector<EntityWrapper> BlendTree::GetEntitesByName(std::string name)
|
||||
{
|
||||
std::vector<Node*> nodes = FindNodesByName(name);
|
||||
std::vector<EntityWrapper> entities;
|
||||
|
||||
for (auto it = nodes.begin(); it != nodes.end(); it++) {
|
||||
Node* currentNode = (*it);
|
||||
|
||||
if (currentNode->Entity.Valid()) {
|
||||
entities.push_back(currentNode->Entity);
|
||||
}
|
||||
}
|
||||
|
||||
return entities;
|
||||
}
|
||||
|
||||
|
||||
void BlendTree::SetWeightByName(std::string name, double weight)
|
||||
{
|
||||
std::vector<Node*> nodes = FindNodesByName(name);
|
||||
|
||||
for (auto node : nodes) {
|
||||
EntityWrapper entity = node->Entity;
|
||||
|
||||
if(entity.HasComponent("Blend")) {
|
||||
entity["Blend"]["Weight"] = weight;
|
||||
node->Weight = weight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BlendTree::Blend(std::map<int, Skeleton::PoseData>& pose)
|
||||
{
|
||||
Node* currentNode;
|
||||
|
||||
@@ -9,6 +9,11 @@ DrawBloomPass::DrawBloomPass(IRenderer* renderer, ConfigFile* config)
|
||||
ChangeQuality(m_Config->Get<int>("GLOW.Quality", 2));
|
||||
}
|
||||
|
||||
DrawBloomPass::~DrawBloomPass() {
|
||||
CommonFunctions::DeleteTexture(&m_GaussianTexture_horiz);
|
||||
CommonFunctions::DeleteTexture(&m_GaussianTexture_vert);
|
||||
}
|
||||
|
||||
void DrawBloomPass::InitializeTextures()
|
||||
{
|
||||
m_BlackTexture = CommonFunctions::TryLoadResource<Texture, false>("Textures/Core/Black.png");
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#include "Rendering/DrawFinalPass.h"
|
||||
DrawFinalPass::DrawFinalPass(IRenderer* renderer, LightCullingPass* lightCullingPass, CubeMapPass* cubeMapPass, SSAOPass* ssaoPass)
|
||||
DrawFinalPass::DrawFinalPass(IRenderer* renderer, LightCullingPass* lightCullingPass, CubeMapPass* cubeMapPass, SSAOPass* ssaoPass, ShadowPass* shadowPass)
|
||||
: m_Renderer(renderer)
|
||||
, m_LightCullingPass(lightCullingPass)
|
||||
, m_CubeMapPass(cubeMapPass)
|
||||
, m_SSAOPass(ssaoPass)
|
||||
, m_ShadowPass(shadowPass)
|
||||
{
|
||||
//TODO: Make sure that uniforms are not sent into shader if not needed.
|
||||
m_ShieldPixelRate = 8;
|
||||
@@ -12,6 +13,14 @@ DrawFinalPass::DrawFinalPass(IRenderer* renderer, LightCullingPass* lightCulling
|
||||
InitializeFrameBuffers();
|
||||
}
|
||||
|
||||
DrawFinalPass::~DrawFinalPass(){
|
||||
CommonFunctions::DeleteTexture(&m_BloomTexture);
|
||||
CommonFunctions::DeleteTexture(&m_SceneTexture);
|
||||
CommonFunctions::DeleteTexture(&m_DepthBuffer);
|
||||
CommonFunctions::DeleteTexture(&m_ShieldBuffer);
|
||||
CommonFunctions::DeleteTexture(&m_CubeMapTexture);
|
||||
}
|
||||
|
||||
void DrawFinalPass::InitializeTextures()
|
||||
{
|
||||
m_WhiteTexture = CommonFunctions::TryLoadResource<Texture, false>("Textures/Core/White.png");
|
||||
@@ -353,6 +362,8 @@ void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>&
|
||||
GLuint explosionSkinnedHandle = m_ExplosionEffectSkinnedProgram->GetHandle();
|
||||
GLuint explosionSplatMapSkinnedHandle = m_ExplosionEffectSplatMapSkinnedProgram->GetHandle();
|
||||
GLuint forwardSplatMapSkinnedHandle = m_ForwardPlusSplatMapSkinnedProgram->GetHandle();
|
||||
GLuint lastShader = 0;
|
||||
unsigned int lastModel = 0;
|
||||
|
||||
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 1, m_LightCullingPass->LightSSBO());
|
||||
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 2, m_LightCullingPass->LightGridSSBO());
|
||||
@@ -361,6 +372,13 @@ void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>&
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_2D, m_SSAOPass->SSAOTexture());
|
||||
|
||||
glActiveTexture(GL_TEXTURE30);
|
||||
if (m_ShadowPass->DepthMap() != NULL) {
|
||||
glBindTexture(GL_TEXTURE_2D_ARRAY, m_ShadowPass->DepthMap());
|
||||
} else {
|
||||
glBindTexture(GL_TEXTURE_2D_ARRAY, m_WhiteTexture->m_Texture);
|
||||
}
|
||||
|
||||
for (auto &job : jobs) {
|
||||
auto explosionEffectJob = std::dynamic_pointer_cast<ExplosionEffectJob>(job);
|
||||
if (explosionEffectJob) {
|
||||
@@ -369,9 +387,17 @@ void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>&
|
||||
case RawModel::MaterialType::SingleTextures:
|
||||
{
|
||||
if (explosionEffectJob->Model->IsSkinned()) {
|
||||
|
||||
m_ExplosionEffectSkinnedProgram->Bind();
|
||||
GLERROR("Bind ExplosionEffectSkinned program");
|
||||
if (lastShader != m_ExplosionEffectSkinnedProgram->GetHandle()) {
|
||||
m_ExplosionEffectSkinnedProgram->Bind();
|
||||
lastShader = m_ExplosionEffectSkinnedProgram->GetHandle();
|
||||
GLERROR("Bind ExplosionEffectSkinned program");
|
||||
glUniform1i(glGetUniformLocation(explosionSkinnedHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionSkinnedHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionSkinnedHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(explosionSkinnedHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(explosionSkinnedHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind ExplosionEffectSkinned Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindExplosionUniforms(explosionSkinnedHandle, explosionEffectJob, scene);
|
||||
//bind textures
|
||||
@@ -391,8 +417,17 @@ void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>&
|
||||
|
||||
}
|
||||
else {
|
||||
m_ExplosionEffectProgram->Bind();
|
||||
GLERROR("Bind ExplosionEffect program");
|
||||
if (lastShader != m_ExplosionEffectProgram->GetHandle()) {
|
||||
m_ExplosionEffectProgram->Bind();
|
||||
lastShader = m_ExplosionEffectProgram->GetHandle();
|
||||
GLERROR("Bind ExplosionEffect program");
|
||||
glUniform1i(glGetUniformLocation(explosionHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(explosionHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(explosionHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind ExplosionEffect Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindExplosionUniforms(explosionHandle, explosionEffectJob, scene);
|
||||
//bind textures
|
||||
@@ -406,8 +441,17 @@ void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>&
|
||||
case RawModel::MaterialType::SplatMapping:
|
||||
{
|
||||
if (explosionEffectJob->Model->IsSkinned()) {
|
||||
m_ExplosionEffectSplatMapSkinnedProgram->Bind();
|
||||
GLERROR("Bind ExplosionEffectSplatMapSkinned program");
|
||||
if (lastShader != m_ExplosionEffectSplatMapSkinnedProgram->GetHandle()) {
|
||||
m_ExplosionEffectSplatMapSkinnedProgram->Bind();
|
||||
lastShader = m_ExplosionEffectSplatMapSkinnedProgram->GetHandle();
|
||||
GLERROR("Bind ExplosionEffectSplatMapSkinned program");
|
||||
glUniform1i(glGetUniformLocation(explosionSplatMapSkinnedHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionSplatMapSkinnedHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionSplatMapSkinnedHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(explosionSplatMapSkinnedHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(explosionSplatMapSkinnedHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind ExplosionEffectSplatMapSkinned Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindExplosionUniforms(explosionSplatMapSkinnedHandle, explosionEffectJob, scene);
|
||||
//bind textures
|
||||
@@ -423,9 +467,17 @@ void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>&
|
||||
|
||||
}
|
||||
else {
|
||||
m_ExplosionEffectSplatMapProgram->Bind();
|
||||
GLERROR("Bind ExplosionEffectSplatMap program");
|
||||
//bind uniforms
|
||||
if (lastShader != m_ExplosionEffectSplatMapProgram->GetHandle()) {
|
||||
m_ExplosionEffectSplatMapProgram->Bind();
|
||||
lastShader = m_ExplosionEffectSplatMapProgram->GetHandle();
|
||||
GLERROR("Bind ExplosionEffectSplatMap program");
|
||||
glUniform1i(glGetUniformLocation(explosionSplatMapHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionSplatMapHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionSplatMapHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(explosionSplatMapHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(explosionSplatMapHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind ExplosionEffectSplatMap Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindExplosionUniforms(explosionSplatMapHandle, explosionEffectJob, scene);
|
||||
//bind textures
|
||||
@@ -438,8 +490,11 @@ void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>&
|
||||
glDisable(GL_CULL_FACE);
|
||||
|
||||
//draw
|
||||
glBindVertexArray(explosionEffectJob->Model->VAO);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, explosionEffectJob->Model->ElementBuffer);
|
||||
if (lastModel != explosionEffectJob->ModelID) {
|
||||
glBindVertexArray(explosionEffectJob->Model->VAO);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, explosionEffectJob->Model->ElementBuffer);
|
||||
lastModel = explosionEffectJob->ModelID;
|
||||
}
|
||||
glDrawElements(GL_TRIANGLES, explosionEffectJob->EndIndex - explosionEffectJob->StartIndex + 1, GL_UNSIGNED_INT, (void*)(explosionEffectJob->StartIndex*sizeof(unsigned int)));
|
||||
glEnable(GL_CULL_FACE);
|
||||
GLERROR("explosion effect end");
|
||||
@@ -453,8 +508,17 @@ void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>&
|
||||
case RawModel::MaterialType::SingleTextures:
|
||||
{
|
||||
if (modelJob->Model->IsSkinned()) {
|
||||
m_ForwardPlusSkinnedProgram->Bind();
|
||||
GLERROR("Bind ForwardPlusSkinnedProgram");
|
||||
if (lastShader != m_ForwardPlusSkinnedProgram->GetHandle()) {
|
||||
m_ForwardPlusSkinnedProgram->Bind();
|
||||
lastShader = m_ForwardPlusSkinnedProgram->GetHandle();
|
||||
GLERROR("Bind ForwardPlusSkinnedProgram program");
|
||||
glUniform1i(glGetUniformLocation(forwardSkinnedHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardSkinnedHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardSkinnedHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(forwardSkinnedHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(forwardSkinnedHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind ForwardPlusSkinnedProgram Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindModelUniforms(forwardSkinnedHandle, modelJob, scene);
|
||||
//bind textures
|
||||
@@ -472,8 +536,17 @@ void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>&
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardSkinnedHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
||||
}
|
||||
else {
|
||||
m_ForwardPlusProgram->Bind();
|
||||
GLERROR("Bind ForwardPlusProgram");
|
||||
if (lastShader != m_ForwardPlusProgram->GetHandle()) {
|
||||
m_ForwardPlusProgram->Bind();
|
||||
lastShader = m_ForwardPlusProgram->GetHandle();
|
||||
GLERROR("Bind ForwardPlusProgram program");
|
||||
glUniform1i(glGetUniformLocation(forwardHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(forwardHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(forwardHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind ForwardPlusProgram Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindModelUniforms(forwardHandle, modelJob, scene);
|
||||
//bind textures
|
||||
@@ -487,8 +560,17 @@ void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>&
|
||||
case RawModel::MaterialType::SplatMapping:
|
||||
{
|
||||
if (modelJob->Model->IsSkinned()) {
|
||||
m_ForwardPlusSplatMapSkinnedProgram->Bind();
|
||||
GLERROR("Bind SplatMap program");
|
||||
if (lastShader != m_ForwardPlusSplatMapSkinnedProgram->GetHandle()) {
|
||||
m_ForwardPlusSplatMapSkinnedProgram->Bind();
|
||||
lastShader = m_ForwardPlusSplatMapSkinnedProgram->GetHandle();
|
||||
GLERROR("Bind SkinnedSplatMapProgram program");
|
||||
glUniform1i(glGetUniformLocation(forwardSplatMapSkinnedHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardSplatMapSkinnedHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardSplatMapSkinnedHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(forwardSplatMapSkinnedHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(forwardSplatMapSkinnedHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind SkinnedSplatMapProgram Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindModelUniforms(forwardSplatMapSkinnedHandle, modelJob, scene);
|
||||
//bind textures
|
||||
@@ -504,8 +586,17 @@ void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>&
|
||||
|
||||
}
|
||||
else {
|
||||
m_ForwardPlusSplatMapProgram->Bind();
|
||||
GLERROR("Bind SplatMap program");
|
||||
if (lastShader != m_ForwardPlusSplatMapProgram->GetHandle()) {
|
||||
m_ForwardPlusSplatMapProgram->Bind();
|
||||
lastShader = m_ForwardPlusSplatMapProgram->GetHandle();
|
||||
GLERROR("Bind SplatMap program");
|
||||
glUniform1i(glGetUniformLocation(forwardSplatMapHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardSplatMapHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardSplatMapHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(forwardSplatMapHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(forwardSplatMapHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind SplatMap Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindModelUniforms(forwardSplatMapHandle, modelJob, scene);
|
||||
//bind textures
|
||||
@@ -516,8 +607,11 @@ void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>&
|
||||
}
|
||||
}
|
||||
//draw
|
||||
glBindVertexArray(modelJob->Model->VAO);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, modelJob->Model->ElementBuffer);
|
||||
if (lastModel != modelJob->ModelID) {
|
||||
glBindVertexArray(modelJob->Model->VAO);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, modelJob->Model->ElementBuffer);
|
||||
lastModel = modelJob->ModelID;
|
||||
}
|
||||
glDrawElements(GL_TRIANGLES, modelJob->EndIndex - modelJob->StartIndex + 1, GL_UNSIGNED_INT, (void*)(modelJob->StartIndex*sizeof(unsigned int)));
|
||||
if (GLERROR("models end")) {
|
||||
continue;
|
||||
@@ -546,6 +640,8 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
GLuint explosionSkinnedShieldCheckHandle = m_ExplosionEffectSkinnedShieldCheckProgram->GetHandle();
|
||||
GLuint explosionSplatMapSkinnedShieldCheckHandle = m_ExplosionEffectSplatMapSkinnedShieldCheckProgram->GetHandle();
|
||||
GLuint forwardSplatMapSkinnedShieldCheckHandle = m_ForwardPlusSplatMapSkinnedShieldCheckProgram->GetHandle();
|
||||
GLuint lastShader = 0;
|
||||
unsigned int lastModel = 0;
|
||||
|
||||
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 1, m_LightCullingPass->LightSSBO());
|
||||
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 2, m_LightCullingPass->LightGridSSBO());
|
||||
@@ -566,9 +662,17 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
case RawModel::MaterialType::SingleTextures:
|
||||
{
|
||||
if (explosionEffectJob->Model->IsSkinned()) {
|
||||
|
||||
m_ExplosionEffectSkinnedShieldCheckProgram->Bind();
|
||||
GLERROR("Bind ExplosionEffectSkinned program");
|
||||
if (lastShader != m_ExplosionEffectSkinnedShieldCheckProgram->GetHandle()) {
|
||||
m_ExplosionEffectSkinnedShieldCheckProgram->Bind();
|
||||
lastShader = m_ExplosionEffectSkinnedShieldCheckProgram->GetHandle();
|
||||
GLERROR("Bind ExplosionEffectSkinned program");
|
||||
glUniform1i(glGetUniformLocation(explosionSkinnedShieldCheckHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionSkinnedShieldCheckHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionSkinnedShieldCheckHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(explosionSkinnedShieldCheckHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(explosionSkinnedShieldCheckHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind ExplosionEffectSkinned Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindExplosionUniforms(explosionSkinnedShieldCheckHandle, explosionEffectJob, scene);
|
||||
//bind textures
|
||||
@@ -587,8 +691,17 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
|
||||
}
|
||||
else {
|
||||
m_ExplosionEffectShieldCheckProgram->Bind();
|
||||
GLERROR("Bind ExplosionEffect program");
|
||||
if (lastShader != m_ExplosionEffectShieldCheckProgram->GetHandle()) {
|
||||
m_ExplosionEffectShieldCheckProgram->Bind();
|
||||
lastShader = m_ExplosionEffectShieldCheckProgram->GetHandle();
|
||||
GLERROR("Bind ExplosionEffect program");
|
||||
glUniform1i(glGetUniformLocation(explosionShieldCheckHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionShieldCheckHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionShieldCheckHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(explosionShieldCheckHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(explosionShieldCheckHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind ExplosionEffect Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindExplosionUniforms(explosionShieldCheckHandle, explosionEffectJob, scene);
|
||||
//bind textures
|
||||
@@ -603,8 +716,17 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
case RawModel::MaterialType::SplatMapping:
|
||||
{
|
||||
if (explosionEffectJob->Model->IsSkinned()) {
|
||||
m_ExplosionEffectSplatMapSkinnedShieldCheckProgram->Bind();
|
||||
GLERROR("Bind ExplosionEffectSplatMapSkinned program");
|
||||
if (lastShader != m_ExplosionEffectSplatMapSkinnedShieldCheckProgram->GetHandle()) {
|
||||
m_ExplosionEffectSplatMapSkinnedShieldCheckProgram->Bind();
|
||||
lastShader = m_ExplosionEffectSplatMapSkinnedShieldCheckProgram->GetHandle();
|
||||
GLERROR("Bind ExplosionEffectSplatMapSkinned program");
|
||||
glUniform1i(glGetUniformLocation(explosionSplatMapSkinnedShieldCheckHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionSplatMapSkinnedShieldCheckHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionSplatMapSkinnedShieldCheckHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(explosionSplatMapSkinnedShieldCheckHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(explosionSplatMapSkinnedShieldCheckHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind ExplosionEffectSplatMapSkinned Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindExplosionUniforms(explosionSplatMapSkinnedShieldCheckHandle, explosionEffectJob, scene);
|
||||
//bind textures
|
||||
@@ -621,9 +743,17 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
|
||||
}
|
||||
else {
|
||||
m_ExplosionEffectSplatMapShieldCheckProgram->Bind();
|
||||
GLERROR("Bind ExplosionEffectSplatMap program");
|
||||
//bind uniforms
|
||||
if (lastShader != m_ExplosionEffectSplatMapShieldCheckProgram->GetHandle()) {
|
||||
m_ExplosionEffectSplatMapShieldCheckProgram->Bind();
|
||||
lastShader = m_ExplosionEffectSplatMapShieldCheckProgram->GetHandle();
|
||||
GLERROR("Bind ExplosionEffectSplatMap program");
|
||||
glUniform1i(glGetUniformLocation(explosionSplatMapShieldCheckHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionSplatMapShieldCheckHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionSplatMapShieldCheckHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(explosionSplatMapShieldCheckHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(explosionSplatMapShieldCheckHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind ExplosionEffectSplatMap Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindExplosionUniforms(explosionSplatMapShieldCheckHandle, explosionEffectJob, scene);
|
||||
//bind textures
|
||||
@@ -639,9 +769,17 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
case RawModel::MaterialType::SingleTextures:
|
||||
{
|
||||
if (explosionEffectJob->Model->IsSkinned()) {
|
||||
|
||||
m_ExplosionEffectSkinnedProgram->Bind();
|
||||
GLERROR("Bind ExplosionEffectSkinned program");
|
||||
if (lastShader != m_ExplosionEffectSkinnedProgram->GetHandle()) {
|
||||
m_ExplosionEffectSkinnedProgram->Bind();
|
||||
lastShader = m_ExplosionEffectSkinnedProgram->GetHandle();
|
||||
GLERROR("Bind ExplosionEffectSkinned program");
|
||||
glUniform1i(glGetUniformLocation(explosionSkinnedHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionSkinnedHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionSkinnedHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(explosionSkinnedHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(explosionSkinnedHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind ExplosionEffectSkinned Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindExplosionUniforms(explosionSkinnedHandle, explosionEffectJob, scene);
|
||||
//bind textures
|
||||
@@ -659,8 +797,17 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionSkinnedHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
||||
}
|
||||
else {
|
||||
m_ExplosionEffectProgram->Bind();
|
||||
GLERROR("Bind ExplosionEffect program");
|
||||
if (lastShader != m_ExplosionEffectProgram->GetHandle()) {
|
||||
m_ExplosionEffectProgram->Bind();
|
||||
lastShader = m_ExplosionEffectProgram->GetHandle();
|
||||
GLERROR("Bind ExplosionEffect program");
|
||||
glUniform1i(glGetUniformLocation(explosionHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(explosionHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(explosionHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind ExplosionEffect Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindExplosionUniforms(explosionHandle, explosionEffectJob, scene);
|
||||
//bind textures
|
||||
@@ -674,8 +821,17 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
case RawModel::MaterialType::SplatMapping:
|
||||
{
|
||||
if (explosionEffectJob->Model->IsSkinned()) {
|
||||
m_ExplosionEffectSplatMapSkinnedProgram->Bind();
|
||||
GLERROR("Bind ExplosionEffectSplatMapSkinned program");
|
||||
if (lastShader != m_ExplosionEffectSplatMapSkinnedProgram->GetHandle()) {
|
||||
m_ExplosionEffectSplatMapSkinnedProgram->Bind();
|
||||
lastShader = m_ExplosionEffectSplatMapSkinnedProgram->GetHandle();
|
||||
GLERROR("Bind ExplosionEffectSkinnedSplatMap program");
|
||||
glUniform1i(glGetUniformLocation(explosionSplatMapSkinnedHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionSplatMapSkinnedHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionSplatMapSkinnedHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(explosionSplatMapSkinnedHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(explosionSplatMapSkinnedHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind ExplosionEffectSkinnedSplatMap Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindExplosionUniforms(explosionSplatMapSkinnedHandle, explosionEffectJob, scene);
|
||||
//bind textures
|
||||
@@ -691,9 +847,17 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
|
||||
}
|
||||
else {
|
||||
m_ExplosionEffectSplatMapProgram->Bind();
|
||||
GLERROR("Bind ExplosionEffectSplatMap program");
|
||||
//bind uniforms
|
||||
if (lastShader != m_ExplosionEffectSplatMapProgram->GetHandle()) {
|
||||
m_ExplosionEffectSplatMapProgram->Bind();
|
||||
lastShader = m_ExplosionEffectSplatMapProgram->GetHandle();
|
||||
GLERROR("Bind ExplosionEffectSplatMap program");
|
||||
glUniform1i(glGetUniformLocation(explosionSplatMapHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionSplatMapHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionSplatMapHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(explosionSplatMapHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(explosionSplatMapHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind ExplosionEffectSplatMap Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindExplosionUniforms(explosionSplatMapHandle, explosionEffectJob, scene);
|
||||
//bind textures
|
||||
@@ -707,8 +871,11 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
glDisable(GL_CULL_FACE);
|
||||
|
||||
//draw
|
||||
glBindVertexArray(explosionEffectJob->Model->VAO);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, explosionEffectJob->Model->ElementBuffer);
|
||||
if (lastModel != explosionEffectJob->ModelID) {
|
||||
glBindVertexArray(explosionEffectJob->Model->VAO);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, explosionEffectJob->Model->ElementBuffer);
|
||||
lastModel = explosionEffectJob->ModelID;
|
||||
}
|
||||
glDrawElements(GL_TRIANGLES, explosionEffectJob->EndIndex - explosionEffectJob->StartIndex + 1, GL_UNSIGNED_INT, (void*)(explosionEffectJob->StartIndex*sizeof(unsigned int)));
|
||||
glEnable(GL_CULL_FACE);
|
||||
GLERROR("explosion effect end");
|
||||
@@ -723,8 +890,17 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
case RawModel::MaterialType::SingleTextures:
|
||||
{
|
||||
if (modelJob->Model->IsSkinned()) {
|
||||
m_ForwardPlusSkinnedShieldCheckProgram->Bind();
|
||||
GLERROR("Bind ForwardPlusSkinnedProgram");
|
||||
if (lastShader != m_ForwardPlusSkinnedShieldCheckProgram->GetHandle()) {
|
||||
m_ForwardPlusSkinnedShieldCheckProgram->Bind();
|
||||
lastShader = m_ForwardPlusSkinnedShieldCheckProgram->GetHandle();
|
||||
GLERROR("Bind ForwardPlusSkinnedProgram program");
|
||||
glUniform1i(glGetUniformLocation(forwardSkinnedShieldCheckHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardSkinnedShieldCheckHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardSkinnedShieldCheckHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(forwardSkinnedShieldCheckHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(forwardSkinnedShieldCheckHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind ForwardPlusSkinnedProgram Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindModelUniforms(forwardSkinnedShieldCheckHandle, modelJob, scene);
|
||||
//bind textures
|
||||
@@ -743,8 +919,17 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
|
||||
}
|
||||
else {
|
||||
m_ForwardPlusShieldCheckProgram->Bind();
|
||||
GLERROR("Bind ForwardPlusProgram");
|
||||
if (lastShader != m_ForwardPlusShieldCheckProgram->GetHandle()) {
|
||||
m_ForwardPlusShieldCheckProgram->Bind();
|
||||
lastShader = m_ForwardPlusShieldCheckProgram->GetHandle();
|
||||
GLERROR("Bind ForwardPlusProgram program");
|
||||
glUniform1i(glGetUniformLocation(forwardShieldCheckHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardShieldCheckHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardShieldCheckHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(forwardShieldCheckHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(forwardShieldCheckHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind ForwardPlusProgram Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindModelUniforms(forwardShieldCheckHandle, modelJob, scene);
|
||||
//bind textures
|
||||
@@ -758,8 +943,17 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
case RawModel::MaterialType::SplatMapping:
|
||||
{
|
||||
if (modelJob->Model->IsSkinned()) {
|
||||
m_ForwardPlusSplatMapSkinnedShieldCheckProgram->Bind();
|
||||
GLERROR("Bind SplatMap program");
|
||||
if (lastShader != m_ForwardPlusSplatMapSkinnedShieldCheckProgram->GetHandle()) {
|
||||
m_ForwardPlusSplatMapSkinnedShieldCheckProgram->Bind();
|
||||
lastShader = m_ForwardPlusSplatMapSkinnedShieldCheckProgram->GetHandle();
|
||||
GLERROR("Bind ForwardPlusProgramSplatMapSkinned program");
|
||||
glUniform1i(glGetUniformLocation(forwardSplatMapSkinnedShieldCheckHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardSplatMapSkinnedShieldCheckHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardSplatMapSkinnedShieldCheckHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(forwardSplatMapSkinnedShieldCheckHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(forwardSplatMapSkinnedShieldCheckHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind ForwardPlusProgramSplatMapSkinned Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindModelUniforms(forwardSplatMapSkinnedShieldCheckHandle, modelJob, scene);
|
||||
//bind textures
|
||||
@@ -775,8 +969,17 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardSplatMapSkinnedShieldCheckHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
||||
}
|
||||
else {
|
||||
m_ForwardPlusSplatMapShieldCheckProgram->Bind();
|
||||
GLERROR("Bind SplatMap program");
|
||||
if (lastShader != m_ForwardPlusSplatMapShieldCheckProgram->GetHandle()) {
|
||||
m_ForwardPlusSplatMapShieldCheckProgram->Bind();
|
||||
lastShader = m_ForwardPlusSplatMapShieldCheckProgram->GetHandle();
|
||||
GLERROR("Bind SplatMap program");
|
||||
glUniform1i(glGetUniformLocation(forwardSplatShieldCheckHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardSplatShieldCheckHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardSplatShieldCheckHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(forwardSplatShieldCheckHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(forwardSplatShieldCheckHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind SplatMap Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindModelUniforms(forwardSplatShieldCheckHandle, modelJob, scene);
|
||||
//bind textures
|
||||
@@ -792,8 +995,17 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
case RawModel::MaterialType::SingleTextures:
|
||||
{
|
||||
if (modelJob->Model->IsSkinned()) {
|
||||
m_ForwardPlusSkinnedProgram->Bind();
|
||||
GLERROR("Bind ForwardPlusSkinnedProgram");
|
||||
if (lastShader != m_ForwardPlusSkinnedProgram->GetHandle()) {
|
||||
m_ForwardPlusSkinnedProgram->Bind();
|
||||
lastShader = m_ForwardPlusSkinnedProgram->GetHandle();
|
||||
GLERROR("Bind ForwardPlusSkinnedProgram program");
|
||||
glUniform1i(glGetUniformLocation(forwardSkinnedHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardSkinnedHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardSkinnedHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(forwardSkinnedHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(forwardSkinnedHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind ForwardPlusSkinnedProgram Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindModelUniforms(forwardSkinnedHandle, modelJob, scene);
|
||||
//bind textures
|
||||
@@ -812,8 +1024,17 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
|
||||
}
|
||||
else {
|
||||
m_ForwardPlusProgram->Bind();
|
||||
GLERROR("Bind ForwardPlusProgram");
|
||||
if (lastShader != m_ForwardPlusProgram->GetHandle()) {
|
||||
m_ForwardPlusProgram->Bind();
|
||||
lastShader = m_ForwardPlusProgram->GetHandle();
|
||||
GLERROR("Bind ForwardPlusProgram program");
|
||||
glUniform1i(glGetUniformLocation(forwardHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(forwardHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(forwardHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind ForwardPlusProgram Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindModelUniforms(forwardHandle, modelJob, scene);
|
||||
//bind textures
|
||||
@@ -827,8 +1048,17 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
case RawModel::MaterialType::SplatMapping:
|
||||
{
|
||||
if (modelJob->Model->IsSkinned()) {
|
||||
m_ForwardPlusSplatMapSkinnedProgram->Bind();
|
||||
GLERROR("Bind SplatMap program");
|
||||
if (lastShader != m_ForwardPlusSplatMapSkinnedProgram->GetHandle()) {
|
||||
m_ForwardPlusSplatMapSkinnedProgram->Bind();
|
||||
lastShader = m_ForwardPlusSplatMapSkinnedProgram->GetHandle();
|
||||
GLERROR("Bind SplatMap program");
|
||||
glUniform1i(glGetUniformLocation(forwardSplatMapSkinnedHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardSplatMapSkinnedHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardSplatMapSkinnedHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(forwardSplatMapSkinnedHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(forwardSplatMapSkinnedHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind SplatMap Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindModelUniforms(forwardSplatMapSkinnedHandle, modelJob, scene);
|
||||
//bind textures
|
||||
@@ -844,8 +1074,17 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardSkinnedHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
||||
}
|
||||
else {
|
||||
m_ForwardPlusSplatMapProgram->Bind();
|
||||
GLERROR("Bind SplatMap program");
|
||||
if (lastShader != m_ForwardPlusSplatMapProgram->GetHandle()) {
|
||||
m_ForwardPlusSplatMapProgram->Bind();
|
||||
lastShader = m_ForwardPlusSplatMapProgram->GetHandle();
|
||||
GLERROR("Bind SplatMap program");
|
||||
glUniform1i(glGetUniformLocation(forwardSplatMapHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardSplatMapHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardSplatMapHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(forwardSplatMapHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(forwardSplatMapHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind SplatMap Uniforms");
|
||||
}
|
||||
//bind uniforms
|
||||
BindModelUniforms(forwardSplatMapHandle, modelJob, scene);
|
||||
//bind textures
|
||||
@@ -857,8 +1096,11 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
}
|
||||
}
|
||||
//draw
|
||||
glBindVertexArray(modelJob->Model->VAO);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, modelJob->Model->ElementBuffer);
|
||||
if (lastModel != modelJob->ModelID) {
|
||||
glBindVertexArray(modelJob->Model->VAO);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, modelJob->Model->ElementBuffer);
|
||||
lastModel = modelJob->ModelID;
|
||||
}
|
||||
glDrawElements(GL_TRIANGLES, modelJob->EndIndex - modelJob->StartIndex + 1, GL_UNSIGNED_INT, (void*)(modelJob->StartIndex*sizeof(unsigned int)));
|
||||
if (GLERROR("models end")) {
|
||||
continue;
|
||||
@@ -963,17 +1205,26 @@ void DrawFinalPass::DrawShieldedModelRenderQueue(std::list<std::shared_ptr<Rende
|
||||
|
||||
void DrawFinalPass::DrawToDepthStencilBuffer(std::list<std::shared_ptr<RenderJob>>& jobs, RenderScene& scene)
|
||||
{
|
||||
|
||||
|
||||
GLuint shaderSkinnedHandle = m_FillDepthStencilBufferSkinnedProgram->GetHandle();
|
||||
GLuint shaderHandle = m_FillDepthStencilBufferProgram->GetHandle();
|
||||
GLuint lastShader = 0;
|
||||
for (auto &job : jobs) {
|
||||
auto modelJob = std::dynamic_pointer_cast<ModelJob>(job);
|
||||
|
||||
if(modelJob->Model->IsSkinned()) {
|
||||
m_FillDepthStencilBufferSkinnedProgram->Bind();
|
||||
GLuint shaderHandle = m_FillDepthStencilBufferSkinnedProgram->GetHandle();
|
||||
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, "M"), 1, GL_FALSE, glm::value_ptr(modelJob->Matrix));
|
||||
if (lastShader != m_FillDepthStencilBufferSkinnedProgram->GetHandle()) {
|
||||
m_FillDepthStencilBufferSkinnedProgram->Bind();
|
||||
lastShader = m_FillDepthStencilBufferSkinnedProgram->GetHandle();
|
||||
glUniform1i(glGetUniformLocation(shaderSkinnedHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform2f(glGetUniformLocation(shaderSkinnedHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(shaderSkinnedHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind Uniforms 1");
|
||||
}
|
||||
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "PVM"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix() * scene.Camera->ViewMatrix() * modelJob->Matrix));
|
||||
GLERROR("Bind PVM uniform");
|
||||
|
||||
std::vector<glm::mat4> frameBones;
|
||||
if (modelJob->BlendTree != nullptr) {
|
||||
@@ -984,11 +1235,19 @@ void DrawFinalPass::DrawToDepthStencilBuffer(std::list<std::shared_ptr<RenderJob
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
||||
|
||||
} else {
|
||||
m_FillDepthStencilBufferProgram->Bind();
|
||||
GLuint shaderHandle = m_FillDepthStencilBufferProgram->GetHandle();
|
||||
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, "M"), 1, GL_FALSE, glm::value_ptr(modelJob->Matrix));
|
||||
if (lastShader != m_FillDepthStencilBufferProgram->GetHandle()) {
|
||||
m_FillDepthStencilBufferProgram->Bind();
|
||||
lastShader = m_FillDepthStencilBufferProgram->GetHandle();
|
||||
glUniform1i(glGetUniformLocation(shaderHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
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->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
glUniform4fv(glGetUniformLocation(shaderHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind Uniforms 2");
|
||||
}
|
||||
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "PVM"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix() * scene.Camera->ViewMatrix() * modelJob->Matrix));
|
||||
GLERROR("Bind PVM uniform");
|
||||
}
|
||||
|
||||
|
||||
@@ -1010,6 +1269,9 @@ void DrawFinalPass::DrawSprites(std::list<std::shared_ptr<RenderJob>>&jobs, Rend
|
||||
|
||||
GLuint shaderHandle = m_SpriteProgram->GetHandle();
|
||||
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
glUniform3fv(glGetUniformLocation(shaderHandle, "CameraPos"), 1, glm::value_ptr(scene.Camera->Position()));
|
||||
|
||||
for(auto& job : jobs) {
|
||||
auto spriteJob = std::dynamic_pointer_cast<SpriteJob>(job);
|
||||
RenderState jobState;
|
||||
@@ -1018,10 +1280,7 @@ void DrawFinalPass::DrawSprites(std::list<std::shared_ptr<RenderJob>>&jobs, Rend
|
||||
if(spriteJob->Depth == 0) {
|
||||
jobState.Disable(GL_DEPTH_TEST);
|
||||
}
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(spriteJob->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()));
|
||||
glUniform3fv(glGetUniformLocation(shaderHandle, "CameraPos"), 1, glm::value_ptr(scene.Camera->Position()));
|
||||
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, "FillColor"), 1, glm::value_ptr(spriteJob->FillColor));
|
||||
glUniform1f(glGetUniformLocation(shaderHandle, "FillPercentage"), spriteJob->FillPercentage);
|
||||
@@ -1051,17 +1310,14 @@ void DrawFinalPass::DrawSprites(std::list<std::shared_ptr<RenderJob>>&jobs, Rend
|
||||
|
||||
void DrawFinalPass::BindExplosionUniforms(GLuint shaderHandle, std::shared_ptr<ExplosionEffectJob>& job, RenderScene& scene)
|
||||
{
|
||||
glUniform1i(glGetUniformLocation(shaderHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
GLERROR("Bind 1 uniform");
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(job->Matrix));
|
||||
GLERROR("Bind 2 uniform");
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
GLERROR("Bind 3 uniform");
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
GLERROR("Bind 4 uniform");
|
||||
|
||||
glUniform2f(glGetUniformLocation(shaderHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
GLERROR("Bind 5 uniform");
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "PVM"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix() * scene.Camera->ViewMatrix() * job->Matrix));
|
||||
GLERROR("Bind PVM uniform");
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "VM"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix() * job->Matrix));
|
||||
GLERROR("Bind VM uniform");
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "TIM"), 1, GL_FALSE, glm::value_ptr(glm::transpose(glm::inverse(job->Matrix))));
|
||||
GLERROR("Bind TIM uniform");
|
||||
|
||||
glUniform3fv(glGetUniformLocation(shaderHandle, "ExplosionOrigin"), 1, glm::value_ptr(job->ExplosionOrigin));
|
||||
GLERROR("Bind 6 uniform");
|
||||
@@ -1092,29 +1348,25 @@ void DrawFinalPass::BindExplosionUniforms(GLuint shaderHandle, std::shared_ptr<E
|
||||
GLERROR("Bind 18 uniform");
|
||||
glUniform1f(glGetUniformLocation(shaderHandle, "FillPercentage"), job->FillPercentage);
|
||||
GLERROR("Bind 19 uniform");
|
||||
glUniform4fv(glGetUniformLocation(shaderHandle, "AmbientColor"), 1, glm::value_ptr(scene.AmbientColor));
|
||||
GLERROR("Bind 20 uniform");
|
||||
glUniform1f(glGetUniformLocation(shaderHandle, "GlowIntensity"), job->GlowIntensity);
|
||||
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "LightP"), MAX_SPLITS, GL_FALSE, glm::value_ptr(*m_ShadowPass->LightP().data()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "LightV"), MAX_SPLITS, GL_FALSE, glm::value_ptr(*m_ShadowPass->LightV().data()));
|
||||
glUniform1fv(glGetUniformLocation(shaderHandle, "FarDistance"), MAX_SPLITS, m_ShadowPass->FarDistance().data());
|
||||
GLERROR("END");
|
||||
}
|
||||
|
||||
void DrawFinalPass::BindModelUniforms(GLuint shaderHandle, std::shared_ptr<ModelJob>& job, RenderScene& scene)
|
||||
{
|
||||
glUniform1i(glGetUniformLocation(shaderHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
GLERROR("Bind 1 uniform");
|
||||
GLint Location_M = glGetUniformLocation(shaderHandle, "M");
|
||||
glUniformMatrix4fv(Location_M, 1, GL_FALSE, glm::value_ptr(job->Matrix));
|
||||
GLERROR("Bind 2 uniform");
|
||||
GLint Location_V = glGetUniformLocation(shaderHandle, "V");
|
||||
glUniformMatrix4fv(Location_V, 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
GLERROR("Bind 3 uniform");
|
||||
GLint Location_P = glGetUniformLocation(shaderHandle, "P");
|
||||
glUniformMatrix4fv(Location_P, 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
GLERROR("Bind 4 uniform");
|
||||
|
||||
GLint Location_ScreenDimensions = glGetUniformLocation(shaderHandle, "ScreenDimensions");
|
||||
glUniform2f(Location_ScreenDimensions, m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
GLERROR("Bind 5 uniform");
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "PVM"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix() * scene.Camera->ViewMatrix() * job->Matrix));
|
||||
GLERROR("Bind PVM uniform");
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "VM"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix() * job->Matrix));
|
||||
GLERROR("Bind VM uniform");
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "TIM"), 1, GL_FALSE, glm::value_ptr(glm::transpose(glm::inverse(job->Matrix))));
|
||||
GLERROR("Bind TIM uniform");
|
||||
|
||||
GLint Location_FillPercentage = glGetUniformLocation(shaderHandle, "FillPercentage");
|
||||
glUniform1f(Location_FillPercentage, job->FillPercentage);
|
||||
@@ -1127,14 +1379,12 @@ void DrawFinalPass::BindModelUniforms(GLuint shaderHandle, std::shared_ptr<Model
|
||||
GLERROR("Bind 8 uniform");
|
||||
GLint Location_Color = glGetUniformLocation(shaderHandle, "Color");
|
||||
glUniform4fv(Location_Color, 1, glm::value_ptr(job->Color));
|
||||
GLERROR("Bind 9 uniform");
|
||||
GLint Location_AmbientColor = glGetUniformLocation(shaderHandle, "AmbientColor");
|
||||
glUniform4fv(Location_AmbientColor, 1, glm::value_ptr(scene.AmbientColor));
|
||||
|
||||
GLERROR("Bind 10 uniform");
|
||||
GLint Location_GlowIntensity = glGetUniformLocation(shaderHandle, "GlowIntensity");
|
||||
glUniform1f(Location_GlowIntensity, job->GlowIntensity);
|
||||
|
||||
glUniform1f(Location_GlowIntensity, job->GlowIntensity);
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "LightP"), MAX_SPLITS, GL_FALSE, glm::value_ptr(*m_ShadowPass->LightP().data()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "LightV"), MAX_SPLITS, GL_FALSE, glm::value_ptr(*m_ShadowPass->LightV().data()));
|
||||
glUniform1fv(glGetUniformLocation(shaderHandle, "FarDistance"), MAX_SPLITS, m_ShadowPass->FarDistance().data());
|
||||
|
||||
GLERROR("END");
|
||||
}
|
||||
|
||||
@@ -24,6 +24,13 @@ RenderBuffer::~RenderBuffer()
|
||||
}
|
||||
}
|
||||
|
||||
Texture2DArray::~Texture2DArray()
|
||||
{
|
||||
if (m_ResourceHandle != 0) {
|
||||
glDeleteTextures(1, m_ResourceHandle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FrameBuffer::~FrameBuffer()
|
||||
{
|
||||
@@ -53,12 +60,15 @@ void FrameBuffer::Generate()
|
||||
case GL_TEXTURE_2D:
|
||||
glFramebufferTexture2D(GL_FRAMEBUFFER, (*it)->m_Attachment, (*it)->m_ResourceType, *(*it)->m_ResourceHandle, 0);
|
||||
GLERROR("FrameBuffer generate: glFramebufferTexture2D");
|
||||
|
||||
break;
|
||||
case GL_RENDERBUFFER:
|
||||
glFramebufferRenderbuffer(GL_FRAMEBUFFER, (*it)->m_Attachment, (*it)->m_ResourceType, *(*it)->m_ResourceHandle);
|
||||
GLERROR("FrameBuffer generate: glFramebufferRenderbuffer");
|
||||
break;
|
||||
case GL_TEXTURE_2D_ARRAY:
|
||||
glFramebufferTexture(GL_FRAMEBUFFER, (*it)->m_Attachment, *(*it)->m_ResourceHandle, 0);
|
||||
GLERROR("FrameBuffer generate: glFramebufferTexture2DArray");
|
||||
break;
|
||||
}
|
||||
GLERROR("2");
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@ PickingPass::PickingPass(IRenderer* renderer, EventBroker* eb)
|
||||
|
||||
PickingPass::~PickingPass()
|
||||
{
|
||||
|
||||
CommonFunctions::DeleteTexture(&m_PickingTexture);
|
||||
CommonFunctions::DeleteTexture(&m_DepthBuffer);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,8 +62,9 @@ void PickingPass::Draw(RenderScene& scene)
|
||||
//TODO: Render: Add code for more jobs than modeljobs.
|
||||
GLuint shaderHandle = m_PickingProgram->GetHandle();
|
||||
GLuint shaderSkinnedHandle = m_PickingSkinnedProgram->GetHandle();
|
||||
GLuint lastShader = 0;
|
||||
unsigned int lastModel = 0;
|
||||
m_PickingProgram->Bind();
|
||||
|
||||
if (scene.ClearDepth) {
|
||||
//glClear(GL_DEPTH_BUFFER_BIT);
|
||||
state->Disable(GL_DEPTH_TEST);
|
||||
@@ -98,10 +100,11 @@ void PickingPass::Draw(RenderScene& scene)
|
||||
m_PickingColorsToEntity[glm::ivec2(pickColor[0], pickColor[1])] = pickInfo;
|
||||
|
||||
if (modelJob->Model->IsSkinned()) {
|
||||
m_PickingSkinnedProgram->Bind();
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "M"), 1, GL_FALSE, glm::value_ptr(modelJob->Matrix));
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
if (lastShader != m_PickingSkinnedProgram->GetHandle()) {
|
||||
m_PickingSkinnedProgram->Bind();
|
||||
lastShader = m_PickingSkinnedProgram->GetHandle();
|
||||
}
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "PVM"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix() * scene.Camera->ViewMatrix() * modelJob->Matrix));
|
||||
glUniform2fv(glGetUniformLocation(shaderSkinnedHandle, "PickingColor"), 1, glm::value_ptr(glm::vec2(pickColor[0], pickColor[1])));
|
||||
|
||||
std::vector<glm::mat4> frameBones;
|
||||
@@ -114,15 +117,19 @@ void PickingPass::Draw(RenderScene& scene)
|
||||
|
||||
|
||||
} else {
|
||||
m_PickingProgram->Bind();
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(modelJob->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()));
|
||||
if (lastShader != m_PickingProgram->GetHandle()) {
|
||||
m_PickingProgram->Bind();
|
||||
lastShader = m_PickingProgram->GetHandle();
|
||||
}
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "PVM"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix() * scene.Camera->ViewMatrix() * modelJob->Matrix));
|
||||
glUniform2fv(glGetUniformLocation(shaderHandle, "PickingColor"), 1, glm::value_ptr(glm::vec2(pickColor[0], pickColor[1])));
|
||||
}
|
||||
|
||||
glBindVertexArray(modelJob->Model->VAO);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, modelJob->Model->ElementBuffer);
|
||||
if (lastModel != modelJob->ModelID) {
|
||||
glBindVertexArray(modelJob->Model->VAO);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, modelJob->Model->ElementBuffer);
|
||||
lastModel = modelJob->ModelID;
|
||||
}
|
||||
glDrawElements(GL_TRIANGLES, modelJob->EndIndex - modelJob->StartIndex + 1, GL_UNSIGNED_INT, (void*)(modelJob->StartIndex * sizeof(unsigned int)));
|
||||
}
|
||||
}
|
||||
@@ -208,10 +215,11 @@ void PickingPass::Draw(RenderScene& scene)
|
||||
m_PickingColorsToEntity[glm::ivec2(pickColor[0], pickColor[1])] = pickInfo;
|
||||
|
||||
if (modelJob->Model->IsSkinned()) {
|
||||
m_PickingSkinnedProgram->Bind();
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "M"), 1, GL_FALSE, glm::value_ptr(modelJob->Matrix));
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||
if (lastShader != m_PickingSkinnedProgram->GetHandle()) {
|
||||
m_PickingSkinnedProgram->Bind();
|
||||
lastShader = m_PickingSkinnedProgram->GetHandle();
|
||||
}
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "PVM"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix() * scene.Camera->ViewMatrix() * modelJob->Matrix));
|
||||
glUniform2fv(glGetUniformLocation(shaderSkinnedHandle, "PickingColor"), 1, glm::value_ptr(glm::vec2(pickColor[0], pickColor[1])));
|
||||
|
||||
std::vector<glm::mat4> frameBones;
|
||||
@@ -224,19 +232,24 @@ void PickingPass::Draw(RenderScene& scene)
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
||||
|
||||
} else {
|
||||
m_PickingProgram->Bind();
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(modelJob->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()));
|
||||
if (lastShader != m_PickingProgram->GetHandle()) {
|
||||
m_PickingProgram->Bind();
|
||||
lastShader = m_PickingProgram->GetHandle();
|
||||
}
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "PVM"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix() * scene.Camera->ViewMatrix() * modelJob->Matrix));
|
||||
glUniform2fv(glGetUniformLocation(shaderHandle, "PickingColor"), 1, glm::value_ptr(glm::vec2(pickColor[0], pickColor[1])));
|
||||
}
|
||||
|
||||
glBindVertexArray(modelJob->Model->VAO);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, modelJob->Model->ElementBuffer);
|
||||
if (lastModel != modelJob->ModelID) {
|
||||
glBindVertexArray(modelJob->Model->VAO);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, modelJob->Model->ElementBuffer);
|
||||
lastModel = modelJob->ModelID;
|
||||
}
|
||||
glDrawElements(GL_TRIANGLES, modelJob->EndIndex - modelJob->StartIndex + 1, GL_UNSIGNED_INT, (void*)(modelJob->StartIndex * sizeof(unsigned int)));
|
||||
}
|
||||
}
|
||||
|
||||
m_PickingProgram->Bind();
|
||||
for (auto& job : scene.Jobs.SpriteJob) {
|
||||
auto spriteJob = std::dynamic_pointer_cast<SpriteJob>(job);
|
||||
if (!spriteJob->Pickable) {
|
||||
@@ -271,14 +284,11 @@ void PickingPass::Draw(RenderScene& scene)
|
||||
|
||||
m_PickingColorsToEntity[glm::ivec2(pickColor[0], pickColor[1])] = pickInfo;
|
||||
|
||||
m_PickingProgram->Bind();
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(spriteJob->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()));
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "PVM"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix() * scene.Camera->ViewMatrix() * spriteJob->Matrix));
|
||||
glUniform2fv(glGetUniformLocation(shaderHandle, "PickingColor"), 1, glm::value_ptr(glm::vec2(pickColor[0], pickColor[1])));
|
||||
|
||||
glBindVertexArray(spriteJob->Model->VAO);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, spriteJob->Model->ElementBuffer);
|
||||
glBindVertexArray(spriteJob->Model->VAO);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, spriteJob->Model->ElementBuffer);
|
||||
glDrawElements(GL_TRIANGLES, spriteJob->EndIndex - spriteJob->StartIndex + 1, GL_UNSIGNED_INT, (void*)(spriteJob->StartIndex * sizeof(unsigned int)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,7 +258,8 @@ void RenderSystem::fillModels(RenderScene::Queues &Jobs)
|
||||
m_World,
|
||||
fillColor,
|
||||
fillPercentage,
|
||||
isShielded
|
||||
isShielded,
|
||||
false
|
||||
));
|
||||
if (m_World->HasComponent(cModel.EntityID, "Shield")){
|
||||
explosionEffectJob->CalculateHash();
|
||||
@@ -296,7 +297,8 @@ void RenderSystem::fillModels(RenderScene::Queues &Jobs)
|
||||
m_World,
|
||||
fillColor,
|
||||
fillPercentage,
|
||||
isShielded
|
||||
isShielded,
|
||||
(bool)cModel["Shadow"]
|
||||
));
|
||||
if (m_World->HasComponent(cModel.EntityID, "Shield")) {
|
||||
modelJob->CalculateHash();
|
||||
@@ -449,7 +451,7 @@ void RenderSystem::Update(double dt)
|
||||
fillModels(scene.Jobs);
|
||||
fillPointLights(scene.Jobs.PointLight, m_World);
|
||||
//TODO: Make sure all objects needed are also sorted.
|
||||
scene.Jobs.OpaqueObjects.sort();
|
||||
scene.Jobs.OpaqueObjects.sort([](auto& a, auto& b) {return *a < *b; });
|
||||
fillSprites(scene.Jobs.SpriteJob, m_World);
|
||||
fillDirectionalLights(scene.Jobs.DirectionalLight, m_World);
|
||||
fillText(scene.Jobs.Text, m_World);
|
||||
|
||||
@@ -2,6 +2,19 @@
|
||||
|
||||
std::unordered_map<GLFWwindow*, Renderer*> Renderer::m_WindowToRenderer;
|
||||
|
||||
Renderer::~Renderer() {
|
||||
delete m_PickingPass;
|
||||
delete m_LightCullingPass;
|
||||
delete m_ImGuiRenderPass;
|
||||
delete m_DrawFinalPass;
|
||||
delete m_DrawScreenQuadPass;
|
||||
delete m_DrawBloomPass;
|
||||
delete m_DrawColorCorrectionPass;
|
||||
delete m_SSAOPass;
|
||||
delete m_CubeMapPass;
|
||||
delete m_TextPass;
|
||||
}
|
||||
|
||||
void Renderer::Initialize()
|
||||
{
|
||||
m_SSAO_Quality = m_Config->Get<int>("SSAO.Quality", 0);
|
||||
@@ -133,7 +146,9 @@ void Renderer::Draw(RenderFrame& frame)
|
||||
m_DrawFinalPass->ClearBuffer();
|
||||
m_DrawBloomPass->ClearBuffer();
|
||||
m_SSAOPass->ClearBuffer();
|
||||
m_ShadowPass->ClearBuffer();
|
||||
m_BlurHUDPass->ClearBuffer();
|
||||
m_ShadowPass->DebugGUI();
|
||||
PerformanceTimer::StopTimer("Renderer-ClearBuffers");
|
||||
GLERROR("ClearBuffers");
|
||||
for (auto scene : frame.RenderScenes) {
|
||||
@@ -149,6 +164,9 @@ void Renderer::Draw(RenderFrame& frame)
|
||||
PerformanceTimer::StartTimer("Renderer-Depth");
|
||||
SortRenderJobsByDepth(*scene);
|
||||
GLERROR("SortByDepth");
|
||||
PerformanceTimer::StartTimerAndStopPrevious("Draw shadow maps");
|
||||
m_ShadowPass->Draw(*scene);
|
||||
GLERROR("Draw shadow maps");
|
||||
PerformanceTimer::StartTimerAndStopPrevious("Renderer-Generate Frustrums");
|
||||
m_LightCullingPass->GenerateNewFrustum(*scene);
|
||||
GLERROR("Generate frustums");
|
||||
@@ -251,8 +269,9 @@ void Renderer::InitializeRenderPasses()
|
||||
m_LightCullingPass = new LightCullingPass(this);
|
||||
m_CubeMapPass = new CubeMapPass(this);
|
||||
m_SSAOPass = new SSAOPass(this, m_Config);
|
||||
m_ShadowPass = new ShadowPass(this);
|
||||
m_BlurHUDPass = new BlurHUD(this);
|
||||
m_DrawFinalPass = new DrawFinalPass(this, m_LightCullingPass, m_CubeMapPass, m_SSAOPass);
|
||||
m_DrawFinalPass = new DrawFinalPass(this, m_LightCullingPass, m_CubeMapPass, m_SSAOPass, m_ShadowPass);
|
||||
m_DrawScreenQuadPass = new DrawScreenQuadPass(this);
|
||||
m_DrawBloomPass = new DrawBloomPass(this, m_Config);
|
||||
m_DrawColorCorrectionPass = new DrawColorCorrectionPass(this);
|
||||
|
||||
@@ -10,6 +10,13 @@ SSAOPass::SSAOPass(IRenderer* renderer, ConfigFile* config)
|
||||
|
||||
}
|
||||
|
||||
SSAOPass::~SSAOPass() {
|
||||
CommonFunctions::DeleteTexture(&m_SSAOTexture);
|
||||
CommonFunctions::DeleteTexture(&m_SSAOViewSpaceZTexture);
|
||||
CommonFunctions::DeleteTexture(&m_Gaussian_horiz);
|
||||
CommonFunctions::DeleteTexture(&m_Gaussian_vert);
|
||||
}
|
||||
|
||||
void SSAOPass::ChangeQuality(int quality)
|
||||
{
|
||||
if (m_Quality == quality) {
|
||||
|
||||
@@ -4,22 +4,32 @@ GLuint Shader::CompileShader(GLenum shaderType, std::string fileName)
|
||||
{
|
||||
LOG_INFO("Compiling shader \"%s\"", fileName.c_str());
|
||||
|
||||
std::string shaderFile;
|
||||
std::ifstream in(fileName, std::ios::in);
|
||||
if (!in) {
|
||||
LOG_ERROR("Error: Failed to open shader file \"%s\"", fileName.c_str());
|
||||
return 0;
|
||||
}
|
||||
in.seekg(0, std::ios::end);
|
||||
shaderFile.resize((int)in.tellg());
|
||||
in.seekg(0, std::ios::beg);
|
||||
in.read(&shaderFile[0], shaderFile.size());
|
||||
in.close();
|
||||
std::string shaderFile = ReadFile(fileName);
|
||||
|
||||
GLuint shader = glCreateShader(shaderType);
|
||||
if (GLERROR("glCreateShader"))
|
||||
return 0;
|
||||
|
||||
std::size_t startPos = 0;
|
||||
std::size_t SEofNewFile[2];
|
||||
std::string key = "#include";
|
||||
while((startPos = shaderFile.find(key, startPos)) != std::string::npos)
|
||||
{
|
||||
SEofNewFile[0] = shaderFile.find('"', startPos+key.length())+1;
|
||||
SEofNewFile[1] = shaderFile.find('"', SEofNewFile[0]);
|
||||
if (SEofNewFile[0] == std::string::npos || SEofNewFile[1] == std::string::npos)
|
||||
return 0;
|
||||
|
||||
std::string replacementFileName = shaderFile.substr(SEofNewFile[0], SEofNewFile[1] - SEofNewFile[0]);
|
||||
std::string replacementString = ReadFile(replacementFileName);
|
||||
size_t firstof = replacementString.find_first_of((char)0);
|
||||
replacementString.erase(firstof, replacementString.size() - firstof);
|
||||
if (replacementString.length() <= 0)
|
||||
return 0;
|
||||
shaderFile.replace(startPos, SEofNewFile[1]+2 - startPos, replacementString + "\n");
|
||||
startPos += replacementString.length(); //This might not be wanted.
|
||||
}
|
||||
|
||||
const GLchar* shaderFiles = shaderFile.c_str();
|
||||
const GLint length = static_cast<GLint>(shaderFile.length());
|
||||
glShaderSource(shader, 1, &shaderFiles, &length);
|
||||
@@ -46,6 +56,24 @@ GLuint Shader::CompileShader(GLenum shaderType, std::string fileName)
|
||||
return shader;
|
||||
}
|
||||
|
||||
std::string Shader::ReadFile(std::string fileName)
|
||||
{
|
||||
std::string shaderFile;
|
||||
std::ifstream in(fileName, std::ios::in);
|
||||
if (!in) {
|
||||
LOG_ERROR("Error: Failed to open shader file \"%s\"", fileName.c_str());
|
||||
return "";
|
||||
}
|
||||
|
||||
in.seekg(0, std::ios::end);
|
||||
shaderFile.resize((int)in.tellg());
|
||||
in.seekg(0, std::ios::beg);
|
||||
in.read(&shaderFile[0], shaderFile.size());
|
||||
in.close();
|
||||
return shaderFile;
|
||||
}
|
||||
|
||||
|
||||
Shader::Shader(GLenum shaderType, std::string fileName) : m_ShaderType(shaderType), m_FileName(fileName)
|
||||
{
|
||||
m_ShaderHandle = 0;
|
||||
|
||||
@@ -0,0 +1,313 @@
|
||||
#include "Rendering/ShadowPass.h"
|
||||
|
||||
ShadowPass::ShadowPass(IRenderer * renderer, int shadow_res_x, int shadow_res_y)
|
||||
{
|
||||
m_Renderer = renderer;
|
||||
m_ResolutionSizeWidth = shadow_res_x;
|
||||
m_ResolutionSizeHeight = shadow_res_y;
|
||||
|
||||
InitializeFrameBuffers();
|
||||
InitializeShaderPrograms();
|
||||
}
|
||||
|
||||
ShadowPass::ShadowPass(IRenderer * renderer)
|
||||
{
|
||||
m_Renderer = renderer;
|
||||
|
||||
InitializeFrameBuffers();
|
||||
InitializeShaderPrograms();
|
||||
}
|
||||
|
||||
ShadowPass::~ShadowPass()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ShadowPass::DebugGUI()
|
||||
{
|
||||
ImGui::Checkbox("EnableShadows", &m_EnableShadows);
|
||||
ImGui::DragFloat2("ShadowMapNearFar", m_NearFarPlane, 1.f, -1000.f, 1000.f);
|
||||
ImGui::DragFloat("ShadowClippingWeight", &m_SplitWeight, 0.001f, 0.f, 1.f);
|
||||
ImGui::Checkbox("ShadowTransparentObjects", &m_TransparentObjects);
|
||||
ImGui::Checkbox("ShadowOnTextureAlphas", &m_TexturedShadows);
|
||||
}
|
||||
|
||||
void ShadowPass::InitializeCameras(RenderScene & scene)
|
||||
{
|
||||
for (int i = 0; i < m_CurrentNrOfSplits; i++) {
|
||||
m_shadowFrusta[i].AspectRatio = scene.Camera->AspectRatio();
|
||||
m_shadowFrusta[i].FOV = scene.Camera->FOV();
|
||||
}
|
||||
}
|
||||
|
||||
// UpdateSplitDist computes the near and far distances for every frustum slice
|
||||
// in camera eye space - that is, at what distance does a slice start and end
|
||||
void ShadowPass::UpdateSplitDist(std::array<ShadowFrustum, MAX_SPLITS>& frusta, float near_distance, float far_distance)
|
||||
{
|
||||
float lambda = m_SplitWeight;
|
||||
float ratio = far_distance / near_distance;
|
||||
|
||||
frusta[0].NearClip = near_distance;
|
||||
|
||||
for (int i = 1; i < m_CurrentNrOfSplits; i++) {
|
||||
float si = i / static_cast<float>(m_CurrentNrOfSplits);
|
||||
|
||||
frusta[i].NearClip = lambda * (near_distance * powf(ratio, si)) + (1 - lambda) * (near_distance + (far_distance - near_distance) * si);
|
||||
frusta[i - 1].FarClip = frusta[i].NearClip * 1.005f;
|
||||
}
|
||||
|
||||
frusta[m_CurrentNrOfSplits - 1].FarClip = far_distance;
|
||||
}
|
||||
|
||||
void ShadowPass::UpdateFrustumPoints(ShadowFrustum& frustum, glm::mat4 p, glm::mat4 v)
|
||||
{
|
||||
std::array<glm::vec4, 8> CornerPoint = {
|
||||
glm::vec4(-1.f, -1.f, -1.f, 1.f),
|
||||
glm::vec4(-1.f, 1.f, -1.f, 1.f),
|
||||
glm::vec4(1.f, 1.f, -1.f, 1.f),
|
||||
glm::vec4(1.f, -1.f, -1.f, 1.f),
|
||||
glm::vec4(-1.f, -1.f, 1.f, 1.f),
|
||||
glm::vec4(-1.f, 1.f, 1.f, 1.f),
|
||||
glm::vec4(1.f, 1.f, 1.f, 1.f),
|
||||
glm::vec4(1.f, -1.f, 1.f, 1.f)
|
||||
};
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
glm::vec4 NDC = glm::inverse(p) * CornerPoint[i];
|
||||
NDC = NDC / NDC.w;
|
||||
frustum.CornerPoint[i] = glm::vec3(glm::inverse(v) * NDC);
|
||||
}
|
||||
}
|
||||
|
||||
// Compute the 8 corner points of the current view frustum in world space
|
||||
void ShadowPass::UpdateFrustumPoints(ShadowFrustum& frustum, glm::vec3 camera_position, glm::vec3 view_dir)
|
||||
{
|
||||
glm::vec3 up = glm::vec3(0.f, 1.f, 0.f);
|
||||
glm::vec3 right = glm::normalize(glm::cross(view_dir, up));
|
||||
|
||||
glm::vec3 far_center = camera_position + glm::normalize(view_dir) * frustum.FarClip;
|
||||
glm::vec3 near_center = camera_position + glm::normalize(view_dir) * frustum.NearClip;
|
||||
frustum.MiddlePoint = near_center + (far_center - near_center) * 0.5f;
|
||||
|
||||
up = glm::normalize(glm::cross(right, view_dir));
|
||||
|
||||
// these heights and widths are half the heights and widths of the near and far plane rectangles.
|
||||
float near_height = tan(frustum.FOV / 2.f) * frustum.NearClip;
|
||||
float near_width = near_height * frustum.AspectRatio;
|
||||
float far_height = tan(frustum.FOV / 2.f) * frustum.FarClip;
|
||||
float far_width = far_height * frustum.AspectRatio;
|
||||
|
||||
frustum.CornerPoint[0] = near_center - up * near_height - right * near_width;
|
||||
frustum.CornerPoint[1] = near_center + up * near_height - right * near_width;
|
||||
frustum.CornerPoint[2] = near_center + up * near_height + right * near_width;
|
||||
frustum.CornerPoint[3] = near_center - up * near_height + right * near_width;
|
||||
|
||||
frustum.CornerPoint[4] = far_center - up * far_height - right * far_width;
|
||||
frustum.CornerPoint[5] = far_center + up * far_height - right * far_width;
|
||||
frustum.CornerPoint[6] = far_center + up * far_height + right * far_width;
|
||||
frustum.CornerPoint[7] = far_center - up * far_height + right * far_width;
|
||||
}
|
||||
|
||||
float ShadowPass::FindRadius(ShadowFrustum& frustum)
|
||||
{
|
||||
float radius = 0.f;
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
float distance = glm::distance(frustum.MiddlePoint, frustum.CornerPoint[i]);
|
||||
if (distance > radius) {
|
||||
radius = distance;
|
||||
}
|
||||
}
|
||||
|
||||
frustum.Radius = radius;
|
||||
return radius;
|
||||
}
|
||||
|
||||
void ShadowPass::InitializeFrameBuffers()
|
||||
{
|
||||
// Depth texture
|
||||
glGenTextures(1, &m_DepthMap);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D_ARRAY, m_DepthMap);
|
||||
glTexStorage3D(GL_TEXTURE_2D_ARRAY, 1, GL_DEPTH_COMPONENT16, m_ResolutionSizeWidth, m_ResolutionSizeHeight, m_CurrentNrOfSplits);
|
||||
|
||||
//glTexSubImage3D(GL_TEXTURE_2D_ARRAY, 0, 0, 0, 0, m_ResolutionSizeWidth, m_ResolutionSizeHeight, m_CurrentNrOfSplits, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, nullptr);
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
|
||||
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
|
||||
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);
|
||||
glTexParameterfv(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_BORDER_COLOR, glm::vec4(1.f).data);
|
||||
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);
|
||||
|
||||
m_DepthBuffer.AddResource(std::shared_ptr<BufferResource>(new Texture2DArray(&m_DepthMap, GL_DEPTH_ATTACHMENT)));
|
||||
m_DepthBuffer.Generate();
|
||||
|
||||
GLERROR("depthMap failed END");
|
||||
}
|
||||
|
||||
void ShadowPass::InitializeShaderPrograms()
|
||||
{
|
||||
m_ShadowProgram = ResourceManager::Load<ShaderProgram>("#ShadowProgram");
|
||||
m_ShadowProgram->AddShader(std::shared_ptr<Shader>(new VertexShader("Shaders/Shadow.vert.glsl")));
|
||||
m_ShadowProgram->AddShader(std::shared_ptr<Shader>(new FragmentShader("Shaders/Shadow.frag.glsl")));
|
||||
m_ShadowProgram->Compile();
|
||||
m_ShadowProgram->BindFragDataLocation(0, "ShadowMap");
|
||||
m_ShadowProgram->Link();
|
||||
|
||||
|
||||
}
|
||||
|
||||
void ShadowPass::ClearBuffer()
|
||||
{
|
||||
m_DepthBuffer.Bind();
|
||||
|
||||
for (int i = 0; i < m_CurrentNrOfSplits; i++) {
|
||||
glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, m_DepthMap, 0, i);
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
}
|
||||
|
||||
m_DepthBuffer.Unbind();
|
||||
}
|
||||
|
||||
void ShadowPass::PointsToLightspace(ShadowFrustum& frustum, glm::mat4 v)
|
||||
{
|
||||
float left = INFINITY;
|
||||
float right = -INFINITY;
|
||||
float bottom = INFINITY;
|
||||
float top = -INFINITY;
|
||||
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
glm::vec3 tempPoint = glm::vec3(v * glm::vec4(frustum.CornerPoint[i], 1.f));
|
||||
|
||||
if (tempPoint.x < left) { left = tempPoint.x; }
|
||||
if (tempPoint.x > right) { right = tempPoint.x; }
|
||||
if (tempPoint.y < bottom) { bottom = tempPoint.y; }
|
||||
if (tempPoint.y > top) { top = tempPoint.y; }
|
||||
}
|
||||
|
||||
frustum.LRBT = { left, right, bottom, top };
|
||||
}
|
||||
|
||||
void ShadowPass::RadiusToLightspace(ShadowFrustum& frustum)
|
||||
{
|
||||
float quantizationStep = 1.0f / m_ResolutionSizeHeight;
|
||||
|
||||
float left = -frustum.Radius;
|
||||
float right = frustum.Radius;
|
||||
float bottom = -frustum.Radius;
|
||||
float top = frustum.Radius;
|
||||
|
||||
frustum.LRBT = { left, right, bottom, top };
|
||||
}
|
||||
|
||||
void ShadowPass::Draw(RenderScene & scene)
|
||||
{
|
||||
if (m_EnableShadows) {
|
||||
InitializeCameras(scene);
|
||||
UpdateSplitDist(m_shadowFrusta, scene.Camera->NearClip(), scene.Camera->FarClip());
|
||||
|
||||
ShadowPassState* state = new ShadowPassState(m_DepthBuffer.GetHandle());
|
||||
|
||||
m_ShadowProgram->Bind();
|
||||
GLuint shaderHandle = m_ShadowProgram->GetHandle();
|
||||
glViewport(0, 0, m_ResolutionSizeWidth, m_ResolutionSizeHeight);
|
||||
|
||||
for (int i = 0; i < m_CurrentNrOfSplits; i++) {
|
||||
UpdateFrustumPoints(m_shadowFrusta[i], scene.Camera->Position(), scene.Camera->Forward());
|
||||
|
||||
glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, m_DepthMap, 0, i);
|
||||
|
||||
for (auto &job : scene.Jobs.DirectionalLight) {
|
||||
auto directionalLightJob = std::dynamic_pointer_cast<DirectionalLightJob>(job);
|
||||
|
||||
if (directionalLightJob) {
|
||||
m_LightView[i] = glm::lookAt(glm::vec3(-directionalLightJob->Direction) + m_shadowFrusta[i].MiddlePoint, m_shadowFrusta[i].MiddlePoint, glm::vec3(0.f, 1.f, 0.f));
|
||||
|
||||
PointsToLightspace(m_shadowFrusta[i], m_LightView[i]);
|
||||
//FindRadius(m_shadowFrusta[i]);
|
||||
//RadiusToLightspace(m_shadowFrusta[i]);
|
||||
m_LightProjection[i] = glm::ortho(m_shadowFrusta[i].LRBT[LEFT], m_shadowFrusta[i].LRBT[RIGHT], m_shadowFrusta[i].LRBT[BOTTOM], m_shadowFrusta[i].LRBT[TOP], m_NearFarPlane[NEAR], m_NearFarPlane[FAR]);
|
||||
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "P"), 1, GL_FALSE, glm::value_ptr(m_LightProjection[i]));
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "V"), 1, GL_FALSE, glm::value_ptr(m_LightView[i]));
|
||||
|
||||
GLERROR("ShadowLight ERROR");
|
||||
|
||||
for (auto &objectJob : scene.Jobs.OpaqueObjects) {
|
||||
if (!std::dynamic_pointer_cast<ExplosionEffectJob>(objectJob)) {
|
||||
auto modelJob = std::dynamic_pointer_cast<ModelJob>(objectJob);
|
||||
|
||||
if (!modelJob->Shadow) {
|
||||
continue;
|
||||
}
|
||||
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(modelJob->Matrix));
|
||||
glUniform1f(glGetUniformLocation(shaderHandle, "Alpha"), 1.f);
|
||||
|
||||
glBindVertexArray(modelJob->Model->VAO);
|
||||
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)));
|
||||
|
||||
GLERROR("Shadow Draw ERROR");
|
||||
}
|
||||
}
|
||||
if (m_TransparentObjects) {
|
||||
state->CullFace(GL_BACK);
|
||||
for (auto &objectJob : scene.Jobs.TransparentObjects) {
|
||||
if (!std::dynamic_pointer_cast<ExplosionEffectJob>(objectJob)) {
|
||||
auto modelJob = std::dynamic_pointer_cast<ModelJob>(objectJob);
|
||||
|
||||
if (!modelJob->Shadow) {
|
||||
continue;
|
||||
}
|
||||
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(modelJob->Matrix));
|
||||
glUniform1f(glGetUniformLocation(shaderHandle, "Alpha"), modelJob->Color.a);
|
||||
|
||||
if (m_TexturedShadows) {
|
||||
switch (modelJob->Type) {
|
||||
case RawModel::MaterialType::SingleTextures:
|
||||
case RawModel::MaterialType::Basic:
|
||||
{
|
||||
glActiveTexture(GL_TEXTURE24);
|
||||
if (modelJob->DiffuseTexture.size() > 0 && modelJob->DiffuseTexture[0]->Texture != nullptr) {
|
||||
glBindTexture(GL_TEXTURE_2D, modelJob->DiffuseTexture[0]->Texture->m_Texture);
|
||||
glUniform2fv(glGetUniformLocation(shaderHandle, "DiffuseUVRepeat"), 1, glm::value_ptr(modelJob->DiffuseTexture[0]->UVRepeat));
|
||||
}
|
||||
else {
|
||||
glBindTexture(GL_TEXTURE_2D, m_WhiteTexture->m_Texture);
|
||||
glUniform2fv(glGetUniformLocation(shaderHandle, "DiffuseUVRepeat"), 1, glm::value_ptr(glm::vec2(1.0f, 1.0f)));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case RawModel::MaterialType::SplatMapping:
|
||||
{
|
||||
glActiveTexture(GL_TEXTURE24);
|
||||
glBindTexture(GL_TEXTURE_2D, m_WhiteTexture->m_Texture);
|
||||
glUniform2fv(glGetUniformLocation(shaderHandle, "DiffuseUVRepeat"), 1, glm::value_ptr(glm::vec2(1.0f, 1.0f)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
glBindVertexArray(modelJob->Model->VAO);
|
||||
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)));
|
||||
|
||||
GLERROR("Shadow Draw ERROR");
|
||||
}
|
||||
}
|
||||
state->CullFace(GL_FRONT);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
glViewport(0, 0, m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||
m_DepthBuffer.Unbind();
|
||||
delete state;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#include "Rendering/ShadowPassState.h"
|
||||
|
||||
ShadowPassState::ShadowPassState(GLuint frameBuffer)
|
||||
{
|
||||
BindFramebuffer(frameBuffer);
|
||||
Enable(GL_DEPTH_TEST);
|
||||
Enable(GL_CULL_FACE);
|
||||
Disable(GL_BLEND);
|
||||
Disable(GL_TEXTURE_2D);
|
||||
CullFace(GL_FRONT);
|
||||
ClearColor(glm::vec4(0.f, 0.f, 0.f, 0.f));
|
||||
//Enable(GL_ALPHA_TEST);
|
||||
//glAlphaFunc(GL_GREATER, 0.9f);
|
||||
}
|
||||
|
||||
ShadowPassState::~ShadowPassState()
|
||||
{
|
||||
|
||||
}
|
||||
@@ -321,6 +321,8 @@ Skeleton::~Skeleton()
|
||||
for (auto &kv : Bones) {
|
||||
delete kv.second;
|
||||
}
|
||||
|
||||
BlendTrees.clear();
|
||||
}
|
||||
|
||||
const Skeleton::Animation* Skeleton::GetAnimation(std::string name)
|
||||
|
||||
@@ -37,7 +37,7 @@ ScreenCoords::PixelData ScreenCoords::ToPixelData(float x, float y, FrameBuffer*
|
||||
glReadPixels(x, y, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, &pdata);
|
||||
GLERROR("glReadPixels(pdata) Error");
|
||||
PickDataBuffer->Unbind();
|
||||
|
||||
GLERROR("Unbind Error");
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, DepthBuffer);
|
||||
GLERROR("glBindFramebuffer(DepthBuffer) Error");
|
||||
float depthData;
|
||||
|
||||
@@ -81,27 +81,18 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
||||
cameraOrientation.x += controller->Rotation().x;
|
||||
// Limit camera pitch so we don't break our necks
|
||||
cameraOrientation.x = glm::clamp(cameraOrientation.x, -glm::half_pi<float>(), glm::half_pi<float>());
|
||||
|
||||
// Set third person model aim pitch
|
||||
EntityWrapper playerModel = player.FirstChildByName("PlayerModel");
|
||||
|
||||
//Third-person aim
|
||||
if (playerModel.Valid()) {
|
||||
EntityWrapper aimPrimaryEntity = playerModel.FirstChildByName("AimPrimary");
|
||||
EntityWrapper aimPrimaryEntity = playerModel.FirstChildByName("Aim");
|
||||
if(aimPrimaryEntity.Valid()){
|
||||
if(aimPrimaryEntity.HasComponent("Animation")) {
|
||||
float pitch = cameraOrientation.x + 0.2f;
|
||||
double time = (pitch + glm::half_pi<float>()) / glm::pi<float>();
|
||||
float pitch = cameraOrientation.x;
|
||||
double time = ((pitch + glm::half_pi<float>()) / glm::pi<float>());
|
||||
(double&)aimPrimaryEntity["Animation"]["Time"] = time;
|
||||
}
|
||||
}
|
||||
EntityWrapper aimSecondaryEntity = playerModel.FirstChildByName("AimSecondary");
|
||||
if (aimSecondaryEntity.Valid()) {
|
||||
if (aimSecondaryEntity.HasComponent("Animation")) {
|
||||
float pitch = cameraOrientation.x + 0.2f;
|
||||
double time = (pitch + glm::half_pi<float>()) / glm::pi<float>();
|
||||
(double&)aimSecondaryEntity["Animation"]["Time"] = time;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +204,7 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
||||
{
|
||||
Events::AutoAnimationBlend aeb;
|
||||
aeb.Duration = 0.25;
|
||||
aeb.NodeName = "StandCrouchBlend";
|
||||
aeb.NodeName = "MovementBlend";
|
||||
aeb.RootNode = playerModel;
|
||||
aeb.Start = true;
|
||||
aeb.Restart = false;
|
||||
@@ -244,11 +235,11 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
||||
{
|
||||
Events::AutoAnimationBlend aeb;
|
||||
aeb.Duration = 0.25;
|
||||
aeb.NodeName = "StandCrouchBlend";
|
||||
aeb.NodeName = "MovementBlend";
|
||||
aeb.RootNode = playerModel;
|
||||
aeb.Start = true;
|
||||
aeb.Restart = false;
|
||||
aeb.AnimationEntity = playerModel.FirstChildByName("Jump");
|
||||
aeb.AnimationEntity = playerModel.FirstChildByName("BlendTreeLower").FirstChildByName("Jump");
|
||||
m_EventBroker->Publish(aeb);
|
||||
}
|
||||
}
|
||||
@@ -377,12 +368,12 @@ void PlayerMovementSystem::spawnHexagon(EntityWrapper target)
|
||||
bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
|
||||
{
|
||||
EntityWrapper player(m_World, e.Player);
|
||||
if (!player.Valid() || !IsClient){// || player.ID == LocalPlayer.ID) {
|
||||
if (!player.Valid()){// || !IsClient || player.ID == LocalPlayer.ID) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto entityFile = ResourceManager::Load<EntityFile>("Schema/Entities/DashEffect.xml");
|
||||
EntityWrapper dashEffect = entityFile->MergeInto(m_World);
|
||||
// auto entityFile = ResourceManager::Load<EntityFile>("Schema/Entities/DashEffect.xml");
|
||||
// EntityWrapper dashEffect = entityFile->MergeInto(m_World);
|
||||
EntityWrapper playerModel = player.FirstChildByName("PlayerModel");
|
||||
|
||||
for (auto& kv : m_PlayerInputControllers) {
|
||||
@@ -400,7 +391,7 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
|
||||
if (controller->Movement().x > 0) {
|
||||
{
|
||||
Events::AutoAnimationBlend aeb;
|
||||
aeb.Duration = 0.3;
|
||||
aeb.Duration = 0.1;
|
||||
aeb.NodeName = "DashRight";
|
||||
aeb.RootNode = playerModel;
|
||||
aeb.Restart = true;
|
||||
@@ -409,19 +400,18 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
|
||||
}
|
||||
{
|
||||
Events::AutoAnimationBlend aeb;
|
||||
aeb.Duration = 0.3;
|
||||
aeb.NodeName = "StandCrouchBlend";
|
||||
aeb.Duration = 0.2;
|
||||
aeb.NodeName = "MovementBlend";
|
||||
aeb.RootNode = playerModel;
|
||||
aeb.Delay = -0.3;
|
||||
aeb.Start = true;
|
||||
aeb.Restart = false;
|
||||
aeb.AnimationEntity = playerModel.FirstChildByName("DashForward");
|
||||
aeb.AnimationEntity = playerModel.FirstChildByName("DashRight");
|
||||
m_EventBroker->Publish(aeb);
|
||||
}
|
||||
} else {
|
||||
{
|
||||
Events::AutoAnimationBlend aeb;
|
||||
aeb.Duration = 0.3;
|
||||
aeb.Duration = 0.1;
|
||||
aeb.NodeName = "DashLeft";
|
||||
aeb.RootNode = playerModel;
|
||||
aeb.Restart = true;
|
||||
@@ -430,13 +420,12 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
|
||||
}
|
||||
{
|
||||
Events::AutoAnimationBlend aeb;
|
||||
aeb.Duration = 0.3;
|
||||
aeb.NodeName = "StandCrouchBlend";
|
||||
aeb.Duration = 0.2;
|
||||
aeb.NodeName = "MovementBlend";
|
||||
aeb.RootNode = playerModel;
|
||||
aeb.Delay = -0.3;
|
||||
aeb.Start = true;
|
||||
aeb.Restart = false;
|
||||
aeb.AnimationEntity = playerModel.FirstChildByName("DashForward");
|
||||
aeb.AnimationEntity = playerModel.FirstChildByName("DashLeft");
|
||||
m_EventBroker->Publish(aeb);
|
||||
}
|
||||
}
|
||||
@@ -444,7 +433,7 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
|
||||
if (controller->Movement().z < 0) {
|
||||
{
|
||||
Events::AutoAnimationBlend aeb;
|
||||
aeb.Duration = 0.3;
|
||||
aeb.Duration = 0.1;
|
||||
aeb.NodeName = "DashForward";
|
||||
aeb.RootNode = playerModel;
|
||||
aeb.Restart = true;
|
||||
@@ -453,10 +442,9 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
|
||||
}
|
||||
{
|
||||
Events::AutoAnimationBlend aeb;
|
||||
aeb.Duration = 0.3;
|
||||
aeb.NodeName = "StandCrouchBlend";
|
||||
aeb.Duration = 0.2;
|
||||
aeb.NodeName = "MovementBlend";
|
||||
aeb.RootNode = playerModel;
|
||||
aeb.Delay = -0.3;
|
||||
aeb.Start = true;
|
||||
aeb.Restart = false;
|
||||
aeb.AnimationEntity = playerModel.FirstChildByName("DashForward");
|
||||
@@ -465,7 +453,7 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
|
||||
} else {
|
||||
{
|
||||
Events::AutoAnimationBlend aeb;
|
||||
aeb.Duration = 0.3;
|
||||
aeb.Duration = 0.1;
|
||||
aeb.NodeName = "DashBackward";
|
||||
aeb.RootNode = playerModel;
|
||||
aeb.Restart = true;
|
||||
@@ -474,32 +462,41 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
|
||||
}
|
||||
{
|
||||
Events::AutoAnimationBlend aeb;
|
||||
aeb.Duration = 0.3;
|
||||
aeb.NodeName = "StandCrouchBlend";
|
||||
aeb.Duration = 0.2;
|
||||
aeb.NodeName = "MovementBlend";
|
||||
aeb.RootNode = playerModel;
|
||||
aeb.Delay = -0.3;
|
||||
aeb.Start = true;
|
||||
aeb.Restart = false;
|
||||
aeb.AnimationEntity = playerModel.FirstChildByName("DashForward");
|
||||
aeb.AnimationEntity = playerModel.FirstChildByName("DashBackward");
|
||||
m_EventBroker->Publish(aeb);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
auto playerEntityAnimation = playerModel["Animation"];
|
||||
|
||||
playerEntityModel.Copy(dashEffect["Model"]);
|
||||
playerEntityAnimation.Copy(dashEffect["Animation"]);
|
||||
dashEffect["ExplosionEffect"]["EndColor"] = (glm::vec4)playerEntityModel["Color"];
|
||||
((glm::vec4&)dashEffect["ExplosionEffect"]["EndColor"]).w = 0.f;
|
||||
*/
|
||||
EntityWrapper dashEffectModel;
|
||||
dashEffectModel = playerModel.Clone();
|
||||
player["Transform"].Copy(dashEffectModel["Transform"]);
|
||||
|
||||
|
||||
dashEffectModel.AttachComponent("ExplosionEffect");
|
||||
dashEffectModel["ExplosionEffect"]["EndColor"] = (glm::vec4)playerModel["Model"]["Color"];
|
||||
((glm::vec4&)dashEffectModel["ExplosionEffect"]["EndColor"]).w = 0.f;
|
||||
(double&)dashEffectModel["ExplosionEffect"]["ExplosionDuration"] = dashEffect["Lifetime"]["Lifetime"];
|
||||
(glm::vec3&)dashEffectModel["ExplosionEffect"]["ExplosionOrigin"] = glm::vec3(0, 1, 0) + (0.2f * controller->Movement());
|
||||
|
||||
|
||||
|
||||
|
||||
auto animationChildren = dashEffectModel.ChildrenWithComponent("Animation");
|
||||
|
||||
for (auto animationEntity : animationChildren) {
|
||||
(bool&)animationEntity["Animation"]["Play"] = false;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -49,6 +49,5 @@ bool ServerListSystem::OnServerListRecieved(const Events::DisplayServerlist& e)
|
||||
(int&)cIdentity["PlayersConnected"] = e.Serverlist[i].PlayersConnected;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -133,11 +133,6 @@ void AssaultWeaponBehaviour::OnReload(ComponentWrapper cWeapon, WeaponInfo& wi)
|
||||
b1.Restart = true;
|
||||
b1.Start = true;
|
||||
m_EventBroker->Publish(b1);
|
||||
Events::AutoAnimationBlend b2;
|
||||
b2.RootNode = wi.ThirdPersonPlayerModel;
|
||||
b2.NodeName = "MovementBlend";
|
||||
b2.AnimationEntity = wi.ThirdPersonPlayerModel.FirstChildByName("AssaultWeaponBlend").FirstChildByName("Reload");
|
||||
m_EventBroker->Publish(b2);
|
||||
|
||||
// Spawn explosion effect
|
||||
if (wi.FirstPersonEntity.Valid()) {
|
||||
@@ -247,6 +242,7 @@ void AssaultWeaponBehaviour::fireBullet(ComponentWrapper cWeapon, WeaponInfo& wi
|
||||
|
||||
// Play animation
|
||||
playAnimationAndReturn(wi.FirstPersonEntity, "ActionBlend", "Fire");
|
||||
|
||||
// Third person anim
|
||||
Events::AutoAnimationBlend b1;
|
||||
b1.RootNode = wi.ThirdPersonPlayerModel;
|
||||
@@ -254,11 +250,6 @@ void AssaultWeaponBehaviour::fireBullet(ComponentWrapper cWeapon, WeaponInfo& wi
|
||||
b1.Restart = true;
|
||||
b1.Start = true;
|
||||
m_EventBroker->Publish(b1);
|
||||
Events::AutoAnimationBlend b2;
|
||||
b2.RootNode = wi.ThirdPersonPlayerModel;
|
||||
b2.NodeName = "MovementBlend";
|
||||
b2.AnimationEntity = wi.ThirdPersonPlayerModel.FirstChildByName("AssaultWeaponBlend").FirstChildByName("Fire");
|
||||
m_EventBroker->Publish(b2);
|
||||
|
||||
// Sound
|
||||
Events::PlaySoundOnEntity e;
|
||||
|
||||
Reference in New Issue
Block a user