Re: [osg-users] Combining particles with different textures

2009-08-01 Thread Roland Smeenk
Hi Martin,

The particle system indeed supports a tiled texture that will be selected based 
on it's age. Since all mechanisms are there it should be quite easy to make a 
small modification to let emitters determine the texture tile and disable 
updating of the texture tile.

When mixing fire and smoke you typically would want the fire to be emissive and 
the smoke to be lit by scene lights. This can be done from within the same 
texture by using pre-multiplied alpha.

regards, 

Roland Smeenk

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=15700#15700





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Combining particles with different textures

2009-08-01 Thread Martin Scheffler
I just looked at the cessna example, and it seems to have the z fighting 
problem I tried to describe. If you turn the camera around the plane, at some 
point the fire jumps over the smoke. The two particle systems are not really 
mixing.

Martin

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=15699#15699





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Combining particles with different textures

2009-08-01 Thread Jean-Sébastien Guay

Hi Martin,


I'm trying to work out how to combine particles with different textures. I want 
to create a fire particle system where I can dynamically change the amount of 
fire-, smoke- and spark-particles. I haven't found a good way to do this yet.


I have no specific answers to offer, but have you looked at the 
cessnafire.osg file? It has fire and smoke on the cessna. You could open 
that file and see how it does it.


http://www.openscenegraph.org/projects/osg/browser/OpenSceneGraph-Data/trunk/cessnafire.osg?rev=8969

Hope this helps,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Combining particles with different textures

2009-08-01 Thread Martin Scheffler
Hi,

I'm trying to work out how to combine particles with different textures. I want 
to create a fire particle system where I can dynamically change the amount of 
fire-, smoke- and spark-particles. I haven't found a good way to do this yet.

My first idea was to overlay multiple particle systems. This has the problem 
that the particles of the different kinds start z-fighting. Depending on camera 
position, different kinds of particle are rendered on top.

My second thought was to create a single particle system that has emitters for 
the different particles. I can add multiple emitters to a particle system with 
different particle prototypes. 
I can only assign one single texture to a particle system. This would be OK if 
I could specify different texture coordinates for the different particle 
prototypes. There is the method in the particle class "setTextureTile" that I 
can use to let a single particle loop through the tiles of a texture during its 
lifetime. But there is no way to set a start and end tile, so the particle 
always loops through all tiles.

Is there something I don't see? Or is there currently no way to add differently 
textured particles to a single particle system? If there is none, the easiest 
way to change this would be to add a setStartTile and setEndTile method to the 
particle class so that I can assign different tile segments to different 
particles.

Thank you!

Cheers,
Martin

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=15697#15697





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org