[osg-users] Non emissive ParticleSystem and lighting

Christophe.medard christophe.medard at oktal.fr
Thu Mar 12 05:35:01 PDT 2009

Hi All,

Anybody having an elegant hint for 3. ???


----- Original Message ----- 
From: Christophe.medard 
To: osg-users at lists.openscenegraph.org 
Sent: Friday, March 06, 2009 4:07 PM
Subject: [osg-users] Non emissive ParticleSystem and lighting

A patch solution could be introduced to give the impression ambient lighting works onto Particle System.

Into osgParticleSystem::update() method, after particles' update(dt) method call their _current_color are stepped.
We could there re-touch the stepped color and darken it according to an ambient color value if we can override setDefaultsAttributes not to have it enable LIGHTING when lighting parameter is true.

This trick should work provided :
1. ParticleSystem::setDefaultAttributes() method be set as virtual
2. Particle class be added a getColor()/setColor() method make it possible to read/write onto _current_color
3. We find a mean to get the active ambient lighting value in the place of the scenegraph where the ParticleSystem is attached

If someone has an idea for 3., I'm interested !
(A very ugly walkaround method would be to memorize a pointer onto the external osg::Vec4 value containing the ambient value and add a method into ParticleSystem interface just for this purpose, but how baaaaad !!!!)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20090312/0833dbb7/attachment-0003.htm>

More information about the osg-users mailing list