Game Development Community

Beta 5: Player not casting shadow with advanced lighting (not a bug)

by Matt Kronyak · in Torque 3D Professional · 08/10/2009 (5:30 pm) · 6 replies

When Advanced Lighting is enabled everything in the scene casts a shadow except the player (whether in first or third person). The image mounted to the player (the weapon) DOES cast a shadow. If I switch to basic lighting, the player shadow appears again.

#1
08/10/2009 (6:29 pm)
@Matt, just FYI, Tom mentioned this earlier today here in the office. A field for specifying what stuff does and doesn't cast shadows was hooked up, and I guess it's not on by default for the player itself, thus the player shadow has the weapon but no actual character.

I can't do an update at the moment, or I'd find out some specifics for you, but I just wanted to give a heads up that this is easily fixed (or should be, I think).
#2
08/10/2009 (6:58 pm)
thx for the heads up Ross.
#3
08/10/2009 (7:51 pm)
Ross, thanks for the info.


I believe I found the datablock property that needs to be changed:
shadowEnable

which is defined in ShapeBaseData.

I set shadowEnable=true; on the player datablock(s) although its still not casting a shadow. If I echo the datablock.shadowEnable from the console it is definitely set as 1.

shadowEnable is set to true on PlayerData by the way (and nearly every other ShapeBaseData derived class), but ShapeBaseData itself appears to initialize it as false.

It could be that I'm on the wrong path, but I'm following this route a bit further.
#4
08/10/2009 (7:53 pm)
Matt, it's a property on the material, not on the shape.
#5
08/10/2009 (8:02 pm)
Ah ha, found it. Thanks Pat.

The property is castShadows on the material. The material editor supports this property being edited. The Gideon character was simply missing this property.
#6
08/11/2009 (5:45 am)
Actually the Gideon character wasn't missing this property when I went into the editor to look. The checkmark was marked for cast shadow but it wasn't until after I had unchecked it and checked it again that the shadow appeared. Not really a serious problem as it works fine now.