Search Issue Tracker
Won't Fix
Votes
0
Found in
2020.3.37f1
2021.3.7f1
2022.1.13f1
2022.2.0b5
2023.1.0a6
Issue ID
UUM-12019
Regression
No
[macOS] White texture appears when setting “RenderTextureFormat.Depth” to “RenderTexture” on the Camera
How to reproduce:
1. Open the user’s attached project
2. Open the “SampleScene” Scene (Assets > Scenes > SampleScene)
3. Enter Play Mode
4. Press the “Render” button and observe the Game view
Expected result: Black Texture
Actual result: White Texture
Reproducible with: 10.10.0 (2020.3.37f1), 12.1.7 (2021.3.7f1), 13.1.8 (2022.1.13f1), 14.0.3 (2022.2.0b5), 15.0.0 (2023.1.0a6)
Reproduced on:
- macOS 12.4 (Intel)
- macOS 12.4 Beta (M1)
Not reproduced on: Windows 11
Notes:
- If enabling the “Screen Space Ambient Occlusion” Component in the “URP-High Fidelity Renderer” asset, then not reproducible.
- Intel Mac - no Texture with and without the “Screen Space Ambient Occlusion” Component
- M1 Mac - without the “Screen Space Ambient Occlusion” Component white Texture, with the Component black Texture.
- Windows - black Texture with and without the Component
Comments (2)
-
qpuilie
Sep 25, 2022 13:21
Following my steps, you should get a depth map with content (other platforms are fine).
-
qpuilie
Sep 25, 2022 13:20
Hi, before this, I reported a bug, but maybe I didn't describe it clearly enough.
What I care about is that it doesn't have any content, not what color channel is it.
Nothing appears on the RenderTexture.
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
- Opening Terrain Prefab in Prefab Editing Mode throws "NullReferenceException" error
- [Search] Dragging query pills put them behind the search text field
- A CustomPropertyDrawer that returns a PropertyField for a property named the same as a child field will not render all child fields
- Graphics Settings shows default values instead of the real values in the Rendering Debugger when Volume.profile is assigned via script
- Deleting multiple Tags throws “NullReferenceException”, and "Retrieving array element that was out of bounds" errors when holding the Enter key
Resolution Note:
The result is expected. First thing to note is that Depth Texture has just one component, so upon sampling missing components are filled with default values. For, say, Open GL it is specified to be 0 for RGB and 1 for A. Metal does similar with a caveat, from metal shading language spec (6.12 Texture Functions):
For unspecified color components in a pixel format, the default values are: • zero, for components other than alpha.
In a pixel format with integer components, the alpha default value is represented as the integral value 0x1. For a pixel format with floating-point or normalized components, the alpha default value is represented as the floating-point value 1.0.
For example, for a texture with the MTLPixelFormatR8Uint pixel format, the default values for unspecified integer components are G = 0, B = 0, and A = 1. For a texture with the MTLPixelFormatR8Unorm pixel format, the default values for unspecified normalized components are G = 0.0, B = 0.0, and A = 1.0. For a texture with depth or stencil pixel format (such as MTLPixelFormatDepth24Unorm_Stencil8 or MTLPixelFormatStencil8), the default value for an unspecified component is undefined.
Note that depth is treated differently, so metal is in the right to just duplicate depth information from "red" channel to all others. If you want to make sure it looks the same across all APIs use just red channel from the texture directly in the shader