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
- Crash on UnityPlayer!profiling::ProfilerManager::DisposeProfilerRecorder+0xa when Player gets relaunched and exited after running for a long amount of time
- [Input system] When releasing one touch and pressing a second touch during a single frame, the second touch is not translated into UI event line OnPointerDown by the InputSystemUIInputModule
- URP Samples - multiple "Attempting to resolve render surface" and other errors appear when setting Quality pipeline asset
- OnDemandRendering.willCurrentFrameRender returns incorrect values in the Player when UnityEngine.Rendering.OnDemandRendering.renderFrameInterval is greater than 1
- Root motion is not reapplied when transitioning from an animation without root motion to an animation with root motion
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.