I use projected textures for my terrain (as seen here), and a talk during Pax Dev made me realize that it should be fairly straightforward to use it for other objects such as rocks.
This would accomplish a few things:
- It would obviously avoid me having to create/purchase UV-mapped objects for terrain features such as rocks. A potential big time-saver if I want a lot of natural object variety in my game.
- It would allow me to “extend” the look of the terrain onto objects. Say for instance I want some hoodoos in a part of my world. I could just plop down that geometry, and it would end up looking just like the local terrain. My terrain engine has some limitations when it comes to overhangs and sharp angles, so this would help overcome these.
Of course, objects don’t need to blend into the terrain; so there should be a version of the shader that doesn’t use terrain tile indices and such, but simply the xyz texture projection.
The downside is that this is a fairly expensive shader, with a minimum of 6 (for projection only) to 14 (for terrain) texture fetches. Some of these can be optimized out via dynamic branching. And – assuming no overdraw – this would be balanced by less terrain being drawn anyway.
I could even programmatically generate geological terrain features, and essentially have the UV mapping done for free.