Question about environment maps
by Spencer Boomhower · in Artist Corner · 01/04/2003 (1:29 am) · 9 replies
I'm stepping through the Max2DTSExporter Guide and so far it's been going well. But I got to the part about environment mapping and I'm stuck. A few things:
1) It says
2) Someone said in a post that you have to add the line emap = true; to your model's corresponding .cs file in server\scripts\ in order to make evironment maps work in a model. But I don't see such a .cs file. I'm exporting a static dts, instead of a player or a weapon, could that be the problem? Because...
3) I saw this in another post by MunkiBoi:
So does environment mapping work on static DTS files? Incidentally, I'm modding RW here, not the demo.
Many thanks in advance,
Spencer
1) It says
Quote:You can do this by making sure that $pref::environmentMaps = "1" in your prefs.CS and clientprefs.CS files.but I can't find a clientprefs.cs file in my GarageGames directory. In searching for an answer, I found other people had the same problem.
2) Someone said in a post that you have to add the line emap = true; to your model's corresponding .cs file in server\scripts\ in order to make evironment maps work in a model. But I don't see such a .cs file. I'm exporting a static dts, instead of a player or a weapon, could that be the problem? Because...
3) I saw this in another post by MunkiBoi:
Quote:I went through this as well, after much headbanging I was able to make enviroment mapping show up for objects created by me, i.e. by setting all the scripts etc, but only player and weapons - I have not been able to get static DTS objects to show environent maps at all.
So does environment mapping work on static DTS files? Incidentally, I'm modding RW here, not the demo.
Many thanks in advance,
Spencer
#2
What is meant is probably prefs.cs in directory ...\rw\client\. In that file, there is a line that looks like this:
$pref::environmentMaps = "0";
However, I don't know if setting this to 1 changes anything.
Stefan.
01/06/2003 (2:31 am)
About 1):What is meant is probably prefs.cs in directory ...\rw\client\. In that file, there is a line that looks like this:
$pref::environmentMaps = "0";
However, I don't know if setting this to 1 changes anything.
Stefan.
#3
datablock StaticShapeData(myStaticName)
{
category = "Misc";
emap=true;
shapeFile = "~/data/shapes/myStaticShape/myShape.dts";
};
function myStaticName::onAdd(%this,%obj)
{
%obj.playThread(0,"rotate");
}
function StaticShapeData::create(%block)
{
%obj = new StaticShape()
{
dataBlock = %block;
};
return(%obj);
}
The first is the datablock, the onAdd funtion is incase you want an animation to be played.
The create function isn't really nescessary as its probably already defined in another script.
In game.cs make sure you have this line somewhere:
exec("./yourstatic.cs");
If you do all this and run the game, you will be able to place this object in the maps. Don't place it as a static shape tough. Place it as an object (it will be listed under "Misc", unless you changed its category)
01/06/2003 (5:32 am)
Make a cs file called whatever you like (for example yourstatic.cs). Then put this in it:datablock StaticShapeData(myStaticName)
{
category = "Misc";
emap=true;
shapeFile = "~/data/shapes/myStaticShape/myShape.dts";
};
function myStaticName::onAdd(%this,%obj)
{
%obj.playThread(0,"rotate");
}
function StaticShapeData::create(%block)
{
%obj = new StaticShape()
{
dataBlock = %block;
};
return(%obj);
}
The first is the datablock, the onAdd funtion is incase you want an animation to be played.
The create function isn't really nescessary as its probably already defined in another script.
In game.cs make sure you have this line somewhere:
exec("./yourstatic.cs");
If you do all this and run the game, you will be able to place this object in the maps. Don't place it as a static shape tough. Place it as an object (it will be listed under "Misc", unless you changed its category)
#4
Thanks for the reply! It was already set to 1, and I think it it important; seems like I read about it in my search.
Ward:
Thanks, I'll give it a shot!
01/06/2003 (12:22 pm)
Stefan: Thanks for the reply! It was already set to 1, and I think it it important; seems like I read about it in my search.
Ward:
Thanks, I'll give it a shot!
#5
05/16/2004 (10:42 pm)
I have followed the tips here, as I also have the similar problem of static objects not reflecting the environment. Still didnt work for me, wonder if there are any other suggestions. I tried even adding another map to the reflection slot in max 6 for my dts, and no change even.
#6
10/18/2004 (2:02 pm)
All I get is a box that shows off the environemnt mapping rather than the actual geometry that I exported to Torque.
#7
10/18/2004 (2:16 pm)
All I get is a box that shows off the environemnt mapping rather than the actual geometry that I exported to Torque.
#8
11/16/2004 (2:32 am)
I too can't figure out env maps to work.
Torque 3D Owner Spencer Boomhower