[osg-users] blending with shader

David Heitbrink david-heitbrink at uiowa.edu
Fri Nov 11 11:46:34 PST 2016

yeah basically you want to use un-warped coordinates for your blending image, and warped coordinates for your scene image. If not you would have to warp your blending image, which may be easier for you depending on process. 

As per passing your texture width, you can use the function textureSize, that will get the dimensions of the image:

Do keep in mind, you need to set the version number in your shader to use this. 

In our case case we basically hard coded texture width as we generated the shader code with our blending image, as well as a few parameters for color correction and a few other other things. 

You can also query the size of your texture and do a text replace on your shader code before loading it.

Read this topic online here:

More information about the osg-users mailing list