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
- The tag adder functionality does not work if a space is entered instead of a name
- Errors thrown in the Console when configuring In-App Purchases package
- Longer Scaler Profile names go out of the"Scaler Profilers" section
- AI Navigation window UI elements overlap when the AI Navigation window is docked and resized
- Editor freezes after some time when using NavMeshQuery::Raycast
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).