Skip to main content
GameDev.net gamedev.net
🔒 Locked

Cloud Edge Glow Effect

Started by Quat Jun 8, 2010 at 6:34 PM 4 replies 1.9k views
Original Post
Quat
Quat
I am trying to get my cloud edges to get a glow/bloom effect from the sun. The problem is how to figure out the cloud edges to glow them. I model my clouds as a cluster of cloud sprite billboards. Any suggestions appreciated.
-----Quat
wiegje85
wiegje85
Render the clouds to a separate render target and pull that render target through a glow shader, then blend the original one and the glowy one?
Quat
Quat
Won't that glow the interior of the clouds instead of just the cloud edges?
-----Quat
Razvan1024
Razvan1024
You could try to draw the clouds into a render target and use that as some kind of stencil texture or you could use a stencil buffer to constrain the glow effect to only the visible areas (not blocked by the clouds) and render the glow effect by using that stencil buffer.
venzon
venzon
I've been thinking about how to do this too, and here's what I came up with (continues it the direction that Razvan was going in): store cloud density in the alpha channel of your cloud sprite billboards and when you render your cloud scene, render the alpha into an additional "density" texture using additive blending. Then during your glow pass you can control how much glow to apply by looking for low density values in your density texture.
samoth
samoth
Quote:
Won't that glow the interior of the clouds instead of just the cloud edges?
You will need the cloud's depth to modify your glow strength accordingly.

There is an article by Oat and Scheuermann in ShaderX6 about how to get the depth easily. The basic idea is to render normalised depth and (1-depth) to two render targets, which allows you to catch the front and backside in one pass. Subtract the two, and you have depth.
Quat
Quat
Thanks for the reference to that article!
-----Quat

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.