Search Issue Tracker
By Design
Votes
4
Found in
2017.3.0a1
2017.4.20f2
2018.3.0a1
2019.1.0a1
2019.2.0a1
Issue ID
1129666
Regression
No
RenderTexture is flipped upside down when using "RenderTextureDescriptor"
Reproduction steps:
1. Open "1129666" project
2. Enter Play mode
3. Double Click "CustomDrawer" -> "CustomDrawer (Script)" -> "Rendertexture" -> "CustomRT"
4. Notice that the RenderTexture is flipped upside down
5. Uncomment line 25 and Comment line 24 in "CustomDrawer" script and repeat steps 2 and 3
6. Notice that the RenderTexture is not flipped
Expected Result: Uniform behavior in how RenderTexture is rendered
Actual Result: RenderTexture is flipped upside down when using "RenderTextureDescriptor"
Reproduced with: 2019.2.0a6, 2019.1.0b5, 2018.3.7f1, 2017.4.21f1
Comments (1)
-
Baggers_
May 20, 2020 11:14
Also present on both Unity versions 2020.1.0b6 & 2019.3.0f3. I did not test other versions.
Additional test case with write-up available here if helpful: https://github.com/Bouncyrock/potential-cubemap-descriptor-bug
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
- Multiple errors are thrown in the console while using perforce when moving an asset using shortcuts
- PlayerPropertiesChanged event fires before Player Properties are applied
- Opening Media Pop-out in “Before You Start” Tutorial throws “Styles” and “Styles_Dark” messages in the Console window
- Play Mode Scenario selection/highlight is too long and out of its bounds when the Play Mode Scenario window is opened after maximizing
- Asset name is not shown in the Undo History window when a sprite is modified
Resolution Note:
You can avoid this behaviour by making sure that you use a constructor that takes any amount of parameters greater than 0, or by manually setting `flags |= RenderTextureCreationFlags.AllowVerticalFlip`. I would generally recommend the first solution, as that will ensure that any new properties or flags that might be added in the future have sensible default values.
The reason this happens is that C# provides a parameterless constructor for all struct types. It is not possible to remove or override this constructor. The parameterless constructor will set all values in the struct to 0, whereas the constructors we have implemented for the struct will, amongst other things, set the `RenderTextureCreationFlags.AllowVerticalFlip` on the `flags` property.