Creating A Fire Particle: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (clean up, added underlinked tag)
(formatting)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{Underlinked|date=January 2024}}
{{Underlinked|date=January 2024}}
{{lang|Creating_A_Fire_Particle}}
{{languageBar}}
==Overview==
==Overview==


The aim of this tutorial is to give you a insight of fire creation in particles.  
The aim of this tutorial is to give you a insight of fire creation in particles.
This article will not explain the complete ins and outs of particle creation, as
there is already documentation on it [[:Category:Particle_System|here]]. You will learn to create a fire particle like this:


:[[Image:Fire particle.jpg|200px]]
This article will not explain the complete ins and outs of particle creation, as there is already documentation on it [[:Category:Particle_System|here]]. You will learn to create a fire particle like this:
 
:[[File:Fire particle.jpg|200px]]


===Properties===
===Properties===


Make a new particle system, and name it. First we need to determine the  
1. Make a new particle system, and name it. First we need to determine the  
main properies of the particle. In the main tab of the particle,  select the '''system properties''' tab.
main properies of the particle. In the main tab of the particle,  select the '''system properties''' tab.


Change the '''max_particles''' to 40. Now select the '''material''' line, and click  
2. Change the '''{{mono|max_particles}}''' to 40. Now select the '''material''' line, and click the {{mono|...}} button to load the material browser and search for an appropriate fire material. For example, {{path|icon=file|particle/fire_particle_4/fire_particle_4|vmt}}.
the ... button to load the material browser and search for a appropriate fire material. For example particle\fire_particle_4\fire_particle_4.vmt.
   
   
Set the '''bounding_box_min''' to -512 -512 -512 and the bounding_box_max to 512 512 512.  
3. Set the {{code|bounding_box_min}} to {{code|-512 -512 -512}} and the {{code|bounding_box_max}} to {{code|512 512 512}}.
Change the '''color''' field to an orange color. We're done on the system properties tab now. Now in the main tab select the '''render''' tab. Right-click on the tab and select the add option.
Change the {{code|color}}''' field to an orange color. We're done on the system properties tab now. Now in the main tab select the '''render''' tab. Right-click on the tab and select the add option.


===Renderer===
===Renderer===


All particles need some kind of renderer to actually do anything. So we're going to add a '''render_animated_sprites''' renderer. Inside it change the '''animation_rate''' number to 0.9 and set the '''animation_fit_lifetime''' to 1. We're done with the renderer now. next click on the '''operator''' tab.
All particles need some kind of renderer to actually do anything. So we're going to add a '''{{mono|render_animated_sprites}}''' renderer. Inside it change the {{code|animation_rate}} number to {{code|0.9}} and set the {{code|animation_fit_lifetime}} to {{code|1}}. We're done with the renderer now. next click on the '''operator''' tab.


===Operators===
===Operators===


With the operators we will determine things like movement type, alpha fade in/out, lifespan etc. Operators do the work after the particle is initialized, rather then the initializers job of setting the starting state.
1. With the operators we will determine things like movement type, alpha fade in/out, lifespan etc. Operators do the work after the particle is initialized, rather then the initializers job of setting the starting state.


In the operator tab, add a '''movement_basic'''. This will determine the basic movement that the particle will do. In the '''movement_basic''', we only need to do one thing here. In the '''gravity''' field, set it to 0 0 50. Gravity gives the fire a direction to emit, 0 0 50 will make the fire go up like it would in real life, where as setting it to 0 0 -50, it will make it emit downwards.
2. In the operator tab, add a '''Movement Basic'''. This will determine the basic movement that the particle will do. In the '''Movement Basic''', we only need to do one thing here. In the {{code|gravity}} field, set it to {{code|0 0 50}}. Gravity gives the fire a direction to emit, {{code|0 0 50}} will make the fire go up like it would in real life, where as setting it to {{code|0 0 -50}}, it will make it emit downwards.


Next add a ''Oscillate_Vector'''. This operator will help us create a wavy fire effect, to keep the fire being wavy and bumpy like a real fire, rather then a static looking fire. Here's a example of its function:
3. Next add a '''Oscillate Vector'''. This operator will help us create a wavy fire effect, to keep the fire being wavy and bumpy like a real fire, rather then a static looking fire. Here's a example of its function:


::[[Image:Sin_wave.jpg]]
::[[File:Sin_wave.jpg]]


In the '''Oscillate_Vector''' under the '''oscillation rate min''' change the numbers to -0.400000006 -0.400000006 0 and under '''oscillation rate max''' change the numbers to 0.400000006 0.400000006 0. Change the '''oscillation frequency min''' numbers to 0.5 0.5 1 and the '''oscillation frequency max''' numbers to 1 1 0.
4. In the '''Oscillate Vector''', under the {{code|oscillation rate min}}, change the numbers to {{code|-0.400000006 -0.400000006 0}} and under {{code|oscillation rate max}}, change the numbers to {{code|0.400000006 0.400000006 0}}. Change the {{code|oscillation frequency min}} numbers to {{code|0.5 0.5 1}} and the {{code|oscillation frequency max}} numbers to {{code|1 1 0}}.


We're done with this operator now.
We're done with this operator now.


Next add a '''Lifespan Decay'''. This will delete the particle when it's given lifespan expires, we need to do this to make our alpha fade work, which we'll add. We don't need to add anything to this operator, it just needs to be there for it to function correctly.
5. Next add a '''Lifespan Decay'''. This will delete the particle when it's given lifespan expires, we need to do this to make our alpha fade work, which we'll add. We don't need to add anything to this operator, it just needs to be there for it to function correctly.


Now we'll add the Alpha Fade. Add a '''Alpha_Fade_In_Random'''. Inside it change the '''fade in time min''' to 0.3000000119 and the '''fade in time max''' to 0.400000006. Now add a '''Alpha_Fade_Out_Random''' and change the '''fade out time min''' to 0.349999994 and '''fade out time max''' to 0.5.
6. Now we'll add the '''Alpha Fade''''. Add a '''Alpha Fade In Random'''. Inside it change the {{code|fade in time min}} to {{code|0.3000000119}} and the {{code|fade in time max}} to {{code|0.400000006}}. Now add a '''Alpha Fade Out Random''' and change the {{code|fade out time min}} to {{code|0.349999994}} and {{code|fade out time max}} to {{code|0.5}}.


We're done with the operators now.
We're done with the operators now.
Line 48: Line 47:
We need to add some initializers. These will determine the particles starting state.
We need to add some initializers. These will determine the particles starting state.


Add a '''Radius Random''', set the '''radius_min''' to 3, and the '''radius_max''' to 10. This emits the particle within this radius, if you wanted a much larger fire, then for instance you would set the max to 50.
1. Add a '''Radius Random''', set the {{code|radius_min}} to {{code|3}}, and the {{code|radius_max}} to {{code|10}}. This emits the particle within this radius, if you wanted a much larger fire, then for instance you would set the max to {{code|50}}.


Next add a '''Alpha Random'''. Set the '''alpha_min''' to 120 and the '''alpha_max''' to 200.
2. Next add a '''Alpha Random'''. Set the {{code|alpha_min}} to {{code|120}} and the {{code|alpha_max}} to {{code|200}}.


Now add a  '''Rotation Random'''. Nothing is needed to add inside here.
3. Now add a  '''Rotation Random'''. Nothing is needed to add inside here.


Next add a '''Position Within Sphere Random'''. Set the '''distance_bias''' to 1 1 0 and the '''speed_max''' to 10.  
4. Next add a '''Position Within Sphere Random'''. Set the {{code|distance_bias}} to {{code|1 1 0}} and the {{code|speed_max}} to {{code|10}}.  
Set the '''speed_in_local_coordinate_system_min''' and '''speed_in_local_coordinate_system_max''' both to 0 0 5. This tells the particle to emit inside this sphere with a certain speed.
Set both the {{code|speed_in_local_coordinate_system_min}} and {{code|speed_in_local_coordinate_system_max}} to {{code|0 0 5}}. This tells the particle to emit inside this sphere with a certain speed.


Add a '''Lifetime Random''' and set it's '''lifetime_max''' to 1.25 and '''lifetime_min''' to 1. This sets each particle in the fires life to random in these numbers.
5. Add a '''Lifetime Random''' and set it's {{code|lifetime_max}} to {{code|1.25}} and {{code|lifetime_min}} to {{code|1}}. This sets each particle in the fires life to random in these numbers.


Add a '''Sequence Random''' and set the '''sequence_max/min''' to 2.
6. Add a '''Sequence Random''' and set both the {{code|sequence_max}} and the {{code|sequence_min}} to {{code|2}}.


Now add a '''Position Modify Offset Random''' and set the '''offset in local space 0/1''' to 1.
7. Now add a '''Position Modify Offset Random''' and set the {{code|offset in local space 0/1}} to {{code|1}}.


The Initializing is now complete.
The initializing is now complete.


===Emitters===
===Emitters===


Now lastly we need to add the main function that brings the particle to life. Emitters are what do this.
Lastly, we need to add the main function that brings the particle to life. Emitters are what do this.


Add a '''emit_continuously''' and the fire particle should come to life in the preview box.
1. Add a {{code|emit_continuously}} and the fire particle should come to life in the preview box.
Set the '''emission_rate''' to 50.
Set the {{code|emission_rate}} to {{code|50}}.


==Conclusion==
==Conclusion==


The particle is now finished, you should have a small fire particle built. You can
The particle is now finished, you should have a small fire particle built. You can learn from the way you built this to edit from it to make other particles like a waterfall.
 
learn from the way you built this to edit from it to make other particles like a
 
waterfall.


[[Category:Particle System]]
[[Category:Particle System]]
[[Category:Tutorials]]
[[Category:Tutorials]]

Latest revision as of 09:58, 28 May 2025

Underlinked - Logo.png
This article needs more Wikipedia icon links to other articles to help Wikipedia icon integrate it into the encyclopedia. Please help improve this article by adding links Wikipedia icon that are relevant to the context within the existing text.
January 2024
English (en)Русский (ru)中文 (zh)Translate (Translate)

Overview

The aim of this tutorial is to give you a insight of fire creation in particles.

This article will not explain the complete ins and outs of particle creation, as there is already documentation on it here. You will learn to create a fire particle like this:

Fire particle.jpg

Properties

1. Make a new particle system, and name it. First we need to determine the main properies of the particle. In the main tab of the particle, select the system properties tab.

2. Change the max_particles to 40. Now select the material line, and click the ... button to load the material browser and search for an appropriate fire material. For example, Fileparticle/fire_particle_4/fire_particle_4.vmt.

3. Set the bounding_box_min to -512 -512 -512 and the bounding_box_max to 512 512 512. Change the color field to an orange color. We're done on the system properties tab now. Now in the main tab select the render tab. Right-click on the tab and select the add option.

Renderer

All particles need some kind of renderer to actually do anything. So we're going to add a render_animated_sprites renderer. Inside it change the animation_rate number to 0.9 and set the animation_fit_lifetime to 1. We're done with the renderer now. next click on the operator tab.

Operators

1. With the operators we will determine things like movement type, alpha fade in/out, lifespan etc. Operators do the work after the particle is initialized, rather then the initializers job of setting the starting state.

2. In the operator tab, add a Movement Basic. This will determine the basic movement that the particle will do. In the Movement Basic, we only need to do one thing here. In the gravity field, set it to 0 0 50. Gravity gives the fire a direction to emit, 0 0 50 will make the fire go up like it would in real life, where as setting it to 0 0 -50, it will make it emit downwards.

3. Next add a Oscillate Vector. This operator will help us create a wavy fire effect, to keep the fire being wavy and bumpy like a real fire, rather then a static looking fire. Here's a example of its function:

Sin wave.jpg

4. In the Oscillate Vector, under the oscillation rate min, change the numbers to -0.400000006 -0.400000006 0 and under oscillation rate max, change the numbers to 0.400000006 0.400000006 0. Change the oscillation frequency min numbers to 0.5 0.5 1 and the oscillation frequency max numbers to 1 1 0.

We're done with this operator now.

5. Next add a Lifespan Decay. This will delete the particle when it's given lifespan expires, we need to do this to make our alpha fade work, which we'll add. We don't need to add anything to this operator, it just needs to be there for it to function correctly.

6. Now we'll add the Alpha Fade'. Add a Alpha Fade In Random. Inside it change the fade in time min to 0.3000000119 and the fade in time max to 0.400000006. Now add a Alpha Fade Out Random and change the fade out time min to 0.349999994 and fade out time max to 0.5.

We're done with the operators now.

Initializers

We need to add some initializers. These will determine the particles starting state.

1. Add a Radius Random, set the radius_min to 3, and the radius_max to 10. This emits the particle within this radius, if you wanted a much larger fire, then for instance you would set the max to 50.

2. Next add a Alpha Random. Set the alpha_min to 120 and the alpha_max to 200.

3. Now add a Rotation Random. Nothing is needed to add inside here.

4. Next add a Position Within Sphere Random. Set the distance_bias to 1 1 0 and the speed_max to 10. Set both the speed_in_local_coordinate_system_min and speed_in_local_coordinate_system_max to 0 0 5. This tells the particle to emit inside this sphere with a certain speed.

5. Add a Lifetime Random and set it's lifetime_max to 1.25 and lifetime_min to 1. This sets each particle in the fires life to random in these numbers.

6. Add a Sequence Random and set both the sequence_max and the sequence_min to 2.

7. Now add a Position Modify Offset Random and set the offset in local space 0/1 to 1.

The initializing is now complete.

Emitters

Lastly, we need to add the main function that brings the particle to life. Emitters are what do this.

1. Add a emit_continuously and the fire particle should come to life in the preview box. Set the emission_rate to 50.

Conclusion

The particle is now finished, you should have a small fire particle built. You can learn from the way you built this to edit from it to make other particles like a waterfall.