Sunday, December 12, 2010

Rendering grass and heightmap with GPU

Here i render grass and the video card seems to be happy ;-) , i'm using only vertex texture fetch and stream instancing , wich is DX9 level hardware.
This version is far from being optimized ( the particle system still update its physics ...) but the results are here
in an Xbox360 HD Res ( 720p AA 2x ) 140 Hz without optimization and crappy shaders , GPU is Radeon HD5770 , number of grass blades is 200k. It uses opaque rendering in order to avoid the sorting.
Billboards are generated on the fly with stream instancing, nothing revolutionnary but nature scene with lot of grass are eye candy.
The directionnal diffuse lighting is evaluated but the blades fine lighting is in the texture (wich is crappy because global illumination cannot be resolved for dynamic light source ) , one should add dynamic lighting with only gray shaded texture generation , and then evaluate scattering of light interreflection from other grass blades... i've some ideas for this.