private void DrawShadow <K, V>(AbstractRenderer3D <K, V> renderer) where V : IRenderable3D { // Skeletons use a custom shadow shader (since skeletal vertices are transformed differently). var shadowShader = renderer.ShadowShader ?? shadowMapShader; shadowShader.Use(); renderer.PrepareShadow(); List <V> items; while ((items = renderer.RetrieveNext()) != null) { foreach (V item in items) { // Even if the object doesn't cast a shadow, its world matrix is recomputed here for use during // normal rendering. item.RecomputeWorldMatrix(); if (!item.IsShadowCaster) { continue; } shadowShader.SetUniform("lightMatrix", Light.Matrix * item.WorldMatrix); renderer.Draw(item, null); } } }
private void Draw <K, V>(AbstractRenderer3D <K, V> renderer) where V : IRenderable3D { renderer.Prepare(); List <V> items; while ((items = renderer.RetrieveNext()) != null) { foreach (V item in items) { renderer.Draw(item, VpMatrix); } } }