trouble with relief map
by Felix999 · in Torque Game Engine Advanced · 04/12/2009 (9:44 am) · 12 replies
hello,
i recently got tgea and am trying to get a relief map onto a basic bridge model i'm making with constructor.
i'm using stonewall_d.png and stonewall_n.png from the barricade demo along with the code from materials.cs:
also i added the code for ReliefShapeShader in client/scripts/shaders:
it kinda works but it's going a bit screwy.
here's a link to a pic which shows what it looks like so far:
http://img10.imageshack.us/img10/7950/20747233.jpg
if anyone has any ideas i'd be grateful.
thanks in advance.
i recently got tgea and am trying to get a relief map onto a basic bridge model i'm making with constructor.
i'm using stonewall_d.png and stonewall_n.png from the barricade demo along with the code from materials.cs:
// Materials for the Relief Map example
new Material(Relief_Map_Fallback)
{
basetex[0] = "~/data/interiors/mountainBridge/stonewall_d";
bumpTex[0] = "~/data/interiors/mountainBridge/stonewall_n";
specular[0] = "0.75 0.75 0.75";
specularPower[0] = 128.0;
pixelSpecular[0] = true;
};
new CustomMaterial(Relief_Map)
{
texture[0] = "~/data/interiors/mountainBridge/stonewall_d";
texture[1] = "~/data/interiors/mountainBridge/stonewall_n";
shader = ReliefShapeShader;
mapTo = "stonewall_d";
version = 3.0;
specular = "0.75 0.75 0.75";
specularPower = 128.0;
fallback = Relief_Map_Fallback;
};also i added the code for ReliefShapeShader in client/scripts/shaders:
new ShaderData( ReliefShapeShader )
{
DXVertexShaderFile = "shaders/reliefShapeV.hlsl";
DXPixelShaderFile = "shaders/reliefShapeP.hlsl";
pixVersion = 3.0;
};it kinda works but it's going a bit screwy.
here's a link to a pic which shows what it looks like so far:
http://img10.imageshack.us/img10/7950/20747233.jpg
if anyone has any ideas i'd be grateful.
thanks in advance.
About the author
#2
i tried changing to reliefInteriorV/P but no change.
i don't think there's a problem with the alpha channel in the normal map, cause i moved the interior and the materials script into the barricade demo and added the bridge there and it looks fine.
could the difference be that the barricade demo is version 1.7.1 and i'm using version 1.8.1?
thanks for the reply ;)
04/13/2009 (4:52 am)
hi eb,i tried changing to reliefInteriorV/P but no change.
i don't think there's a problem with the alpha channel in the normal map, cause i moved the interior and the materials script into the barricade demo and added the bridge there and it looks fine.
could the difference be that the barricade demo is version 1.7.1 and i'm using version 1.8.1?
thanks for the reply ;)
#3
http://www.garagegames.com/community/forums/viewthread/88671
But I have not had a reply with a solution! Also in the waiting!
04/13/2009 (6:32 am)
I have the same problem, this is my post:http://www.garagegames.com/community/forums/viewthread/88671
But I have not had a reply with a solution! Also in the waiting!
#4
What are your specs on your vid cards ?
Examples:
GeForce 9400 ?
Ati x800 ?
04/13/2009 (4:25 pm)
Everything tested fine..so..What are your specs on your vid cards ?
Examples:
GeForce 9400 ?
Ati x800 ?
#5
04/13/2009 (6:15 pm)
my Card 8600 GT XFX
#6
Are your drivers current ? ...what directx sdk are you using ?
04/13/2009 (7:26 pm)
! ..I just burned out one of those 3 weeks ago.Are your drivers current ? ...what directx sdk are you using ?
#7
04/14/2009 (1:05 am)
i have a, Gainward GeForce GTS 250 2GB PhysX
#9
Send me the source files and game files that you guys are having issues with. Zip them up and mail to my profile's email plz. thx
04/14/2009 (8:43 am)
I use a XFX gts250 1GB.Send me the source files and game files that you guys are having issues with. Zip them up and mail to my profile's email plz. thx
#10
i try use T3D GameExemple and occours the same thing
04/22/2009 (11:03 am)
hey, u have a solution?i try use T3D GameExemple and occours the same thing
#11
new Material(Relief_Map_Fallback)
{
basetex[0] = "~/data/interiors/Techdemo/stonewall_d";
bumpTex[0] = "~/data/interiors/Techdemo/stonewall_n";
specular[0] = "0.75 0.75 0.75";
specularPower[0] = 128.0;
pixelSpecular[0] = true;
};
// Materials for the Relief Map example
new CustomMaterial(Relief_Map)
{
texture[0] = "~/data/interiors/Techdemo/stonewall_d";
texture[1] = "~/data/interiors/Techdemo/stonewall_n";
shader = ReliefInteriorShader;
mapTo = "stonewall_d";
pixversion = 3.0;
specular = "0.75 0.75 0.75";
specularPower = 64.0;
fallback = Relief_Map_Fallback;
};
and this problem appeared, but when inserting this line in CustomMaterial(Relief_Map):
texture[2] = "$lightmap";
The problem is solved if I don't use the relight, but if I do not use it, the relief shader turns completely dark with no light, using relight, the error back.
Another observation: inverted lightmap
The sunshine is on one side of the map, but relief map it reflects on the other side of object, and side of the map that it reflects the light have the problem of red spots
04/22/2009 (12:51 pm)
(sorry english, google translator) The error in this lightmap, first i used this code: new Material(Relief_Map_Fallback)
{
basetex[0] = "~/data/interiors/Techdemo/stonewall_d";
bumpTex[0] = "~/data/interiors/Techdemo/stonewall_n";
specular[0] = "0.75 0.75 0.75";
specularPower[0] = 128.0;
pixelSpecular[0] = true;
};
// Materials for the Relief Map example
new CustomMaterial(Relief_Map)
{
texture[0] = "~/data/interiors/Techdemo/stonewall_d";
texture[1] = "~/data/interiors/Techdemo/stonewall_n";
shader = ReliefInteriorShader;
mapTo = "stonewall_d";
pixversion = 3.0;
specular = "0.75 0.75 0.75";
specularPower = 64.0;
fallback = Relief_Map_Fallback;
};
and this problem appeared, but when inserting this line in CustomMaterial(Relief_Map):
texture[2] = "$lightmap";
The problem is solved if I don't use the relight, but if I do not use it, the relief shader turns completely dark with no light, using relight, the error back.
Another observation: inverted lightmap
The sunshine is on one side of the map, but relief map it reflects on the other side of object, and side of the map that it reflects the light have the problem of red spots
#12
or use: eb7898[at]hotmail[Dot]com
..send some screenshots of other issues too plz.
04/22/2009 (10:04 pm)
Marcos, did you ever mail your example files to me...be aware that you must remove the "null" form that email address.or use: eb7898[at]hotmail[Dot]com
..send some screenshots of other issues too plz.
Torque Owner TheGasMan
G.A.S. [+others]
1.
do you have the heightmap in the alpha channel of your normal map ?
alpha channel information: white = high / black = low
2.
shape = model
constructor exports 'interiors'...an interior not a shape/model.
Change your material over to the "reliefinteriorV/P.hlsl" and see if your issue remains. (this is probably not the problem but never doubt anything)