Which state would cause colors to become like this

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,

If however, I add the grid plane (the applications object), the colors are spoiled as shown below.

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

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.

It could be anything. What says glIntercept/gDEBugger ?

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?

Take a look at GL_GREMEDY_string_marker, 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.

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.

Thanks for the help guys. Here is the final snapshot after these changes.