Increase detail texture feature
by Jeff · in Torque Game Engine · 12/13/2004 (6:11 pm) · 3 replies
I want to make modifications to torque so that I can support multiple detail textures for each terrain texture...so my grass looks like grass and my pebbles look like...well...pebbles....etc.
I was browsing through the terrData.cc file, and I noticed the MaterialMap...'materialMap = mFile->mMaterialMap;'...I have not been a Torque SDK owner for long...but I am guessing that this is part of the ter file that contains information on where the materials are "placed" on the terrain polygons(please correct me if I am wrong).
My thought is, in theory, would it work to create a detail file for each terrain texture used, and create a DetailMap, which is basically identical to the MaterialMap(only with the detail textures). Then run the DetailMap through the blender and render the results?
My logic may be way off on this due to the fact that I don't 100% understand how everything renders in Torque...but hopefully some of you Terrain gurus can help ;)(ahem...Ben Garney...Chris Hobbiticus...etc)
Also, any input or good starting places as to where I can start work on this...any info I find will be given to the community of course :).
-Jeff
I was browsing through the terrData.cc file, and I noticed the MaterialMap...'materialMap = mFile->mMaterialMap;'...I have not been a Torque SDK owner for long...but I am guessing that this is part of the ter file that contains information on where the materials are "placed" on the terrain polygons(please correct me if I am wrong).
My thought is, in theory, would it work to create a detail file for each terrain texture used, and create a DetailMap, which is basically identical to the MaterialMap(only with the detail textures). Then run the DetailMap through the blender and render the results?
My logic may be way off on this due to the fact that I don't 100% understand how everything renders in Torque...but hopefully some of you Terrain gurus can help ;)(ahem...Ben Garney...Chris Hobbiticus...etc)
Also, any input or good starting places as to where I can start work on this...any info I find will be given to the community of course :).
-Jeff
About the author
#2
hmm...the current implementation of the detail texture renders details in a radius from the camera(i believe)....so one method would be to determine what terrain texture the camera is closest to, and render a corresponding detail texture
this would probably be the most simple way to accomplish it, BUT, I think that when you come to a point where two seperate textures start to blend, the renderer may put inappropriate detail textures onto neighboring terrain textures.
The other implementation I can think of is to run the detail textures as a separate texture layer on top of the terrain textures...but this would require large amounts of coding changes. Not an easy delimma
Once again, I admit I may be way off on this...
12/13/2004 (6:36 pm)
I know it only supports 1 detail texture, the idea behind my post was to extend the Terrain Renderer to render the detail texture based on the current texture you are standing on in game(supposing an fps). Basically, I don't want to use a single 512 detail texture map, I want each terrain texture to have a corresponding detail texture that is rendered in the same way that the terrain is rendered....hmm...the current implementation of the detail texture renders details in a radius from the camera(i believe)....so one method would be to determine what terrain texture the camera is closest to, and render a corresponding detail texture
this would probably be the most simple way to accomplish it, BUT, I think that when you come to a point where two seperate textures start to blend, the renderer may put inappropriate detail textures onto neighboring terrain textures.
The other implementation I can think of is to run the detail textures as a separate texture layer on top of the terrain textures...but this would require large amounts of coding changes. Not an easy delimma
Once again, I admit I may be way off on this...
#3
12/14/2004 (10:50 pm)
Most of your stuff is pretty accurate. Extending the detail textures as you describe, but doing it without seams, would be a pretty difficult task. :-/ You'd basically have to do some sort of blending operation on the detail maps, either in a caching blender or using GL. Gross, slow stuff either way.
Torque 3D Owner Stephen Zepp
You could most likely extend the detail texture stuff that is there already and work towards an extra detail texture per terrain texture, or alternatively look at the bumpmap textures, or a combination of all of 'em!