Game Development Community

ScatterSky doesn't cast shadows

by Smelly McBeard · in Torque 3D Professional · 06/29/2009 (2:08 pm) · 16 replies

Hey folks, I'm having an issue when I create a ScatterSky sun not casting shadows. I'm losing most of my normal map bump on my textures as well. Any help would be great.

Thanks


#1
06/29/2009 (2:32 pm)
It should cast shadows, you may just may need to tweak some of the ScatterSky settings (i.e brightness, shadow softness, etc...), unless there's something else going on.
#2
06/29/2009 (4:39 pm)
Increase the brightness under Lighting, and reduce the skyBrightness a little.
#3
06/29/2009 (5:40 pm)
I have 2 questions on this as well:

1. Am I correct to assume that with ScatterSky on, you don't need a sun object?

2. Is there any reason why shadows would cast on all objects, but not from my player?
#4
06/29/2009 (5:49 pm)
I've the same prob as steve.

TSStatic correctly cast shadows.
But the characters don't, but they are affected by the TSStatic dynamic shadow

With Beta 2 this worked from what I remember. Has there something changed on the scattersky related settings or the player / shapebase settings?
#5
06/30/2009 (2:25 am)
In beta 1 my character recieved shadows but then beta 2 he no longer had a shadow cast. I've yet to have time to port to Beta 3
#6
06/30/2009 (10:10 am)
Beta 3 has some flags on the lights (scatterSky included) that allow you to disable shadow rendering for dynamic and static objects. Check the world editor, this is likely the problem.

And yes, scatterSky is a combined sky+sun solution. You shouldn't have another sun.
#7
06/30/2009 (11:27 am)
Thanks for replying to my question about the sun object, Manoel.
In regards, however, to your suggestion on checking the flags in scattersky, I don't think this is the source of the problem. I have the following settings checked: cast shadows / shadow static geometry / shadow dynamic geometry / light dynamic geometry / light static geometry diffuse / light static geometry specular and I still can't get my player to cast a shadow.
#8
06/30/2009 (1:02 pm)
Ah! Then your player material might be alpha-blended, but doesn't have the translucent Z-write enabled. Translucent objects don't write do depth buffer by default, and without depth they cannot cast shadows.
#9
07/01/2009 (5:46 am)
uh...ok. If I never altered the player material, where would I find said material to check if it is alpha-blended? I still think there is a bug here, because what is happening is that the player does cast a shadow, but when I start playing around with switching from sun to scattersky or back and forth from basic lighting to see how things look, he loses his shadow.
#10
07/01/2009 (7:11 am)
Manoel, I actually don't think that flag is checked (which may be a bug) for shadow rendering. If the object is flagged as translucent it doesn't render in the shadow map.
#11
07/01/2009 (7:30 am)
@Steve: check the material editor.
#12
07/01/2009 (1:51 pm)
I don't know how to bring up the player in the material editor, and he is the only object not casting shadows. Furthermore, he casts shadows if I switch to basic lighting, so wouldn't that mean he is not alpha-blended?
#13
07/01/2009 (3:31 pm)
Switch to the free camera (ALT+C), select your player and open the material editor. It should show your player's material.

The basic lighting shadows are just projected circles and are object based. Advanced lighting uses shadow mapping, which writes the scene depth to a textures drawn from the light's point of view, and then uses that texture to check whether things are shadowed or not.

Semi-translucent objects don't write to the depth, since the very concept of a depth buffer goes against the idea behind translucency. So they don't get depth-based shadows.
#14
07/01/2009 (4:40 pm)
That does not help
Even if you use common players that come with T3D like the boombot it does not work.
#15
07/01/2009 (5:20 pm)
On the contrary...
i167.photobucket.com/albums/u143/heretek/torque/playerShadows.jpg
Hmm -- it certainly appears to be working for me, with the common default player shapes even :D

EDIT: and just to show the sky. All I did was to delete the skybox and the sun, and then add a ScatterSky to the template mission.
i167.photobucket.com/albums/u143/heretek/torque/screenshot_002-00001-3.png
#16
07/01/2009 (7:37 pm)
@Manoel -- thanks for teaching me that.

@Michael -- I don't think that the fact that it works for you is really the issue. After all, it obviously works for most people, or it would immediately be flagged a bug, and that would be that. I guess it is also true that Marc should have said it didn't work for him, instead of making a blanket claim that it didn't work. The real issue in my mind, is are we dealing with a bug that *some* people have or is it just "operator error".

Well, if it is operator error, I still need to know how to fix it.

I admit I am not too familiar with the material editor, and the official docs seem to be down now. I tried to set Gideon's material properties to exactly what they were in Warrior Camp. However, it seems that whenever I open Gideon's material to edit it, cast shadows is not set. I can not seem to save it set, even though i click the box. Everytime I save and re-enter the level, Gideon's cast shadow box is un-checked.

Also, I did not create a new project, if that is relevant. I opened up blank room, and added stuff to that one.

Lastly, Gideon (as I recollect) did cast shadows initially. Before I knew what I was doing, I had a sun object as well as scattersky on. Since then, no matter what I do, i can not get him to cast shadows.

I suppose I could just delete the whole level and start from scratch, but that seems a bit drastic.