View Full Version : Which OpenGL State can be modified in CG Pixel Shader

05-24-2007, 09:28 PM
My CG Pixel Shader program need to save the processing result in a OpenGL state(such as "emmision" state),my just processing result is just a float value,so I think if I can save it in OpenGL state,then I can call the "glGetFloat()" to get result,without readout whole image(Pixel shader's processing result is a image);But I am not sure is it possible to modify GL state in a CG program,and I don't know the CG function name or parameter name that can modify gl state,so I post the topic.Help me,Please!

05-25-2007, 12:35 AM
Well you can't set an openglstate in a shader, but whats the problem?

if your state results in just one float ( or 4 floats if you want to simulate the emission state) then you just have to read out one single pixel from the rendertarget, and that shouldn't be that slow.