Fixed draw final pass with shided objects having to many if-statments.
Shields is working with transparancy Player cameras should have nearclip fater away and far clip nearer. Defaultconfig push
This commit is contained in:
@@ -38,12 +38,6 @@ private:
|
||||
void DrawShieldedModelRenderQueue(std::list<std::shared_ptr<RenderJob>>& jobs, RenderScene& scene);
|
||||
void DrawToDepthStencilBuffer(std::list<std::shared_ptr<RenderJob>>& jobs, RenderScene& scene);
|
||||
|
||||
void DrawExplosionSetup(ShaderProgram* shader, GLuint shaderHandle, std::shared_ptr<ExplosionEffectJob>& job, RenderScene& scene);
|
||||
void DrawSkinnedExplosionSetup(ShaderProgram* shader, GLuint shaderHandle, std::shared_ptr<ExplosionEffectJob>& job, RenderScene& scene);
|
||||
|
||||
void DrawModelSetup(ShaderProgram* shader, GLuint shaderHandle, std::shared_ptr<ModelJob>& job, RenderScene& scene);
|
||||
void DrawSkinnedModelSetup(ShaderProgram* shader, GLuint shaderHandle, std::shared_ptr<ModelJob>& job, RenderScene& scene);
|
||||
|
||||
void BindExplosionUniforms(GLuint shaderHandle, std::shared_ptr<ExplosionEffectJob>& job, RenderScene& scene);
|
||||
void BindModelUniforms(GLuint shaderHandle, std::shared_ptr<ModelJob>& job, RenderScene& scene);
|
||||
|
||||
|
||||
@@ -68,5 +68,17 @@ Contrast=1.5
|
||||
Intensity=1.0
|
||||
NumSamples=24
|
||||
NumTurns=17
|
||||
NumIterations=13
|
||||
NumIterations=9
|
||||
TextureQuality=0
|
||||
|
||||
[GLOW]
|
||||
Quality=3;
|
||||
|
||||
[GLOW1]
|
||||
NumIterations=5
|
||||
|
||||
[GLOW2]
|
||||
NumIterations=9
|
||||
|
||||
[GLOW3]
|
||||
NumIterations=13
|
||||
@@ -13,7 +13,7 @@
|
||||
</c:AssaultWeapon>
|
||||
<c:Collidable/>
|
||||
<c:DefenderWeapon>
|
||||
<TimeSinceLastFire>1.6944730461160304</TimeSinceLastFire>
|
||||
<TimeSinceLastFire>52.867678870419283</TimeSinceLastFire>
|
||||
</c:DefenderWeapon>
|
||||
<c:DoubleJump/>
|
||||
<c:Health/>
|
||||
@@ -37,7 +37,10 @@
|
||||
<Children>
|
||||
<Entity name="Camera">
|
||||
<Components>
|
||||
<c:Camera/>
|
||||
<c:Camera>
|
||||
<NearClip>0.10000000149011612</NearClip>
|
||||
<FarClip>300</FarClip>
|
||||
</c:Camera>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="1.27700007" Z="0"/>
|
||||
</c:Transform>
|
||||
@@ -372,7 +375,7 @@
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName1>Idle</AnimationName1>
|
||||
<Time1>0.67172915251515519</Time1>
|
||||
<Time1>1.9408570429715581</Time1>
|
||||
<Speed1>1</Speed1>
|
||||
<AnimationName2></AnimationName2>
|
||||
<AnimationName3></AnimationName3>
|
||||
@@ -386,25 +389,25 @@
|
||||
<Children>
|
||||
<Entity name="PrimaryAttachment">
|
||||
<Components>
|
||||
<c:WeaponAttachment>
|
||||
<Weapon>DefenderWeapon</Weapon>
|
||||
</c:WeaponAttachment>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/DefenderWeaponView.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Transform/>
|
||||
<c:WeaponAttachment>
|
||||
<Weapon>DefenderWeapon</Weapon>
|
||||
</c:WeaponAttachment>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="SecondaryAttachment">
|
||||
<Components>
|
||||
<c:WeaponAttachment>
|
||||
<Weapon>AssaultWeapon</Weapon>
|
||||
</c:WeaponAttachment>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/AssaultWeaponView.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Transform/>
|
||||
<c:WeaponAttachment>
|
||||
<Weapon>AssaultWeapon</Weapon>
|
||||
</c:WeaponAttachment>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
@@ -414,7 +417,10 @@
|
||||
</Entity>
|
||||
<Entity name="ThirdPersonCamera">
|
||||
<Components>
|
||||
<c:Camera/>
|
||||
<c:Camera>
|
||||
<NearClip>0.10000000149011612</NearClip>
|
||||
<FarClip>300</FarClip>
|
||||
</c:Camera>
|
||||
<c:Model>
|
||||
<Resource>Models/Widgets/Camera.mesh</Resource>
|
||||
<Visible>false</Visible>
|
||||
@@ -430,6 +436,7 @@
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName1>Idle</AnimationName1>
|
||||
<Time1>1.5631122524686134</Time1>
|
||||
<Speed1>1</Speed1>
|
||||
<AnimationName2></AnimationName2>
|
||||
<AnimationName3></AnimationName3>
|
||||
@@ -449,31 +456,31 @@
|
||||
<Children>
|
||||
<Entity name="PrimaryAttachment">
|
||||
<Components>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/DefenderWeaponWorld.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Transform/>
|
||||
<c:WeaponAttachment>
|
||||
<Weapon>DefenderWeapon</Weapon>
|
||||
<Person>
|
||||
<ThirdPerson/>
|
||||
</Person>
|
||||
</c:WeaponAttachment>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/DefenderWeaponWorld.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="SecondaryAttachment">
|
||||
<Components>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/AssaultWeaponWorld.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Transform/>
|
||||
<c:WeaponAttachment>
|
||||
<Weapon>AssaultWeapon</Weapon>
|
||||
<Person>
|
||||
<ThirdPerson/>
|
||||
</Person>
|
||||
</c:WeaponAttachment>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/AssaultWeaponWorld.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</c:AssaultWeapon>
|
||||
<c:Collidable/>
|
||||
<c:DefenderWeapon>
|
||||
<TimeSinceLastFire>1.6944730461160304</TimeSinceLastFire>
|
||||
<TimeSinceLastFire>22.22055262342397</TimeSinceLastFire>
|
||||
</c:DefenderWeapon>
|
||||
<c:DoubleJump/>
|
||||
<c:Health/>
|
||||
@@ -37,7 +37,10 @@
|
||||
<Children>
|
||||
<Entity name="Camera">
|
||||
<Components>
|
||||
<c:Camera/>
|
||||
<c:Camera>
|
||||
<NearClip>0.10000000149011612</NearClip>
|
||||
<FarClip>300</FarClip>
|
||||
</c:Camera>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="1.27700007" Z="0"/>
|
||||
</c:Transform>
|
||||
@@ -372,7 +375,7 @@
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName1>Idle</AnimationName1>
|
||||
<Time1>0.67172915251515519</Time1>
|
||||
<Time1>1.1978087298230946</Time1>
|
||||
<Speed1>1</Speed1>
|
||||
<AnimationName2></AnimationName2>
|
||||
<AnimationName3></AnimationName3>
|
||||
@@ -386,25 +389,25 @@
|
||||
<Children>
|
||||
<Entity name="PrimaryAttachment">
|
||||
<Components>
|
||||
<c:WeaponAttachment>
|
||||
<Weapon>DefenderWeapon</Weapon>
|
||||
</c:WeaponAttachment>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/DefenderWeaponViewRed.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Transform/>
|
||||
<c:WeaponAttachment>
|
||||
<Weapon>DefenderWeapon</Weapon>
|
||||
</c:WeaponAttachment>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="SecondaryAttachment">
|
||||
<Components>
|
||||
<c:WeaponAttachment>
|
||||
<Weapon>AssaultWeapon</Weapon>
|
||||
</c:WeaponAttachment>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/AssaultWeaponView.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Transform/>
|
||||
<c:WeaponAttachment>
|
||||
<Weapon>AssaultWeapon</Weapon>
|
||||
</c:WeaponAttachment>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
@@ -414,7 +417,10 @@
|
||||
</Entity>
|
||||
<Entity name="ThirdPersonCamera">
|
||||
<Components>
|
||||
<c:Camera/>
|
||||
<c:Camera>
|
||||
<NearClip>0.10000000149011612</NearClip>
|
||||
<FarClip>300</FarClip>
|
||||
</c:Camera>
|
||||
<c:Model>
|
||||
<Resource>Models/Widgets/Camera.mesh</Resource>
|
||||
<Visible>false</Visible>
|
||||
@@ -430,6 +436,7 @@
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<AnimationName1>Idle</AnimationName1>
|
||||
<Time1>0.69274608502888668</Time1>
|
||||
<Speed1>1</Speed1>
|
||||
<AnimationName2></AnimationName2>
|
||||
<AnimationName3></AnimationName3>
|
||||
@@ -449,31 +456,31 @@
|
||||
<Children>
|
||||
<Entity name="PrimaryAttachment">
|
||||
<Components>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/DefenderWeaponWorldRed.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Transform/>
|
||||
<c:WeaponAttachment>
|
||||
<Weapon>DefenderWeapon</Weapon>
|
||||
<Person>
|
||||
<ThirdPerson/>
|
||||
</Person>
|
||||
</c:WeaponAttachment>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/DefenderWeaponWorldRed.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="SecondaryAttachment">
|
||||
<Components>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/AssaultWeaponWorld.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Transform/>
|
||||
<c:WeaponAttachment>
|
||||
<Weapon>AssaultWeapon</Weapon>
|
||||
<Person>
|
||||
<ThirdPerson/>
|
||||
</Person>
|
||||
</c:WeaponAttachment>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/AssaultWeaponWorld.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
|
||||
@@ -236,7 +236,7 @@ void DrawFinalPass::InitializeShaderPrograms()
|
||||
void DrawFinalPass::Draw(RenderScene& scene)
|
||||
{
|
||||
GLERROR("Pre");
|
||||
DrawStencilState* stateDethp = new DrawStencilState(m_ShieldDepthFrameBuffer.GetHandle());
|
||||
DrawFinalPassState* stateDethp = new DrawFinalPassState(m_ShieldDepthFrameBuffer.GetHandle());
|
||||
//Draw shields to stencil
|
||||
DrawToDepthStencilBuffer(scene.Jobs.ShieldObjects, scene);
|
||||
GLERROR("StencilPass");
|
||||
@@ -276,13 +276,13 @@ void DrawFinalPass::Draw(RenderScene& scene)
|
||||
|
||||
//state->Disable(GL_STENCIL_TEST);
|
||||
//Draw Transparen Shielded objects
|
||||
state->BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
DrawModelRenderQueuesWithShieldCheck(scene.Jobs.TransparentObjects, scene); //might need changing
|
||||
GLERROR("Shielded Transparent objects");
|
||||
|
||||
//Draw Transparen objects
|
||||
//state->BlendFunc(GL_ONE, GL_ONE);
|
||||
//state->StencilFunc(GL_EQUAL, 1, 0xFF);
|
||||
state->BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
//DrawModelRenderQueues(scene.Jobs.TransparentObjects, scene);
|
||||
GLERROR("TransparentObjects");
|
||||
//state->BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
@@ -370,7 +370,6 @@ void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>&
|
||||
frameBones = explosionEffectJob->Skeleton->GetFrameBones(explosionEffectJob->Animations);
|
||||
}
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionSkinnedHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
||||
DrawSkinnedExplosionSetup(m_ExplosionEffectSkinnedProgram, explosionSkinnedHandle, explosionEffectJob, scene);
|
||||
}
|
||||
else {
|
||||
m_ExplosionEffectProgram->Bind();
|
||||
@@ -382,8 +381,6 @@ void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>&
|
||||
glActiveTexture(GL_TEXTURE5);
|
||||
glBindTexture(GL_TEXTURE_CUBE_MAP, m_CubeMapPass->m_CubeMapTexture);
|
||||
glUniform3fv(glGetUniformLocation(explosionHandle, "CameraPosition"), 1, glm::value_ptr(scene.Camera->Position()));
|
||||
|
||||
DrawExplosionSetup(m_ExplosionEffectProgram, explosionHandle, explosionEffectJob, scene);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -405,8 +402,6 @@ void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>&
|
||||
frameBones = explosionEffectJob->Skeleton->GetFrameBones(explosionEffectJob->Animations);
|
||||
}
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionSplatMapSkinnedHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
||||
|
||||
DrawSkinnedExplosionSetup(m_ExplosionEffectSplatMapSkinnedProgram, explosionSplatMapSkinnedHandle, explosionEffectJob, scene);
|
||||
}
|
||||
else {
|
||||
m_ExplosionEffectSplatMapProgram->Bind();
|
||||
@@ -417,7 +412,6 @@ void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>&
|
||||
//bind textures
|
||||
BindExplosionTextures(explosionSplatMapHandle, explosionEffectJob);
|
||||
GLERROR("asdasd");
|
||||
DrawExplosionSetup(m_ExplosionEffectSplatMapProgram, explosionSplatMapHandle, explosionEffectJob, scene);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -623,43 +617,7 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch (explosionEffectJob->Type) {
|
||||
case RawModel::MaterialType::Basic:
|
||||
case RawModel::MaterialType::SingleTextures:
|
||||
{
|
||||
if (explosionEffectJob->Model->IsSkinned()) {
|
||||
DrawSkinnedExplosionSetup(m_ExplosionEffectSkinnedProgram, explosionSkinnedHandle, explosionEffectJob, scene);
|
||||
}
|
||||
else {
|
||||
DrawExplosionSetup(m_ExplosionEffectProgram, explosionHandle, explosionEffectJob, scene);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case RawModel::MaterialType::SplatMapping:
|
||||
{
|
||||
if (explosionEffectJob->Model->IsSkinned()) {
|
||||
DrawSkinnedExplosionSetup(m_ExplosionEffectSplatMapSkinnedProgram, explosionSplatMapSkinnedHandle, explosionEffectJob, scene);
|
||||
}
|
||||
else {
|
||||
DrawExplosionSetup(m_ExplosionEffectSplatMapProgram, explosionSplatMapHandle, explosionEffectJob, scene);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
glDisable(GL_CULL_FACE);
|
||||
|
||||
//draw
|
||||
glBindVertexArray(explosionEffectJob->Model->VAO);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, explosionEffectJob->Model->ElementBuffer);
|
||||
glDrawElements(GL_TRIANGLES, explosionEffectJob->EndIndex - explosionEffectJob->StartIndex + 1, GL_UNSIGNED_INT, (void*)(explosionEffectJob->StartIndex*sizeof(unsigned int)));
|
||||
glEnable(GL_CULL_FACE);
|
||||
GLERROR("explosion effect end");
|
||||
} else {
|
||||
auto explosionEffectJob = std::dynamic_pointer_cast<ExplosionEffectJob>(job);
|
||||
if (explosionEffectJob) {
|
||||
switch (explosionEffectJob->Type) {
|
||||
case RawModel::MaterialType::Basic:
|
||||
case RawModel::MaterialType::SingleTextures:
|
||||
@@ -684,7 +642,6 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
frameBones = explosionEffectJob->Skeleton->GetFrameBones(explosionEffectJob->Animations);
|
||||
}
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionSkinnedHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
||||
DrawSkinnedExplosionSetup(m_ExplosionEffectSkinnedProgram, explosionSkinnedHandle, explosionEffectJob, scene);
|
||||
}
|
||||
else {
|
||||
m_ExplosionEffectProgram->Bind();
|
||||
@@ -696,8 +653,6 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
glActiveTexture(GL_TEXTURE5);
|
||||
glBindTexture(GL_TEXTURE_CUBE_MAP, m_CubeMapPass->m_CubeMapTexture);
|
||||
glUniform3fv(glGetUniformLocation(explosionHandle, "CameraPosition"), 1, glm::value_ptr(scene.Camera->Position()));
|
||||
|
||||
DrawExplosionSetup(m_ExplosionEffectProgram, explosionHandle, explosionEffectJob, scene);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -719,8 +674,6 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
frameBones = explosionEffectJob->Skeleton->GetFrameBones(explosionEffectJob->Animations);
|
||||
}
|
||||
glUniformMatrix4fv(glGetUniformLocation(explosionSplatMapSkinnedHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
||||
|
||||
DrawSkinnedExplosionSetup(m_ExplosionEffectSplatMapSkinnedProgram, explosionSplatMapSkinnedHandle, explosionEffectJob, scene);
|
||||
}
|
||||
else {
|
||||
m_ExplosionEffectSplatMapProgram->Bind();
|
||||
@@ -731,11 +684,11 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
//bind textures
|
||||
BindExplosionTextures(explosionSplatMapHandle, explosionEffectJob);
|
||||
GLERROR("asdasd");
|
||||
DrawExplosionSetup(m_ExplosionEffectSplatMapProgram, explosionSplatMapHandle, explosionEffectJob, scene);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
glDisable(GL_CULL_FACE);
|
||||
|
||||
//draw
|
||||
@@ -744,12 +697,83 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
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");
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
auto modelJob = std::dynamic_pointer_cast<ModelJob>(job);
|
||||
if (modelJob) {
|
||||
//bind forward program
|
||||
//TODO: JOHAN/TOBIAS: Bind shader based on ModelJob->ShaderID;
|
||||
if (modelJob->IsShielded) {
|
||||
switch (modelJob->Type) {
|
||||
case RawModel::MaterialType::Basic:
|
||||
case RawModel::MaterialType::SingleTextures:
|
||||
{
|
||||
if (modelJob->Model->IsSkinned()) {
|
||||
m_ForwardPlusSkinnedShieldCheckProgram->Bind();
|
||||
GLERROR("Bind ForwardPlusSkinnedProgram");
|
||||
//bind uniforms
|
||||
BindModelUniforms(forwardSkinnedShieldCheckHandle, modelJob, scene);
|
||||
//bind textures
|
||||
BindModelTextures(forwardSkinnedShieldCheckHandle, modelJob);
|
||||
glActiveTexture(GL_TEXTURE5);
|
||||
glBindTexture(GL_TEXTURE_CUBE_MAP, m_CubeMapPass->m_CubeMapTexture);
|
||||
glUniform3fv(glGetUniformLocation(forwardSkinnedShieldCheckHandle, "CameraPosition"), 1, glm::value_ptr(scene.Camera->Position()));
|
||||
|
||||
std::vector<glm::mat4> frameBones;
|
||||
if (modelJob->AnimationOffset.animation != nullptr) {
|
||||
frameBones = modelJob->Skeleton->GetFrameBones(modelJob->Animations, modelJob->AnimationOffset);
|
||||
}
|
||||
else {
|
||||
frameBones = modelJob->Skeleton->GetFrameBones(modelJob->Animations);
|
||||
}
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardSkinnedShieldCheckHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
||||
|
||||
}
|
||||
else {
|
||||
m_ForwardPlusShieldCheckProgram->Bind();
|
||||
GLERROR("Bind ForwardPlusProgram");
|
||||
//bind uniforms
|
||||
BindModelUniforms(forwardShieldCheckHandle, modelJob, scene);
|
||||
//bind textures
|
||||
BindModelTextures(forwardShieldCheckHandle, modelJob);
|
||||
glActiveTexture(GL_TEXTURE5);
|
||||
glBindTexture(GL_TEXTURE_CUBE_MAP, m_CubeMapPass->m_CubeMapTexture);
|
||||
glUniform3fv(glGetUniformLocation(forwardShieldCheckHandle, "CameraPosition"), 1, glm::value_ptr(scene.Camera->Position()));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case RawModel::MaterialType::SplatMapping:
|
||||
{
|
||||
if (modelJob->Model->IsSkinned()) {
|
||||
m_ForwardPlusSplatMapSkinnedShieldCheckProgram->Bind();
|
||||
GLERROR("Bind SplatMap program");
|
||||
//bind uniforms
|
||||
BindModelUniforms(forwardSplatMapSkinnedShieldCheckHandle, modelJob, scene);
|
||||
//bind textures
|
||||
BindModelTextures(forwardSplatMapSkinnedShieldCheckHandle, modelJob);
|
||||
GLERROR("asdasd");
|
||||
std::vector<glm::mat4> frameBones;
|
||||
if (modelJob->AnimationOffset.animation != nullptr) {
|
||||
frameBones = modelJob->Skeleton->GetFrameBones(modelJob->Animations, modelJob->AnimationOffset);
|
||||
}
|
||||
else {
|
||||
frameBones = modelJob->Skeleton->GetFrameBones(modelJob->Animations);
|
||||
}
|
||||
glUniformMatrix4fv(glGetUniformLocation(forwardSplatMapSkinnedShieldCheckHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
||||
|
||||
}
|
||||
else {
|
||||
m_ForwardPlusSplatMapShieldCheckProgram->Bind();
|
||||
GLERROR("Bind SplatMap program");
|
||||
//bind uniforms
|
||||
BindModelUniforms(forwardSplatShieldCheckHandle, modelJob, scene);
|
||||
//bind textures
|
||||
BindModelTextures(forwardSplatShieldCheckHandle, modelJob);
|
||||
GLERROR("asdasd");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
switch (modelJob->Type) {
|
||||
case RawModel::MaterialType::Basic:
|
||||
case RawModel::MaterialType::SingleTextures:
|
||||
@@ -820,6 +844,7 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//draw
|
||||
glBindVertexArray(modelJob->Model->VAO);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, modelJob->Model->ElementBuffer);
|
||||
@@ -830,7 +855,6 @@ void DrawFinalPass::DrawModelRenderQueuesWithShieldCheck(std::list<std::shared_p
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DrawFinalPass::DrawShieldedModelRenderQueue(std::list<std::shared_ptr<RenderJob>>& jobs, RenderScene& scene)
|
||||
@@ -1013,76 +1037,6 @@ void DrawFinalPass::DrawSprites(std::list<std::shared_ptr<RenderJob>>&jobs, Rend
|
||||
// m_SpriteProgram->Unbind();
|
||||
}
|
||||
|
||||
void DrawFinalPass::DrawExplosionSetup(ShaderProgram* shader, GLuint shaderHandle, std::shared_ptr<ExplosionEffectJob>& job, RenderScene& scene)
|
||||
{
|
||||
shader->Bind();
|
||||
GLERROR("Bind ExplosionEffect program");
|
||||
//bind uniforms
|
||||
BindExplosionUniforms(shaderHandle, job, scene);
|
||||
//bind textures
|
||||
BindExplosionTextures(shaderHandle, job);
|
||||
glActiveTexture(GL_TEXTURE5);
|
||||
glBindTexture(GL_TEXTURE_CUBE_MAP, m_CubeMapPass->m_CubeMapTexture);
|
||||
glUniform3fv(glGetUniformLocation(shaderHandle, "CameraPosition"), 1, glm::value_ptr(scene.Camera->Position()));
|
||||
}
|
||||
|
||||
void DrawFinalPass::DrawSkinnedExplosionSetup(ShaderProgram* shader, GLuint shaderHandle, std::shared_ptr<ExplosionEffectJob>& job, RenderScene& scene)
|
||||
{
|
||||
shader->Bind();
|
||||
GLERROR("Bind ExplosionEffectSkinned program");
|
||||
//bind uniforms
|
||||
BindExplosionUniforms(shaderHandle, job, scene);
|
||||
//bind textures
|
||||
BindExplosionTextures(shaderHandle, job);
|
||||
glActiveTexture(GL_TEXTURE5);
|
||||
glBindTexture(GL_TEXTURE_CUBE_MAP, m_CubeMapPass->m_CubeMapTexture);
|
||||
glUniform3fv(glGetUniformLocation(shaderHandle, "CameraPosition"), 1, glm::value_ptr(scene.Camera->Position()));
|
||||
|
||||
std::vector<glm::mat4> frameBones;
|
||||
if (job->AnimationOffset.animation != nullptr) {
|
||||
frameBones = job->Skeleton->GetFrameBones(job->Animations, job->AnimationOffset);
|
||||
}
|
||||
else {
|
||||
frameBones = job->Skeleton->GetFrameBones(job->Animations);
|
||||
}
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
||||
}
|
||||
|
||||
void DrawFinalPass::DrawModelSetup(ShaderProgram* shader, GLuint shaderHandle, std::shared_ptr<ModelJob>& job, RenderScene& scene)
|
||||
{
|
||||
m_ForwardPlusProgram->Bind();
|
||||
GLERROR("Bind ForwardPlusProgram");
|
||||
//bind uniforms
|
||||
BindModelUniforms(shaderHandle, job, scene);
|
||||
//bind textures
|
||||
BindModelTextures(shaderHandle, job);
|
||||
glActiveTexture(GL_TEXTURE5);
|
||||
glBindTexture(GL_TEXTURE_CUBE_MAP, m_CubeMapPass->m_CubeMapTexture);
|
||||
glUniform3fv(glGetUniformLocation(shaderHandle, "CameraPosition"), 1, glm::value_ptr(scene.Camera->Position()));
|
||||
}
|
||||
|
||||
void DrawFinalPass::DrawSkinnedModelSetup(ShaderProgram* shader, GLuint shaderHandle , std::shared_ptr<ModelJob>& job, RenderScene& scene)
|
||||
{
|
||||
shader->Bind();
|
||||
GLERROR("Bind ForwardPlusSkinnedProgram");
|
||||
//bind uniforms
|
||||
BindModelUniforms(shaderHandle, job, scene);
|
||||
//bind textures
|
||||
BindModelTextures(shaderHandle, job);
|
||||
glActiveTexture(GL_TEXTURE5);
|
||||
glBindTexture(GL_TEXTURE_CUBE_MAP, m_CubeMapPass->m_CubeMapTexture);
|
||||
glUniform3fv(glGetUniformLocation(shaderHandle, "CameraPosition"), 1, glm::value_ptr(scene.Camera->Position()));
|
||||
|
||||
std::vector<glm::mat4> frameBones;
|
||||
if (job->AnimationOffset.animation != nullptr) {
|
||||
frameBones = job->Skeleton->GetFrameBones(job->Animations, job->AnimationOffset);
|
||||
}
|
||||
else {
|
||||
frameBones = job->Skeleton->GetFrameBones(job->Animations);
|
||||
}
|
||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
||||
}
|
||||
|
||||
void DrawFinalPass::BindExplosionUniforms(GLuint shaderHandle, std::shared_ptr<ExplosionEffectJob>& job, RenderScene& scene)
|
||||
{
|
||||
glUniform1i(glGetUniformLocation(shaderHandle, "SSAOQuality"), m_SSAOPass->TextureQuality());
|
||||
|
||||
@@ -27,6 +27,7 @@ DrawStencilState::DrawStencilState(GLuint frameBuffer)
|
||||
BindFramebuffer(frameBuffer);
|
||||
Enable(GL_DEPTH_TEST);
|
||||
DepthMask(GL_TRUE);
|
||||
Enable(GL_CULL_FACE);
|
||||
ClearColor(glm::vec4(0.f));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user