====== Grass ====== Grass, one of the key elements of making a computerworld look lush. ===== Rendering Countless Blades of Grass ===== The basic idea came from Nvidia [[http://http.developer.nvidia.com/GPUGems/gpugems_ch07.html]] From This moment we had thousands blades of grass rendered in one piece. The simulation of the waving is being done in the shader. ===== Rendering Different Types of Grass ===== The next idea was it's dull to have just one type of grass so, the we putt several types of grass on one texture. To make it more usual we created a little tool, here you could drag around textures put them in structured or filling manor. The tool would then export the texture and along with it an XML file where all the UV-coords are stored. ===== Make The Grass look less dull ===== The next idea was another one from Nvidia[[http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter01.html]] the idea is that grass is never the same color. The thing that keeps is interested in natural environemts is the diversity and non-repetion of it. There for we wanted the grass not to have the same color but all different. We did by using a noise randomisation between 2 colors green and brown \\ {{:documentation:vegetation:grassnocolornoise.jpg|}} \\ without NoiseColoring \\ {{:documentation:vegetation:grasscolornoise.jpg|}} \\ with NoiseColoring ===== Future Ideas ===== *Using a textureMap to make grass fall down when you walk on it or when something is rolled over it. *Using a textureMap make the color change, this way you could fire a fireball that burn the grass it fly's over and destroys the grass where it lands ===== TODO? ===== * TextureAtlas * To solve this we give an extra uv coord through with the VertexData * TextureAtlasCreationTool * Manual drag and drop * Scale function * Later algorithm that automatically puts textures in an optimal arrangement * Output XML file with all the uvCoords for each texture on the map * Use random color diversions to get rid of repetition(nvidia site)