Пример #1
0
    public void Render(ScriptableRenderContext context, Camera camera, ShadowSetting shadowSettings)
    {
        this.context = context;
        this.camera  = camera;
#if UNITY_EDITOR
        PrepareForBuffer();
        PrepareForSceneWindow();
#endif

        if (!Cull(shadowSettings.maxDistance))
        {
            return;
        }
        buffer.BeginSample(bufferName);
        ExecuteBuffer();
        light.Setup(context, ref cullingResults, shadowSettings);
        buffer.EndSample(bufferName);
        ExecuteBuffer();
        Setup();
        DrawVisibleGeometry();
#if UNITY_EDITOR
        DrawUnsupportedShaders();
        DrawGizmos();
#endif
        light.Cleanup();
        Submit();
    }
    public void Render(
        ScriptableRenderContext context, Camera camera,
        bool useDynamicBatching, bool useGPUInstancing, bool useLightsPerObject,
        ShadowSettings shadowSettings
        )
    {
        this.context = context;
        this.camera  = camera;

        PrepareBuffer();
        PrepareForSceneWindow();
        if (!Cull(shadowSettings.maxDistance))
        {
            return;
        }

        buffer.BeginSample(SampleName);
        ExecuteBuffer();
        lighting.Setup(
            context, cullingResults, shadowSettings, useLightsPerObject
            );
        buffer.EndSample(SampleName);
        Setup();
        DrawVisibleGeometry(
            useDynamicBatching, useGPUInstancing, useLightsPerObject
            );
        DrawUnsupportedShaders();
        DrawGizmos();
        lighting.Cleanup();
        Submit();
    }
Пример #3
0
    public void Render(ScriptableRenderContext context, Camera camera, bool useDynamicBatching, bool useGPUInstancing, ShadowSettings shadowSettings,
                       float defaultShadowBrightness, float brightnessMultiplier, float shadowTreshold)
    {
        this.context = context;
        this.camera  = camera;

        PrepareBuffer();
        PrepareForSceneWindow();
        if (!Cull(shadowSettings.maxDistance))
        {
            return;
        }

        buffer.BeginSample(SampleName);
        ExecuteBuffer();
        lighting.Setup(context, cullingResults, shadowSettings, shadowTreshold);
        buffer.SetGlobalFloat(defaultShadowBrightnesId, defaultShadowBrightness);
        buffer.SetGlobalFloat(brightnessMultiplierId, brightnessMultiplier);
        buffer.SetGlobalFloat(shadowTresholdId, shadowTreshold);
        buffer.EndSample(SampleName);
        Setup();
        DrawVisibleGeometry(useDynamicBatching, useGPUInstancing);
        DrawUnsupportedShaders();
        DrawGizmos();
        lighting.Cleanup();
        Submit();
    }
Пример #4
0
    public void Render(ScriptableRenderContext context, Camera camera, bool useDynamicBatching, bool useGPUInstancing, ShadowSettings shadowSettings)
    {
        this.context = context;
        this.camera  = camera;

        PrepareBuffer();
        PrepareForSceneWindow();
        if (!Cull(shadowSettings.maxDistance))
        {
            return;
        }

        ///We should render the shadows before invoking CameraRenderer.Setup in CameraRenderer.Render
        ///so regular rendering will not be affected.
        buffer.BeginSample(SampleName);
        ExecuteBuffer();
        lighting.Setup(context, cullingResults, shadowSettings);
        buffer.EndSample(SampleName);
        Setup();
        DrawVisibleGeometry(useDynamicBatching, useGPUInstancing);
        DrawUnsupportedShaders();
        DrawGizmos();
        lighting.Cleanup();
        Submit();
    }
Пример #5
0
 void Cleanup()
 {
     lighting.Cleanup();
     if (postFXStack.IsActive)
     {
         buffer.ReleaseTemporaryRT(frameBufferId);
     }
 }
Пример #6
0
 void Cleanup()
 {
     lighting.Cleanup();
     if (useIntermediateBuffer)
     {
         buffer.ReleaseTemporaryRT(colorAttachmentId);
         buffer.ReleaseTemporaryRT(depthAttachmentId);
         if (useColorTexture)
         {
             buffer.ReleaseTemporaryRT(colorTextureId);
         }
         if (useDepthTexture)
         {
             buffer.ReleaseTemporaryRT(depthTextureId);
         }
     }
 }