T&C LAB-AI
Robotics
Computer Graphics and Programming
Lecture 13
Particle Effect
Jeong-Yean Yang
2020/12/8
1
T&C LAB-AI
Robotics
Our World can NOT be Perfectly Modeled
• We start to understand our world by Ray tracing
– One pixel color is the combination of many lights interaction
– Simple Modeling implies Simple Result (Not Realistic)
• World is filled with Stochastic Processes
– From the viewpoint of Ray Tracing, We omitted dusts in air.
– Dust is modeled by Probabilistic Distribution as in
Probabilistic Robotics ^^
• From the Multiple Objects Interaction,
– The Concept of “Particle Effect” arises.
2
T&C LAB-AI
Robotics
Our World works under Quantum Computing
• The basic of Material meets Quantum
– Higgs-Boson is an elementary particle.
– Quantum excitation of Higgs field, and so on.
• Small sized Object interacts with others
– Cells Vs. Human
• Fluid dynamics and Heat transfer is modeled by
mathematics.
– But, boundary condition is simplified in many cases.
– Explicit model Vs. Implicit model
3
T&C LAB-AI
Robotics
Particle Effect
• Fire or Fluid movement is defined as
– the integration of many Particles or elements.
• Multiple Object with Random Movements looks
Realistic.
• Each particle has some attributes
– Life cycle, Color variance, Size, moving direction
• Each particle works during its Life then it dies
( After the death, a particle starts a new Life)
4
T&C LAB-AI
Robotics
Example of
“Fire” with uParticle
• uParticle is composed of 300 objects
•
5
• uParticle is inherited by uObj
• Random with mean and
variance
• mXXX mean of XXX
• vXXX variance of XXX
2
2
~
( ,
)
:
: variance
X
N
mean
T&C LAB-AI
Robotics
Particle is RECREATED after Death
uParticle::Set()
6
Function Random returns -1.0~ 1.0
Position is varying
-vpos + mpos< Position< vpos+mpos
T&C LAB-AI
Robotics
Template for Particle Effect
:uGL-42-ParticleEffect
• GLSL is simple.
– Shader.fsh and shader.vsh for only 2D texture mapping
• Gaussian distribution like texture named “gauss.png”
is used for Every Particle
7
Gauss.png
300 particles
are overlapped
Particle effect
T&C LAB-AI
Robotics
Key Point of Particle Effect is
Overlapped Images
• OpenGL has Blending function for Mixing Images
8
Enable
Blending
Disable
Blending
T&C LAB-AI
Robotics
Particle Works by Timer function
9
Particle’s life is reduced in every turn
Particle moves toward some direction
Particle’s size is varied
T&C LAB-AI
Robotics
Ex1 ) Fire with Fixed Scale Particle
• Color =[ R,G,B,A], Alpha, A is used for Blending.
10
10
20
Particle’s
position will be
limited with
width=5 and
height =10
Mean color is red
Red Color variance
is higher.
T&C LAB-AI
Robotics
Fire without Scaling Vs with Scaling
11
Create particle with a variety of scale factor
Scale is controlled
by life proceeding
Scale is fixed
after creation
T&C LAB-AI
Robotics
Ex 2) Initial Position and Direction Changes
12
Upward direction
Higher Position variance
+
Positive Y Direction
Positive and negative y
direction variance
T&C LAB-AI
Robotics
Thank you for Listening Graphics Class
Welcome to Homework Hell
13