Game Development Community

DTS alpha and sunlight issue

by TheGasMan · in Torque Game Engine Advanced · 07/29/2007 (10:45 am) · 2 replies

Hello, I hope someone has solved this ;)

I have a perfectly good DTS shape for flowers in a flowerpot. It casts ugly shadows because of the lack of alpha-shadow support and TBH, I could care less about the lacking alpha shadow support.

**What I DO care about is that the entire image containing the transparencies disappears when I deselect "receivesunlight".
-> Is there a simple fix or does it deal with the not-well-thought-out rendering order ?

The models will be used indoors, so I need these shapes to specifically have sunlight off.

Thanks ahead of time for your time.
www.fragstudios.com/devuploads/tgea_wow54.jpg
P.S. I know the flower image isn't nice...this is just tests.

#1
07/30/2007 (8:01 am)
What do your materials definition look like?

I tested the example trees that come with TGE using the following definitions and it worked as expected:

new Material(oak_bark)
{
   mapTo = oak_bark;
   baseTex[0] = "~/data/shapes/trees/oak_bark";
};

new Material(oak_branch)
{
   mapTo = oak_branch;
   baseTex[0] = "~/data/shapes/trees/oak_branch";
   translucent = true;
};
#2
07/30/2007 (11:55 am)
I tend to get overly technical, sorry ahead of time:

I have found the culprit !
*This is all to blame on the "reloadmaterials" function (and myself for trusting it's functionality).*
I was attempting to use the function to test material changes and of course...once the issue started, it would not change/fix until the exe was restarted (but only after removing the ill-working syntax lines).
-> It seems that the engine will only allow certain syntax/elements to change-in-render form while using the reloadmaterials function. It does/will not fully utilize all of the material changes.

If I had to blame a specific 'setup' for this thread's issue, I would guess that it is the use of transparency + a bump + pixelspecular in the same material-block.

Example: [[WARNING: do not use this unless you want the same problem]]
new Material(mflowers1)
{
baseTex[0] = "flowers1";
bumpTex[0] = "./alphasn/flowers1n";
translucent[0] = true;
pixelSpecular[0] = true;
specular[0] = "1.0 1.0 1.0 1";
specularPower[0] = 32.0;
translucentZWrite = true;
alphaTest = true; // default value
alphaRef = 150; // alpha less than 128 in brightness (255 is max) will not be rendered
emissive[0] = true;
glow[0] = false;
};

I have since changed the material file and fixed the issue. Thanks for trying to help me with your reply John. ;)

1 more thing John: do you have an example material that has 3 different layers scrolling in 3 different directions ?
...I can only get the base texture layer to scroll all of the layers in 1 direction. Would I have to write HLSL and give it to our programmer ? ((I mean, this should be a base function IMO, Q3 had this capability in 1999)

I hope you can help me on this one as the TSEMaterials-PDF is a bit outdated/unexplained in sections.

- Cheers