Hi,

This is my second post here. I split it here because I am actually confused 
about a shader related problem and I decided to post it here.

I'm trying to implement a glow shader in osgOcean like the one explained at GPU 
Gems chapter 21 on NVIDIA's site (can't post the link because it looks like You 
must have 2 posts before you can post URL's/Links). On the page it was 
explained that we can use the alpha channel to determine the glow and 
brighteness of the glow of an object. So an alpha of 0.0 = glowing brightly, 
0.5 = glowing not to brightly, 1.0 = not glowing / normal texture.

However I see that the glare effect also uses alpha channel to determine which 
one to be glared. I see that in "OceanScene::downsamplePass()", there are these 
lines in the fragment shader:


Code:

        "  color = color*0.25;\n"
        "\n"
        "  if(color.a >= osgOcean_GlareThreshold) "
        "      gl_FragColor = color;\n"
        "  else\n"
        "    gl_FragColor = vec4(0.0);"
        "\n"  




So in a way you are determining which part glare should be implemented by their 
alpha channel, only reversed in this part. If the alpha is equal to or bigger 
than the threshold, it will be glared. So, what I'm confused of right now is 
how can I make a glow shader that won't collide with the glare shader, so maybe 
I can actually use them both at the same time? 

Thank you!

Cheers,
Bawenang

PS: LOL!!!!!

> You must have 2 posts before you can post URL's/Links.


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





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

Reply via email to