예제 #1
0
        private LightShaderGroupDynamic FindOrCreateLightShaderGroup(LightGroupKey lightGroupKey, ProcessLightsParameters parameters)
        {
            LightShaderGroupDynamic lightShaderGroup;

            // Check to see if this combination of parameters has already been stored as a group:
            if (!lightShaderGroupPool.TryGetValue(lightGroupKey, out lightShaderGroup))
            {
                // If a group with the same key has not already been added, create it:
                ILightShadowMapShaderGroupData    shadowMapGroupData         = CreateShadowMapShaderGroupData(lightGroupKey.ShadowRenderer, lightGroupKey.ShadowType);
                ITextureProjectionShaderGroupData textureProjectionGroupData = CreateTextureProjectionShaderGroupData(lightGroupKey.TextureProjectionRenderer);

                lightShaderGroup = new SpotLightShaderGroup(parameters.Context.RenderContext, shadowMapGroupData, textureProjectionGroupData);
                lightShaderGroup.SetViews(parameters.Views);

                lightShaderGroupPool.Add(lightGroupKey, lightShaderGroup);
            }

            return(lightShaderGroup);
        }
예제 #2
0
        private ITextureProjectionShaderGroupData CreateTextureProjectionShaderGroupData(ITextureProjectionRenderer textureProjectionRenderer)
        {
            ITextureProjectionShaderGroupData textureProjectionShaderGroupData = textureProjectionRenderer?.CreateShaderGroupData();

            return(textureProjectionShaderGroupData);
        }
예제 #3
0
 public SpotLightShaderGroup(RenderContext renderContext, ILightShadowMapShaderGroupData shadowGroupData, ITextureProjectionShaderGroupData textureProjectionShaderGroupData)
     : base(renderContext, shadowGroupData)
 {
     TextureProjectionShaderGroupData = textureProjectionShaderGroupData;
 }