OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

[ASK] Need help for a shader related issue


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> osgOcean [osgOcean]
View previous topic :: View next topic  
Author Message
benang
User


Joined: 31 Jan 2011
Posts: 21

PostPosted: Mon Jan 31, 2011 1:14 pm    Post subject:
[ASK] Need help for a shader related issue
Reply with quote

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!!!!!
Quote:
You must have 2 posts before you can post URL's/Links.
Back to top
View user's profile Send private message
benang
User


Joined: 31 Jan 2011
Posts: 21

PostPosted: Tue Feb 01, 2011 4:45 am    Post subject:
Reply with quote

Hi,

Because I can post URLs now, I'll post the source of what I want to implement. http://http.developer.nvidia.com/GPUGems/gpugems_ch21.html

Thank you!

Cheers,
Bawenang
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> osgOcean [osgOcean] All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts osgOcean and OpenSceneGraph issue sta... Paradox osgOcean [osgOcean] 0 Tue Jun 20, 2017 10:21 am View latest post
No new posts osgOcean and OpenSceneGraph issue sta... Paradox osgOcean [osgOcean] 0 Tue Jun 20, 2017 10:16 am View latest post
No new posts osgOcean and OpenSceneGraph issue sta... Paradox osgOcean [osgOcean] 0 Tue Jun 20, 2017 10:13 am View latest post
No new posts osgOcean and OpenSceneGraph issue sta... Paradox osgOcean [osgOcean] 0 Tue Jun 20, 2017 10:04 am View latest post
No new posts osgOcean and OpenSceneGraph issue sta... Paradox osgOcean [osgOcean] 0 Tue Jun 20, 2017 10:03 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP