Game Development Community

disable backface culling for custommaterials

by Dan Keller · in Torque 3D Professional · 10/22/2011 (7:44 pm) · 3 replies

How can I turn off backface culling for custommaterials? I tried creating a state block:
singleton GFXStateBlockData( LeafSBData )
{
   cullDefined = true;
   cullMode = GFXCullNone;
};
and referring to it in the material definition, but it doesn't make any difference.

#1
10/23/2011 (5:53 am)
You can mark your custom material as doublesided.
This should set the stateblock on the fly.
#2
10/23/2011 (7:04 am)
doubleSided = "1";

add that into your singleton material
#3
10/23/2011 (10:02 am)
I did that and it didn't work. Turns out the problem was the pixel shader multiplying the alpha by the dot product of the view vector and world normal. Silly me, dot is negative for antiparallel vectors...