Game Development Community

More than 1 Detail Texture for terrain. Possible?

by TerroX · in Torque Game Engine · 03/18/2005 (6:13 pm) · 22 replies

At the moment TGE only allows one Detail Texture for the whole mission and it covers all terrain.

Is it possible to modify the engine and allow multiple detail maps?
Doesn't have to be paintable like terrain textures but it would be a lot more useful having more than one.

A detail terrain texture which just changes based on which terrain texture you are standing on would be fine - so you have "GrassDetail.png" and "SandDetail.png" and you map them to the Grassy and sandy texures in your texture list in the mission terrain texture info.

This would nearly solve the "massive terrain textures" issue because we could at least fake a detailed ground look.

Currently, having only 1 Detail Texture is not very good, all textures on the map get overlayed with the same texture.
Page «Previous 1 2
#1
03/18/2005 (6:21 pm)
Possible? Yes. Probable? Not without some extreme knowledge of the underlying terrain and blending code. Ben has stated in past posts that it was a design decision that made sense at the time, but that due to the blending techniques used and several other factors, it's not an easy modification.

Not the answer you wanted to hear, I know...and it would certainly be awesome if someone wound up coming up with a solution!
#2
03/18/2005 (9:22 pm)
Probably be better to just go with TSE if it is that much of an issue for you.
#3
03/19/2005 (12:24 am)
Well, if TSE will support all graphics cards, yeah I would support TSE.
#4
03/19/2005 (6:41 pm)
How much of a hit are you willing to take? :)

You could easily sample off the opacity map, do some dynamic geometry, and do N passes, one for each detail texture. Problem solved. Barring the inevitable tweaking, incompatibility issues, and so forth. :)
#5
03/19/2005 (7:44 pm)
No hit :-) Okay a tiny hit, on the arm.

I would not expect the detail map to be visible any further than it normally is, which means only a few units from the cam - I assume anything else would be a huge hit. So nothing would be affected or checked beyond that range and I would not expect blending on the edges of the details maps (again, huge hit), just the whole 'detail grid/bump map' fades/swaps to the next 'detail grid/bump map' when the cam is near a new texture (which would probably look wrong in-game).
#6
03/20/2005 (1:43 pm)
*bampf*

Anyway, I meant performance hit. Detail textures tend to eat fill rate, especially when you're doing multiple foreground passes.

If you just want to change the whole detail texture based on cam position, the change should be pretty trivial... Go for it. :)
#7
08/11/2005 (7:27 am)
I want to switch detail textures on a trigger.

I'll note that this is a single player only game, since that might make a difference....

I have tried :
Terrain.detailTexture = "~/data/terrains/details/snow_detail";

but it doesnt seam to do anything. It doesn't give me a nerror. Just doesnt work.

Does anyone know what I need to call ?
#8
08/11/2005 (7:42 am)
I think you add in the mission file:
detailTexture = "~/data/terrains/details/snow_detail";
in the datablock for your terrain, right under the scale.
#9
08/11/2005 (8:14 am)
Yes, that would change it permanently... but I want to change it on the fly when I hit a trigger.
#10
08/13/2005 (11:08 am)
Noone knows how to swap the terrain detail texture in real time ?
#11
08/13/2005 (12:14 pm)
If you switched it on the fly... I can't help but think it would be very noticable to the player... possibly ruining the effect.
#12
08/13/2005 (12:21 pm)
Quote:
No one knows how to swap the terrain detail textures in real time?

Don't whine. :P

It's very simple. There's a texture handle in the terrain rendering code (probably stored in the terrainblock class as a TextureHandle) which stores a reference to the teture. Just make that change and you're set. Setting the field isn't going to work because even in a single player game networking is active and the networking won't automatically transmit a changed field. I would add a method that would set the appropriate net mask to make the change propagate as well as changing the value.
#13
08/13/2005 (4:29 pm)
Ben - yes, thanks. I just figured this out a few hours ago.

And just for the record.... I'm not whining... I'm bitching.
#14
08/13/2005 (4:32 pm)
So, you got it working?... Would make a nice resource .. hint hint. :)
#15
08/13/2005 (4:33 pm)
Chris - Still working on it... gimme an hour or so.

Robert - What are you talking about ?
#16
10/11/2005 (3:34 pm)
Any progress ?
#17
10/12/2005 (3:29 am)
Alienforce - It was not worth the effort, for what it added to my game. I dropped it.
#18
12/08/2007 (5:47 pm)
I have been working on a way to achieve this,
I'm not sure if it will be feasible to do it this way but this is what I have so far.
Let me know what you think...
John

img144.imageshack.us/img144/5697/terraintest01cx4.jpg
#19
12/08/2007 (8:33 pm)
I think it rocks because it works!. But there are questions.

1. Performance.
2. OS Compatibility.
3. Implementation difficulty.
4. TLK compatible?
5. Limit on amount of terrain detail textures?
#20
12/08/2007 (10:37 pm)
Very nice work John. I'm sure if you are successful in getting this to work well enough, it would be a very well addition to the TGE community.

I would really be interested in seeing how you achieved this.
Page «Previous 1 2