protected override void Init(PipelineResources resources)
 {
     proper = RenderPipeline.GetEvent <PropertySetEvent>();
     if (useTBDR)
     {
         minMaxBoundMat = new Material(resources.shaders.minMaxDepthBounding);
     }
     needCheckedShadows = new NativeList <ShadowAvaliable>(20, Allocator.Persistent);
     cbdr = new CBDRSharedData(resources);
     for (int i = 0; i < cascadeShadowMapVP.Length; ++i)
     {
         cascadeShadowMapVP[i] = Matrix4x4.identity;
     }
     cubeDepthMaterial = new Material(resources.shaders.cubeDepthShader);
     spotBuffer        = new RenderSpotShadowCommand();
     spotBuffer.Init(resources.shaders.spotLightDepthShader);
     whiteTex = new Texture2DArray(1, 1, 1, TextureFormat.ARGB32, false, false);
     whiteTex.SetPixels(new Color[] { Color.white }, 0);
     if (iesTextures.Length > 0)
     {
         ComputeShader texCopyShader = resources.shaders.texCopyShader;
         iesAtlas = new RenderTexture(new RenderTextureDescriptor
         {
             colorFormat       = RenderTextureFormat.R8,
             dimension         = TextureDimension.Tex2DArray,
             width             = 256,
             height            = 1,
             volumeDepth       = iesTextures.Length,
             enableRandomWrite = true,
             msaaSamples       = 1
         });
         ((RenderTexture)iesAtlas).Create();
         UpdateIESTexture(texCopyShader);
     }
 }
 protected override void Init(PipelineResources resources)
 {
     cbdr = new CBDRSharedData(resources);
     for (int i = 0; i < cascadeShadowMapVP.Length; ++i)
     {
         cascadeShadowMapVP[i] = Matrix4x4.identity;
     }
     cubeDepthMaterial = new Material(resources.shaders.cubeDepthShader);
     spotBuffer        = new RenderSpotShadowCommand();
     spotBuffer.Init(resources.shaders.spotLightDepthShader);
 }
Beispiel #3
0
 protected override void Init(PipelineResources resources)
 {
     proper = RenderPipeline.GetEvent <PropertySetEvent>();
     if (useTBDR)
     {
         minMaxBoundMat = new Material(resources.shaders.minMaxDepthBounding);
     }
     needCheckedShadows = new NativeList <ShadowAvaliable>(20, Allocator.Persistent);
     cbdr = new CBDRSharedData(resources);
     for (int i = 0; i < cascadeShadowMapVP.Length; ++i)
     {
         cascadeShadowMapVP[i] = Matrix4x4.identity;
     }
     cubeDepthMaterial = new Material(resources.shaders.cubeDepthShader);
     spotBuffer        = new RenderSpotShadowCommand();
     spotBuffer.Init(resources.shaders.spotLightDepthShader);
     lightingMaterial = new Material(resources.shaders.lightingShader);
 }
Beispiel #4
0
        protected override void Init(PipelineResources resources)
        {
            cbdr             = PipelineSharedData.Get(renderPath, resources, (a) => new CBDRSharedData(a));
            shadMaskMaterial = new Material(resources.shadowMaskShader);
            for (int i = 0; i < cascadeShadowMapVP.Length; ++i)
            {
                cascadeShadowMapVP[i] = Matrix4x4.identity;
            }
            pointLightMaterial = new Material(resources.pointLightShader);
            cubeDepthMaterial  = new Material(resources.cubeDepthShader);
            Vector3[]             vertices    = resources.sphereMesh.vertices;
            int[]                 triangle    = resources.sphereMesh.triangles;
            NativeArray <Vector3> allVertices = new NativeArray <Vector3>(triangle.Length, Allocator.Temp, NativeArrayOptions.UninitializedMemory);

            for (int i = 0; i < allVertices.Length; ++i)
            {
                allVertices[i] = vertices[triangle[i]];
            }
            sphereBuffer = new ComputeBuffer(allVertices.Length, sizeof(Vector3));
            sphereBuffer.SetData(allVertices);
            allVertices.Dispose();
            spotBuffer = new RenderSpotShadowCommand();
            spotBuffer.Init(resources.spotLightDepthShader);
        }
Beispiel #5
0
 public static void DrawSpotLight(CommandBuffer buffer, ComputeShader cullingShader, ref PipelineCommandData data, Camera currentCam, ref SpotLight spotLights, ref RenderSpotShadowCommand spotcommand, bool inverseRender)
 {
     ref SpotLightMatrix spotLightMatrix = ref spotcommand.shadowMatrices[spotLights.shadowIndex];
Beispiel #6
0
 public static void DrawSpotLight(MLight mlight, int mask, ComputeShader cullingShader, ref PipelineCommandData data, ref SpotLight spotLights, ref RenderSpotShadowCommand spotcommand, bool inverseRender, Material opaqueOverride, NativeList_Int culledResult)
 {
     if (mlight.ShadowIndex < 0)
     {
         return;
     }
     CommandBuffer       buffer          = data.buffer;
     ref SpotLightMatrix spotLightMatrix = ref spotcommand.shadowMatrices[spotLights.shadowIndex];
Beispiel #7
0
 public static void DrawSpotLight(ref RenderClusterOptions options, ref PipelineCommandData data, Camera currentCam, ref SpotLight spotLights, ref RenderSpotShadowCommand spotcommand)
 {
     ref SpotLightMatrix spotLightMatrix = ref spotcommand.shadowMatrices[spotLights.shadowIndex];
Beispiel #8
0
 public static void DrawSpotLight(CommandBuffer buffer, MLight mlight, int mask, ComputeShader cullingShader, ref PipelineCommandData data, Camera currentCam, ref SpotLight spotLights, ref RenderSpotShadowCommand spotcommand, bool inverseRender, Material opaqueOverride)
 {
     if (mlight.ShadowIndex < 0)
     {
         return;
     }
     ref SpotLightMatrix spotLightMatrix = ref spotcommand.shadowMatrices[spotLights.shadowIndex];