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!

Friday, 21 September 2012

Development Cycle II

This semester I will be working on another Directed Studies Project, focusing on refining the existing systems, developing a few new ones, but most importantly focusing on the Organic Motion Camera.

My plan is to create a functional industrial environment utilizing many different systems, showing  to allow users the ability to fully explore the virtual world through the Organic Motion Camera.  I will conduct a user based evaluation of the effectiveness of the camera system, as well as the visual systems.  I will create two sample animations, one using a standard linear camera, and the other using the Organic Motion Camera.  The comparison of these two animations will be another standard of the technical evaluation. 

Using development techniques and the evaluation data, I will write a condensed technical paper explaining my project.  Hopefully I will be able publish this paper through a Graphics Conference, in order to gain more experience, and exposure within the academic field.  Once the paper is submitted, I will post my programs for shared use and development.... Hopefully my systems and tools will be easy enough to use for communal use in games and animations.

After this cycle, I should also be able to quickly create artistic representative industrial models and environments.  I have a lot of project in mind, including a few video games, many educational animations, as well as some visual art installations...  I am taking a break from the normal course calender to focus on personal interest and project development...  I hope to get as far as I can on these projects now for future development through my University education.

To start off, I worked on integrating the previous systems into one working environment. 

Pretty simple, nothing really new, but putting things together really helped to lay a future framework for additional systems.



This summer I was also lucky enough (...with a few detours) to gather a significant amount of documentation and reference footage.  From the industrial forest harvesting opperations in British Columbia, to the Alberta Tar Sands, Rocky Mountain Copper and Coal mines, and Gas and Oil infrastructure in the Southern United States.. I plan to develop basic systems for these processes in the future. 

Here is a short video showing real life examples of some of the additional systems I plan to develop:









Monday, 23 April 2012

First Development Closing

As I have now finished my Directed Studies class, the initial development cycle for this project is complete.   I definitely plan to continue working on this project, including further refinement of these systems, as well as developing many more.

I plan to use these tools for Animations focused on Education and Awareness, for elements in Video Game Environments, and even for Visual Art Installations.  Though this project definitely has a long way to go before any applications can really be taken seriously. 

I put together a compilation video, briefly showing each of the systems I have developed during this cycle. 








I also created a sample oil tanker spill animation, using a Kinect sensor for camera controls.  This implementation is the Organic Motion Camera, which I also plan on using extensively and refining for ease of use.


Wednesday, 4 April 2012

Advanced Land Modification and Dirt Movement

I have done significant work on refining the dirt systems.  I have worked on smoothing out the basic land alteration, making changes in texture, height and saturation smooth between vertices, and have ensured that the height of the land can not be less than the height of the bucket.



I have also changed the dirt system to implement point sprites.  These sprites are simple a set of masks that use the ground textures for color.  When a sprite is created, its life span is the current height of the bucket, as it falls closer to the ground it fades out to ensure a smooth blend into the land.  This system is heavily reliant on how much the bucket is "open".  Given as a percentage, this value is used to calculate the spawn rate, the amount of side to side variation (width of stream) and the depth of each point sprite.



If the bucket is barely open, you should see a very thin stream from the side, but a thicker stream from the front.  If the bucket us fully open, the stream from the side will appear much thicker.  This implementation is done by storing the Vector direction of the bucket and the value of the bucket when the dirt particles are spawned.  In the rendering process, the width of each sprite is determined by taking the dot product between the spawn direction vector, and the vector between the current sprite and the camera.  this is scaled by the complement of the bucket value and added to the value of the bucket multiplied by the sprite width.


As you can see I have also integrated the exhaust and light systems into this model.  The visuals are quite strong, and this is definitely the aesthetics I am looking for.  For model shading, I have implemented basic "Desaturate Highs" and "Desaturate Lows" which are basic Final Cut filters.  This coloring gives a much more dissonant feel than normal shading.

These systems could still use some refinement, but are pretty much finalized.

Land Formations and Water Pollution

A simple system I have worked on is creating an animation of undisturbed land changing into a mine site. Using a simple map editor, I can save XML files that contain vertex data for the land grid, which holds values for terrain height, texture weights, and saturation. In the editor I created an additional array to hold the "change" values for the terrain map, which is the height at the end of the animation.

At the start of the program, I simple divide the difference between the height and the change values by the running time for the animation. Once the animation has started, I subtract the divided difference value from the height, and also change the saturation and the texture by this same value.







The process is simple, but the results are pretty strong.


Another supplementary system is general water pollution.  This system only discolors water, but could be easily used to represent sedimentary contamination, acid mine drainage, and thermal pollution.  My goal is to have this system work with streams and lakes, which means the pollution needs to be able to flow in a specific direction.





So far I am using a diffuse algorithm, and only spreading the pollution weight in the specified direction, but these results are not quite what I am looking for.  I want the pollution to disipate more from the source, and flow down stream if the emitter is turned off.  I will continue to work on this process define in more detail the algorithm used.

Wednesday, 14 March 2012

Oil Pollution Refinement

Previously I was just using a simple linear texture for the oil pollution effect, which was just an appropriation of the realistic color spectrum.  Since I have talked to a Graduate Student from the UVic Graphics Department (credit will be given for the help) about the actual pyhsics of the appearance of oil slicks.  The color spectrum at the borders of large scale oil spills, or small puddles on roads are from the distortion of light traveling through the material.  Basically the change in color is a function of the viewing angle, and the thickness of the oil on the water.



I have created a simple 2d color spectrum map, that for each vertex I determine the sampling point from the viewing angle relative to the camera, and an oil weight value which spreads to neighboring pixels.  This effect is a very basic approximation of the real physics, but gives a nice effect very efficiently.




My water is rendered as a solid color, which transitions to a dulled reflection as the viewing angle decreases.  The water system has the potential for more detail, I will be adding in the reflections of the land, smoke, and models on the water as well as a simple bump map that will give the effect of smaller sub waves.  The water can also recognize nodes that are underground, which will be culled and set to inactive, which can be anchors for smooth wave transitions to the land.  (pollution and waves will then not spread through land)

The smoke in this scene is an adaptation of the steam system.

Steam System Finalization

In XNA 4.0 there is a common problem with rendering point sprites with Alpha Blending.  For the Steam System I am using Alpha Blending vs Additive Blending because it is crucial to give the clouds the needed voluminous effect.  Additive Blending looks great for the darker exhaust, but for particles that are more detailed and fade out from center, Alpha Blending is the right choice.

As each pixel is written to the Z-Buffer, even those with full alpha, normal rendering results are box artifacts around point sprites for certain camera orientations. These artifacts occur when point sprites are drawn out of order, (relative to the camera position) but even if the list is sorted, the artifacts are extremely visible when two particles have the same distance.  The solution to this problem is to disable writing to Z-Buffer, but maintaining the read function, so the point sprites do not show through other objects in the scene.

This simple solution still has problems with my steam system.  After particles spawn, they fade out linearly until their transparency value is 0.  The sprites are rendered correctly when viewed from the front of the chain, but appear hollow from behind.  This requires that the list needs to be sorted relative to the camera.  From behind the point sprites with the most opacity are drawn last, so the over all effect appears to be a smoke funnel, which is a nice effect, but is not what I am looking for.

As the collection of Point Sprites is a linked list, I can simple choose draw from start or draw from end depending on the position of the camera relative to the spawn point and the wind direction.  This looks fine except at the point where the order changes, there is a very obvious shift in the smoke column because of the details in the steam clouds, and the faded borders necessary to give the steam volume.

My solution to this transition point is to multiply the color of each smoke cloud by the dot product of the vector between the camera and the spawn point, and the wind vector.  This gives a smooth blending as you rotate around the steam column, but the steam only renders fully when viewed exactly from behind or in front.  Make the transition quadratic preserves the full volume effect longer and then quickly changes to the fade transition.

The following video shows these problems:


The transition ends up becoming very white, but I am able to specify the color of the transition to match the color of the smoke.  I am also slightly reducing the size of the point sprites at the transition, otherwise it appears that they grow in the transition.  After balancing these different functions and constant scalars, I have been able to produce steam columns that have volume, texture, and transition smoothly for all orientations.

Using multiple emitters, each emitter must be sorted by its relative position to the camera.  The number of emitters should be very small, (unless the implementation is showing an over all view of the Tar Sands or the coal plants in China)  Unfortunately there is an obvious shift at the transition point, but most of the time this is not too noticeable, and for my purposes this artifact can be tolerated, as it can be avoided.



The second part of this video is integrating the factory with a land map created with my terrain editor.  As particles spawn and dissipate, they effect the land by saturating nearby vertices.