Shadow size and Shadow render distance
by Caylo Gypsyblood · in Torque Game Engine · 12/06/2006 (11:56 pm) · 9 replies
In one of my missions i have creatures in trees, and im wanting the shadow cast from them to be the only clue the player have that the creatures are in the trees. (untill they look up...)
Some of my tree branches are over 300 units off the ground, and at this hight there are no shadows reaching the ground. How do i change the distance a shadow is cast?
Then for some of the lower branches, if the shadow DO reach the ground, it is very small. How can i make it stop shrinking the shadow after it reach a set size?
I already changed Shadow::smSmallestVisibleSize for rendering smaller shadows, but thats not relay ALL i need. Also i changed smGenericRadiusSkew = 0.8f; hoeing to get the generic shadow to be bigger...
Some of my tree branches are over 300 units off the ground, and at this hight there are no shadows reaching the ground. How do i change the distance a shadow is cast?
Then for some of the lower branches, if the shadow DO reach the ground, it is very small. How can i make it stop shrinking the shadow after it reach a set size?
I already changed Shadow::smSmallestVisibleSize for rendering smaller shadows, but thats not relay ALL i need. Also i changed smGenericRadiusSkew = 0.8f; hoeing to get the generic shadow to be bigger...
#2
It seems that a F32 shadowLen up to 20.0f work fine.
Is there any other way to increase the distance a shadow will render? As stated in my first post, i need shadows to render to the ground from a high distance.
02/22/2007 (2:29 pm)
F32 shadowLen = 50.0f * mShapeInstance->getShape()->radius; Will cause a crash with dynamic shape mesh, (the ones that use a datablock, and scope alwasy). I have not found any other way to make a shadow render for more distance.It seems that a F32 shadowLen up to 20.0f work fine.
Is there any other way to increase the distance a shadow will render? As stated in my first post, i need shadows to render to the ground from a high distance.
#3
Is there any other way to increase the distance a shadow will render? As stated in my first post, i need shadows to render to the ground from a high distance.
Some of my tree branches are over 300 units off the ground, and at this hight there are no shadows reaching the ground. How do i change the distance a shadow is cast?
Then for some of the lower branches, if the shadow DO reach the ground, it is very small. How can i make it stop shrinking the shadow after it reach a set size?
02/23/2007 (11:22 am)
In my fear that the weekend is coming quick, i do hope i can solve this problem before another week slithers by..Is there any other way to increase the distance a shadow will render? As stated in my first post, i need shadows to render to the ground from a high distance.
Some of my tree branches are over 300 units off the ground, and at this hight there are no shadows reaching the ground. How do i change the distance a shadow is cast?
Then for some of the lower branches, if the shadow DO reach the ground, it is very small. How can i make it stop shrinking the shadow after it reach a set size?
#4
02/26/2007 (6:24 pm)
I have been unable to replicate the crash. I have used various values from 10-50, but it all seems to work. Did you make any other changes elsewhere that could possible be conflicting?
#5
The crash takes place when using dynamic lights NEAR the dynamic shape mesh, (the ones that use a data block, and scope always shapes)- something i see i failed to mention.
I found this small bug when firing a projectile with a light radius of 15 near an data block defined StaticShape. Durring the debugging proses, I found that returning F32 shadowLen = to no more then 20 will not crash.
02/26/2007 (7:26 pm)
Actually yes. Many changes. But I have systematically removed every edit placing it back to SDK defaults. The crash takes place when using dynamic lights NEAR the dynamic shape mesh, (the ones that use a data block, and scope always shapes)- something i see i failed to mention.
I found this small bug when firing a projectile with a light radius of 15 near an data block defined StaticShape. Durring the debugging proses, I found that returning F32 shadowLen = to no more then 20 will not crash.
#6
The offending object, is it larger than your typical object?
02/27/2007 (5:48 pm)
When the game crashes, where does the debugger stop? The offending object, is it larger than your typical object?
#7
02/28/2007 (8:42 am)
Hmm, i have never been able to get a de-bug build to work. And the offending object is anything- including shapes from the TLK demo.
#8
It's important to have the debugger working as it is a vital tool for finding crashes such as these and other problems.
02/28/2007 (3:01 pm)
Can you not get the debug build to compile, does the game crash while debugging or does it give you an error about not finding main.cs?It's important to have the debugger working as it is a vital tool for finding crashes such as these and other problems.
#9
02/28/2007 (4:10 pm)
I can not speak for Caylo, but he is probably using TGEA. If that is the case then removing Torque_Debug from the preprocessor defines will make your debug builds again. You get less Torque debugging aids, but at least you can now debug.
Torque 3D Owner Caylo Gypsyblood
F32 shadowLen = 10.0f * mShapeInstance->getShape()->radius;
I place a 50.0f in place of the 10.0f and now i get a shadow from farther away.
I would still like to know how to stop the shadow from getting smaller at greater distance. Im not too worried about the 'realism' of it, if i could stop the shadow shrinking at 1/3 scale would be nice.