void DrawFinal(CameraSettings.FinalBlendMode finalBlendMode) { //percamera blend mode buffer.SetGlobalFloat(srcBlendId, (float)finalBlendMode.source); buffer.SetGlobalFloat(dstBlendId, (float)finalBlendMode.destination); buffer.SetGlobalTexture(sourceTextureId, colorAttachmentId); buffer.SetRenderTarget(BuiltinRenderTextureType.CameraTarget, // load the previous camer render if MultiCam blend finalBlendMode.destination != BlendMode.Zero ? RenderBufferLoadAction.Load : RenderBufferLoadAction.DontCare, RenderBufferStoreAction.Store); //set the render viewpost to camera rect buffer.SetViewport(camera.pixelRect); buffer.DrawProcedural(Matrix4x4.identity, material, 0, MeshTopology.Triangles, 3); // set blend to one-zero for following buffer.SetGlobalFloat(srcBlendId, 1f); buffer.SetGlobalFloat(dstBlendId, 0f); }
public void Setup( ScriptableRenderContext context, Camera camera, Vector2Int bufferSize, PostFXSettings settings, bool keepAlpha, bool useHDR, int colorLUTResolution, CameraSettings.FinalBlendMode finalBlendMode, CameraBufferSettings.BicubicRescalingMode bicubicRescaling, CameraBufferSettings.FXAA fxaa ) { this.fxaa = fxaa; this.bicubicRescaling = bicubicRescaling; this.bufferSize = bufferSize; this.finalBlendMode = finalBlendMode; this.colorLUTResolution = colorLUTResolution; this.keepAlpha = keepAlpha; this.useHDR = useHDR; this.context = context; this.camera = camera; this.settings = camera.cameraType <= CameraType.SceneView ? settings : null; ApplySceneViewState(); }
public void Setup(ScriptableRenderContext context, Camera camera, PostFXSettings settings, bool useHDR, int colorLUTResolution, CameraSettings.FinalBlendMode finalBlendMode) { this.context = context; this.camera = camera; this.settings = camera.cameraType <= CameraType.SceneView ? settings : null; this.useHDR = useHDR; this.colorLUTResolution = colorLUTResolution; this.finalBlendMode = finalBlendMode; ApplySceneViewState(); }