2 using SiliconStudio.Paradox.Effects;
3 using SiliconStudio.Paradox.Engine;
4 using SiliconStudio.Paradox.EntityModel;
5 using SiliconStudio.Paradox.Games;
6 using SiliconStudio.Core;
8 namespace ScriptShader.Effects
14 private IRenderSystem renderSystem;
20 : base(new
PropertyKey[] { LightShaftsComponent.Key, LightComponent.Key })
22 this.mainPlugin = mainPlugin;
23 this.mainTargetPlugin = mainTargetPlugin;
24 this.lightShaftsPass = lightShaftsPass;
29 renderSystem = Services.GetSafeServiceAs<IRenderSystem>();
43 var shadowMapPermutation = data.LightComponent.Get(LightProcessor.ShadowMapKey);
45 data.CurrentShadowMapPermutation = shadowMapPermutation;
46 if (shadowMapPermutation != null)
53 RenderTarget = mainTargetPlugin.RenderTarget,
54 DepthStencil = mainTargetPlugin.DepthStencil,
55 ViewParameters = mainPlugin.ViewParameters,
57 data.LightShaftsPlugin.BoundingBoxes.AddRange(data.LightShaftsComponent.LightShaftsBoundingBoxes);
59 renderSystem.RenderPassPlugins.Add(data.LightShaftsPlugin);
67 renderSystem.RenderPassPlugins.Remove(data.LightShaftsPlugin);
68 data.LightShaftsPlugin = null;
74 foreach (var matchingEntity
in enabledEntities)
76 var lightShaftsComponent = matchingEntity.Value.LightShaftsComponent;
77 var lightShaftsPlugin = matchingEntity.Value.LightShaftsPlugin;
82 EntityReadd(matchingEntity.Key);
85 if (lightShaftsPlugin != null)
override void OnEntityRemoved(Entity entity, AssociatedData data)
Add a light to an Entity, that will be used during rendering.
Game entity. It usually aggregates multiple EntityComponent
Entity processor, triggered on various EntitySystem events such as Entity and Component additions and...
override void OnEntityAdded(Entity entity, AssociatedData data)
override void OnSystemAdd()
LightShaftsComponent LightShaftsComponent
SiliconStudio.Core.Mathematics.Color Color
override AssociatedData GenerateAssociatedData(Entity entity)
Plugin used for the main rendering view.
static PropertyKey< LightComponent > Key
Level10 render pass using a depth buffer and a render target.
ShadowMapPermutation CurrentShadowMapPermutation
static readonly PropertyKey< ShadowMapPermutation > ShadowMapKey
RenderPass is a hierarchy that defines how to collect and render meshes.
A class that represents a tag propety.
LightComponent LightComponent
LightShaftsPlugin LightShaftsPlugin
LightShaftsProcessor(MainPlugin mainPlugin, RenderTargetsPlugin mainTargetPlugin, RenderPass lightShaftsPass)