Parallax Shader on the TDN
by Sixth World Games Team · in Torque Game Engine Advanced · 10/28/2006 (6:47 pm) · 15 replies
I am trying to get the parallax shader from this TDN entry working in a fresh build of TSE. I followed all the steps on the TDN, but saw no difference in the engine. I tried it first with the included materials.cs and the test cube, and also with some of my own textures and normal maps. The textures showed up fine, but look like regular bump maps. I am not sure what the issue is here. Is anyone else having any problems with this? Thanks
About the author
#2
11/09/2006 (12:02 am)
Can you see the Hightmap by doing this:Fragout main( ConnectData IN,
uniform sampler2D diffuseMap : register(S0),
uniform sampler2D bumpMap : register(S1),
uniform sampler2D height_map : register(S2),
uniform float4 ambient : register(C2),
uniform sampler2D lightMap : register(S3)
)
{
Fragout OUT;
OUT.col = tex2D(height_map, IN.texCoord);
return OUT;
}?
#3
11/09/2006 (6:36 pm)
Hi, I also am having difficulty, before it was a black texture. But after following Martin's advice it is now a pixelated multi color blue/purpleish mosaic, which once in a while will flicker for a very short period of time what appears to be a garage games logo with a similar color scheme
#4
This pack includes both parallax and relief mapping. As it turns out, the TDN entry had correct code, but no real explanation on how to create your own textures. I had no luck using the png normal maps, which I had been using with TGEA in the past. AFAIK you need to create DDS textures using the nvidia photoshop plugin. The height map (used for parallax/relief mapping) is set as a greyscale map in the alpha channel. And then make sure to select explict alpha channel when you export the DDS. It looks really good and still runs at a decent speed. Still, the parallax section on the TDN could use some work as it doesnt explain some of these crutial steps.
11/09/2006 (6:59 pm)
Ok. Well I got it working by using this resource instead: www.noolness.com/downloads/nool-shader-pack-1.zip (thanks so much Noolness!). This pack includes both parallax and relief mapping. As it turns out, the TDN entry had correct code, but no real explanation on how to create your own textures. I had no luck using the png normal maps, which I had been using with TGEA in the past. AFAIK you need to create DDS textures using the nvidia photoshop plugin. The height map (used for parallax/relief mapping) is set as a greyscale map in the alpha channel. And then make sure to select explict alpha channel when you export the DDS. It looks really good and still runs at a decent speed. Still, the parallax section on the TDN could use some work as it doesnt explain some of these crutial steps.
#5
-edit2-
Y'know what would be awesome.. Shader decals, small shaderized textures that can be applied to a surface, or maybe even a shader-decal that modifies a portion the current surface. To make parallax mapped bullet holes and such
-edit3- Nooob question, what is the difference between Parallax, Normal and relief mapping in laymens terms?
11/09/2006 (7:38 pm)
It works. It's awesome. It's like 3D glasses. I'm too speechless to say any more :) -edit- (to say any more, except many, many thanks Noolness for making, and thanks SRO team for sharing)-edit2-
Y'know what would be awesome.. Shader decals, small shaderized textures that can be applied to a surface, or maybe even a shader-decal that modifies a portion the current surface. To make parallax mapped bullet holes and such
-edit3- Nooob question, what is the difference between Parallax, Normal and relief mapping in laymens terms?
#6
just a BIG thanks to SRO i couldn't get it going due to the fact i was using .png.
11/09/2006 (7:56 pm)
Hi, just a BIG thanks to SRO i couldn't get it going due to the fact i was using .png.
#7
11/13/2006 (12:43 am)
Hi, Can someone please help me! lol i have the Relief map shader working fine but can't seem to get the new lighting working with it, shadows work and the light from the sun but thats it, some help would be great.
#8
11/13/2006 (1:58 am)
Those shaders were pre-lighting implementation. They will need to be modified to take advantage of the lighting. They will need to be modified.
#9
01/29/2007 (11:04 am)
Anyone converted these to work with the new lightning system ?
#10
02/10/2007 (9:21 pm)
I had a few free hours the other day and hacked away it it for a bit, couldn't get it working. Would be nice if there was some kind of documentation someplace on how to use TSE's lighting in our shaders. I was trying to figure it out by looking at the terrains dynamic lighting but it didn't seem to work in the same way. I'm busy with work again I'll try some more when things slow down.
#11
03/04/2007 (3:34 am)
Wow amazing stuff...
#12
I just need more time to tweak it a bit.
04/22/2007 (6:02 pm)
Thanks alot for the help. I finally got something to work.I just need more time to tweak it a bit.
#13
04/29/2007 (8:49 pm)
Feel free to update the TDN document.
#14
09/09/2007 (9:42 am)
I can seem to get this working , i added the height map and exported as dds in photoshop, and used the explict alpha channel, looks unaffected by the heightmap
#15
new Material(MetalPlane)
{
baseTex[0] = "MetalPlane";
bumpTex[0] = "flammableBox_n.dds";
shader = Parallax;
mapTo = "MetalPlane";
pixversion = 2.0;
pixelSpecular[0] = true;
specular[0] = "0.1 0.1 0.1 0.1";
specularPower[0] = 15.0;
};
09/09/2007 (9:51 am)
Here is my material tonew Material(MetalPlane)
{
baseTex[0] = "MetalPlane";
bumpTex[0] = "flammableBox_n.dds";
shader = Parallax;
mapTo = "MetalPlane";
pixversion = 2.0;
pixelSpecular[0] = true;
specular[0] = "0.1 0.1 0.1 0.1";
specularPower[0] = 15.0;
};
Torque Owner Sixth World Games Team