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
- HDRP 6-way VFX Shader is lit incorrectly when World coordinates are used
- 2D Sprite Renderer in front is affected by Sprites in the background when using Sorting Layers and a Shadow Caster 2D with Self Shadow
- Modifying UI Prefab child's Height only confirms the first 1 or 2 digits when the Scene is newly opened or the Prefab is newly created
- ProfilingSampler.Get() returns null and makes the Player only render black when building a Release Build
- Search text field visual controls for the Path binding in an Input Actions Asset is misaligned
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).