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
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
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Crash on GUIManager::DoGUIEvent when focusing on the Game view window on a specific project
- Asset creation in the Project Browser is not always undone/inconsistent when the undo shortcut is pressed right after creating an asset
- JobTempAlloc memory leak warning is thrown when the Player is shut down
- Graphics State Collection warm-up does not work when using with Addressables Shaders
- "Baked Shadow Radius" field is visible but inactive when when the Shadow Type is set to "Hard Shadows" under the Light Component
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.