Game Development Community

Reflective textures on .dif objects

by Cameron Ditty · in Artist Corner · 12/01/2003 (4:37 pm) · 7 replies

I am importing maps made in GLB 2.21 into Quark 6.4.0 and texturing them and then compiling them into .dif and loading them into the engine, and it works almost great ( I get a Error: No Possible Plane, then the engin crashes, but I will write another forum post for that ;) )

What I want to do is have my window textures glossy, or partially reflective. This is easy to do for dts models, but I do not know how to do it in quark. Does anyone have any suggestions?

Thanks in advance,

Cameron

#1
12/01/2003 (6:17 pm)
This was stolen from somewhere else in the forums:

Quote:look in PropertyMap.cs

you need to use the addMaterialMapping function to enable Environmental Mapping on Worldcraft objects.

An example from the Racing MOD:

addMaterialMapping( "glass" , "environment: fps/data/skies/day_0007 0.5" );

"glass" is the name of the texture (without extension) you wish to have Env. Mapping

"environment: fps/data/skies/day_0007" Specifies the texture to use for the reflection

0.5 is how much reflection to have.
you can also have footstep sounds change based off the texture you are walking on using:

addMaterialMapping( "stone" , "sound: 0" , "color: 0.46 0.36 0.26 0.4 0.0" );

again "stone" is the name of the texture without the extention.
#2
12/01/2003 (7:02 pm)
Matt,

Thanks, I will give this a try, and I love the addition about the sound.

I would have to think that you can do this more then once if you want more things to be reflected, I will have to see how much performance is lost.


Thanks again,

Cameron
#3
12/01/2003 (7:47 pm)
...except that transparencies don't work with the stock edition of Torque. Unless they've put them in 1.2?

EDIT: Where's the auto spell when you need it?
#4
12/01/2003 (8:00 pm)
Eric is right, transparent textures don't work in the stock Torque that I'm aware of either(for dif files), but there is code in the forums to add support if you require it. Environmental mapping should still work for reflections providing that that its not broken in 1.2. (I haven't tested the lasted build to see if it still works.)

Tribes 2 makes good use of these effects....
#5
12/01/2003 (10:31 pm)
E. mapping isn't broken with 1.2. I'm using the above trick to add dif reflections with 1.2 and it is fine. I would prefer to have it on a per pixel level (based on the alpha channel of the world texture in the same way it works for dts shapes) but you can't have everything you want and I've added it to the long list of things to suggest to the overworked programmers if they have the time and inclination to add it in.

One thing to remember is that if you use the ingame editor to change and save your level then it'll strip your 'hack' out when it saves and so you have to either add the lines after you've finished the rest of the level or make sure to store the line(s) in another file as a backup so you can re-add them when they get wiped.
#6
12/01/2003 (10:39 pm)
Note, they've also added mirrors in 1.2.
#7
12/02/2003 (4:00 am)
Hey Everyone,

I tried it and it worked very well. The reflection is not very relaistic, i.e. If using the sky as the reflection, textures that are shielded from the sky will still reflect it, but Knowing this, it can be planned for and it works well enough to full most players.

There is negligible performance loss when reflecting multiple images...I could not see even 1 FPS difference between not reflecting and reflectin 5 images with the same tesxture.

Thanks again everyone. I will have to look into the code that adds Alpha support for .difs


Cameron