Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5566: Introduce special DepthFillPass type
- Loading branch information
1 parent
c580829
commit 4c3a09c
Showing
8 changed files
with
78 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include "DepthFillPass.h" | ||
|
||
#include "../OpenGLRenderSystem.h" | ||
#include "GLProgramFactory.h" | ||
|
||
namespace render | ||
{ | ||
|
||
DepthFillPass::DepthFillPass(OpenGLShader& owner, OpenGLRenderSystem& renderSystem) : | ||
OpenGLShaderPass(owner) | ||
{ | ||
// Mask colour => we only write to the depth buffer | ||
_glState.setRenderFlag(RENDER_MASKCOLOUR); | ||
|
||
_glState.setRenderFlag(RENDER_FILL); | ||
_glState.setRenderFlag(RENDER_CULLFACE); | ||
_glState.setRenderFlag(RENDER_DEPTHTEST); | ||
_glState.setRenderFlag(RENDER_DEPTHWRITE); | ||
_glState.setRenderFlag(RENDER_PROGRAM); | ||
|
||
// Our shader will discard any fragments not passing the alphatest (if active) | ||
_glState.setRenderFlag(RENDER_ALPHATEST); | ||
|
||
// We need texture coords and the full vertex attribute stack | ||
_glState.setRenderFlag(RENDER_TEXTURE_2D); | ||
_glState.setRenderFlag(RENDER_BUMP); | ||
|
||
// ZFILL will make this pass pretty much top priority | ||
_glState.setSortPosition(OpenGLState::SORT_ZFILL); | ||
|
||
// Load the GLSL program tailored for this pass | ||
_glState.glProgram = renderSystem.getGLProgramFactory().getBuiltInProgram("depthFillAlpha"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#pragma once | ||
|
||
#include "OpenGLShaderPass.h" | ||
|
||
namespace render | ||
{ | ||
|
||
class OpenGLRenderSystem; | ||
|
||
/** | ||
* Special render pass filling the depth buffer. | ||
* This is the first pass before any interaction shaders are run. | ||
*/ | ||
class DepthFillPass : | ||
public OpenGLShaderPass | ||
{ | ||
public: | ||
DepthFillPass(OpenGLShader& owner, OpenGLRenderSystem& renderSystem); | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters