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
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
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.