Alpha material on DIF
by Mark Pilkington · in Torque Game Engine Advanced · 11/15/2008 (5:09 pm) · 2 replies
I've knocked up a test cube with a wirefence texture inside Constructor, When I set up the shader and drop it into a level it appears to draw over everything except for the blue sky cube.
Here is my shader parameters:
-----------------------------------------
new Material(wire_fence2)
{
mapTo = "wire_fence2_d";
basetex[0] = "wire_fence2_d";
bumptex[0] = "wire_fence2_local";
translucent = true;
translucentBlendOp = LerpAlpha;
translucentZWrite = true;
alphaRef = 10;
pixelSpecular[0] = true;
specular[0] = "1.0 1.0 1.0 1.0";
specularPower[0] = 32.0;
};
------------------------------------------
I haven't tried the texture on a DTS shape yet and I have read somewhere that alpha materials don't work on DIF objects. The material is working....just very bizarrely.
Any help would be much appreciated, I have searched the demo projects for examples and clues but I've not been succesful.
Here is my shader parameters:
-----------------------------------------
new Material(wire_fence2)
{
mapTo = "wire_fence2_d";
basetex[0] = "wire_fence2_d";
bumptex[0] = "wire_fence2_local";
translucent = true;
translucentBlendOp = LerpAlpha;
translucentZWrite = true;
alphaRef = 10;
pixelSpecular[0] = true;
specular[0] = "1.0 1.0 1.0 1.0";
specularPower[0] = 32.0;
};
------------------------------------------
I haven't tried the texture on a DTS shape yet and I have read somewhere that alpha materials don't work on DIF objects. The material is working....just very bizarrely.
Any help would be much appreciated, I have searched the demo projects for examples and clues but I've not been succesful.
About the author
#2
A new problem. I exported the shape and dropped it into my environment and, while the diffuse is working fine the normal map isn't coming through. Just to test my shader I applied the DTS shape's texture to a DIF object and the normal map works on this fine.
The textures and material.cs is in the same folder as the DTS file and looks like this:
new Material(desk)
{
baseTex[0] = "desk_d";
bumpTex[0] = "desk_bump";
pixelSpecular[0] = true;
specular[0] = "1.0 1.0 1.0 1.0";
specularPower[0] = 8.0;
};
Any ideas would be very helpful.
11/16/2008 (5:35 am)
I have a new problem with DTS shapes and normal maps.A new problem. I exported the shape and dropped it into my environment and, while the diffuse is working fine the normal map isn't coming through. Just to test my shader I applied the DTS shape's texture to a DIF object and the normal map works on this fine.
The textures and material.cs is in the same folder as the DTS file and looks like this:
new Material(desk)
{
baseTex[0] = "desk_d";
bumpTex[0] = "desk_bump";
pixelSpecular[0] = true;
specular[0] = "1.0 1.0 1.0 1.0";
specularPower[0] = 8.0;
};
Any ideas would be very helpful.
Torque Owner Surge
MDNAMEDIA