Parallax Map Questions
by BryceSquared · in Torque Game Engine Advanced · 06/27/2009 (6:34 am) · 7 replies
As far as i know, tgea 1.7.1 has parallax shaders built in. Could somebody please tell me how to utilize them as i am fairly new to the materials system? This is what i have been doing but it doesn't look any different.
Is a parallax map different to a Bump Map, and if so how do i create one with the Nvidia plug in?
Thanks in advance
Bryce
Is a parallax map different to a Bump Map, and if so how do i create one with the Nvidia plug in?
new Material(CASTLESTONE3)
{
baseTex[0] = "CASTLESTONE3";
bumpTex[0] = "CASTLESTONE3_bump";
shader = Parralax;
pixelSpecular = true;
specular = "0 0 0 0";
specularPower = 5;
};Thanks in advance
Bryce
#2
06/28/2009 (7:02 am)
Can you please walk me through what to do exactly. I set it up but it is making the material invisible
#3
#1 make your diffuse color map, add specular map to the alpha channel, saving as superpng is ideal.
#2 make your normal map and add the heightmap into the alpha channel, saving as superpng is ideal.
#3 add them to a directory within your game and add this to the material.cs file in the directory containing the images(or however you set it up) but change the texture names used:
New CustomMaterial(Paratexture999)
{
texture[0] = "texture999";
texture[1] = "texture999normal";
shader = PshapeShader;
pixversion = 2.0;
specular = "0.4 0.4 0.4 1";
specularPower = 16.0;
};
4. Make sure you have a shader specified as "PshapeShader(or the specified name)" in your client/scripts/shaders.cs file. TGEA 1.8.1 had a few parallax shaders and I think they would all work with whatever you're using them on..but being specific is never a bad thing..so shapeshader on shape interior shader on interior...etc.
Example: [ Pintshader = Parallax Interior Shader ]
new ShaderData( PintShader )
{
DXVertexShaderFile = "shaders/parallaxInteriorV.hlsl";
DXPixelShaderFile = "shaders/parallaxInteriorP.hlsl";
OGLVertexShaderFile = "shaders/gl/parallaxInteriorV.glsl";
OGLPixelShaderFile = "shaders/gl/parallaxInteriorP.glsl";
pixVersion = 2.0;
};
new ShaderData( PpartShader )
{
DXVertexShaderFile = "shaders/parallaxParticleV.hlsl";
DXPixelShaderFile = "shaders/parallaxParticleP.hlsl";
OGLVertexShaderFile = "shaders/gl/parallaxParticleV.glsl";
OGLPixelShaderFile = "shaders/gl/parallaxParticleP.glsl";
pixVersion = 2.0;
};
new ShaderData( PshapeShader )
{
DXVertexShaderFile = "shaders/parallaxshapeV.hlsl";
DXPixelShaderFile = "shaders/parallaxshapeP.hlsl";
OGLVertexShaderFile = "shaders/gl/parallaxShapeV.glsl";
OGLPixelShaderFile = "shaders/gl/parallaxShapeP.glsl";
pixVersion = 2.0;
};
You can add those lines to your client/scripts/shaders.cs file if you're using 1.8.1...not positive about other versions.
#5. make sure you have a capable video card...and make a backup material for those people that cannot render 2.0 shaders.
I shorthand things..so ask a question if needed.
Edit: I caught a confusing sentence and fixed it.
06/28/2009 (11:58 pm)
Sure. Here is the basics:#1 make your diffuse color map, add specular map to the alpha channel, saving as superpng is ideal.
#2 make your normal map and add the heightmap into the alpha channel, saving as superpng is ideal.
#3 add them to a directory within your game and add this to the material.cs file in the directory containing the images(or however you set it up) but change the texture names used:
New CustomMaterial(Paratexture999)
{
texture[0] = "texture999";
texture[1] = "texture999normal";
shader = PshapeShader;
pixversion = 2.0;
specular = "0.4 0.4 0.4 1";
specularPower = 16.0;
};
4. Make sure you have a shader specified as "PshapeShader(or the specified name)" in your client/scripts/shaders.cs file. TGEA 1.8.1 had a few parallax shaders and I think they would all work with whatever you're using them on..but being specific is never a bad thing..so shapeshader on shape interior shader on interior...etc.
Example: [ Pintshader = Parallax Interior Shader ]
new ShaderData( PintShader )
{
DXVertexShaderFile = "shaders/parallaxInteriorV.hlsl";
DXPixelShaderFile = "shaders/parallaxInteriorP.hlsl";
OGLVertexShaderFile = "shaders/gl/parallaxInteriorV.glsl";
OGLPixelShaderFile = "shaders/gl/parallaxInteriorP.glsl";
pixVersion = 2.0;
};
new ShaderData( PpartShader )
{
DXVertexShaderFile = "shaders/parallaxParticleV.hlsl";
DXPixelShaderFile = "shaders/parallaxParticleP.hlsl";
OGLVertexShaderFile = "shaders/gl/parallaxParticleV.glsl";
OGLPixelShaderFile = "shaders/gl/parallaxParticleP.glsl";
pixVersion = 2.0;
};
new ShaderData( PshapeShader )
{
DXVertexShaderFile = "shaders/parallaxshapeV.hlsl";
DXPixelShaderFile = "shaders/parallaxshapeP.hlsl";
OGLVertexShaderFile = "shaders/gl/parallaxShapeV.glsl";
OGLPixelShaderFile = "shaders/gl/parallaxShapeP.glsl";
pixVersion = 2.0;
};
You can add those lines to your client/scripts/shaders.cs file if you're using 1.8.1...not positive about other versions.
#5. make sure you have a capable video card...and make a backup material for those people that cannot render 2.0 shaders.
I shorthand things..so ask a question if needed.
Edit: I caught a confusing sentence and fixed it.
#4
06/29/2009 (11:47 pm)
Could you email me an example please eb i still don't understand. I downloaded the SuperPNG plug-in and set up the images like you told me but it still doesn't work i just get a completely black yuck wall.
#5
- I am having the same trouble with Parallax mapping in 1.8.1
..I thought it just worked but it seems to be broken.
Now that I think about it, I have not used it since 1.0.3 :X
06/30/2009 (1:54 am)
Bryce, maybe someone else will be along to help you. - I am having the same trouble with Parallax mapping in 1.8.1
..I thought it just worked but it seems to be broken.
Now that I think about it, I have not used it since 1.0.3 :X
#6
06/30/2009 (6:21 am)
I GOT IT WORKING!! but it doesn't look right. I'll email some pictures and hopefully you will know what to do to fix it.
#7
06/30/2009 (11:45 am)
If you copy-paste from my profile, make sure you remove the word "null" from the email. It gets added in for what I assume is bot protection.
Torque Owner TheGasMan
G.A.S. [+others]