PDA

View Full Version : Which state would cause colors to become like this



mobeen
03-22-2011, 10:25 AM
I am rendering volume rndering in a CAD application as a plugin. In the app, if i donot add the CAD primitive, the rendering is fine as follows,
http://www3.ntu.edu.sg/home2007/mova0002/test/b.png
If however, I add the grid plane (the applications object), the colors are spoiled as shown below.
http://www3.ntu.edu.sg/home2007/mova0002/test/a.png

My suspicion is that the cad software is modifying the opengl state so i want to know which state might cause this behaviour?

McLeary
03-22-2011, 10:29 AM
Did you try render your primitive inside CAD application with flat colors?

At least for me, looks like the CAD is using the normals as colors.

ZbuffeR
03-22-2011, 11:09 AM
It could be anything. What says glIntercept/gDEBugger ?

mobeen
03-22-2011, 11:32 AM
Hmm the colors seem to be clamped to the nearest color so i will try to render as solid color and show the result here later.

As for using glIntercept/gDebugger i havent tried them yet I thought i'd ask here first from the gurus about the possible OpenGL state that might be causing this?

Previously I was rendering the volume slices alpha blended but the application primtive (the grid plane) changed the polygon mode to lines and so i was not able to see the volume rendering properly. Therefore, it is highly likely that the grid plane rendering is also changing some other opengl state that is not reset after the primitives rendering and thus my rendering is spoiled.

For gDebugger/glINtercept how do i know about the specific state change since the rendering is quite fast and the state changed are alot? How do i confine my search? Any ideas?

carsten neumann
03-22-2011, 01:04 PM
Take a look at GL_GREMEDY_string_marker (http://www.opengl.org/registry/specs/GREMEDY/string_marker.txt), it should be available under gDEBugger, otherwise inserting a glGet(GL_VENDOR) or something like that can help identify specific spots in the command stream.

mobeen
03-23-2011, 12:11 AM
Hi all,
I managed to solve my problem. The shademodel was modified to GL_FLAT by the CAD application. I thus changed it to GL_SMOOTH before my render and after the render I restore it to what it was earlier and now its perfectly fine.
http://www3.ntu.edu.sg/home2007/mova0002/test/c.png
Thanks for the help guys. Here is the final snapshot after these changes.