Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f89cef7a78 | |||
| 937bf823f3 | |||
| e35b09cc68 | |||
| b172526e62 | |||
| 551745b0a6 | |||
| 8b89df0095 | |||
| b094b9feca | |||
| 0a94373f3f | |||
| 7ced9e6767 |
+1
-1
Submodule assets updated: 85d96f6f3d...007b54bd67
@@ -13,6 +13,7 @@
|
||||
#include "Texture.h"
|
||||
#include "ShadowPass.h"
|
||||
#include "BlurHUD.h"
|
||||
#include "TextPass.h"
|
||||
|
||||
class DrawFinalPass
|
||||
{
|
||||
@@ -22,7 +23,7 @@ public:
|
||||
void InitializeTextures();
|
||||
void InitializeFrameBuffers();
|
||||
void InitializeShaderPrograms();
|
||||
void Draw(RenderScene& scene, BlurHUD* blurHUDPass);
|
||||
void Draw(RenderScene& scene, BlurHUD* blurHUDPass, TextPass* textPass);
|
||||
void ClearBuffer();
|
||||
void OnWindowResize();
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ private:
|
||||
bool CapturePointSystem::OnTriggerLeave(const Events::TriggerLeave& e);
|
||||
EventRelay<CapturePointSystem, Events::Captured> m_ECaptured;
|
||||
bool CapturePointSystem::OnCaptured(const Events::Captured& e);
|
||||
void ChangeCapturePointModelsVisibility(EntityWrapper &capturePointModels, bool isOwner);
|
||||
|
||||
bool m_WinnerWasFound = false;
|
||||
//need to track these variables for the captureSystem to work as per design!
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
</c:Team>
|
||||
<c:PlayerSpawn/>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/Player.xml</EntityFile>
|
||||
<EntityFile>Schema/Entities/PlayerRed.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
@@ -225,6 +225,11 @@
|
||||
</Team>
|
||||
</c:Team>
|
||||
<c:Trigger/>
|
||||
<c:Model>
|
||||
<Resource></Resource>
|
||||
<Color A="0.300000012" B="0" G="0" R="1"/>
|
||||
<Visible>false</Visible>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0" Z="-4.10000038"/>
|
||||
</c:Transform>
|
||||
@@ -239,7 +244,17 @@
|
||||
<Scale X="2.70000005" Y="3.4000001" Z="4.60000038"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource></Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="Blue">
|
||||
<Components>
|
||||
|
||||
@@ -242,7 +242,7 @@ void DrawFinalPass::InitializeShaderPrograms()
|
||||
|
||||
}
|
||||
|
||||
void DrawFinalPass::Draw(RenderScene& scene, BlurHUD* blurHUDPass)
|
||||
void DrawFinalPass::Draw(RenderScene& scene, BlurHUD* blurHUDPass, TextPass* textPass)
|
||||
{
|
||||
GLERROR("Pre");
|
||||
DrawFinalPassState* stateDethp = new DrawFinalPassState(m_ShieldDepthFrameBuffer.GetHandle());
|
||||
@@ -282,10 +282,36 @@ void DrawFinalPass::Draw(RenderScene& scene, BlurHUD* blurHUDPass)
|
||||
//state->StencilMask(0x00);
|
||||
DrawModelRenderQueues(scene.Jobs.OpaqueObjects, scene);
|
||||
GLERROR("OpaqueObjects");
|
||||
delete state;
|
||||
|
||||
DrawFinalPassState* stateSprite = new DrawFinalPassState(m_FinalPassFrameBuffer.GetHandle());
|
||||
if (scene.ShouldBlur) {
|
||||
//Combine nonblur and blur texture
|
||||
stateSprite->Disable(GL_DEPTH_TEST);
|
||||
stateSprite->Disable(GL_STENCIL_TEST);
|
||||
m_CombinedTexture = blurHUDPass->CombineTextures(m_SceneTexture, m_FullBlurredTexture);
|
||||
|
||||
}
|
||||
//Draw Transparen objects
|
||||
//state->BlendFunc(GL_ONE, GL_ONE);
|
||||
//state->StencilFunc(GL_EQUAL, 1, 0xFF);
|
||||
//DrawModelRenderQueues(scene.Jobs.TransparentObjects, scene);
|
||||
GLERROR("TransparentObjects");
|
||||
//state->BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
stateSprite->Enable(GL_DEPTH_TEST);
|
||||
//stateSprite->AlphaFunc(GL_GEQUAL, 0.05f);
|
||||
//stateSprite->Enable(GL_ALPHA_TEST);
|
||||
DrawSprites(scene.Jobs.SpriteJob, scene);
|
||||
GLERROR("SpriteJobs");
|
||||
|
||||
delete stateSprite;
|
||||
|
||||
state = new DrawFinalPassState(m_FinalPassFrameBuffer.GetHandle());
|
||||
|
||||
//state->Disable(GL_STENCIL_TEST);
|
||||
//Draw Transparen Shielded objects
|
||||
state->BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
textPass->Draw(scene, m_FinalPassFrameBuffer);
|
||||
DrawModelRenderQueuesWithShieldCheck(scene.Jobs.TransparentObjects, scene); //might need changing
|
||||
GLERROR("Shielded Transparent objects");
|
||||
|
||||
@@ -296,27 +322,7 @@ void DrawFinalPass::Draw(RenderScene& scene, BlurHUD* blurHUDPass)
|
||||
m_FullBlurredTexture = blurHUDPass->Draw(m_SceneTexture, scene);
|
||||
}
|
||||
|
||||
DrawFinalPassState* stateSprite = new DrawFinalPassState(m_FinalPassFrameBuffer.GetHandle());
|
||||
if(scene.ShouldBlur) {
|
||||
//Combine nonblur and blur texture
|
||||
stateSprite->Disable(GL_DEPTH_TEST);
|
||||
stateSprite->Disable(GL_STENCIL_TEST);
|
||||
m_CombinedTexture = blurHUDPass->CombineTextures(m_SceneTexture, m_FullBlurredTexture);
|
||||
|
||||
}
|
||||
//Draw Transparen objects
|
||||
//state->BlendFunc(GL_ONE, GL_ONE);
|
||||
//state->StencilFunc(GL_EQUAL, 1, 0xFF);
|
||||
//DrawModelRenderQueues(scene.Jobs.TransparentObjects, scene);
|
||||
GLERROR("TransparentObjects");
|
||||
//state->BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
stateSprite->Enable(GL_DEPTH_TEST);
|
||||
//stateSprite->AlphaFunc(GL_GEQUAL, 0.05f);
|
||||
//stateSprite->Enable(GL_ALPHA_TEST);
|
||||
DrawSprites(scene.Jobs.SpriteJob, scene);
|
||||
GLERROR("SpriteJobs");
|
||||
|
||||
delete stateSprite;
|
||||
|
||||
GLERROR("END");
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ DrawFinalPassState::DrawFinalPassState(GLuint frameBuffer)
|
||||
Enable(GL_DEPTH_TEST);
|
||||
DepthMask(GL_TRUE);
|
||||
Enable(GL_CULL_FACE);
|
||||
Enable(GL_ALPHA_TEST);
|
||||
AlphaFunc(GL_GEQUAL, 0.05f);
|
||||
// Enable(GL_STENCIL_TEST);
|
||||
// StencilFunc(GL_NOTEQUAL, 1, 0xFF);
|
||||
// StencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
||||
|
||||
@@ -210,14 +210,15 @@ void Renderer::Draw(RenderFrame& frame)
|
||||
PerformanceTimer::StartTimerAndStopPrevious("Renderer-Light Culling");
|
||||
m_LightCullingPass->CullLights(*scene);
|
||||
GLERROR("LightCulling");
|
||||
PerformanceTimer::StartTimerAndStopPrevious("Renderer-Draw Text");
|
||||
//m_TextPass->Draw(*scene, *m_DrawFinalPass->FinalPassFrameBuffer());
|
||||
GLERROR("Draw Text");
|
||||
PerformanceTimer::StartTimerAndStopPrevious("Renderer-Draw Geometry+Light");
|
||||
m_DrawFinalPass->Draw(*scene, m_BlurHUDPass);
|
||||
m_DrawFinalPass->Draw(*scene, m_BlurHUDPass, m_TextPass);
|
||||
GLERROR("Draw Geometry+Light");
|
||||
//m_DrawScenePass->Draw(*scene);
|
||||
|
||||
PerformanceTimer::StartTimerAndStopPrevious("Renderer-Draw Text");
|
||||
m_TextPass->Draw(*scene, *m_DrawFinalPass->FinalPassFrameBuffer());
|
||||
GLERROR("Draw Text");
|
||||
|
||||
PerformanceTimer::StopTimer("Renderer-Draw Text");
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ void TextPass::Update()
|
||||
void TextPass::Draw(RenderScene& scene, FrameBuffer& frameBuffer)
|
||||
{
|
||||
GLERROR("Derp1");
|
||||
TextPassState* state = new TextPassState(frameBuffer.GetHandle());
|
||||
//TextPassState* state = new TextPassState(frameBuffer.GetHandle());
|
||||
for (auto &job : scene.Jobs.Text) {
|
||||
auto textJob = std::dynamic_pointer_cast<TextJob>(job);
|
||||
if (textJob) {
|
||||
@@ -43,7 +43,7 @@ void TextPass::Draw(RenderScene& scene, FrameBuffer& frameBuffer)
|
||||
}
|
||||
}
|
||||
GLERROR("Derp2");
|
||||
delete state;
|
||||
// delete state;
|
||||
}
|
||||
|
||||
void TextPass::renderText(std::string text, Font* font, TextJob::AlignmentEnum alignment, glm::vec4 color, glm::mat4 modelMatrix, glm::mat4 projectionMatrix, glm::mat4 viewMatrix)
|
||||
|
||||
@@ -4,10 +4,13 @@
|
||||
TextPassState::TextPassState(GLuint frameBuffer)
|
||||
{
|
||||
BindFramebuffer(frameBuffer);
|
||||
glEnable(GL_BLEND);
|
||||
glDisable(GL_CULL_FACE);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
Enable(GL_BLEND);
|
||||
Disable(GL_CULL_FACE);
|
||||
Enable(GL_DEPTH_TEST);
|
||||
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
Enable(GL_ALPHA_TEST);
|
||||
AlphaFunc(GL_GEQUAL, 0.05f);
|
||||
|
||||
}
|
||||
|
||||
TextPassState::~TextPassState()
|
||||
|
||||
@@ -108,10 +108,10 @@ void CapturePointSystem::UpdateComponent(EntityWrapper& capturePointEntity, Comp
|
||||
//change what model is displaying (change all in case 2 capturepoints has been captured on the same frame)
|
||||
for (int i = 0; i < m_NumberOfCapturePoints; i++) {
|
||||
auto owner = (int)m_CapturePointNumberToEntityMap[i]["Team"]["Team"];
|
||||
if (m_CapturePointNumberToEntityMap[i].FirstChildByName("Red").ID != EntityID_Invalid) {
|
||||
(bool&)m_CapturePointNumberToEntityMap[i].FirstChildByName("Red")["Model"]["Visible"] = owner == redTeam ? true : false;
|
||||
(bool&)m_CapturePointNumberToEntityMap[i].FirstChildByName("Blue")["Model"]["Visible"] = owner == blueTeam ? true : false;
|
||||
(bool&)m_CapturePointNumberToEntityMap[i].FirstChildByName("Spectator")["Model"]["Visible"] = owner == spectatorTeam ? true : false;
|
||||
if (m_CapturePointNumberToEntityMap[i].FirstChildByName("Red").Valid()) {
|
||||
ChangeCapturePointModelsVisibility(m_CapturePointNumberToEntityMap[i].FirstChildByName("Red"), owner == redTeam);
|
||||
ChangeCapturePointModelsVisibility(m_CapturePointNumberToEntityMap[i].FirstChildByName("Blue"), owner == blueTeam);
|
||||
ChangeCapturePointModelsVisibility(m_CapturePointNumberToEntityMap[i].FirstChildByName("Spectator"), owner == spectatorTeam);
|
||||
}
|
||||
}
|
||||
//save the next cap points and publish the captured event
|
||||
@@ -232,6 +232,14 @@ void CapturePointSystem::UpdateComponent(EntityWrapper& capturePointEntity, Comp
|
||||
|
||||
}
|
||||
|
||||
void CapturePointSystem::ChangeCapturePointModelsVisibility(EntityWrapper &capturePointModels, bool isOwner) {
|
||||
(bool&)capturePointModels["Model"]["Visible"] = isOwner;
|
||||
for (auto& capModel : capturePointModels.ChildrenWithComponent("Model"))
|
||||
{
|
||||
(bool&)capModel["Model"]["Visible"] = isOwner;
|
||||
}
|
||||
}
|
||||
|
||||
bool CapturePointSystem::OnTriggerTouch(const Events::TriggerTouch& e)
|
||||
{
|
||||
//personEntered = e.Entity, thingEntered = e.Trigger
|
||||
|
||||
Reference in New Issue
Block a user