Relief Shader Bug?
by Marcos - NGames · in Torque Game Engine Advanced · 04/06/2009 (9:58 am) · 5 replies
Hi Guys, firts, sorry my english, it's Google Translation!
I am having problems with Relief Shader, see the image below:
http://www.n41.com.br/reliefbug.jpg
Well, this model was done in the Constructor, using "Export as DIF...", i use the Shader effects like this in the demo barricade, but it faces some of the model simply does not appear and the most critical, only the brush that using the shader is some red spots, and the shadow is reversed, that part of the picture is where it should be without light, since the Sun is the other side
Do have any idea what could be?
I am having problems with Relief Shader, see the image below:
http://www.n41.com.br/reliefbug.jpg
Well, this model was done in the Constructor, using "Export as DIF...", i use the Shader effects like this in the demo barricade, but it faces some of the model simply does not appear and the most critical, only the brush that using the shader is some red spots, and the shadow is reversed, that part of the picture is where it should be without light, since the Sun is the other side
Do have any idea what could be?
About the author
N41 - Digital Solutions
#2
04/06/2009 (12:46 pm)
for the model, turn off HSR. That should cure the missing faces problem.
#3
materials.cs:
new CustomMaterial(Relief_Map)
{
texture[0] = "~/data/interiors/Techdemo/stonewall_d";
texture[1] = "~/data/interiors/Techdemo/stonewall_n";
texture[2] = "$lightmap";
shader = ReliefInteriorShader;
mapTo = "stonewall_d";
pixversion = 3.0;
specular = "0.75 0.75 0.75";
specularPower = 128.0;
};
shader.cs
new ShaderData( ReliefInteriorShader )
{
DXVertexShaderFile = "shaders/reliefInteriorV.hlsl";
DXPixelShaderFile = "shaders/reliefInteriorP.hlsl";
pixVersion = 3.0;
};
I relight scene and the lightmap works fine, but red spots persist!
04/06/2009 (12:58 pm)
not work :( see my code:materials.cs:
new CustomMaterial(Relief_Map)
{
texture[0] = "~/data/interiors/Techdemo/stonewall_d";
texture[1] = "~/data/interiors/Techdemo/stonewall_n";
texture[2] = "$lightmap";
shader = ReliefInteriorShader;
mapTo = "stonewall_d";
pixversion = 3.0;
specular = "0.75 0.75 0.75";
specularPower = 128.0;
};
shader.cs
new ShaderData( ReliefInteriorShader )
{
DXVertexShaderFile = "shaders/reliefInteriorV.hlsl";
DXPixelShaderFile = "shaders/reliefInteriorP.hlsl";
pixVersion = 3.0;
};
I relight scene and the lightmap works fine, but red spots persist!
#4
04/06/2009 (1:15 pm)
Thanks Jaimi, Missing Faces fixed!
#5
04/06/2009 (1:38 pm)
I'm tested this shader on my comp. I have no red spots, the bump works fine, but the dynamic lights not affect on the surfaces, only my sg sunlight do the effect, and I have no specular gleams too :( Sorry, I can't help, u need a shader magus, but you can find lots of information about parallax/relief shaders in this forum: www.garagegames.com/community/forums/viewthread/36211
Torque 3D Owner Marton Szucs
I think, the red spots is an unused texture channel (lightmap).
try this:
to shader.cs:
new ShaderData( ReliefInteriorShader ) { DXVertexShaderFile = "shaders/reliefInteriorV.hlsl"; DXPixelShaderFile = "shaders/reliefInteriorP.hlsl"; pixVersion = 3.0; };to your material.cs:
new Material(BoxEdge) { texture[0] = "~/data/relief/rockbumpd.png"; texture[1] = "~/data/relief/rockbumpn.dds"; texture[2] = "$lightmap"; shader = ReliefInteriorShader; mapTo = "box_edge"; pixVersion = 3.0; specular = "0.75 0.75 0.75"; specularPower = 128.0; };