environment mapped terrain?
by Dr. John Nobody · in Torque Game Engine · 10/18/2002 (9:28 am) · 7 replies
hey guys, sorry to bother everyone, but I really need to put an environment map on my terrain to make it glossy and reflective, is it possible to do this in the torque, and if so could someone tell me how to do it please? thanks guys :)
#2
just a thought.
10/18/2002 (8:04 pm)
mmm... I'm not sure but, can it be done like it is with water?just a thought.
#3
I wanted the same feature, so that I could simulate rain puddles, and shiny ice. Oh well. :)
10/18/2002 (9:05 pm)
There was some discussion of that some months ago (many months). I can't find any of the threads, but I seem to recall talk of it requiring some terrain rendering code re-write. But dont quote me on that. I think Mark F. would know best.I wanted the same feature, so that I could simulate rain puddles, and shiny ice. Oh well. :)
#4
10/19/2002 (7:44 am)
ah I see... I wish there was some way to get Marks attention over to this thread... I've heard rumors that this can be done from other members... it would be a shame if it were possible but no one knew how to do it :(
#5
10/19/2002 (8:41 am)
I suppose you could take a look at the water code and see how it was done there and then simply apply the same technique in the terrain rendering code... but there may be an easier I wouldn't know for sure.
#6
10/19/2002 (8:47 am)
I guess I could try that, thanks for the suggestion
#7
Another possible way to do it I think, is to create a new object class for the reflective bits. For my purposes, I'd like to simulate rain puddles. Perhaps I can achieve this with a hacked up waterblock object class. In this way I can cut out unnecessary things like waves, submersion, etc and customize blending modes, and allow more flexibility for user preferences.
If all you are after is applying the env map to the ENTIRE terrain, I think it may be much simpler. Perhaps as simple as running a rendering phase seperate from the main textures like in the water code. Since fog is done in it's own pass anyways.
I'll play with it.
oh, and heres a link to the thread I mentioned earlier with Mark F. It was actually concerning animated terrain textures, but it may answer other questions a little.
Anyone else have any insight or ideas?
Eric, please keep us all updated if you come up with anything. It would be a great feature to add to alot of games, Im sure.
10/21/2002 (6:50 pm)
My understanding, from what I've gotten out of studying the terrain rendering code, is that when a mission is built, the blender code creates a texture for each terrain tile (the ones you can raise/lower etc) based on the textures you feed it (painted/mathematic, plus lightmap data), and caches it. When the engine goes to render said tiles, it grabs the generated textures from cache, applies them to the triangles of the tile, and draws it accordingly. If this is true, then it would indeed require a bit of a blnder re-write. How does the engine discern which pixels in the given texture to apply the env map, and which to leave be? This is not to say it's impossible (as far as I know), but very difficult, and time consuming.Another possible way to do it I think, is to create a new object class for the reflective bits. For my purposes, I'd like to simulate rain puddles. Perhaps I can achieve this with a hacked up waterblock object class. In this way I can cut out unnecessary things like waves, submersion, etc and customize blending modes, and allow more flexibility for user preferences.
If all you are after is applying the env map to the ENTIRE terrain, I think it may be much simpler. Perhaps as simple as running a rendering phase seperate from the main textures like in the water code. Since fog is done in it's own pass anyways.
I'll play with it.
oh, and heres a link to the thread I mentioned earlier with Mark F. It was actually concerning animated terrain textures, but it may answer other questions a little.
Anyone else have any insight or ideas?
Eric, please keep us all updated if you come up with anything. It would be a great feature to add to alot of games, Im sure.
Torque Owner Dr. John Nobody