Search Issue Tracker
By Design
Votes
1
Found in
2020.3.38f1
2021.3.10f1
2022.1.16f1
2022.2.0b7
2023.1.0a10
Issue ID
UUM-15002
Regression
No
Depth texture “_CameraDepthTexture” is not recognized when building for the Windows platform
Reproduction steps:
1. Open the user’s attached project
2. In the Project window select the “Depth” shader file
3. Make sure there are no errors in the Inspector window
4. Go to File -> Build Settings, for Target Platform select Windows, and press Build
5. When the build finishes, again select “Depth” shader in the Project window
6. Inspect the Console and Inspector windows
Expected result: There are no errors in both windows
Actual result: There is an error in Inspector and Console windows saying that 'sampler_CameraDepthTexture' is an undeclared identifier
Reproducible with: 2020.3.38f1, 2021.3.10f1, 2022.1.16f1 2022.2.0b7, 2023.1.0a10
Reproducible on: macOS 12.5
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
- Unity CIL Linker fails on Player build when persistent listeners have "<" and ">" in their XML attribute names
- ”Lighting data asset ‘LightingData’ is incompatible with the current Unity version…” warnings are thrown when saving Indoors (URP) and Outdoors (URP) Scenes as Scene Templates
- [iOS] The screen blinks when transitioning from custom to Unity splash screen
- [macOS] ”Ignoring depth surface load action as it is memoryless” warnings are thrown when taking Game View Snapshot
- UI Builder Inspector scrolls back up when changes on an expanded but not fully displayed Inspector tab are saved
Resolution Note:
The variant for XR is failing to compile. This is because SAMPLE_DEPTH_TEXTURE requires different data when compiling for XR (their project has XR enabled). If you want a texture that works for depth sampling across the board, then UNITY_DECLARE_DEPTH_TEXTURE should be used to declared the texture sampler.