I am by no means a shader expert, but this is not an OSG problem. It is a shader problem. OSG doesn't do much special on top of what OpenGL gives you for shaders.

I'd recommend the orange book on the OpenGL shading language. It will help you reconstruct the parts of the built-in shader pipeline that you need for your custom shader.

-Paul

Jeremy Trammell wrote:
I hope this isn't a ridiculously obvious question, but I have yet to find a clear set of solid documentation for OSG, so pardon my naiveness!

I'm working on a little game that allows the user to assemble a 3D map out of blocks. As part of the user interface, I wrote a shader that would smoothly fade out levels above and below the level the user is currently editing. This allows the user to see where geometry is in the other levels, but without seriously obstructing their view of the level they are currently working on. Great.

My problem is that I also want the user to be able to place "objects" in the map. Naturally these objects should also be "faded out" by my shader. The problem is this: My shader, since it completely replaces the default rendering pipeline, ignores all the textures in the loaded objects. Yikes!

So I guess what I'm looking for is a way to get OSG to "render the objects as it normally would", and then pass those gl_FragColor, gl_Position, ...etc. values to my custom shader to modify as it sees fit before finally drawing the modified data on screen. Is this possible? If not, how do I go about accomplishing this task?


--
/Fortiter/ in re, /suaviter/ in modo.
------------------------------------------------------------------------


------------------------------------------------------------------------

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to