Search Issue Tracker
Postponed means that the issue was either a feature request or something that requires major refactoring on our side. Since that makes the issue not actionable in the close future we choose to close it as Postponed and add it on our internal roadmaps and technical debt pages instead.
Postponed
Votes
0
Found in
3.0.0b1
Issue ID
357989
Regression
No
Camera.targetTexture confuses camera callbacks
Camera.targetTexture or RenderTexture.active with Camera.RenderWithShader are making trouble.
If I set the camera's targetTexture in OnPreRender or OnPostRender in a script attached to the camera, it turns out those functions get called only once. Not once per frame, just once. The render texture gets filled properly, but the framebuffer isn't filled anymore, as I end up with some empty dark grey scene.
If I put a debug line in Update, I can see it gets called every frame.
If however I set my render texture into RenderTexture.active, then OnPreRender or OnPostRender are called every frame. However my render texture isn't filled (just black and 0 alpha) while the framebuffer is with what should be in the render texture, and my normal scene isn't drawn (or rather is drawn over).
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- "AssertionException: Assertion failure. Value was False" error is thrown when adding a Material to the Mesh Renderer Component in the Player 2 window
- Lighting Settings' "Direct/Indirect sample" number field upper limit can be increased
- “No frame data available.” label does not appear when Entities Memory module is selected until something is typed into the search bar in the Profiler window
- Box Collider 2D warning has unnecessary double spaces when the collider is resized too small
- ShadowCaster2D shadow flickers in the Editor's Scene and Game Views when Tilemap Shadow Caster's Casting Source is set to Tilemap Collider 2D
Add comment