public void RenderAllInstancesWithShadows(CascadedShadowMap shadowMap, Matrix view, Matrix projection, Light light) { if (mWithShadowsConfigurer != null) { foreach (RendererParameters instance in mInstances) { RenderWithShadows(shadowMap, view, projection, light, instance); } } }
protected void RenderWithShadows(CascadedShadowMap shadowMap, Matrix view, Matrix projection, Light light, RendererParameters instance) { DrawGeometry(view, projection, new object[] { shadowMap, light }, mWithShadowsConfigurer, instance); }
/// <summary> /// Instantiates scene light sources and shadow manager. /// </summary> private static void CreateLightsAndShadows() { mDirectionalLight = new Light( Vector3.Normalize(new Vector3(0.4233333f, 1.0f, -0.5533332f)), // Direction Vector3.Zero, // Gaze new Vector3(0.05333332f, 0.09882354f, 0.1819608f), // Ambient Color new Vector3(1, 0.9607844f, 0.8078432f), // Diffuse Color new Vector3(1, 0.9607844f, 0.8078432f) // Specular Color ); mShadowMap = new CascadedShadowMap(mDevice, 2048); }