• Non ci sono risultati.

Particle systems

N/A
N/A
Protected

Academic year: 2021

Condividi "Particle systems"

Copied!
7
0
0

Testo completo

(1)

Game Dev 2017/2018 Univ Insubira

Particle systems

Marco Tarini

Particle systems:

a type of 3D Models

Digital representations of 3D objects...

Not easily described by their surfaces

And/or: very dynamic (variable topology)

…such as:

clouds, dust clouds

flames, explosions

water sparys, waterfall, spouts

rain, falling snow

wind (transporting dust)

steam whiffle, walking dust-puffs

custom visual effects (e.g. for spells, etc)

swarms of flies

sparks, fireworks

smoke etc…

(aka particle effects)

(2)

Particle systems:

just a bunch of particles

one particle represents

a water drop, a flame spark, a rain drop, a smoke puff…

state

of a particle

includes: pos, (maybe) orientation, vel,

remaining lifespan

and/or custom variables: size, color , whatever…

Dynamically emitted

From an «emitter»

evolved (state changes)

Then disposed

According to some predefined criteria

Emitters & Particles

Emitter (plane)

Emitters (spheres) Particles

(3)

Emitter:

the producer of particles

it lives in a scene graph node

i.e.: it is positioned in the scene with a model transformation

i.e.: it has its own object space

to position/rotate the emitter isto position/rotate the particle system

emits particlesaccording an designated criterion…

in pseudo-random way

with chosen probability distribution

position generated in its space object

at a designated rate (how many/sec)

given particle with an initial state (e.g. initial velocity)

also randomized

…for an established interval of time

e.g.: short (e.g. an explosion)

or medium (e.g. an blood gush from a wound)

or long (e.g. a column of smoke)

or undefined (e.g. water from tap, flame from torch…)

The blaze, explosion, water spray…

Emitter’s shape

Geometrical abstraction useful to guide particles creation

Shaped like a: sphere, cone, box, plan, point…

Particle created in a pseudo-random position inside this volume

Particle state:

initialized with data expressed in world space or in object space (of the emitter)

e.g.: smoke: vel predominantly in Y dir of world space

e.g.: rocket engine blaze: in Z dir of emitter space

(4)

Evolution of the particles

Physic Engine task (and extremely parallelizable)

not necessarily physics mass particles

may be ad-hoc (e.g. smoke: «move up and expand»)

may be simplified - huge number of particles! (10^1 – 10^5)

Particles progress computation:

Can be numeric: state( t+dt )  F( state(t) , dt )

or analytic: state( t )  F( t )

Computed in: emitter space, or world space

Particles can interact with (or not)

other particles (e.g. cohesion):

v. expensive (therefore rare)

environment (collisions): (expensive)

If static: or only static parts of the scene, or also dynamic

If dynamic: “one way” (usually), or “two ways” (rare)

Simplified example in C++

class Particle{

vec3 pos;

vec3 vel;

float life; // how much longer to live ...

}

class ParticleSystem{

std::vector< Particle > particles;

void evolve( float dt );

void render();

void init( vec3 p );

}

(5)

Rendering

of the particles system

Way 1: each particle rendered separately, through:

A rendering primitive

A point (splatting) , a segment…

A small 3D model

few (or one!) polygons, maybe textured

An impostor , i.e.

A small quad

Oriented towards the observer (usually)

with a texture (often, animated: frames) e.g. alpha maps + RGB maps

Most common

case

Textured impostors

for particle rendering

(6)

Textured impostors for particle rendering

Rendering

of the particles system

Way 2: screen-space particle merging

pass 1:

splat a temporary “blob” foreach particle (paint in the depth buffer)

pass 2:

estimation in normal screen space of “blobs” union

pass 3:

rendering of the resulting surface

«Luxury» alternative for fluids.

(7)

Authoring

a particle system

Task of the

Effects specialist

Designing the behavior

Specify how particles are created/ evolved

through:

programming scripts for the task (e.g. shaders), or

specifying predefined set of parameters (determined by the engine)

Designing the look

texturesfor impostors, or tiny 3D models, or splat parameters, etc.

No standard format for particle systems 

each Game Engine uses its own system/format

Particle systems:

cosmetics or gameplay?

Usually, only graphic coating

Physical collisions: absent or one-way

no effect on collision

no effect on gameplay

A few remarkable exceptions

Riferimenti

Documenti correlati

LEGENDA I principali Centri storici del tufo Il patrimonio storico-culturale Centri minerari dell’Amiata I centri storici di crinale Rete dei siti e luoghi minerari Inserimento

We implement a geoadditive mixed model for extremes with a temporal random effect, where we assume that the observations follow generalized extreme value (GEV) distributions

proiettando nei futuri trenta anni i dati (misero in relazione variabili come il volume consegnato, il prezzo del lavoro, l’elettricità, le materie prime, i servizi ed il capitale,

From this disccussion it is evident that the emergence of quantum pumping due to periodic perturbations, (at least in the weak pumping regime) has many beneficial effects

Lo Juventus Stadium (oggi Allianz Stadium) è stato fin da subito pensato come uno stadio per il calcio, cioè un impianto dedicato a chi questo sport lo vive nei suoi

Così i docenti di Giurisprudenza, che garantivano una solida preparazione scientifica alle nuove generazioni di studenti, hanno coscienziosamente proseguito la loro opera nel

Non vi è alcun dubbio sul fatto che il controllo continuo del ritmo cardiaco, dell’ossimetria transcutanea, della PetCO2, della pressione arteriosa, invasiva

(C and D) qRT-PCR analysis of CaMKIα, CaMKIIα, CaMKIV and REST mRNA levels (C) and western blotting analysis of CaMKIV and REST protein levels (D) of primary cortical