Commit 726df68b authored by Ken Martin's avatar Ken Martin Committed by Code Review

Merge topic 'molucule_depth_peeling' into master

85666eb9 Make sure molecule mapper works with depth peeling
parents 0fbf84d6 85666eb9
......@@ -113,6 +113,17 @@ void vtkOpenGLSphereMapper::ReplaceShaderValues(std::string &VSSource,
" gl_FragDepth = (pos.z / pos.w + 1.0) / 2.0;\n"
);
if (ren->GetLastRenderingUsedDepthPeeling())
{
FSSource = vtkgl::replace(FSSource,
"//VTK::DepthPeeling::Impl",
"float odepth = texture2D(opaqueZTexture, gl_FragCoord.xy/screenSize).r;\n"
" if (gl_FragDepth >= odepth) { discard; }\n"
" float tdepth = texture2D(translucentZTexture, gl_FragCoord.xy/screenSize).r;\n"
" if (gl_FragDepth <= tdepth) { discard; }\n"
);
}
this->Superclass::ReplaceShaderValues(VSSource,FSSource,GSSource,lightComplexity,ren,actor);
}
......
......@@ -173,6 +173,19 @@ void vtkOpenGLStickMapper::ReplaceShaderValues(std::string &VSSource,
);
}
if (ren->GetLastRenderingUsedDepthPeeling())
{
FSSource = vtkgl::replace(FSSource,
"//VTK::DepthPeeling::Impl",
"float odepth = texture2D(opaqueZTexture, gl_FragCoord.xy/screenSize).r;\n"
" if (gl_FragDepth >= odepth) { discard; }\n"
" float tdepth = texture2D(translucentZTexture, gl_FragCoord.xy/screenSize).r;\n"
" if (gl_FragDepth <= tdepth) { discard; }\n"
);
}
this->Superclass::ReplaceShaderValues(VSSource,FSSource,GSSource,lightComplexity,ren,actor);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment