Tuesday 28 February 2012

Initial Oil Pollution

The first form of water pollution I am working on oil spills on large bodies of water.  I am using a texture that ranges from full alpha, then has an oil color spectrum transitioning into a solid oil fill.  The water grid has variable for oil weight, and when this value is past a certain threshold, it spreads to its neighbors.  This creates slight variation in the size of the transition spectrum, but does not stretch too much and stays at a good level.

Oil Texture

Right now I am using a simple water system that has simple, but efficient updating and movement.  The water grid has the potential to be interactive, and can be implemented so it can be updated with the GPU rather than using CPU cycles, which will be much more efficient and allow for a much more detailed water grid.




This video shows a simple oil spill spreading across the water grid.  The oil is spreading based on the UpSpeed of the waves to make it more varied and not completely linear.  The wind direction forces movement more in the specified direction, but still allows the spread in the other directions as well depending on the magnitude. 

Friday 3 February 2012

Smoke and Steam Systems Polishing

 

I have added a few changes to the exhaust system to make it look more realistic.  I basically using two elements for each particle spawn, one that is larger with more transparency in the center that lasts longer... This gives a nice "wispy" effect as the smoke disappears.  The other particle is smaller but solid in the middle, to fill the centers of the larger particles.  The filler particles only last about half as long. 





I have done a lot more work with the Steam System, slowing the movement/spawn rate down, adding more variation and implementing a simple "fade in, fade out" life span for each particle.  At the peak of its existence, there is a chance that it will spawn a new particle that has a greater directional velocity, giving a nice "billowing" effect.  The particles are also chained to the element before them, so they do not bunch up too close and do not get too far away.

I still have more adjustments to make with this system, and I am still having trouble with alpha blending... I must either sort every particle relative to the position of the camera, or I must figure out a way to Alpha Blend particles correctly in XNA 4.0  (Apparently this is a fairly common problem, with no real clear cut solutions)