[osg-users] blending with shader

David Heitbrink david-heitbrink at uiowa.edu
Thu Nov 10 11:30:23 PST 2016


OK, I see it now. Taking a quick look at the code, it seems what you want to do is to add a vertex shader, and pass the texture coordinates from you Mesh, into your fragment shader. Then in your fragment shader use the texture coordinates in this line:

"vec4 sceneColor = texture2D(sceneTexture, texCoord); \n"
 
If you use the texCoord, texture coordinate for the sceneColor, its just going to pull the pixel from your first rendering pass from its space on the screen. The point of the warping mesh is it maps the pixel to a new place. 

You will still want to use texCoord to get the blending value.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=69312#69312








More information about the osg-users mailing list