Stefano wrote:
> Hi there,
> I'm trying to implement a simple glow effect with OpenSG. Has anyone 
> already
> made it?
>
> I have already:
> - used a TextureGrabForeground to take the 2D rendering of the scene;
> - used a PolygonForegroundPtr with a shader material to obtain the glow
> effect on the whole scene;
Sounds good.
>
> Which obviously is not what I want, as I only want some objects in my 
> scene
> to glow. For what I know, what I have to do is to mask out the parts 
> of the
> scene that do not glow, turning them black in the glow source 
> rendering, use
> the glowing shader material on this texture, and then alpha blend the 
> result
> over the ordinary rendering. Am I right?
Yup. But you need to define what parts should glow (i.e. have a light 
value larger than 1) somehow.
>
> How can I achieve all this stuff with OpenSG?
No different than OpenGL in general. I suggest reading some 
papers/tutorials on glow/bloom and High Dynamics Rendering, HDR.

Anyway, the two most common approaches are:
 * Store material glow "amount" in frambuffer alpha channel, multiply 
scene rgb with alpha in glow effect shader to get glow amount,
 * Render to floating point texture/buffer with values > 1 denoting 
"really bright lights". Just filter all that together and compress into 
0..1 by various values (depending on how bright your scene is and how 
much glow you want)

Cheers,
/Marcus

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to