[resolved] Terrain Not Casting Shadows in 1.1A (stock)
by Henry Todd · in Torque 3D Professional · 01/13/2010 (3:30 am) · 18 replies
Is this a known issue? Hard to believe I didn't notice it until now... the terrain seems to no longer cast shadows.
I initially assumed this must have been something I'd done, so I installed a fresh copy of 1.1, loaded the terrain demo level in the FPS example, dropped the sun to low altitude, and there were no terrain shadows.
To be clear, objects are casting shadows onto the terrain normally, but the terrain itself won't cast shadows onto itself or other objects under any conditions. Tested scattersky and several variations on placed lights.
I couldn't find any obvious changes in the terrain code or the shadow code, but this isn't exactly something I'm an expert in. Is it possible the terrain material is being incorrectly generated with cast shadows disabled?
I initially assumed this must have been something I'd done, so I installed a fresh copy of 1.1, loaded the terrain demo level in the FPS example, dropped the sun to low altitude, and there were no terrain shadows.
To be clear, objects are casting shadows onto the terrain normally, but the terrain itself won't cast shadows onto itself or other objects under any conditions. Tested scattersky and several variations on placed lights.
I couldn't find any obvious changes in the terrain code or the shadow code, but this isn't exactly something I'm an expert in. Is it possible the terrain material is being incorrectly generated with cast shadows disabled?
About the author
Recent Threads
#2
I'm going to start winmerging stock 1.0.1 with stock 1.1, see what I can find, and report back tomorrow if there haven't been any updates here.
01/13/2010 (4:35 am)
I'm thinking most of those are leftovers from the TGE lighting system. I just tried deleting every scripted value on one of my terrains from 1.0.1, it had no effect (terrain still was casting shadows).I'm going to start winmerging stock 1.0.1 with stock 1.1, see what I can find, and report back tomorrow if there haven't been any updates here.
#3
Is this a consistant bug everyone else is getting? Any chance this is already fixed in 1.1B and I'm simply wasting my time?
Win7, GF GTX 285, Intel Q9560, 4 gig RAM. Just for the record.
01/16/2010 (5:28 am)
Double posting for bump (not sure how many people are actually checking sub-sections like 1.1 bugs). I've done a bit of searching in WinMerge, and I've yet to spot anything that really sticks out. It's probably something blatantly obvious I'm completely skipping, or a file I've neglected to open. :PIs this a consistant bug everyone else is getting? Any chance this is already fixed in 1.1B and I'm simply wasting my time?
Win7, GF GTX 285, Intel Q9560, 4 gig RAM. Just for the record.
#4
For another record:
XP, 4 gig Ram, NVIDIA GF9800
01/16/2010 (4:48 pm)
I have tried WinMerge too, but I also did not find anything.For another record:
XP, 4 gig Ram, NVIDIA GF9800
#6
01/17/2010 (6:43 am)
If this get fixed wouldn't mind a delta. Would be nice to put as an option :-).
#7
@Henry:
Have you made some progress yet?
01/25/2010 (5:00 am)
This weekend I started to look at the changed files, but still no success.@Henry:
Have you made some progress yet?
#8
I'm trying to figure out... is there a base material the terrain mats all derive from, or feed into? Not a TerrainMaterial, but an actual material that would have the "castShadows" flag, possibly hard-coded to false somewhere.
I don't have all the betas installed anymore, which is unfortunate, because I'd like to see if this issue showed up when the castShadows option moved to materials. I've been busy, but I'll give this another pass as soon as I can.
02/05/2010 (2:21 am)
I've still got nothing here. All this modern rendering code is reminding me that it's time to update myself a bit... this modern D3D shader pipeline stuff is a little more cryptic than the old pre-shader OpenGL code I used to know so well. Either way I can't see anything that stands out, so it might be time to actually ::gulp:: step-by-step debug the terrain render code.I'm trying to figure out... is there a base material the terrain mats all derive from, or feed into? Not a TerrainMaterial, but an actual material that would have the "castShadows" flag, possibly hard-coded to false somewhere.
I don't have all the betas installed anymore, which is unfortunate, because I'd like to see if this issue showed up when the castShadows option moved to materials. I've been busy, but I'll give this another pass as soon as I can.
#9
But I personally wouldn't waste any time on it on the Alpha. Wait at least till the beta until you break your head.
Also I would likely start out with the terrain code and the used detail level for shadow generation. That caused incorrect shadows in the beta already.
02/05/2010 (2:25 am)
As at least 1.0.1 did correctly cast realtime shadow, so whatever potentially has changed, it would had to happen between that time.But I personally wouldn't waste any time on it on the Alpha. Wait at least till the beta until you break your head.
Also I would likely start out with the terrain code and the used detail level for shadow generation. That caused incorrect shadows in the beta already.
#10
I will give it a try this weekend.
02/05/2010 (4:25 am)
Quote:Also I would likely start out with the terrain code and the used detail level for shadow generation.
I will give it a try this weekend.
#11
02/05/2010 (3:11 pm)
I would check shaders, All shadows are working on my terrain in Both lighting versions, I have an AMD Quad, and an ATI 4870 1GB, with the latest DirectX SDK and Drivers. Let me know if I can help:O)
#12
shadows over terrain are working,but terrain does not cast shadows to other meshes.
For example the player enters a dark area,but it is fully lit by the sun.
Terrain shadows are not the only shadow problem - custom materials also does not cast shadows.
Also there is a very interesting bug when using opcode: the player casts its shadow through walls.
02/05/2010 (3:30 pm)
Hi Bobby,shadows over terrain are working,but terrain does not cast shadows to other meshes.
For example the player enters a dark area,but it is fully lit by the sun.
Terrain shadows are not the only shadow problem - custom materials also does not cast shadows.
Also there is a very interesting bug when using opcode: the player casts its shadow through walls.
#13
@Bobby: And yeah, again for clarification, the problem here is that terrain does not cast shadows (either to itself or onto other meshes), not that it doesn't receive them. You'll have to set up a pretty steep light angle on a sharp bit of terrain to see what's missing.
@Marc: Normally I'd agree, but Tom's already been in here to point out that he's watching, which suggests there hasn't been any internal fix on this yet.
02/05/2010 (5:12 pm)
Ivan, I think you might have hit the issue: if custom material don't cast shadows, that's likely the issue. I assume the terrain assembles its TerrainMaterial's into a custom material (more than 1?), since the terrain system's output would be too complex to simply work with the standard material system. I'll take a look at the code that handles custom materials when I start digging into this later today.@Bobby: And yeah, again for clarification, the problem here is that terrain does not cast shadows (either to itself or onto other meshes), not that it doesn't receive them. You'll have to set up a pretty steep light angle on a sharp bit of terrain to see what's missing.
@Marc: Normally I'd agree, but Tom's already been in here to point out that he's watching, which suggests there hasn't been any internal fix on this yet.
#14
02/05/2010 (7:06 pm)
Wish I had more time but i writing a program for Direct input for this weeks class and its a nightmare, but Ill look through the lighting code for the terrain if I get a chance, and information you find please post as i would like to help if I can for just the sake of learning to use the debugger more:O)
#15
02/13/2010 (1:07 pm)
Appears to be fixed in 1.1 beta 1. I suppose we'll never know what was broken. =)
#16
I'm not seeing the difference.
I've created a steep hill, stood (in 3rd person) behind it in the light, run into the shadowed area, and not seen the lighting change on my player model (from 3rd person).
HUGE EDIT FFFFFFUUUUU-
Okay, having said that I noticed that my lighting had defaulted to something called "custom", when I swapped it for "high", yes it is indeed fixed.
Well done all.
retreats sheepishly into the corner to lick his wounds!
02/13/2010 (5:32 pm)
@HenryI'm not seeing the difference.
I've created a steep hill, stood (in 3rd person) behind it in the light, run into the shadowed area, and not seen the lighting change on my player model (from 3rd person).
HUGE EDIT FFFFFFUUUUU-
Okay, having said that I noticed that my lighting had defaulted to something called "custom", when I swapped it for "high", yes it is indeed fixed.
Well done all.
retreats sheepishly into the corner to lick his wounds!
#17
06/06/2010 (1:02 pm)
Logged as TQA-245.
#18
06/10/2010 (12:48 pm)
Confirmed as fixed for 1.1 Beta2.
Richard Marrevee
R.G.S - Richards Game Studio