Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
particles [2019/03/08 11:46] – [Mouse interaction] adminparticles [2020/11/06 13:51] – [Physics Particle Support] admin
Line 1: Line 1:
 ====== Using the ParticleSystem ====== ====== Using the ParticleSystem ======
 +
 +{{::particles1.jpg?nolink|}}
  
 Gorilla3D provides an integrated particle system for rendering complex and individual particle effects. Gorilla3D provides an integrated particle system for rendering complex and individual particle effects.
Line 7: Line 9:
 Gorilla3D already supplies some of the most popular effects, like: fire, smoke, rain, snow, waterfall, eruption, explosion. Gorilla3D already supplies some of the most popular effects, like: fire, smoke, rain, snow, waterfall, eruption, explosion.
  
 +{{::particles2.jpg?nolink|}}
  
 It is possible to manipulate each particle by the so-called influencers. It is possible to manipulate each particle by the so-called influencers.
Line 20: Line 23:
   * Endless or limited emmittance   * Endless or limited emmittance
   * Physically based particle collision detection with other scene objects (not with particles!)   * Physically based particle collision detection with other scene objects (not with particles!)
 +  * Autosorting of particles depending on assigned camera
  
 +===== Shader / Material =====
 +
 +The particle emitter expects a pointsprite compatible material source to be applied.
 +Gorilla3D therefor provides the **TGorillaParticleMaterialSource** as default material.
 +It supports rendering a single texture, texture-atlas (for animated particles) and colored particles on pointsprite basis.
 +
 +Have a look at [[materials|Materials]]
 +
 +Of course you can write your own shader if those features do not suit your needs.
 +
 +===== Shader Attributes =====
 +
 +To allow extended particle functionality Gorilla3D changes the default values of some vertex attributes, because at the moment it is not possible to declare our own vertex attributes.
 +
 +In the following table we show the attribute settings for each particle, when using a TGorillaParticleEmitter:
 +
 +^ Vertex-Attribute ^ Value ^
 +| a_Position | position |
 +| a_Normal | velocity | 
 +| a_Color0 | current color|
 +| a_TexCoord0 | current texture or texture atlas offset |
 +| a_Binormal | X = size, Y = angle, Z = weight |
 +| a_Tangent | X = age, Y = life time, Z = delta time |
 +===== Physics Particle Support =====
 +
 +{{::particles3.jpg?nolink|}}
 ===== Example ===== ===== Example =====
  
Line 31: Line 61:
 begin begin
   LParticles := TGorillaFireParticleEmitter.Create(FGorilla);   LParticles := TGorillaFireParticleEmitter.Create(FGorilla);
-  LParticles .Camera := FCamera;+  LParticles.Parent := FGorilla; 
 +  LParticles.Camera := FCamera;
  
   // a fire effect contains multiple parts: a front and back flame and smoke   // a fire effect contains multiple parts: a front and back flame and smoke
Line 58: Line 89:
 begin begin
   LParticles := TGorillaSmokeParticleEmitter.Create(FGorilla);   LParticles := TGorillaSmokeParticleEmitter.Create(FGorilla);
 +  LParticles.Parent := FGorilla;
   LParticles.Camera := FCamera;   LParticles.Camera := FCamera;
  
Line 87: Line 119:
 begin begin
   LParticles := TGorillaEruptionParticleEmitter.Create(FGorilla);   LParticles := TGorillaEruptionParticleEmitter.Create(FGorilla);
 +  LParticles.Parent := FGorilla;
   LParticles.Camera := FCamera;   LParticles.Camera := FCamera;
  
Line 109: Line 142:
 begin begin
   LParticles := TGorillaRainParticleEmitter.Create(FGorilla);   LParticles := TGorillaRainParticleEmitter.Create(FGorilla);
 +  LParticles.Parent := FGorilla;
   LParticles.Camera := FCamera;   LParticles.Camera := FCamera;
 end; end;
Line 126: Line 160:
 begin begin
   LParticles := TGorillaSnowParticleEmitter.Create(FGorilla);   LParticles := TGorillaSnowParticleEmitter.Create(FGorilla);
 +  LParticles.Parent := FGorilla;
   LParticles.Camera := FCamera;   LParticles.Camera := FCamera;
 end; end;
Line 247: Line 282:
 end; end;
 </file> </file>
 +
 +
 +Next step: [[physics|Physics]]