P-152: Virtual World Concept Update 72: Triplanar Projection + Texture Splatting
While researching texturing techniques to use with Spherical Terrain, I came across a technique called TriPlanar Texturing,or Triplanar Projection.
This looks like it will work perfectly with the project I am developing. THIS is an excellent introduction to the technique.
Triplanar texturing basically renders the texture three times, once from the direction of each axis (X,Y,and Z). This produces a final texture with minimal distortion. Triplanar texturing is a procedural technique, making it suitable for my purposes. It does not require a UV map, the only data is needs is the list of World-Space coordinates.
This means that a lot of very powerful things can be done with this technique that would be impossible with a conventional texture (which would require the manual generation of a texture map). In addition to being generated dynamically, Triplanar projection should be able to perform per-vertex texturing operations The most basic example of this would be selecting a texture based on the height of a given vertex. Higher vertices would be rendered with a snow or rock texture, while lower ones would be grass or sand.
However, real-time per-vertex texturing could also be used to create charring on the ground underneath a forest fire. As the fire spreads, the textures changes from soil or grass to burnt, charred, earth. I could also simulate the gradual build up of snow during a snow storm, from small patches of snow to a completely snow covered area of terrain. My project will be a completely realistic simulated world, and so plants will scatter their seeds to the wind, resulting in new plants growing where those seeds land. This could cause areas of empty soil to slowly become green, as grasses and weeds grow and die off.
This technique, (and all procedural texturing techniques) have tremendous power, and, since it uses a shader, you also get all of the other benefits of shaders as well, such as reflection, refraction, etc etc. Shaders are discussed in much more detail on other websites. I had planned to integrate my terrain system with T3D’s existing material system, which heavily uses shaders. I should be able to use this system to implement triplanar texturing.
The way I would use it in a procedural universe environment would be to give each plant type a texture library. There would be a library for Ice Planets, Desert Planets, Temperate planets, etc, which would contain all of the textures that that planet is allowed to render (An Ice planet, for example, would not be able to use grass textures). This texture library would consist of images generated manually. Once this texture library has been loaded, some of those textures will be chosen to be drawn at different points on the planet.
All of these textures will have a “render priority”, so, for example, rock will always render before soil, and soil will always render before snow. This means that when these textures are combined, you end up with a realistic looking texture. I am currently looking into a technique called “Texture Splatting” to combine the multiple textures together. I can also use alpha transparency to make certain textures more or less visible than others. This would contribute to the overall effect that I wanted to create at that particular location.
Triplanar texturing is quite slow, however, since the texture has to be rendered three time. This may end up being a problem, but it is definitely worth trying.





























































