[vtkusers] Mixed Color with Depth Peeling: Solved

LiPan li76pan at hotmail.com
Thu Nov 13 10:14:44 EST 2014


Hi all,
I solved the problem. The trick is, vtkOpenGLTexture set the flag useTexture (used in vtkDepthPeeling_fs.glsl) to true and does not reset to zero again. This will map the same texture image to the following polygon data which actually does not use texture mapping. So I reset the flag to zero before a new actor is drawn in function vtkRenderer::UpdateTranslucentPolygonalGeometry(). This is only a quick and dirty solution of cause. 
regards
Pan


From: li76pan at hotmail.com
To: vtkusers at vtk.org
Date: Mon, 10 Nov 2014 21:17:39 +0800
Subject: [vtkusers] Mixed Color with Depth Peeling




Dear all,
I was trying to use Depth Peeling to display several translucent polydata in one 3D scene. The problem is, if their colors are set with SetColor, everything works fine. However, if texture mapping is applied to one of the polygon, the colors of the rest polydata are mixed up with color of this texture map.

In the attached simplified example code, I was trying to create two polydata. One is quad, the other is cube. Quad got a texture which is loaded from a jpg file. The image is nothing more than a square of red color. The color of cube is white. Opacity of both were set to 0.5. So, if you run the program, you'll see the cube polygon becomes red which comes from the texture image.

I'm using vtk6.0 under Kubunto 12.04. glxinfo shows OpenGL version string: 4.4.0 NVIDIA 331.38. I've read the paper of Depth Peeling by Cass Everitt. Still couldn't understand where the problem comes from. Could anyone give me a hint?

Thank you
Pan



 		 	   		  

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20141113/fd308631/attachment.html>


More information about the vtkusers mailing list