Hi,

use two viewports:

1st viewport:

- contains the scene which does normal rendering.
- Set the depth test to LESS
- The viewport has TravMask set to 3.
- the viewport has a TextureGrabForeground that grabs the rendering
into a texture, lets call it texture "A".

on top of the 1st viewport you put a second viewport, made of:
- The same scene as in viewport no.1
- Clear the background color (use black as color and leave 
the depth unchanged!).
- Set the depth test to LESS_EQUAL
- Set the TravMask of the viewport to 2.
- Set the TravMask of the geometry that has to glow  to 2, set
TravMask 1 to the rest of the geometry. (this way only the glowing
geometry will be rendered)
- the viewport has a TextureGrabForeground that grabs the rendering
into a texture, lets call it texture "B".

Now you should have in texture "A" the normal rendering, in "B"
you should have the texture with only the geometry that
has to glow.

Now render texture A and B in respective PolygonForegrounds (you can
add them to the second viewport actually...
Apply to texture B an adequate shader (blur...).

I haven't tried this.... So, there might be conceptual bugs ;)
E.g., I'm not very sure how to control the depth test... Perhaps
by using a MaterialGroup on top of the root Node?

Regards,

  Toni


________________________________________
Da: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Per conto di Stefano
Inviato: venerdì 30 marzo 2007 15.35
A: [email protected]
Oggetto: [Opensg-users] Glow effect

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; 

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?

How can I achieve all this stuff with OpenSG?
Thanks, 
-- 
Stefano Verna


-------------------------------------------------------------------------
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