Search Issue Tracker

By Design

Votes

0

Found in

2018.3.0a1

2018.4.0f1

2019.1.0a1

2019.2.0a1

2019.3.0a1

Issue ID

1158031

Regression

No

Using CommandBuffer.Blit() & empty OnRenderMethod() methods render black view when Camera Event is set to After Image Effect

Camera

-

How to reproduce:
1. Open the attached project
2. Go to Scenes-> open "CmdBufferAndOnRenderImage" scene
3. Go to the Hierarchy window-> Select the Main Camera
4. Go to the Inspector window-> Cmd Buffer And On Render Image Blur (Script) Component
5. Set Camera Event to After Image Effects
6. Enter the play mode and inspect Game view

Expected: Game view has a blur effect
Actual: Game view goes black

Reproducible with: 2018.4.1f1, 2019.1.5f1, 2019.2.0b5, 2019.3.0a5

Note: Could not test with the earlier versions because of the thrown errors
This case mentions a few bugs, check the comments for the link to another bug and more information about it

  1. Resolution Note:

    Hi, this issue is by design and the user is not doing the correct steps for the rendering to work as they want.

    The root issue is that when the user is using the command buffer then the rendering is happening directly to the back buffer, it then has to do a backbuffer read (very slow) before the effect can be applied and the backbuffer resolution is different to their selected resolution.

    The user needs to do two things.
    1) In the 'CmdBufferOnlyBlur' script add Camera.forceIntoRenderTexture = true; to OnEnable(). This will mean that rendering happens to an intermediate buffer saving the extra frame buffer fetch.
    2) In the helper.cs be blits should look like this:
    cmdBuffer.Blit(BuiltinRenderTextureType.CurrentActive, smallRTId);
    cmdBuffer.Blit(smallRTId, BuiltinRenderTextureType.CameraTarget, blurMaterial, 0);

    This will blit to the correct target.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.