Skip to content
Snippets Groups Projects
Commit ab9d8eb8 authored by Ken Martin's avatar Ken Martin
Browse files

A depth peeling fix when compositing

When compositing we need the alpha to be correct when it
comes out of depth peeling. Previously it was being set
to 1.0.
parent bca06605
Branches
Tags
No related merge requests found
......@@ -29,6 +29,6 @@ void main()
{
vec4 t1Color = texture2D(translucentRGBATexture, tcoordVC);
vec4 t2Color = texture2D(opaqueRGBATexture, tcoordVC);
gl_FragData[0].a = 1.0;
gl_FragData[0].a = t1Color.a + (1.0-t1Color.a)*t2Color.a;
gl_FragData[0].rgb = (t1Color.rgb*t1Color.a + t2Color.rgb*(1.0-t1Color.a));
}
......@@ -453,6 +453,7 @@ void vtkDepthPeelingPass::Render(const vtkRenderState *s)
bool done = false;
GLuint nbPixels = threshold + 1;
int peelCount = 0;
glDepthFunc( GL_LEQUAL );
while(!done)
{
glDepthMask(GL_TRUE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment