public void Initialize(LightComponent lightComponent, IDirectLight light, LightShadowMap shadowMap, int size, ILightShadowMapRenderer renderer) { if (lightComponent == null) { throw new ArgumentNullException("lightComponent"); } if (light == null) { throw new ArgumentNullException("light"); } if (shadowMap == null) { throw new ArgumentNullException("shadowMap"); } if (renderer == null) { throw new ArgumentNullException("renderer"); } LightComponent = lightComponent; Light = light; Shadow = shadowMap; Size = size; FilterType = Shadow.Filter == null || !Shadow.Filter.RequiresCustomBuffer() ? null : Shadow.Filter.GetType(); Renderer = renderer; Atlas = null; // Reset the atlas, It will be setup after ShadowType = renderer.GetShadowType(Shadow); }
public void Initialize(RenderView renderView, LightComponent lightComponent, IDirectLight light, LightShadowMap shadowMap, int size, ILightShadowMapRenderer renderer) { if (renderView == null) { throw new ArgumentNullException(nameof(renderView)); } if (lightComponent == null) { throw new ArgumentNullException(nameof(lightComponent)); } if (light == null) { throw new ArgumentNullException(nameof(light)); } if (shadowMap == null) { throw new ArgumentNullException(nameof(shadowMap)); } if (renderer == null) { throw new ArgumentNullException(nameof(renderer)); } RenderView = renderView; LightComponent = lightComponent; Light = light; Shadow = shadowMap; Size = size; FilterType = Shadow.Filter == null || !Shadow.Filter.RequiresCustomBuffer() ? null : Shadow.Filter.GetType(); Renderer = renderer; Atlas = null; // Reset the atlas, It will be setup after CascadeCount = 1; ShadowType = renderer.GetShadowType(Shadow); }
public override bool CanRenderLight(IDirectLight light) { var lightPoint = light as LightPoint; if (lightPoint != null) { return(((LightPointShadowMap)lightPoint.Shadow).Type == LightPointShadowMapType.CubeMap); } return(false); }
public override bool CanRenderLight(IDirectLight light) { var pl = light as LightPoint; if (pl != null) { var type = ((LightPointShadowMap)pl.Shadow).Type; return(type == LightPointShadowMapType.DualParaboloid); } return(false); }
public ILightShadowMapRenderer FindRenderer(IDirectLight light) { foreach (var renderer in Renderers) { if (renderer.CanRenderLight(light)) { return(renderer); } } return(null); }
public override LightShadowMapTexture CreateShadowMapTexture(RenderView renderView, RenderLight renderLight, IDirectLight light, int shadowMapSize) { var shadowMap = shadowMaps.Add(); shadowMap.Initialize(renderView, renderLight, light, light.Shadow, shadowMapSize, this); shadowMap.CascadeCount = 2; // 2 faces return(shadowMap); }
public override LightShadowMapTexture CreateShadowMapTexture(RenderView renderView, RenderLight renderLight, IDirectLight light, int shadowMapSize) { var shadowMap = base.CreateShadowMapTexture(renderView, renderLight, light, shadowMapSize); shadowMap.CascadeCount = ((LightDirectionalShadowMap)light.Shadow).GetCascadeCount(); // Views with orthographic cameras cannot use cascades, we force it to 1 shadow map here. if (renderView.Projection.M44 == 1.0f) { shadowMap.ShadowType &= ~(LightShadowType.CascadeMask); shadowMap.ShadowType |= LightShadowType.Cascade1; shadowMap.CascadeCount = (int)LightShadowMapCascadeCount.OneCascade; } return(shadowMap); }
public override bool CanRenderLight(IDirectLight light) { return(light is LightDirectional); }
public override LightShadowMapTexture CreateShadowMapTexture(RenderView renderView, RenderLight renderLight, IDirectLight light, int shadowMapSize) { var shadowMapTexture = base.CreateShadowMapTexture(renderView, renderLight, light, shadowMapSize); shadowMapTexture.CascadeCount = 6; // 6 faces return(shadowMapTexture); }
public override bool CanRenderLight(IDirectLight light) { return(light is LightSpot); }
public void Initialize(LightComponent lightComponent, IDirectLight light, LightShadowMap shadowMap, int size, ILightShadowMapRenderer renderer) { if (lightComponent == null) throw new ArgumentNullException("lightComponent"); if (light == null) throw new ArgumentNullException("light"); if (shadowMap == null) throw new ArgumentNullException("shadowMap"); if (renderer == null) throw new ArgumentNullException("renderer"); LightComponent = lightComponent; Light = light; Shadow = shadowMap; Size = size; FilterType = Shadow.Filter == null || !Shadow.Filter.RequiresCustomBuffer() ? null : Shadow.Filter.GetType(); Renderer = renderer; Atlas = null; // Reset the atlas, It will be setup after ShadowType = renderer.GetShadowType(Shadow); }
public abstract bool CanRenderLight(IDirectLight light);
public virtual LightShadowMapTexture CreateShadowMapTexture(RenderView renderView, RenderLight renderLight, IDirectLight light, int shadowMapSize) { var shadowMap = shadowMaps.Add(); shadowMap.Initialize(renderView, renderLight, light, light.Shadow, shadowMapSize, this); return(shadowMap); }