Particle Effects

From Wolfire Games Wiki
Revision as of 20:01, 13 February 2015 by Poddus (talk | contribs) (added section on File Structure)
Jump to: navigation, search

Particle Effects

There isn't much information released about Overgrowth's particle system. Running or jumping on the ground creates small dust clouds at the characters' feet, and particle streams were added in A128 along with blood dripping. Particles are controlled through scripts, examples below:

Simple Particle Example

MakeParticle("Data/Particles/impactfast.xml",pos,vec3(0.0f));

Particle Stream Example

float blood_force = sin(time*_spurt_frequency)*0.5f+0.5f;
uint32 id = MakeParticle("Data/Particles/blooddrop.xml",bleed_pos,(head_transform*vec3(0.0f,blood_amount*blood_force,0.0f)+this_mo.velocity));
if(last_blood_particle_id != 0){
   ConnectParticles(last_blood_particle_id, id);
}
last_blood_particle_id = id;

File Structure

There appear to be two different kinds of particles. Both are defined by an .xml file, however, one version is based on a video file, while the other is based on a static texture.

OGV-Based

One Particle Effect is based on .ogv files found under Data/Textures/anims/ (though they are not referenced as .ogv but as .xml files in the Particle XML)

<?xml version="1.0" ?>
<particle>
    <textures animation_effect = "Data/Textures/anims/bigexplosion.xml"
              shader = "theorabluescreen"
              soft_shader = "theorabluescreensoft"/>
    <size val="40.0"/>
    <color red =   "1.0"
           green = "1.0"
           blue =  "1.0"
           alpha = "1.0"/>
    <behavior inertia="1.0" gravity="0.0" wind="0.0" size_decay_rate="0.0" opacity_decay_rate="0.0"/>
    <no_rotation />
</particle>

<textures/> - This tag has 3 attributes.

  • animation_effect - this is the only attribute specific to ogv-based particles and references the file path, starting from the Data folder, to a video file. NOTE: for some reason, as of a209, the files referenced are xml format, however all files under Data/Textures/anims/ are ogv format. Is the reference is a typo?
  • shader - the name (not including file extension, typically .frag) of the shader in folder Data/GLSL/
  • soft_shader - ?? usually just the name of the shader with the word "soft" appended to the end.

<size> - This tag uses the attribute "val" (floating point number) to specify the size of the particle. NOTE: Units are unknown

Texture-Based

<?xml version="1.0" ?>
<particle>
    <textures color_map = "Data/Textures/smoke.tga" 
              normal_map = "Data/Textures/smoke_normal.tga"
              shader = "litsprite"
              soft_shader = "litspritesoft"/>
    <size min = "0.4" max = "0.7"/>
    <color red =   "0.5"
           green = "0.5"
           blue =  "0.5"
           alpha_min = "0.5" alpha_max = "1.0"/>
    <behavior inertia="0.9" gravity="0.0" wind="1.0" size_decay_rate="0.0" opacity_decay_rate="0.0"/>
    <quadratic_expansion speed="4.0"/>
    <quadratic_dispersion persistence="1.0"/>
</particle>

This article is a stub. You should help Wolfire by expanding it.


Post Processing Effects

Post processing effects are image filters that are applied as a final step before each rendered frame is drawn to the screen -- much like Photoshop filters. This explanation is lifted word-for-word from David's blog post on the subject. He doesn't go into much detail about it in his blog posts, but here's links to part one and part two any way.

Shaders

Overgrowth uses GLSL shader language, and the users can create custom shaders. Some blog posts explain how some of the shaders work, such as the posts about Object Lightning, Character Rim Lighting and Trees in the Breeze. Overgrowth's character animation is also done through a shader, as David mentioned in a blog comment.

           The skeletal animation is done in the vertex shader anyway, so it's actually 
           faster and smoother-looking to just apply the bone matrices to the object-space 
           normal map than it is to recalculate transformed normals and tangents for 
           each vertex.
    

Motion Blur for Weapons

Overgrowth's weapons use motion blur based on stippling. Stippling is also used to render soft shadows, and the technique of stippling is explained in this old blog post. The motion blur for weapons works by drawing the weapon several times along it spath using different stipple patterns for each instance, as mentioned in the A135 video.

Relevant blog posts

A summary of most blog posts explaining Overgrowth's graphical features, focusing on more technical details. There are additional links below, some of which are not mentioned in the summary.

http://blog.wolfire.com/2008/12/object-lighting-part-1/ http://blog.wolfire.com/2010/02/Gamma-correct-lighting

http://blog.wolfire.com/2009/09/character-rim-lighting/ http://blog.wolfire.com/2009/10/character-normal-maps/ http://blog.wolfire.com/2009/09/soft-normal-maps-for-fur/

http://blog.wolfire.com/2009/09/trees-in-the-breeze/ http://blog.wolfire.com/2010/10/Imposters

http://blog.wolfire.com/2009/05/decals-editor-part-one/ http://blog.wolfire.com/2009/05/decals-editor-part-two/ http://blog.wolfire.com/2009/06/decals-editor-part-three/