On mer 13 août 2008, Vivian Meazza wrote:
> gerard robin wrote:
> > Are we sure that, all the Particle features which are within OSG, are
> > available with the new XML coding <particlesystem> ?
> >
> > When translating one of my .osg file to <particlesystem> .xml file, i
> > don't
> > get the same quality of result.
> >
> > It could be just me. I can be wrong.  :(
> >
> > Or that new XML coding is may be a first step, and others improvements
> > are coming :)
>
> No, all the features of particles are not available with the xml version,
> but I don't think that should affect performance.
>
> Tim recently fixed a bug which only showed up under MSVC9, and other bugs
> have been reported, in particular that the particles "jitter".
>
> There are no further enhancements planned to the xml stuff that I am aware
> of, unless Tiago is doing something.
>
> What exactly is the problem?
>
> Vivian
Hello Vivian , nice to read you

Here are the snapshots which show the difference with Catalina model
I have done the test on the   left float only. 

In order to get the <particlesystem> file, i translated the .osg file to the 
new xml file. (same parameters, when available) 


First with the     .osg  model
http://pagesperso-orange.fr/GRTux/OSG_ModelParticle-Img1.jpg
http://pagesperso-orange.fr/GRTux/OSG_ModelParticle-Img2.jpg

Second with the xml file <particlesystem> from Tiago developement
http://pagesperso-orange.fr/GRTux/OSG_XMLParticle-Img1.jpg
http://pagesperso-orange.fr/GRTux/OSG_XMLParticle-Img2.jpg


In addition to, we can notice that the <particlesystem> doesn't mind with 
the "hide"  feature, we can see the effect through the wing on the top view, 
the .osg model take care of it, with respect of the hierarchy, objects 
behind, objects in front of   (seems to be the same problem with the new Rain 
feature, raining can be seen in the cockpit :(  )   
Is it a bug ?

Regarding the eye candy difference, it is sure that i can try to improve with 
others parameters, and  with some additional cumulative effects (3, 4 , 5 
effects on the same starting point).
I fear that the cpu would be overloaded, quickly

However, i can see an advantage  to the   <particlesystem>      :)   :
it follows the trajectory of the source, which is significant when the life 
time is long.


Here are the osg files and the resulting xml file <particlesystem>

You can notice that that .osg file is very simple, it does not use the full 
featuring that we can use with it, it could be more complex, and an expert (i 
am not) could get with it more and more realistic effects.

So the <particlesystem> ( in spite of the good work which has yet been done by 
Tiago) to me, will need more and more improvements in order to use fully that 
nice OSG system.


Regards

-- 
Gérard
http://pagesperso-orange.fr/GRTux/

"J'ai décidé d'être heureux parce que c'est bon pour la santé. 
Voltaire "
//Gerard Robin  03-02-2007 FlightGear Copyright License:  GPL


Group {
  UniqueID Group_20
  DataVariance DYNAMIC
  name "catalina_flux1.osg"
  nodeMask 0xffffffff
  cullingActive TRUE
  num_children 3
          osgParticle::ModularEmitter {
        UniqueID ModularEmitter_23
        DataVariance DYNAMIC
        name "ModularEmitter2"
        nodeMask 0xffffffff
        cullingActive FALSE
        osgParticle::ParticleSystem {
          UniqueID ParticleSystem_24
          DataVariance DYNAMIC
          StateSet {
            UniqueID StateSet_25
            DataVariance STATIC
            rendering_hint OPAQUE_BIN
            renderBinMode USE
            binNumber 0
            binName RenderBin
            GL_LIGHTING OFF
            GL_COLOR_MATERIAL ON
            GL_BLEND ON
            textureUnit 0 {
              GL_TEXTURE_2D ON
              Texture2D {
                UniqueID Texture2D_26
                DataVariance STATIC
                wrap_s CLAMP
                wrap_t CLAMP
                wrap_r CLAMP
                min_filter LINEAR
                mag_filter LINEAR
                maxAnisotropy 1
                borderColor 0 0 0 0
                borderWidth 0
                useHardwareMipMapGeneration TRUE
                unRefImageDataAfterApply FALSE
                internalFormatMode USE_IMAGE_DATA_FORMAT
                resizeNonPowerOfTwo TRUE
              }
              TexEnv {
                UniqueID TexEnv_27
                DataVariance STATIC
                mode MODULATE
              }
            }
          }
          supportsDisplayList FALSE
          useDisplayList FALSE
          useVertexBufferObjects FALSE
          particleAlignment BILLBOARD
          alignVectorX 1 0 0
          alignVectorY 0 1 0
          doublePassRendering FALSE
          frozen FALSE
          freezeOnCull TRUE
          defaultBoundingBox -10 -10 -10 10 10 10
          particleTemplate {
            shape QUAD
            lifeTime 4
            sizeRange 0.35 0.2
            alphaRange 0.5 0
            colorRange 0.440696 0.504509 0.53962 0.8 0.0784009 0.535637 
0.540536 1
            position 0 0 0
            velocity 0 0 0
            angle 0 0 0
            angularVelocity 0 0 0
            radius 0.8
            mass 0.8
            textureTile 1 1 1
            sizeInterpolator {
              osgParticle::LinearInterpolator {
                UniqueID LinearInterpolator_28
                DataVariance DYNAMIC
              }
            }
            alphaInterpolator {
              osgParticle::LinearInterpolator {
                UniqueID LinearInterpolator_29
                DataVariance DYNAMIC
              }
            }
            colorInterpolator {
              osgParticle::LinearInterpolator {
                UniqueID LinearInterpolator_30
                DataVariance DYNAMIC
              }
            }
          }
        }
        enabled TRUE
        referenceFrame ABSOLUTE
        endless TRUE
        lifeTime 0
        startTime 0
        currentTime 0
        resetTime 2
        useDefaultTemplate TRUE
        osgParticle::RandomRateCounter {
          UniqueID RandomRateCounter_31
          DataVariance DYNAMIC
          rateRange 80 80
        }
        osgParticle::SectorPlacer {
          UniqueID SectorPlacer_32
          DataVariance DYNAMIC
          center 0 0 0
          radiusRange 0 0.35
          phiRange 0 6.28319
        }
        osgParticle::RadialShooter {
          UniqueID RadialShooter_33
          DataVariance DYNAMIC
          thetaRange 0 0
          phiRange 0 0
          initialSpeedRange 4 5
          initialRotationalSpeedRange 40 0 0 70 0 0
        }
      }
  osgParticle::ParticleSystemUpdater {
    DataVariance DYNAMIC
    name "ParticleSystemUpdater6"
    nodeMask 0xffffffff
    cullingActive FALSE
    Use ParticleSystem_24
  }
  Geode {
    DataVariance DYNAMIC
    name "geode1"
    nodeMask 0xffffffff
    cullingActive TRUE
    num_drawables 1
    Use ParticleSystem_24
  }
}
<?xml version="1.0"?>
<!--Document started 27/01/2008 by Tiago Gusm�o
Updated 02/02/2008 to reflect syntax changes
Updated 03/02/2008 to add trails (connected particles)

This is a short specification/tutorial to define particle systems in FlightGear using XML


Stick this inside any model XML like it was an animation and it should work (notice the condition requires wheel on the ground)

Specification:

Note:-->
<!--<VALUEORPROP/> means you can either specify a property with factor and offset (result = (prop*factor)+offset ) in the usual way-->


<PropertyList>



<particlesystem>
  <type>normal</type>
  <!--<offset>
	<x-m>1.75098</x-m>
	<y-m>-15.5773</y-m>
	<z-m>2.10195</z-m>
	<pitch-deg>91</pitch-deg>
	<heading-deg>0</heading-deg>
	<roll-deg>0</roll-deg>
  </offset>-->
  <name>fluxGD</name>
  <attach>world</attach>
  <!--<texture>particle1.rgb</texture>--><!-- = the texture path relative to the XML file location-->

  <!--particleAlignment BILLBOARD
          alignVectorX 1 0 0
          alignVectorY 0 1 0-->

  <emissive>false</emissive>
  <lighting>true</lighting>
  <align>billboard</align>

  <!--osgParticle::SectorPlacer {
          UniqueID SectorPlacer_32
          DataVariance DYNAMIC
          center 0 0 0
          radiusRange 0 0.35
          phiRange 0 6.28319
        }-->
  <placer>
    <type>sector</type>
    <radius-min-m>0</radius-min-m>
    <radius-max-m>0.35</radius-max-m>
    <phi-min-deg>0</phi-min-deg>
    <phi-max-deg>6.3</phi-max-deg>
    <!--<segments> = only for segments, encloses sequential points that form segments
      <vertex> = specifies one point, put as many as you want
        <x-m>float</x-m>
        <y-m>float</y-m>
        <z-m>float</z-m>
      </vertex>
      ....
      <vertex>
      ...
      </vertex>
    </segments>-->
  </placer>


   <!--osgParticle::RadialShooter {
          UniqueID RadialShooter_33
          DataVariance DYNAMIC
          thetaRange 0 0
          phiRange 0 0
          initialSpeedRange 4 5
          initialRotationalSpeedRange 40 0 0 70 0 0
        }-->
  <shooter>
	<theta-min-deg>0</theta-min-deg>
	<theta-max-deg>0</theta-max-deg>
	<phi-min-deg>0</phi-min-deg>
	<phi-max-deg>0</phi-max-deg>
	<speed-mps>
		<value>4</value>
		<spread>1</spread>
	</speed-mps>
	<rotation-speed>
	<x-min-deg-sec>40</x-min-deg-sec>
	<y-min-deg-sec>0</y-min-deg-sec>
	<z-min-deg-sec>0</z-min-deg-sec>
	<x-max-deg-sec>70</x-max-deg-sec>
	<y-max-deg-sec>0</y-max-deg-sec>
	<z-max-deg-sec>0</z-max-deg-sec>
	</rotation-speed>
  </shooter>

  <!--osgParticle::RandomRateCounter {
          UniqueID RandomRateCounter_31
          DataVariance DYNAMIC
          rateRange 80 80-->
  <counter>
	<particles-per-sec>
		<value>80</value>
		<spread>0</spread>
	</particles-per-sec>
	<!-- <condition> =a tipical condition that if not true stops particles from being emitted (PPS=0)	....
	</condition>-->
  </counter>
  <!--colorRange 0.440696 0.504509 0.53962 0.8 0.0784009 0.535637 0.540536 1
  sizeRange 0.35 0.2-->
  <particle>
    <start>
	<color>
		<red>
			<value>0.45</value>
		</red>
		<green>
			<value>0.50</value>
		</green>
		<blue>
			<value>0.54</value>
		</blue>
		<alpha>
			<value>0.8</value>
		</alpha>
	</color>
      	<size><value>0.35</value></size>
    </start>
    <end>
	<color>
		<red>
			<value>0.078</value>
		</red>
		<green>
			<value>0.54</value>
		</green>
		<blue>
			<value>0.54</value>
		</blue>
		<alpha>
			<value>1</value>
		</alpha>
      	</color>
      	<size><value>0.1</value></size>
    </end>
   <!-- lifeTime 4-->
    <life-sec>
	    <value>4</value>
    </life-sec>
    <!--radius 0.8
	mass 0.8-->
    <radius-m>0.8</radius-m>
    <mass-kg>0.8</mass-kg>
  </particle>

  <program>
    <fluid>water</fluid>
    <gravity>enabled</gravity>
    <wind>disabled</wind>
  </program>


</particlesystem>

<!--Remarks:
  Don't forget you can use existing animations with particles, so if you want to direct or translate the emitter, just use translate, rotate, spin and so on (other animations might have interesting effects too i guess)
  Particle XML should be compatible with plib, as the tags will be ignored (you might get some warning if you attach them to animations though)
  Try not to use a lot of particles in a way that fills the screen, that will demand lots of fill rate and hurt FPS
  If you don't use any properties nor condtions, your particle system doesn't need to use a callback a so it's slightly better on the CPU (mostly useful for static models)
  If your particle lifetime is too big you might run out of particles temporarily (still being investigated)
  Use mass and size(radius) to adjust the reaction to gravity and wind (mass/size = density)
  Altough at the moment severe graphical bugs can be seen in the trails, they are usable. Consider your options correctly! You should consider giving them no initial velocity and most important, no spread, otherwise particles will race and the trail will fold. Start simple (no velocities and forces) and work your way up.-->

</PropertyList>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to