mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
Make sure RenderBin is set before render function is called
This commit is contained in:
@@ -773,18 +773,8 @@ void RenderableModel::render(const RenderData& data, RendererTasks&) {
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
}
|
||||
|
||||
// Only render two pass if the model is in any way transparent
|
||||
bool shouldRenderTwice = false;
|
||||
const float o = opacity();
|
||||
if ((o >= 0.f && o < 1.f) || _geometry->isTransparent()) {
|
||||
setRenderBin(Renderable::RenderBin::PostDeferredTransparent);
|
||||
shouldRenderTwice = true;
|
||||
}
|
||||
else {
|
||||
setRenderBin(_originalRenderBin);
|
||||
}
|
||||
|
||||
if (!shouldRenderTwice) {
|
||||
if (!_shouldRenderTwice) {
|
||||
// Reset manual depth test
|
||||
_program->setUniform(
|
||||
_uniformCache.performManualDepthTest,
|
||||
@@ -920,6 +910,17 @@ void RenderableModel::update(const UpdateData& data) {
|
||||
ghoul::opengl::updateUniformLocations(*_program, _uniformCache, UniformNames);
|
||||
}
|
||||
|
||||
// Only render two pass if the model is in any way transparent
|
||||
const float o = opacity();
|
||||
if ((o >= 0.f && o < 1.f) || _geometry->isTransparent()) {
|
||||
setRenderBin(Renderable::RenderBin::PostDeferredTransparent);
|
||||
_shouldRenderTwice = true;
|
||||
}
|
||||
else {
|
||||
setRenderBin(_originalRenderBin);
|
||||
_shouldRenderTwice = false;
|
||||
}
|
||||
|
||||
if (_geometry->hasAnimation() && !_animationStart.empty()) {
|
||||
double relativeTime;
|
||||
double now = data.time.j2000Seconds();
|
||||
|
||||
@@ -120,6 +120,7 @@ private:
|
||||
GLuint _framebuffer = 0;
|
||||
GLuint _quadVao = 0;
|
||||
GLuint _quadVbo = 0;
|
||||
bool _shouldRenderTwice = false;
|
||||
|
||||
// Opacity program
|
||||
ghoul::opengl::ProgramObject* _quadProgram = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user