Search Issue Tracker
By Design
Votes
1
Found in
2018.4
2019.4
2020.3
2020.3.9f1
2021.1
2021.2
Issue ID
1338426
Regression
No
Camera.RenderToCubemap is inversed when using RenderTextureDescriptor
How to reproduce:
1. Open the attached project "rendercubemap_descriptor.zip"
2. Open Assets/scene.unity
3. Select "BugRepro" in the Hierarchy
4. In the Inspector window open "Cubemap Not Ok"
Expected result: Cubemap is displayed correctly
Actual result: Cubemap is displayed inversed
Reproducible with: 2018.4.35f1, 2019.4.27f1, 2020.3.10f1, 2021.1.9f1, 2021.2.0a18
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
- Standalone Player crashes with "TDerived GetOrLoad<TDerived>() where TDerived : T" when IL2CPP Code generation is set to "Faster (smaller) Builds"
- IndexOutOfRangeException and InvalidOperationException when logging XML string
- Script missing in "Assets/Settings/Mobile_Renderer/GlobalVolumeFeature" of "com.unity.template.urp-blank" template
- “Font Asset Creator - Error Code [Invalid_File_Structure]…“ error is logged when generating Font Assets from fonts with meta files from previous Editor versions
- Input.mousePosition returns (NaN, NaN, 0.00) when Scene view is opened
Resolution Note:
This is by design. Creating a RenderTextureDescriptor struct by using the default constructor initializes the struct with zero values, including the flags. This means the struct is not initialized with some flags with the recommended values, including the RenderTextureCreationFlags.AllowVerticalFlip. The documentation warns for this unfortunate behavior of C#: 'Avoid using the default constructor as it does not initialize some flags with the recommended values' (https://docs.unity3d.com/ScriptReference/RenderTextureDescriptor.html). You can solve this by creating the struct using one of the other constructors, such as RenderTextureDescriptor(width, height).