Game Development Community

T3D 1.1 Beta 2 - Use Side Projection Broken on Diffuse Maps - NOT A BUG

by Tim Dix (Raverix) · in Torque 3D Professional · 08/29/2010 (7:20 pm) · 4 replies

Build: 1.1 Beta 2

Platform: Windows Vista/ 32 bit

Target: Editors, in-game

Issues: Using side projection doesn't work for Diffuse Maps, causing the diffuse/detail maps to get out of sync.

Steps to Repeat:
1. Launch the game
2. Press F11 to enter the mission editor
3. Press F3 to enter the Terrain Painter
4. Edit any of the materials on the terrain (Works best with terrains which have an easy to determine orientation.
5. Turn on side projection, save and apply.

img594.imageshack.us/img594/4582/sideprojection.jpgtp.cantanogames.com/counter.php?sideprojectionbug

#1
08/29/2010 (8:29 pm)
This isn't a bug... it is working as designed.

Side projection isn't applied to the diffuse maps because it is not possible without compromising performance. I'm unsure why your trying to match the base repeat exactly to the detail... thats usually what you avoid as it causes strong repetition artifacts.

The diffuse maps are combined into a single compressed DDS texture then projected top down on to the terrain. This is the normal style of UV projection you find in terrain engines across most engines.

To do a side projection of the diffuse maps we would have to render the diffuse maps like we currently do for the detail maps... this means doubling the number of textures required to render a terrain block. If your already using 6 layers (12 textures... detail+normals) of terrain... you now have 12 (32 textures... base+detail+normals)!

One technique i've seen is "UV relaxation" used in Quake Wars: Enemy Territory. I experimented with this technique to get side projection for detail layers. While its a neat trick the resolution on very steep terrain was still poor, but maybe we can apply it to the base texture in the future.


It still wouldn't match 1 to 1 but would give us a little more variation on steep surfaces.
#2
08/29/2010 (10:55 pm)
I totally get that their's a performance issue involved, but if you're going to have the feature at all, I thought it should be implemented uiformly between the different texture options. The effet which I'm trying to get, which works perfectly with the detail map, is this:

img85.imageshack.us/img85/310/sedimentlayerspaloduroc.jpg
I don't need to match the detail exactly with the diffuse, but I need them to have the same orientation.

Despite the performance issues you mentioned, I think I'd still like to get this to work. In my case, it's just one diffuse + detail + normal, so for me, the additional overhead is acceptable. I haven't looked into the code yet, but do you have any idea on how hard this would be to implement and a suggestion as to where to go?
#3
08/30/2010 (12:01 am)
This isn't the answer you're looking for, but I still thought I'd suggest some practical solutions that don't involve rewriting the terrain texture system.

If you're okay with taking a performance hit in the first place, you can use >= far clip detail texturing range to just completely override the diffuse texture at any range, at least producing a consistent textured look for your vertical terrain.

www.torquepowered.com/community/forums/viewthread/111827/1#comment-730927

That's a pretty ugly example, but with better textures and terrain geometry it could be decent, though obviously you'll have to balance between repetition and lack of detail at close range since you're no longer getting working with both base and detail textures.

If your terrain really needs to be extra-detailed, as in if you need it to have distinct features like those layers of lighter material and still need to have an additional layer of texture detail for being seen very close-up, I'd say your best bet is to build this thing in your modeling software where you can control the texture mapping more precisely. With proper material settings and a well-mapped model you should be able to reproduce that photo far more effectively than you could with the T3D terrain system alone.
#4
08/30/2010 (1:23 am)
Sorry for the duplicate bug report, I didn't see that one.

@Henry - Thanks for the tip!, on my system with a debug build, I actually didn't see a drop in fps at all, and I got the effect I was looking for:

img707.imageshack.us/img707/6285/screenshot00600002.jpg
I want to vary the diffuse now, so instead of using it to show the layers, it'll just kinda vary the color so that the rock doesn't look the same everywhere, but I'm very, very happy with this result :)