Skip to content
Snippets Groups Projects
Commit 2c780961 authored by Róbert Lexmann's avatar Róbert Lexmann
Browse files

RenderingOpenGL2: Fixed final blending of vtkOrderIndependentTranslucentPass.

parent 64e15b35
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ void main()
vec4 t1Color = texture(translucentRGBATexture, texCoord);
float t2Color = texture(translucentRTexture, texCoord).r;
gl_FragData[0] = vec4(t1Color.rgb/max(t2Color,0.01), t1Color.a);
gl_FragData[0] = vec4(t1Color.rgb/max(t2Color,0.01), 1.0-t1Color.a);
// gl_FragData[0] = vec4(t1Color.a, t1Color.a, t1Color.a, 0.0);
// gl_FragData[0] = vec4(t2Color, t2Color, t2Color, 0.0);
}
......@@ -325,8 +325,9 @@ void vtkOrderIndependentTranslucentPass::Render(const vtkRenderState* s)
// back to the original FO
this->State->PopFramebufferBindings();
// Restore blending parameters:
this->State->vtkglBlendFuncSeparate(
GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA);
GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
// Restore the original viewport and scissor test settings
this->State->vtkglViewport(
......@@ -359,10 +360,6 @@ void vtkOrderIndependentTranslucentPass::Render(const vtkRenderState* s)
}
#endif
// Restore blending parameters:
this->State->vtkglBlendFuncSeparate(
GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
this->PostRender(s);
this->NumberOfRenderedProps = this->TranslucentPass->GetNumberOfRenderedProps();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment