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

Texture

-

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

  1. 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).

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.