Friday 19 October 2012

Technical Development: Heat Vent, Flares, Conveyor Belt, Dust


 This video shows the progress made on the additional effect systems so far.  Each system is explained bellow:




Heat Vent (Distortion)

For the effect of Heat Distortion from vents, I am currently using a simple "fade in then out" point sprite system which uses a simple cloud texture as a mask for sampling from bump map.

For this process I am rendering a second scene which contains data used for 2d effects processing.  I am planning to create a simple depth map for anti-alias blurring as well as implementing some kind of depth of field technique.  The heat system uses up 2 channels of the effects render layer, one for each x and y distortion. 

Once the final scene is rendered, I apply the depth/distortion layer to the scene which simply offsets the source pixel by the x and y amount contained in the red and green channels of the depth map. 


This effect works pretty well up close, but the main ripples are caused by the point sprite textures rather than the inner bump map texture.  I could solve this by using larger, less noisy point sprites, or having a single sprite in which the bump map will flow through more visibly...   I want there to be small ripples up close, and less noticeable effect from farther away.



Flare System (Fire)

This effect is achieved by a simple point sprite system and post process blooming with the in place Light System.  The point sprites fade in and grow in size, until they reach the set maximum threshold where they can spawn a new sprite randomly..  Once sprites are past this maximum, they fade out and decrease in size more quickly.  Like all these systems this is a very quick and rough approximation, but it gives a pretty decent looking effect. 

The flare is bloomed simply through the light layer, which renders all pixels with alpha values (writen by model shaders) and also if a pixel is above a certain value.  (Standard Blooming)  These pixels are over saturated, and pass through a Seperable Gaussian blur filter and then combined with the final scene.  This gives a nice effect making the flare appear it is emitting light.

Combining this system with the heat particle stream produces a pretty amazing and realistic effect.  In the sample video the emitters are still separate, to show the difference.  The point sprite implementation of the heat effect is the best for this, as it is more easily controlled.  There is still a problem with distance, but now farther away the effect looks better, and less noticeable close up.  This problem will likely be solved by scaling the effect by the distances read from the depth layer.



Conveyor System

I am basing this system off of my first implementation of the falling dirt system.  This system is fairly straightforward, but is tedious to work with and variable heavy at the moment.

I use a texture strip that is composed of 3 rectangles.  The start of the stream section A, (texture fade from alpha to dirt) can not wrap and mirror upon itself, so once the strip has reached its maximum length, the middle, section B starts to grow.  Once there is no more input flowing into the system, section B ends, and the final segment, section C, begins to flow.  This section is the length of the section A, so if there is only a small amount, the resulting strip is symmetric and contains matching lines.

This system could probably be optimized, and as of now only one section of dirt can move along the belt at one time (though two separate stream objects could be used.)

I plan to add depth to the stream, most easily by sampling off of a bump map as well as having a set of raised vertices in the middle of the strip.  For open dump conveyor belts I will add falling dirt at the end, and try to connect the two systems smoothly.



Dust System

The dust system is very simple, basically a recreation of the exhaust system, with less particles that are based off of the movement of an object.  One pretty major problem with this system is the obvious straight lines created by rendering points sprites from the Z buffer.  If I sort every particle with each object I could simply not read from the Z-buffer, but since that is a large operation I will try to solve this issue with anti-alias blending, most likely read from the Depth/Distortion layer.  In this layer solid object and the ground (which are the problems) do will not render to the alpha channel, which will be open for conflicting point sprite systems to independently use this channel.  Hopefully there will be a way to distinguish these hard lines, and blur them out smoothly.


Rail System

The train is currently running off of a simple implementation of the track system, which is created by successive segments of circles.  This system is great on a 2D plane, but becomes very complicated with the addition of variable height.  I will be converting this system so nodes are generated from mathematical curves, but the movement of objects will be an interpolation between nodes and associated directional and position vectors.   I will write a seperate post, and likely a tutorial on this system once this 3D implementation is worked out.  This is also be the basis for the roads, pipelines, and powerlines... trains are just more fun to start out with!