当前位置:网站首页>Particle system for introduction to unity3d Foundation (attribute introduction + case production of flame particle system)
Particle system for introduction to unity3d Foundation (attribute introduction + case production of flame particle system)
2022-07-06 12:36:00 【SQ Liu】
Unity3D Elementary introduction to particle systems ( Property introduction + Case making of flame particle system )
One 、 Property introduction
1、 Main panel Particle System
(1)Duration: Particle emission period
In the figure ,5.00 That is, at launch 5 Enter the next particle emission cycle in seconds . If not checked Looping, be 5 Seconds later, the particles will stop emitting .
(2)Looping: Particles are emitted periodically
Let the particle emission time cycle , Keep emitting particles .
(3)Prewarm: Preheating system
The particles have been emitted for some time , Only in Looping It is only effective when circulating .
(4)Start Delay: Delayed emission of particles
How long after the particle system is created before it starts emitting particles . If there is Prewarm Then the delay cannot be set .0 Just don't delay ; if 5, be 5 Seconds before launching .
(5)Start Lifetime: The length of time between the occurrence and disappearance of particles
(6)Start Speed: The speed at which the particle first occurs
Generally, choose between two values , Click the inverted triangle at the back , choice Random Between Two Constants.
Constant( Constant ): Fixed value , No change .
Curve( curve ): Use a curve to represent Duration Changes in time . The vertical axis is the change of this value , The horizontal axis is Duration Time . But notice the initial value , Differences at birth , Once born , It is controlled by other values .
Random Between Two Constants( Change randomly between two constants ): Random value .
Random Between Two Curves( Change randomly between two curves ): Random curves .
(7)3D Start Size:3D Initial particle size
You can make particles in X、Y、Z There are different sizes on the three shafts . When the particle is billboard Mode time ,Z Shaft adjustment is meaningless .
(8)Start Size: Initial particle size
The initial size of the overall setting .X、Y、Z Three axis synchronous size , The unit is meters .
(9)3D Start Rotation:3D Initial rotation of particles
Particles can orbit X、Y、Z The three axes set different angles .
(10)Start Rotation: Initial rotation of particles
By default, only z Rotation angle in axis direction , The value is the angle .
(11)Flip Rotation: Bounce rotation
Mainly for the set Start Rotation Value changes in the opposite direction . Suppose the rotation is 10. This value is set to 1, Will become -10. Set to 0.5 Will become a from -10~10 The random .
(12)Start Color: The initial color of the particles
There are often these changes in color :
Color( Color ): Set a color .
Gradient( The gradient ): You can set a gradient . From left to right is Duration Time .
Random Between Two Colors( Change randomly in two colors ): Random color .
Random Between Two Gradients( Change randomly in two gradients ): Random gradient .
Random Color( Random color ): It goes with Random Between Two Colors The biggest difference is that you can control the number of random colors .
(13)Gravity Modifier: Gravity corrector
The particle exerts a downward force . Negative values are upward . Note that this value is an external force , It does not change with the scaling of the particle system .
(14)Simulation Space: Simulation space
Is the space coordinates used . The space coordinates used by the motion of particles .
Local( Oneself ): Coordinates of the game object using its own particle system .
World( The world ): Use world coordinates , Is the scene coordinates .
Custom( To develop ): Use the coordinates of another object . When the coordinates of this object change , Particles will also change , For example, the displacement of an object will drive the displacement of particles .
(15)Simulation Speed: Simulation speed
Change the speed of particle movement as a whole , Notice that it's not just the velocity of the particles , It is the change of the overall attributes of particles in space , Slow down or speed up as a whole .
(16)DeltaTime: Variable time
Delta Time It's a function . The exact meaning is the time of the last frame . Because the device refresh rate is different , So the time consumed by a frame is also different . This Scaled Is to adjust the use of time changes rather than frame changes . Every frame goes 1 Meters and every 0.1 Walking one meter per second is different . The default is Scaled( zoomed ) That's right. .
(17)Scaling Mode: Zoom mode
When scaling the particle system .
Hierarchy( Stratum ): The default value is .
Local( Oneself ): The effect is and Hierarchy equally , If the particle system scales , The moving distance and size of particles are scaled at the same time .Gravity Modifier The force of will not be scaled .
Shape( shape ): Only the size of the emitter will be scaled .
(18)Play On Awake: Wake up and play
When checked out , The particle system will not play when it appears at runtime , It won't play until you tick this tick in the program , Convenient for program control .
(19)Emitter Velocity: Launch rate
It's about the way particles move .
(20)Max Particles: The maximum number of particles
To save money, set an upper limit on the number of particles .
(21)Auto Random Seed: Automatic random seed
The state of particles is represented by seed Seeds determine , same seed The result is the same . and seed The number is huge , If random seeds are used , May never encounter the same value 、 The particle state is the same .
(22)Stop Action: Stop acting
The processing method of the program after the particle system emits all particles , It is related to consumption .
None: No treatment , Passive memory release .
Disable: Ban , Is abandoned , It won't happen again , But it's still in memory .
Destroy: Destroyed , Memory will be released directly .
Callback: Add a script or listen to the following functions in the original script :
public void OnParticleSystemStopped()
You can monitor the complete stop of the particle system .
(23)Culling Mode: Eliminate patterns
When the particle system is removed from the screen , Corresponding processing method .
Automatic: If the particle system is circular emission , The launch will be suspended , The launch will not be suspended in the case of acyclic .
Pause and Catch-up: Pause particle playback , When moving into the screen again , Will do extra calculations , Make the particle system look as if it has not been paused , It is the setting of performance consumption , Use according to the actual situation .
Pause: Pause particle emission .
Always Simulate: Will not pause particle emission .
(24)Ring Buffer Mode: Ring buffer mode
Control how particles disappear , This mode is suitable for continuous effects such as footprints or bullet holes .
Disabled: Particles are destroyed after their own life cycle .
Pause Until Replaced: Particles are not destroyed after their life cycle , Keep the final shape until the number of particles in the system exceeds the maximum limit and is immediately replaced by new particles .
Loop Until Replaced: This model is very similar to the other , It will not be destroyed after its own life cycle , Selecting this setting will add a Loop Range The option to :
Can be set from 0 ~ 1 Value , This value represents the proportion of particle life cycle , For example, the setting is 0 ~ 0.5, If the life cycle of a particle is 2s, So after 2s after , The particles will repeat 0s ~ 1(2 * 0.5)s The effect of particles during this period , Until it exceeds the maximum number of particles in the system and is replaced by new particles .
2、 The emitter Emission modular
The rate at which particles are emitted , And instantly emit a large number of particles ( Explosive effect ), It can be set in this module .
(1)Rate over Time: The transmission frequency is determined by time
1 Number of launches per second . The curve timeline is Duration Time .
(2)Rate over Distance: The transmission frequency is based on distance
1 The number of meters fired . The curve timeline is Duration Time .
(3)Bursts: Burst out
From what point (Time) Seconds to start . How many (Count). How many times is this launch cycle (Cycles). How long is the interval between each cycle (Interval).
Time: Time of particle explosion , Cannot exceed the particle system Duration, Even if you fill in an illegal number , Will also be forced to modify .
Count: If you select a curve , The horizontal axis of the curve is the time axis , It represents the life cycle of particle system . Yes 4 Two configurations can be selected .
Cycles: The number of cycles starting from the burst time .
Interval: The interval between two cycles , Beyond the particle system Duration meaningless .
Probability: The possibility of each outbreak .
3、 Emitter shape Shape modular
Random position generation inside the emitter shape , And can provide initial force , The direction of the force will be emitted along the surface normal or random direction .
(1)Sphere: sphere
Radius: Radius of sphere .
Radius Thickness : The volume ratio of emitted particles . The value is 0 Indicates that particles are emitted from the outer surface of the shape , The value is 1 It means that particles are emitted from the whole volume .
Arc: arc , For spheres 、 hemisphere 、 Vertebrae 、 Doughnut 、 Round edge .
(1)Mode: Mode controls the mode in which particles are generated around an arc
(Random Random ,Loop loop ,Ping-Pong Table tennis ,Burst Spread Sudden expansion ).
(2)Spread: spread , Particles are produced only at a specific angle of the arc .
(0 To disable , stay Arc Under the set value , Show a specific angle to emit particles , It doesn't look so random ).
Texture: Particles are used to get color and texture from the top .
Position: Change the position of particle emission .
Rotation: Change the rotation of particle emission .
Scale: Change the shape scaling of particle emission .
Align To Direction: Orient the particles according to their initial travel direction .( It seems that the advertising board mode has failed , The orientation of the picture has been changed to the direction of the initial speed )
Randomize Direction: Mix the particle direction in a random direction , Set to 0 Will not work , Set to 1 The direction of particles is completely random .
Spherize Direction: Mix the particles towards the sphere , Travel outward from their transformation centers . Set to 0 when , This setting does not work . Set to 1 when , The particle direction is outward from the center ( And Shape Set to Sphere The same behavior when ).
Randomize Position: Move particles by a random amount , Until the specified value is reached . This property is set to 0 when , This setting does not work . Any other value will apply some randomness to the position where the particles are generated .
(2)Hemisphere: hemisphere
(3)Cone: Vertebrae
(4)Donut: Doughnut
(5)Box: The box
(6)Mesh,Mesh Renderer,Skinned Mesh Renderer: Mesh and mesh rendering
Type: Specify where to emit particles .(Vertex Emit particles from vertices ,Edge Launch from the side ,Triangle Launch from triangle )
Mode: How to select the position on the mesh for each new particle .(Random Particles in random positions ,Loop Emit each new particle from the next vertex in the mesh ,Ping-Pong similar Loop, But it alternates along the mesh vertices after each cycle )
Mesh: Provide a grid of emitter shapes .
Single Material: Specifies whether to from a specific sub grid ( Identified by material index ) Emission particle .( Enable this property , A numeric field will be displayed , You can use this field to specify the material index number )
Use Mesh Colors: Use mesh vertex color to adjust particle color , perhaps , If the vertex color does not exist , Then use the shader color attribute in the material color perhaps tincolor.
Normal Offset: How far from the mesh surface to emit particles ( In the direction of the surface normal )
(7)……
4、Texture Sheet Animation modular
The shape of particles need not be a still image . This module allows you to play textures as animation frames .
(1)Mode
There were Grid Patterns and Sprites Pattern .
(2)Tiles
The number of blocks divided by the texture in the horizontal and vertical directions .
If the texture is 3 That's ok 4 Column , be X、Y Fill in... Separately 3,4.
(3)Animation
Animation mode . Can be set to Whole Sheet or Single Row
( That is, each line of the elf atlas represents one Separate animation sequences )
(4)Time Mode
Choose how the particle system samples frames in the animation .
(5)Frame over Time
Specify how animation frames increase over time through a curve .
(6)Start Frame
Allows you to specify at which frame particle animation should start .
(7)Cycles
The number of times the animation sequence repeats in the particle life cycle .
(8)Affected UV Channels
Allows you to specify the influence of the particle system UV flow .
5、Lights modular
Use this module to add real-time illumination to some particles .
(1)Light
Assign a light , Explain what the light of particles should look like .
(2)Ratio
A between 0 and 1 Between the value of the , Represents the proportion of particles that will receive light .
(3)Random Distribution
Choose whether to assign light randomly or regularly . Set to true when , Every particle has a basis ratio The chance to receive light at random . Higher values increase the probability of particles receiving light . by false when , from ratio Controls how often newly created particles receive light .
(4)Use Particle Color
Set to true When , The final color of the light will be modulated by the color of the particles it is attached to . by false No changes will be made .
(5)Size Affects Range
Enable the Ratio( Range ) Will be affected by particle size .
(6)Alpha Affects Intensity
When this attribute is enabled, it is displayed in the Intensity( Strength ) Will receive particles Alpha influence .
(7)Range Multiplier
Use this curve to apply a custom multiplier to the light range over the particle's life cycle .
(8)Intensity Multiply
Use this attribute to apply a custom multiplier to light intensity during the life cycle of particles .
(9)Maximum Lights
Use this setting to avoid accidentally creating large amounts of lighting , A lot of light may make the editor unresponsive , And affect program performance .
6、Renderer modular
(1)Render Mode
Billboard: The particles are always facing the camera .
Stretched Billboard: The particles face the camera , However, various scales are applied .
(Camera Scale: Root camera motion stretches particles . by 0 Disable camera motion stretching )
(Velocity Scale: Stretch the particles according to the proportion of particle velocity . by 0 Ban )
(Length Scale: Stretch the particles in proportion to their current size along the direction of particle velocity . by 0 Will make the particles disappear )
Horizontal Billboard: Particle plane and XZ“ The floor ” The plane is parallel .
Vertical Billboard: Particles in the world y Upright on shaft , But face the camera .
Mesh: from 3D Render particles from meshes instead of textures .( Particles will become solid )
None: Use Trails When the module , If you just want to render tracks and hide the default rendering , You can use this property .( Is not enabled Trails When the module , The particles will disappear )
(2)Normal Direction
Deviation of the illumination normal for the particle shape . The value is 1 Indicates that the normal points to the camera , And the value is 0 Indicates that the normal points to the center of the screen .( Only applicable to Billboard Pattern )
(3)Material
Render particle material
(4)Sort Mode
The order in which particles are drawn .
(5)Sorting Fudge
Deviation of particle system ranking . Lower values will increase the particle system in other transparent objects ( Including other particle systems ) The probability of drawing on . It has an impact on the whole system , It has no effect on the sorting of individual particles .
(6)Min Particle Size
Minimum particle size ( Only when the Billboard Pattern )
(7)Max Particle Size
Maximum particle size ( Only when the Billboard Pattern )
(8)Render Alignment
Use the drop-down radio box to select the direction the particle bulletin board faces .
(View: The particles face the camera plane )
(World: The particles align with the world axis )
(Local: The particles align with the transform components of the GameObject )
(Facing: The particle faces the direct position of the camera game object )
(9)Flip
Mirror a certain proportion of particles on the specified axis . Higher values flip more particles .
(10)Allow Roll
Controls whether particles facing the camera can surround the camera z Shaft rotation , Disable this attribute pair VR Applications are particularly useful .
(11)Pivot
Modify the central pivot point of particles . This value is a multiplier of particle size .
(12)Visualize Pivot
stay Scene Preview the pivot point of particles in the view .
(13)Masking
Set the behavior of particles rendered by the particle system when interacting with the sprite mask .
(No Masking: Do not interact with any wizard mask in the manufacturer )
(Visible Indide Mask: It is visible in the place covered by the Spirit Mask , And not visible outside the mask )
(Visble Outside Mask: Visible outside the sprite mask , And not visible inside the mask , The sprite mask hides the part of the particles it covers )
(14)Apply Active Color Space
When rendering in linear color space , The system will upload the particle color to GPU Previously converted particle colors from gamma space .
(15)Custom Vertex Streams
Configure the particle attributes available in the material's vertex shader .
(16)Cast Shadows
Enable this property , Particles produce shadows under light .(Two Sided Allows shadows to be cast from either side of the mesh ,Shadows Only Make shadows visible , The grid is not visible )
(17)Receive Shadows
Determines whether shadows can be cast on particles . Only opaque materials can accept shadows .
(18)Shadow Bias
Move shadows in the direction of light to eliminate shadow artifacts caused by using billboards to simulate volumes .
(19)Motion Vectors
Motion vector
(20)Sorting Layer ID
Render level
(21)Order in Layer
The order in which this renderer sorts layers .
(22)Light Probes
Probe based illumination interpolation mode .
(23)Reflection Probes
If this property is enabled , And there are reflection probes in the scene , A reflection texture is picked up for this GameObject , And set this texture as a built-in shader uniform Variable .
7、 Other modules will not be introduced for the time being
Two 、 Case making of flame particle system
1、 Flame material
This case takes the following flame material as an example .
2、 Create a particle system
Hierarchy The palette , Under the object that needs to create a particle system , Right mouse click , choice Effects | Particle System. Rename it to HuoYan.
3、 Create a shader
stay Project Create a new material in the panel New Material, Rename it to HuoYan, Be sure to Shader It is amended as follows Additive(Mobile/Particles/Additive), This mode is mainly to remove the black part of the translucent map .
4、 Mapping
(1) Drag the flame material picture into Textures In the folder .
(2) Assign maps to materials , Then drag the material to Hierarchy Particle system in panel .
5、 Attribute changes
(1) Be sure to check the upper texture layer animation module Texture Sheet Animation, And set the row and column of its map Tiles, In this example, it is changed to 2,2, As shown in the figure below .
(2) Usually, the particle system Renderer The largest particle size in Max Particle Size From the initial 0.5 It is amended as follows 1( That is, the window size , Its effective value is 0-1).
(3) At this time, the particles are all in one direction , Very regular , There is no flame , At this time, we need to adjust its initial rotation angle Start Rotation, choice “ Inverted triangle ” Under the Random Between Two Constants(-360,360).
(4) Change the emitter Emission Values in the module , Make the flame more realistic .
(5) You can also modify its shape .
(6) Make an adjustment to the flame color , be used Color over Lifetime. In the arrow below , The above represents transparency , The following represents the color .
(7) You can also modify its initial lifecycle Start Lifetime, Initial speed Start Speed, Initial size Start Size Equal attribute .
6、 Achieve the effect diagram
边栏推荐
- VSCode基础配置
- Conditional probability
- @Autowired 和 @Resource 的区别
- (1) Introduction Guide to R language - the first step of data analysis
- Servlet
- (五)R语言入门生物信息学——ORF和序列分析
- Whistle+switchyomega configure web proxy
- [esp32 learning-2] esp32 address mapping
- 2021.11.10汇编考试
- JS Title: input array, exchange the largest with the first element, exchange the smallest with the last element, and output array.
猜你喜欢
Basic operations of databases and tables ----- creating data tables
ORA-02030: can only select from fixed tables/views
Types de variables JS et transformations de type communes
SVN更新后不出现红色感叹号
2021.11.10汇编考试
idea中好用的快捷键
[Nodejs] 20. Koa2 onion ring model ----- code demonstration
Derivation of logistic regression theory
ES6 grammar summary -- Part 2 (advanced part es6~es11)
dosbox第一次使用
随机推荐
单片机蓝牙无线烧录
[Red Treasure Book Notes simplified version] Chapter 12 BOM
1041 be unique (20 points (s)) (hash: find the first number that occurs once)
Get the position of the nth occurrence of the string
MySQL time, time zone, auto fill 0
燕山大学校园网自动登录问题解决方案
Arduino get random number
[Leetcode15]三数之和
Basic operations of databases and tables ----- view data tables
2022.2.12 resumption
Symbolic representation of functions in deep learning papers
Solution to the problem of automatic login in Yanshan University Campus Network
Unity3d makes the registration login interface and realizes the scene jump
2021.11.10 compilation examination
Conditional probability
idea中好用的快捷键
基于Redis的分布式ID生成器
(the first set of course design) sub task 1-5 317 (100 points) (dijkstra: heavy edge self loop)
VIM command line notes
SVN更新后不出现红色感叹号