mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-07 12:10:52 -06:00
Add manual depth test between models
This commit is contained in:
@@ -77,11 +77,11 @@ namespace {
|
||||
"Enable or disable the animation for the model if it has any"
|
||||
};
|
||||
|
||||
constexpr std::array<const char*, 10> UniformNames = {
|
||||
constexpr std::array<const char*, 11> UniformNames = {
|
||||
"nLightSources", "lightDirectionsViewSpace", "lightIntensities",
|
||||
"modelViewTransform", "normalTransform", "projectionTransform",
|
||||
"performShading", "ambientIntensity", "diffuseIntensity",
|
||||
"specularIntensity"
|
||||
"specularIntensity", "gBufferDepthTexture"
|
||||
};
|
||||
|
||||
constexpr std::array<const char*, 5> UniformOpacityNames = {
|
||||
@@ -740,6 +740,18 @@ void RenderableModel::render(const RenderData& data, RendererTasks&) {
|
||||
_program->setUniform(_uniformCache.specularIntensity, _specularIntensity);
|
||||
_program->setUniform(_uniformCache.performShading, _performShading);
|
||||
|
||||
// Bind the G-buffer depth texture for a manual depth test for the second pass
|
||||
ghoul::opengl::TextureUnit gBufferDepthTextureUnit;
|
||||
gBufferDepthTextureUnit.activate();
|
||||
glBindTexture(
|
||||
GL_TEXTURE_2D,
|
||||
global::renderEngine->renderer()->gBufferDepthTexture()
|
||||
);
|
||||
_program->setUniform(
|
||||
_uniformCache.gBufferDepthTexture,
|
||||
gBufferDepthTextureUnit
|
||||
);
|
||||
|
||||
// Configure blending
|
||||
glEnablei(GL_BLEND, 0);
|
||||
switch (_blendingFuncOption) {
|
||||
|
||||
Reference in New Issue
Block a user