/// <summary> /// Draws the resulting light composition /// </summary> /// <param name="graphics">Graphics device</param> /// <param name="effect">Effect</param> public void DrawResult(Graphics graphics, EffectDeferredComposer effect) { var effectTechnique = effect.DeferredCombineLights; for (int p = 0; p < effectTechnique.PassCount; p++) { graphics.EffectPassApply(effectTechnique, p, 0); graphics.DrawIndexed(this.screenGeometry.IndexCount, this.screenGeometry.Offset, 0); } }
/// <summary> /// Draws a spot light /// </summary> /// <param name="graphics">Graphics device</param> /// <param name="effect">Effect</param> public void DrawSpot(Graphics graphics, EffectDeferredComposer effect) { var geometry = this.spotLightGeometry; this.SetRasterizerStencilPass(); this.SetDepthStencilVolumeMarking(); graphics.ClearDepthStencilBuffer(graphics.DefaultDepthStencil, false, true); this.DrawSingleLight(graphics, geometry, effect.DeferredSpotStencil); this.SetRasterizerLightingPass(); this.SetDepthStencilVolumeDrawing(); this.DrawSingleLight(graphics, geometry, effect.DeferredSpotLight); }