[2.1] Objects in scene are not casting shadows

Problems building or running the engine, queries about how to use features etc.
Post Reply
ikyle620
Gnoblar
Posts: 16
Joined: Wed Mar 07, 2018 6:26 am

[2.1] Objects in scene are not casting shadows

Post by ikyle620 »

I've gotten maybe 90% of the Forward3D tutorial shoved into the multithreaded tutorial- most specifically I've got the plane, rotating cubes (although they don't rotate just yet), 64 static cubes, directional light, and one of the spot lights. At this point, I can see the directional and spotlight illuminating the scene, but no shadows are being cast, and I can't figure out why.

I initially thought that maybe I had not connected the lights to a correct node, but that ended up not solving the problem- and based on the fact that the spotlight and directional light are actually illuminating things, it probably wasn't anything near that to begin with. When I call createItem and createLight and such, I don't muck with the setCastShadows() stuff, I leave it to the default (which I would think it to be "true" based on the Forward3D tutorial). I mention this because no shadows appear anywhere- its not like the shadows are only missing from the plane, they also don't appear on adjacent static cubes.

I feel like I'm super close- as in, its something like sceneManager->enableShadows(). The only difference that I can tell from the slightly modified working forward3D tutorial i'm running and the porting of it into multithreaded is the use of a different compositor. The multithreaded tutorial ends up using the "Demo Workspace", and does a ->createBasicWorkspaceDef()- will this not allow for me to have shadows? I doubt it, but maybe its worth bringing up. I also use the same sceneManager->setShadowDirectionalLightExtrusionDistance(x) and sceneManager->setShadowFarDistance(y) in both the working and not working versions. It might also be useful to say that I do call setForward3D(), in the createScene01() of my graphicsgamestate.

Is there something I should be looking for? Any magic sceneManager functions I should use, or something of the like? I know this question isn't as direct or precise as my last, but I'm alone in the dark here. Thanks for any help.
xrgo
OGRE Expert User
OGRE Expert User
Posts: 1148
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 168

Re: [2.1] Objects in scene are not casting shadows

Post by xrgo »

yes! that's the problem createBasicWorkspaceDef creates a workspace definition without shadow node. The shadow node specifies how shadows are going to be rendered so you need one, you can use the compositor file of the pbs material sample
Post Reply