Game Development Community

Reflective/metallic textures, help please?

by Owen Epps · in Artist Corner · 05/22/2002 (6:29 pm) · 26 replies

I've read all sorts of things about this, including that the textures must be 32bpp PNG files created in Photoshop 5.x or earlier, that the textures require scripting to let the engine know that it should make them reflective, and that the engine must be set up to display reflective textures in the prefs.cs file. So I'd like someone to explain in explicit detail exactly what is required to make a building texture appear to be reflective in the Torque engine.
Page «Previous 1 2
#1
05/24/2002 (8:43 pm)
Hello?

Anyone?

Help?

Please?
#2
05/24/2002 (9:30 pm)
I'm not sure if you can have the enviromapping effect on buildings. Anyone know for sure?

For shapes, the way you add it depends on your modeler. In Milkshape, you use the shininess value. In max, you add a map to the reflection channel. You must then make sure you have the emap = true; line in your object's .cs script.
#3
05/24/2002 (10:28 pm)
I know it can be done for buildings - it was done in Tribes 2. There are tons of threads in these forums about this very subject, but a lot of the information is sketchy at best. I really need someone to tell me exactly what is required in the texture, the building itself, and the scripting so that I can figure out where the problem lies. :/
#4
05/25/2002 (8:29 pm)
addMaterialMapping( "floortech1", "environment: fps/data/skies/sunset_0007 0.25" );

Add that to the end of the scorched earth .mis file... the pyramids should then have a reflection, change the 0.25 to to 1 for an almost mirror like reflection.
#5
05/25/2002 (9:53 pm)
Good to know, thanks Labby.
#6
05/27/2002 (1:16 pm)
Yeah. Thanks muchly Labrat. I now see how the addMaterialMapping works - I was setting the path information incorrectly. :)
#7
05/28/2002 (11:06 am)
Harold,
Tested the material mapping and am getting 100% env image no matter what value I set the last parameter to. I'm using the HEAD version. I'm assuming that the effect should act like an overlay but I'm not seeing any of the primary surface texture...any ideas?
#8
05/28/2002 (12:16 pm)
I'll have to update to the latest head and test tonight.

If this is with the scorched earth example I posted I'm stumped, other then to test the HEAD version.

If it's with another texture it might be worth checking to see if it has an alpha channel. It could be over-riding the overlay value.
#9
05/28/2002 (1:51 pm)
in tribes 2 didn't they use an alpha channel on the .png to give the reflections. perhaps as long as the engine is set up to handle the reflections thats all that you would need to do extra.

j
#10
05/28/2002 (2:42 pm)
There's something going on here, either with drivers or with the TGE rendering. I saw the same thing (100% enviro when it shouldn't have been) for a brief period, then it switched to the correct blending before my very eyes.

Quadro DCC (GF3) with latest Detonator drivers.
#11
05/28/2002 (4:00 pm)
Yeah it does go full reflection for a bit at certain angles, and at certain LOD and when the objects load.

The reverse happens if you go with full reflection, at certain angles, LOD you get a partial overlay.

One thing I noticed is that the floortech1 texture used on the pyramids in scorched earth are .jpg with no alpha channel. Adding an alpha channel may change the behaviour.

I haven't checked the T2 files to see if the Chute textures included an alpha channel or not.
#12
05/29/2002 (12:04 pm)
I got this to (sort of) work by creating a png with alpha channel as the base texture.
addMaterialMapping( "df_graymarble01a", "environment: fps/data/skies/1030march30_u7 0.05" );

However, the last parameter has no affect at all. Also, the sky image in this case is already flipped around the x-axis to be properly oriented for water. In this situation, the image is not flipped properly (or rather the water code is not flipping properly).

One other note: adding this code at the end of the mission file is not the optimal solution since if any map updates occur, this added code will be eliminated.

In what part of the code is this blending process defined?
#13
05/29/2002 (1:48 pm)
I suggested adding it to the end of the map as for a production map (No new changes) it would be the best place for it.

You might want to delete the alpha channel from the PNG and see what happens.
#14
05/29/2002 (2:19 pm)
Tried a png without alpha channel--no go. This is interesting and deserves a deeper look...
#15
05/29/2002 (2:39 pm)
materialPropertyMap.cc

line 112 to line 131

interior.cc

line 400 to line 421

And
finally

interiorRender.cc (no line numbers)
#16
06/22/2002 (11:36 pm)
It seems apparent to me that the method used for reflection on the chutes in Tribes2 is not the same method used to put reflection on things in Torque. First off, in Torque its simply a matter of putting a texture in the skies dir and then using it on your own texture by the addmaterialmapping line where as in T2 the method is far more complicated since in T2 the chute textures have an alpha channel which seemingly is the reason why its able to reflect where as for Torque no alpha channel is needed to make it work.
#17
06/23/2002 (12:06 am)
T2 uses the same method. The chute textures are set to reflective with an addMaterialMapping.

For example in the lush.vl2 , you'll find a lushPropMap.cs, it contains the following (along with alot of other things)

addMaterialMapping("lush/be_ichute01", "environment: special/chuteTexture 0.25");
addMaterialMapping("lush/be_ichute02", "environment: special/chuteTexture 0.25");

These 2 lines specify the chute Texture and the Environment texture to use for reflextion.

The alpha channel on the texture used for the chute not sure whats up with the alpha channel. Looks almost like a bumpmap.
#18
06/23/2002 (2:27 am)
>addMaterialMapping("lush/be_ichute01", "environment: special/chuteTexture 0.25");
>addMaterialMapping("lush/be_ichute02", "environment: special/chuteTexture 0.25");

So, where is the base texture for the chute? both be_ichute01 and be_ichute02 are transparent, and chuteTexture is actually the reflection map... but what is the base one that these are layered upon?

I was just looking at a chute on a level, and it doesn't appear the main/base texture is the chuteTexture.

Any ideas? Or am I missing the boat completely? (again ;) )
#19
06/23/2002 (5:22 am)
Currently you have to add the texture's environment map via the functions in script listed above, and it'll specify what is reflected.

In that example, lush/be_ichute01 is the texture of the chute while special/chuteTexture is the environment map (the image used to emulate the "shinyness" of metal/polish).

I'll have to take a look at this since I'm finally sitting down to test most of the limits with the editor and interiors to see what we have to work with and need to improve. Surface materials always add a good deal to levels, so this is important to get working correctly.
#20
06/23/2002 (10:26 pm)
It maybe just as easy as you say, however, what if you arn't using a texture that you want to put in one of the 5 premade dirs; lush, ice, lava, badlands, desert. How do you proceed when its textures you've made and you have put them in your own texture dir. I have messed with this for a few days now and given up all hope.
Page «Previous 1 2