Exemple #1
0
    private void Render()
    {
        _CommandBuffer      = new CommandBuffer();
        _CommandBuffer.name = "AdvancedRTR";

        // get rt
        _CommandBuffer.GetTemporaryRT(ShaderConstants._SourceRT, _Camera.pixelWidth, _Camera.pixelHeight, 0, FilterMode.Bilinear, RenderTextureFormat.ARGBHalf);
        _CommandBuffer.GetTemporaryRT(ShaderConstants._EdgeRT, _Camera.pixelWidth, _Camera.pixelHeight, 0, FilterMode.Bilinear, RenderTextureFormat.ARGBHalf);
        _CommandBuffer.GetTemporaryRT(ShaderConstants._BlendWeightRT, _Camera.pixelWidth, _Camera.pixelHeight, 0, FilterMode.Bilinear, RenderTextureFormat.ARGBHalf);

        // copy
        RuntimeUtilities.BuiltinBlit(_CommandBuffer, BuiltinRenderTextureType.CameraTarget, ShaderConstants._SourceRT);

        // SMAA
        _CommandBuffer.BeginSample("SMAA");

        // edge
        RuntimeUtilities.BlitFullscreenTriangle(_CommandBuffer, ShaderConstants._SourceRT, ShaderConstants._EdgeRT, _SMAAMat, 0);
        // weight
        RuntimeUtilities.BlitFullscreenTriangle(_CommandBuffer, ShaderConstants._EdgeRT, ShaderConstants._BlendWeightRT, _SMAAMat, 1);
        // blend
        _CommandBuffer.SetGlobalTexture("_BlendWeightTex", ShaderConstants._BlendWeightRT);
        RuntimeUtilities.BlitFullscreenTriangle(_CommandBuffer, ShaderConstants._SourceRT, BuiltinRenderTextureType.CameraTarget, _SMAAMat, 2);

        // release rt
        _CommandBuffer.ReleaseTemporaryRT(ShaderConstants._SourceRT);
        _CommandBuffer.ReleaseTemporaryRT(ShaderConstants._EdgeRT);
        _CommandBuffer.ReleaseTemporaryRT(ShaderConstants._BlendWeightRT);

        _CommandBuffer.EndSample("SMAA");

        _Camera.AddCommandBuffer(CameraEvent.BeforeImageEffects, _CommandBuffer);
    }
    private void WriteCoc(PostProcessRenderContext context, PropertySheet sheet)
    {
        CommandBuffer          command      = context.command;
        RenderTargetIdentifier source       = context.source;
        RenderTextureFormat    sourceFormat = context.sourceFormat;
        float num    = 1f;
        int   width  = context.width / 2;
        int   height = context.height / 2;
        int   num2   = Shader.PropertyToID("DOFtemp1");
        int   num3   = Shader.PropertyToID("DOFtemp2");

        command.GetTemporaryRT(num3, width, height, 0, FilterMode.Bilinear, sourceFormat);
        RuntimeUtilities.BlitFullscreenTriangle(command, source, num3, sheet, 1);
        float num4 = internalBlurWidth * num;

        sheet.properties.SetVector("_Offsets", new Vector4(0f, num4, 0f, num4));
        command.GetTemporaryRT(num2, width, height, 0, FilterMode.Bilinear, sourceFormat);
        RuntimeUtilities.BlitFullscreenTriangle(command, num3, num2, sheet, 0);
        command.ReleaseTemporaryRT(num3);
        sheet.properties.SetVector("_Offsets", new Vector4(num4, 0f, 0f, num4));
        command.GetTemporaryRT(num3, width, height, 0, FilterMode.Bilinear, sourceFormat);
        RuntimeUtilities.BlitFullscreenTriangle(command, num2, num3, sheet, 0);
        command.ReleaseTemporaryRT(num2);
        command.SetGlobalTexture("_FgOverlap", num3);
        RuntimeUtilities.BlitFullscreenTriangle(command, source, source, sheet, 3, RenderBufferLoadAction.Load);
        command.ReleaseTemporaryRT(num3);
    }
    public override void Render(PostProcessRenderContext context)
    {
        Camera        camera        = context.camera;
        TOD_Sky       instance      = TOD_Sky.Instance;
        Vector3       lightPos      = camera.WorldToViewportPoint(instance.Components.LightTransform.position);
        CommandBuffer command       = context.command;
        PropertySheet propertySheet = context.propertySheets.Get(GodRayShader);
        int           skyMask       = GetSkyMask(context, base.settings.Resolution.value, lightPos, base.settings.BlurIterations.value, base.settings.BlurRadius.value, base.settings.MaxRadius.value);
        Color         value         = Color.black;

        if ((double)lightPos.z >= 0.0)
        {
            value = ((!instance.IsDay) ? (base.settings.Intensity.value * instance.MoonVisibility * instance.MoonRayColor) : (base.settings.Intensity.value * instance.SunVisibility * instance.SunRayColor));
        }
        propertySheet.properties.SetColor("_LightColor", value);
        command.SetGlobalTexture("_SkyMask", skyMask);
        if (base.settings.BlendMode.value == BlendModeType.Screen)
        {
            RuntimeUtilities.BlitFullscreenTriangle(context.command, context.source, context.destination, propertySheet, 0);
        }
        else
        {
            RuntimeUtilities.BlitFullscreenTriangle(context.command, context.source, context.destination, propertySheet, 1);
        }
        command.ReleaseTemporaryRT(skyMask);
    }
Exemple #4
0
    public override void Render(PostProcessRenderContext context)
    {
        CommandBuffer command = context.command;

        command.BeginSample("GreyScale");
        PropertySheet propertySheet = context.propertySheets.Get(greyScaleShader);

        propertySheet.properties.Clear();
        propertySheet.properties.SetVector(dataProperty, new Vector4(base.settings.redLuminance.value, base.settings.greenLuminance.value, base.settings.blueLuminance.value, base.settings.amount.value));
        propertySheet.properties.SetColor(colorProperty, base.settings.color.value);
        RuntimeUtilities.BlitFullscreenTriangle(context.command, context.source, context.destination, propertySheet, 0);
        command.EndSample("GreyScale");
    }
    private void DrawBorder(PostProcessRenderContext context, RenderTargetIdentifier buffer1)
    {
        PropertySheet propertySheet = context.propertySheets.Get(ScreenClearShader);
        Rect          value         = new Rect(0f, context.height - 1, context.width, 1f);
        Rect          value2        = new Rect(0f, 0f, context.width, 1f);
        Rect          value3        = new Rect(0f, 0f, 1f, context.height);
        Rect          value4        = new Rect(context.width - 1, 0f, 1f, context.height);

        RuntimeUtilities.BlitFullscreenTriangle(context.command, BuiltinRenderTextureType.None, buffer1, propertySheet, 0, false, value);
        RuntimeUtilities.BlitFullscreenTriangle(context.command, BuiltinRenderTextureType.None, buffer1, propertySheet, 0, false, value2);
        RuntimeUtilities.BlitFullscreenTriangle(context.command, BuiltinRenderTextureType.None, buffer1, propertySheet, 0, false, value3);
        RuntimeUtilities.BlitFullscreenTriangle(context.command, BuiltinRenderTextureType.None, buffer1, propertySheet, 0, false, value4);
    }
Exemple #6
0
    public override void Render(PostProcessRenderContext context)
    {
        CommandBuffer command = context.command;

        command.BeginSample("DoubleVision");
        PropertySheet propertySheet = context.propertySheets.Get(doubleVisionShader);

        propertySheet.properties.Clear();
        propertySheet.properties.SetVector(displaceProperty, base.settings.displace.value);
        propertySheet.properties.SetFloat(amountProperty, base.settings.amount.value);
        RuntimeUtilities.BlitFullscreenTriangle(command, context.source, context.destination, propertySheet, 0);
        command.EndSample("DoubleVision");
    }
    public override void Render(PostProcessRenderContext context)
    {
        CommandBuffer command = context.command;

        command.BeginSample("Frost");
        PropertySheet propertySheet = context.propertySheets.Get(frostShader);

        propertySheet.properties.Clear();
        propertySheet.properties.SetFloat(scaleProperty, base.settings.scale.value);
        propertySheet.properties.SetFloat(sharpnessProperty, base.settings.sharpness.value * 0.01f);
        propertySheet.properties.SetFloat(darknessProperty, base.settings.darkness.value * 0.02f);
        RuntimeUtilities.BlitFullscreenTriangle(command, context.source, context.destination, propertySheet, base.settings.enableVignette.value ? 1 : 0);
        command.EndSample("Frost");
    }
Exemple #8
0
    private void Render()
    {
        _CommandBuffer      = new CommandBuffer();
        _CommandBuffer.name = "AdvancedRTR";

        _CommandBuffer.GetTemporaryRT(ShaderConstants._TaaTmpRT, _Camera.pixelWidth, _Camera.pixelHeight, 0, FilterMode.Bilinear, RenderTextureFormat.ARGBHalf);

        _CommandBuffer.GetTemporaryRT(ShaderConstants._SourceRT, _Camera.pixelWidth, _Camera.pixelHeight, 0, FilterMode.Bilinear, RenderTextureFormat.ARGBHalf);

        //copy
        _CommandBuffer.Blit(BuiltinRenderTextureType.CameraTarget, ShaderConstants._SourceRT);

        //taa
        _CommandBuffer.BeginSample("TemporalAntialiasing");

        int pp           = m_HistoryPingPong;
        var historyRead  = CheckHistory(++pp % 2, _CommandBuffer);
        var historyWrite = CheckHistory(++pp % 2, _CommandBuffer);

        m_HistoryPingPong = ++pp % 2;

        const float kMotionAmplification = 100f * 60f;

        _TaaMat.SetVector(ShaderConstants.Jitter, jitter);
        _TaaMat.SetFloat(ShaderConstants.Sharpness, sharpness);
        _TaaMat.SetFloat(ShaderConstants.feedbackMin, feedbackMin);
        _TaaMat.SetFloat(ShaderConstants.feedbackMax, feedbackMax);
        _TaaMat.SetVector(ShaderConstants.FinalBlendParameters, new Vector4(stationaryBlending, motionBlending, kMotionAmplification, 0f));
        _TaaMat.SetTexture(ShaderConstants.HistoryTex, historyRead);

        m_Mrt[0] = ShaderConstants._TaaTmpRT;
        m_Mrt[1] = historyWrite;

        // _CommandBuffer.SetGlobalTexture(ShaderConstants._MainTex, BuiltinRenderTextureType.CameraTarget);
        // _CommandBuffer.SetRenderTarget(m_Mrt, BuiltinRenderTextureType.CameraTarget);
        // _CommandBuffer.DrawMesh(RuntimeUtilities.fullscreenTriangle, Matrix4x4.identity, _TaaMat, 0, 0);
        RuntimeUtilities.BlitFullscreenTriangle(_CommandBuffer, ShaderConstants._SourceRT, m_Mrt, BuiltinRenderTextureType.CameraTarget, _TaaMat, 0);

        _CommandBuffer.EndSample("TemporalAntialiasing");

        m_ResetHistory = false;

        _CommandBuffer.Blit(ShaderConstants._TaaTmpRT, BuiltinRenderTextureType.CameraTarget, _UberMat);

        _CommandBuffer.ReleaseTemporaryRT(ShaderConstants._TaaTmpRT);
        _Camera.AddCommandBuffer(CameraEvent.BeforeImageEffects, _CommandBuffer);
    }
Exemple #9
0
    public override void Render(PostProcessRenderContext context)
    {
        CommandBuffer command = context.command;

        command.BeginSample("BlurOptimized");
        int           value         = base.settings.downsample.value;
        float         value2        = base.settings.fadeToBlurDistance.value;
        float         value3        = base.settings.blurSize.value;
        int           value4        = base.settings.blurIterations.value;
        BlurType      value5        = base.settings.blurType.value;
        float         num           = 1f / (1f * (float)(1 << value));
        float         z             = 1f / Mathf.Clamp(value2, 0.001f, 10000f);
        PropertySheet propertySheet = context.propertySheets.Get(blurShader);

        propertySheet.properties.SetVector("_Parameter", new Vector4(value3 * num, (0f - value3) * num, z, 0f));
        int width  = context.width >> value;
        int height = context.height >> value;
        int num2   = Shader.PropertyToID("_BlurRT1");
        int num3   = Shader.PropertyToID("_BlurRT2");

        command.GetTemporaryRT(num2, width, height, 0, FilterMode.Bilinear, context.sourceFormat, RenderTextureReadWrite.Default);
        RuntimeUtilities.BlitFullscreenTriangle(command, context.source, num2, propertySheet, 0);
        int num4 = ((value5 != 0) ? 2 : 0);

        for (int i = 0; i < value4; i++)
        {
            float num5 = (float)i * 1f;
            propertySheet.properties.SetVector("_Parameter", new Vector4(value3 * num + num5, (0f - value3) * num - num5, z, 0f));
            command.GetTemporaryRT(num3, width, height, 0, FilterMode.Bilinear, context.sourceFormat);
            RuntimeUtilities.BlitFullscreenTriangle(command, num2, num3, propertySheet, 1 + num4);
            command.ReleaseTemporaryRT(num2);
            command.GetTemporaryRT(num2, width, height, 0, FilterMode.Bilinear, context.sourceFormat);
            RuntimeUtilities.BlitFullscreenTriangle(command, num3, num2, propertySheet, 2 + num4);
            command.ReleaseTemporaryRT(num3);
        }
        if (value2 <= 0f)
        {
            RuntimeUtilities.BlitFullscreenTriangle(command, num2, context.destination);
        }
        else
        {
            command.SetGlobalTexture("_Source", context.source);
            RuntimeUtilities.BlitFullscreenTriangle(command, num2, context.destination, propertySheet, 5);
        }
        command.ReleaseTemporaryRT(num2);
        command.EndSample("BlurOptimized");
    }
Exemple #10
0
    private void Render()
    {
        _CommandBuffer      = new CommandBuffer();
        _CommandBuffer.name = "AdvancedRTR";

        _CommandBuffer.GetTemporaryRT(ShaderConstants._SourceRT, _Camera.pixelWidth, _Camera.pixelHeight, 0, FilterMode.Bilinear, RenderTextureFormat.ARGBHalf);

        //copy
        RuntimeUtilities.BuiltinBlit(_CommandBuffer, BuiltinRenderTextureType.CameraTarget, ShaderConstants._SourceRT);

        //Paper
        _CommandBuffer.BeginSample("Paper");

        RuntimeUtilities.BlitFullscreenTriangle(_CommandBuffer, ShaderConstants._SourceRT, BuiltinRenderTextureType.CameraTarget, _PaperMat, (int)BlurMethod);

        _CommandBuffer.EndSample("Paper");

        _CommandBuffer.ReleaseTemporaryRT(ShaderConstants._SourceRT);
        _Camera.AddCommandBuffer(CameraEvent.BeforeImageEffects, _CommandBuffer);
    }
    public override void Render(PostProcessRenderContext context)
    {
        PropertySheet               propertySheet   = context.propertySheets.Get(dofShader);
        CommandBuffer               command         = context.command;
        int                         width           = context.width;
        int                         height          = context.height;
        RenderTextureFormat         sourceFormat    = context.sourceFormat;
        bool                        value           = base.settings.highResolution.value;
        DOFBlurSampleCountParameter blurSampleCount = base.settings.blurSampleCount;
        float                       value2          = base.settings.focalSize.value;
        float                       value3          = base.settings.focalLength.value;
        float                       value4          = base.settings.aperture.value;
        float                       value5          = base.settings.maxBlurSize.value;
        int                         nameID          = Shader.PropertyToID("DOFrtLow");
        int                         nameID2         = Shader.PropertyToID("DOFrtLow2");

        value4            = Math.Max(value4, 0f);
        value5            = Math.Max(value5, 0.1f);
        value2            = Mathf.Clamp(value2, 0f, 2f);
        internalBlurWidth = Mathf.Max(value5, 0f);
        focalDistance01   = FocalDistance01(context.camera, value3);
        propertySheet.properties.SetVector("_CurveParams", new Vector4(1f, value2, value4 / 10f, focalDistance01));
        if (value)
        {
            internalBlurWidth *= 2f;
        }
        WriteCoc(context, propertySheet);
        if (ConVar.Graphics.dof_debug)
        {
            RuntimeUtilities.BlitFullscreenTriangle(command, context.source, context.destination, propertySheet, 5);
            return;
        }
        command.GetTemporaryRT(nameID, width >> 1, height >> 1, 0, FilterMode.Bilinear, sourceFormat);
        command.GetTemporaryRT(nameID2, width >> 1, height >> 1, 0, FilterMode.Bilinear, sourceFormat);
        int pass = (((DOFBlurSampleCount)blurSampleCount == DOFBlurSampleCount.High || (DOFBlurSampleCount)blurSampleCount == DOFBlurSampleCount.Medium) ? 4 : 2);

        propertySheet.properties.SetVector("_Offsets", new Vector4(0f, internalBlurWidth, 0.025f, internalBlurWidth));
        RuntimeUtilities.BlitFullscreenTriangle(command, context.source, context.destination, propertySheet, pass);
        command.ReleaseTemporaryRT(nameID);
        command.ReleaseTemporaryRT(nameID2);
    }
Exemple #12
0
    private void Render()
    {
        _CommandBuffer      = new CommandBuffer();
        _CommandBuffer.name = "AdvancedRTR";

        _CommandBuffer.GetTemporaryRT(ShaderConstants._SourceRT, _Camera.pixelWidth, _Camera.pixelHeight, 0, FilterMode.Bilinear, RenderTextureFormat.ARGBHalf);

        //copy
        RuntimeUtilities.BuiltinBlit(_CommandBuffer, BuiltinRenderTextureType.CameraTarget, ShaderConstants._SourceRT);

        //FXAA
        _CommandBuffer.BeginSample("SSR");

        _CommandBuffer.GetTemporaryRT(ShaderConstants._TestRT, _Camera.pixelWidth, _Camera.pixelHeight, 0, FilterMode.Bilinear, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear);
        RuntimeUtilities.BlitFullscreenTriangle(_CommandBuffer, ShaderConstants._SourceRT, ShaderConstants._TestRT, _SSRMat, 0);

        RuntimeUtilities.BuiltinBlit(_CommandBuffer, ShaderConstants._TestRT, BuiltinRenderTextureType.CameraTarget, _BlendMat, 0);

        _CommandBuffer.EndSample("SSR");

        _CommandBuffer.ReleaseTemporaryRT(ShaderConstants._SourceRT);
        _CommandBuffer.ReleaseTemporaryRT(ShaderConstants._TestRT);
        _Camera.AddCommandBuffer(CameraPoint, _CommandBuffer);
    }
Exemple #13
0
    public override void Render(PostProcessRenderContext context)
    {
        float         value   = base.settings.bloomSize.value;
        float         value2  = base.settings.gain.value;
        float         value3  = base.settings.threshold.value;
        float         value4  = base.settings.dirtiness.value;
        Color         value5  = base.settings.bloomColor.value;
        Texture       value6  = base.settings.dirtinessTexture.value;
        bool          value7  = base.settings.sceneTintsBloom.value;
        CommandBuffer command = context.command;

        command.BeginSample("LensDirtinessEffect");
        if (value7)
        {
            command.EnableShaderKeyword("_SCENE_TINTS_BLOOM");
        }
        PropertySheet          propertySheet = context.propertySheets.Get(lensDirtinessShader);
        RenderTargetIdentifier source        = context.source;
        RenderTargetIdentifier destination   = context.destination;
        int width  = context.width;
        int height = context.height;
        int num    = Shader.PropertyToID("_RTT_BloomThreshold");
        int num2   = Shader.PropertyToID("_RTT_1");
        int num3   = Shader.PropertyToID("_RTT_2");
        int num4   = Shader.PropertyToID("_RTT_3");
        int num5   = Shader.PropertyToID("_RTT_4");
        int num6   = Shader.PropertyToID("_RTT_Bloom_1");
        int num7   = Shader.PropertyToID("_RTT_Bloom_2");

        propertySheet.properties.SetFloat("_Gain", value2);
        propertySheet.properties.SetFloat("_Threshold", value3);
        command.GetTemporaryRT(num, width / 2, height / 2, 0, FilterMode.Bilinear, context.sourceFormat);
        RuntimeUtilities.BlitFullscreenTriangle(command, source, num, propertySheet, 0);
        propertySheet.properties.SetVector("_Offset", new Vector4(1f / (float)width, 1f / (float)height, 0f, 0f) * 2f);
        command.GetTemporaryRT(num2, width / 2, height / 2, 0, FilterMode.Bilinear, context.sourceFormat);
        RuntimeUtilities.BlitFullscreenTriangle(command, num, num2, propertySheet, 1);
        command.ReleaseTemporaryRT(num);
        command.GetTemporaryRT(num3, width / 4, height / 4, 0, FilterMode.Bilinear, context.sourceFormat);
        RuntimeUtilities.BlitFullscreenTriangle(command, num2, num3, propertySheet, 1);
        command.ReleaseTemporaryRT(num2);
        command.GetTemporaryRT(num4, width / 8, height / 8, 0, FilterMode.Bilinear, context.sourceFormat);
        RuntimeUtilities.BlitFullscreenTriangle(command, num3, num4, propertySheet, 1);
        command.ReleaseTemporaryRT(num3);
        command.GetTemporaryRT(num5, width / 16, height / 16, 0, FilterMode.Bilinear, context.sourceFormat);
        RuntimeUtilities.BlitFullscreenTriangle(command, num4, num5, propertySheet, 1);
        command.ReleaseTemporaryRT(num4);
        command.GetTemporaryRT(num6, width / 16, height / 16, 0, FilterMode.Bilinear, context.sourceFormat);
        command.GetTemporaryRT(num7, width / 16, height / 16, 0, FilterMode.Bilinear, context.sourceFormat);
        RuntimeUtilities.BlitFullscreenTriangle(command, num5, num6);
        command.ReleaseTemporaryRT(num5);
        for (int i = 1; i <= 8; i++)
        {
            float x = value * (float)i / (float)width;
            float y = value * (float)i / (float)height;
            propertySheet.properties.SetVector("_Offset", new Vector4(x, y, 0f, 0f));
            RuntimeUtilities.BlitFullscreenTriangle(command, num6, num7, propertySheet, 1);
            RuntimeUtilities.BlitFullscreenTriangle(command, num7, num6, propertySheet, 1);
        }
        command.SetGlobalTexture("_Bloom", num7);
        propertySheet.properties.SetFloat("_Dirtiness", value4);
        propertySheet.properties.SetColor("_BloomColor", value5);
        propertySheet.properties.SetTexture("_DirtinessTexture", value6);
        RuntimeUtilities.BlitFullscreenTriangle(command, source, destination, propertySheet, 2);
        command.ReleaseTemporaryRT(num6);
        command.ReleaseTemporaryRT(num7);
        command.EndSample("LensDirtinessEffect");
    }
    private int GetSkyMask(PostProcessRenderContext context, ResolutionType resolution, Vector3 lightPos, int blurIterations, float blurRadius, float maxRadius)
    {
        CommandBuffer command       = context.command;
        Camera        camera        = context.camera;
        PropertySheet propertySheet = context.propertySheets.Get(SkyMaskShader);

        command.BeginSample("GodRays");
        int width;
        int height;
        int depthBuffer;

        switch (resolution)
        {
        case ResolutionType.High:
            width       = context.screenWidth;
            height      = context.screenHeight;
            depthBuffer = 0;
            break;

        case ResolutionType.Normal:
            width       = context.screenWidth / 2;
            height      = context.screenHeight / 2;
            depthBuffer = 0;
            break;

        default:
            width       = context.screenWidth / 4;
            height      = context.screenHeight / 4;
            depthBuffer = 0;
            break;
        }
        int num  = Shader.PropertyToID("buffer1");
        int num2 = Shader.PropertyToID("buffer2");

        command.GetTemporaryRT(num, width, height, depthBuffer);
        propertySheet.properties.SetVector("_BlurRadius4", new Vector4(1f, 1f, 0f, 0f) * blurRadius);
        propertySheet.properties.SetVector("_LightPosition", new Vector4(lightPos.x, lightPos.y, lightPos.z, maxRadius));
        if ((camera.depthTextureMode & DepthTextureMode.Depth) != 0)
        {
            RuntimeUtilities.BlitFullscreenTriangle(command, context.source, num, propertySheet, 1);
        }
        else
        {
            RuntimeUtilities.BlitFullscreenTriangle(command, context.source, num, propertySheet, 2);
        }
        if (camera.stereoActiveEye == Camera.MonoOrStereoscopicEye.Mono)
        {
            DrawBorder(context, num);
        }
        float num3 = blurRadius * 0.00130208337f;

        propertySheet.properties.SetVector("_BlurRadius4", new Vector4(num3, num3, 0f, 0f));
        propertySheet.properties.SetVector("_LightPosition", new Vector4(lightPos.x, lightPos.y, lightPos.z, maxRadius));
        for (int i = 0; i < blurIterations; i++)
        {
            command.GetTemporaryRT(num2, width, height, depthBuffer);
            RuntimeUtilities.BlitFullscreenTriangle(command, num, num2, propertySheet, 0);
            command.ReleaseTemporaryRT(num);
            num3 = blurRadius * (((float)i * 2f + 1f) * 6f) / 768f;
            propertySheet.properties.SetVector("_BlurRadius4", new Vector4(num3, num3, 0f, 0f));
            command.GetTemporaryRT(num, width, height, depthBuffer);
            RuntimeUtilities.BlitFullscreenTriangle(command, num2, num, propertySheet, 0);
            command.ReleaseTemporaryRT(num2);
            num3 = blurRadius * (((float)i * 2f + 2f) * 6f) / 768f;
            propertySheet.properties.SetVector("_BlurRadius4", new Vector4(num3, num3, 0f, 0f));
        }
        command.EndSample("GodRays");
        return(num);
    }