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
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
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.