I'm trying to get shadow casting working and I must be doing something wrong because regardless of what I try I cannot get shadows to draw. I found another thread (I don't have permission to post links, it's titled "UrhoSharp - Is casting shadows possible?") with a similar question, but the advice there hasn't helped me.
I'm using a point light configured as
cursorLight = LightNode.CreateComponent<Light>(); cursorLight.LightType = LightType.Point; cursorLight.Color = Color.White; cursorLight.Range = (.02f); cursorLight.ShadowIntensity = .5f; cursorLight.Brightness = 3f; cursorLight.CastShadows = true; cursorLight.ShadowBias = new BiasParameters(0.00025f, 0.5f); cursorLight.ShadowCascade = new CascadeParameters(10.0f, 50.0f, 200.0f, 0.0f, 0.8f); cursorLight.SpecularIntensity = 2f;
I'm testing with two box primitives.
var testBox = Scene.CreateChild(); testBox.SetWorldPosition(new Vector3(0, 0, 1f)); testBox.SetScale(.04f); var testBoxModel = testBox.CreateComponent<StaticModel>(); testBoxModel.CastShadows = true;
Additionally, I configured my renderer based on some of what I saw on GitHub and around Google results for this problem.
Renderer.ShadowMapSize *= 4;
Renderer.DrawShadows = true;
I can see the specular highlight of the light on the boxes, so I know it the light is working. But I cannot see a shadow. I expect the smaller box in front to cast a shadow on the box behind it. The front of the box lights properly, and the sides are darker, as I'd expect. But it does not project a shadow onto the geometry behind it. I've tried cranking the range on the light up much higher and that has no effect other than increasing the size of the specular highlight.
This is a HoloLens project. Are there known issues casting shadows using UrhoSharp in the HoloLens? I haven't encountered a problem like that yet. Something unusual I've noticed is that my lit textures appear illuminated from the front as if the scene has a directional light, but there are no other lights in my project. You can see in the screenshot that the front faces of the cubes appear more illuminated the other faces. Moving around the cubes etc doesn't alter this illumination. I experimented with placing my test shadow caster on one of the sides that is less illuminated, but that had no effect on the problem. I'm at my wit's end with this one - both the mysterious front illumination and the shadow problem. I'll be extremely grateful if anyone has an idea!
Edit: I "have to be around a little while longer to post links." I would like to share two imgur screenshots of this issue. Please let me know what to do in order to do that or send me a PM and I will send you the link. The slugs for the i.imgur URL of the images are AZVcbEn.png and E8fAG08.png.