gamecreator Posted June 22, 2015 Posted June 22, 2015 Seems like this may have come up before but I can't find a solution on the forums or the documentation. I load a map with a default light. The trees and brush and CSG cast shadows correctly. But when I load a model via code, it does not. I've made sure that in the editor the materials are set to cast shadows and the model has a shadow shader and I set the model's SetShadowMode to Light::Dynamic via code right after I load the model. What could I be missing? Quote
Haydenmango Posted June 23, 2015 Posted June 23, 2015 The only thing I can think of is that your Light is only casting Static shadows. Try to set it to Static+Dynamic or Static+Dynamic+Buffered (if it isn't already), I'm not sure what could be wrong other than that. 1 Quote Check out my game Rogue Snowboarding- https://haydenmango.itch.io/roguesnowboarding
gamecreator Posted June 23, 2015 Author Posted June 23, 2015 Great thought. It was static before so I switched it but the moving model still doesn't cast shadows. I did throw the model into the scene just as a sanity check and the standing model does cast a shadow, both in the editor and in the game. The model is parented to a pivot which is a character controller but that shouldn't matter, right? Quote
nick.ace Posted June 23, 2015 Posted June 23, 2015 The pivot should also have the same lighting properties. All children inherit the lighting properties of the parent. Maybe this is happening? 1 Quote
gamecreator Posted June 23, 2015 Author Posted June 23, 2015 Wow. It was the pivot. When I did pivot->SetShadowMode(Light::Dynamic); the shadow came on (regardless of if I did it with the model itself). Very interesting. I don't remember this being needed before but my memory isn't what it once was. Thanks guys. 3 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.