[BUG 1.1Beta] Terrain diffuse material has no side projection - NOT A BUG
by Justin Knight · in Torque 3D Professional · 02/28/2010 (11:02 am) · 5 replies
In the terrain painter there is a check box for setting side projection for each material.
This works fine for the detail map however it does not appear to affect the diffuse texture.
On a vertical terrain surface this means unrealistically elongated textures and vertical stripes even on detail textures which take some of their colour information from the diffuse texture.

This works fine for the detail map however it does not appear to affect the diffuse texture.
On a vertical terrain surface this means unrealistically elongated textures and vertical stripes even on detail textures which take some of their colour information from the diffuse texture.

About the author
#2
The other problem is that from a distance only the diffuse map base texture is visible as you can see on the left of the image even though the detail distance is set quite high here at 500 units, in this image we are actually quite close to the vertical section of terrain. When only the diffuse map becomes visible at a distance the texture is elongated and only becomes a series of stripes and does not look realistic compared to horizontally projected terrain. Modelling a surface and applying it would be one solution but the textures would be side projected onto the modelled section anyway, and from a distance it would look as intended, but why go to the lengths of modelling sections of terrain when the terrain engine can supply a more efficient solution by side projecting both detailed and diffuse base textures?
The effect is most noticeable in an extreme application as is illustrated from the image, but throughout any terrain landscape where terrain is at any angle from 45 degrees to vertical it is desirable to achieve a more realistic projection of the diffuse texture by using a side projection, otherwise as slopes on hillsides increase the textures become distorted and look wrong. This is important because vertical and sloping portions of terrain are the ones most commonly visible to the player, and to get a sense of scale and distance as well as realism they have to look right. Modelling extra surfaces wherever there is a sloping portion of the landscape is not a practical solution.
The best solution is to side project both maps, detail and diffuse, in fact any map applied to a sloping or vertical area. This seems to be what was originally intended as the checkbox for this function appears in the diffuse map section of the terrain painter.
03/01/2010 (2:08 am)
The problem is that the detail map uses some of it's colours from the diffuse map, so we have the vertical banding you see on the right of the image even when we are close up. Extending the distance of the detail map would not solve this problem. What you should see is colours properly projected from the diffuse map base texture as you would normally see on a horizontally projected portion of the terrain.The other problem is that from a distance only the diffuse map base texture is visible as you can see on the left of the image even though the detail distance is set quite high here at 500 units, in this image we are actually quite close to the vertical section of terrain. When only the diffuse map becomes visible at a distance the texture is elongated and only becomes a series of stripes and does not look realistic compared to horizontally projected terrain. Modelling a surface and applying it would be one solution but the textures would be side projected onto the modelled section anyway, and from a distance it would look as intended, but why go to the lengths of modelling sections of terrain when the terrain engine can supply a more efficient solution by side projecting both detailed and diffuse base textures?
The effect is most noticeable in an extreme application as is illustrated from the image, but throughout any terrain landscape where terrain is at any angle from 45 degrees to vertical it is desirable to achieve a more realistic projection of the diffuse texture by using a side projection, otherwise as slopes on hillsides increase the textures become distorted and look wrong. This is important because vertical and sloping portions of terrain are the ones most commonly visible to the player, and to get a sense of scale and distance as well as realism they have to look right. Modelling extra surfaces wherever there is a sloping portion of the landscape is not a practical solution.
The best solution is to side project both maps, detail and diffuse, in fact any map applied to a sloping or vertical area. This seems to be what was originally intended as the checkbox for this function appears in the diffuse map section of the terrain painter.
#3
We bake the base textures into one large DDS compressed texture which is repeated once over the terrain. Side projecting this unique texture will give you incorrect results.
The only way to do side projection with the base textures is if we treated the base textures like the detail textures. That is something we are not looking to do as it would mean 2x the fillrate and draw calls to render the terrain.
There is a technique used by the idTech4 engine where some of the resolution of the flat parts of the terrain are reduced and some UV space is given to the more vertical parts. We experimented with this some, but the results were not as good as our detail side projection.
03/02/2010 (11:14 am)
I guess i wasn't clear in my initial post. You cannot side project the base texture with the technique we use for rendering the terrain.We bake the base textures into one large DDS compressed texture which is repeated once over the terrain. Side projecting this unique texture will give you incorrect results.
The only way to do side projection with the base textures is if we treated the base textures like the detail textures. That is something we are not looking to do as it would mean 2x the fillrate and draw calls to render the terrain.
There is a technique used by the idTech4 engine where some of the resolution of the flat parts of the terrain are reduced and some UV space is given to the more vertical parts. We experimented with this some, but the results were not as good as our detail side projection.
#4
Hardly a perfect solution, but it's the best look for a terrain sheer cliff I've been able to obtain. An option to have the detail texture totally ignore the base texture color would remove the need to change its size value to 1 (doing so is the reason the detail range needs to be set at or higher than farclip -- the texture just turns into 1 color).
Here's a quickly hacked up shot of a really extreme example in 1.1b fps example:
Obvious issue is that the texture won't be nearly as high-res up close as your normal terrain detail textures are (though I've found myself also making this detail distance vs detail res compromise on ground textures more and more often -- the base texture res is just too low when the terrains get really large). This is one case where some object placement could help; a pile of rocks at the base of the cliff, or some high groundcover down there, since it's only at the edge between ground and cliff where you'll be able to get up close to these textures.
If you remember the warrior camp demo, it had some great examples of cliff objects that could be used to suplement this technique; placing one of those long cliff objects at the base of the cliff provides some high-res geometry and texturing for people who actually walk up to it, while the terrain provides a pretty decent medium to long range effect from everywhere else.
There may be engines that handle this better without performance loss, but in the end cliffs are actually something lots of games struggle to render. Level designers are constantly having to use these kinds of tricks to get the job done.
03/03/2010 (1:21 pm)
I'd suggest cranking the detail texture range way up on these cliff textures... and I mean like, turn it up as high as your vis range. Then turn up their size significantly so it doesn't look so much like a repeating pattern (50+). You'll probably also want to increase the detail strength all the way to 1.0, so it totally overrides the base texture -- the size of which you'll have to set to 1 if you want to totally remove the "streaking" effect that's still messing things up.Hardly a perfect solution, but it's the best look for a terrain sheer cliff I've been able to obtain. An option to have the detail texture totally ignore the base texture color would remove the need to change its size value to 1 (doing so is the reason the detail range needs to be set at or higher than farclip -- the texture just turns into 1 color).
Here's a quickly hacked up shot of a really extreme example in 1.1b fps example:
Obvious issue is that the texture won't be nearly as high-res up close as your normal terrain detail textures are (though I've found myself also making this detail distance vs detail res compromise on ground textures more and more often -- the base texture res is just too low when the terrains get really large). This is one case where some object placement could help; a pile of rocks at the base of the cliff, or some high groundcover down there, since it's only at the edge between ground and cliff where you'll be able to get up close to these textures.If you remember the warrior camp demo, it had some great examples of cliff objects that could be used to suplement this technique; placing one of those long cliff objects at the base of the cliff provides some high-res geometry and texturing for people who actually walk up to it, while the terrain provides a pretty decent medium to long range effect from everywhere else.
There may be engines that handle this better without performance loss, but in the end cliffs are actually something lots of games struggle to render. Level designers are constantly having to use these kinds of tricks to get the job done.
#5
Maybe I can compensate by changing the dimensions of the texture I use for the diffuse map and sloping the vertical terrain back a little to add some resolution to the UV's. If I whack up the distance on the detail map and add some fogging and use a big enough texture it should look ok.
I noticed there's an add-on for TGEA which makes cliff sides, hopefully they're going to update it to T3D sometime soon.
http://www.bitgap.com/products/1/cliff_construction_kit.html
03/04/2010 (6:13 am)
Ok thanks for the detailed reply.Maybe I can compensate by changing the dimensions of the texture I use for the diffuse map and sloping the vertical terrain back a little to add some resolution to the UV's. If I whack up the distance on the detail map and add some fogging and use a big enough texture it should look ok.
I noticed there's an add-on for TGEA which makes cliff sides, hopefully they're going to update it to T3D sometime soon.
http://www.bitgap.com/products/1/cliff_construction_kit.html
Associate Tom Spilman
Sickhead Games
That isn't a bug... its working as intended by the technique we're using.
The case your showing there is one where you would either extend the distance of the detail map so that it appears side projected or use TSStatics to dress up the flat side of the terrain.