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
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
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.