CesiumGS / CesiumGS/cesium

depthTexture packing not working: only contains data in red channel

Open
#7,743 6 comments 0 reactions 0 assignees View on GitHub
category - graphics type - bug
Dominant language
JavaScript
Stars
15.7k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

The depthTexture, when used from a postProcessingStage shader appears to only contain data in the red channel, when depth value should be packed across all channels and unpacked with unpackDepth()

A link to a test in Sandcastle: this outputs the raw depthTexture:

https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/#c=bVPbbtswDP0VIS92sFTObS3WXLAu2Z42rECGPRkIFJt2hOliSLK7rMi/j7LcNElrGAZJkYfiOXTDDGk4PIEhC6LgiazA8lrS320sjrLWXWnlGFdgogF5ThXBx+51LfIHxSVzQO6JMzWk6tifpSpVSRIwqc1AARW6ZIa7veTZGiq3/1IXRduwYMJCW9HgPSptueNa4UF3ixUzDi2mJrQwWq6hNAA2vhmNJ3R4N53ejj4NyHRKhx+Hk7vhrW/ugWojECOiNDm9D1Vlkw2TlYA1cyyROgdhk9DnB1OdtUWTlmIXeaQwgjMs+wP5V+W4OyBsFwbvc7CU5XnccaKY9FRg+0EInCa6P5ndSdsfw12lf2rDQ3EIHU9s+pEKw0qJPTd7loPZ6NpkQBYhM6oVL7SRxLbzmfGa5J7mX/DX1QZmJE1VRD50yYh24KokDWRj0mxdSFppbXKuUEt7na95TiSqH3urf3n4fOn6D+JOQ38kq0Mfr+PzGw3e7dufvQUrxfYbTr7SQvt9aUGu0o6t+6pXWDmk2z0ajetrN46VnU5nC/54lfCi4SXRKMh7zHtpvDa9QW9u3UHAMhR/5rLSxnkRY1w6B6iHHy3Z1bhDjmbW+rJ58lI0z3lDeL5Ie1c/WtojmWDW4klRC7Hh/yDtLecJ5l+UCc2QvvJnA0awg0/Zj5bfQ5BSOk/QfVvltBY7Zs4Q/wM

Contributor guide

Open the contributing guide

Research direction

Start with the linked Sandcastle test, which outputs the raw depthTexture from a postProcessingStage shader. Read how depthTexture is packed and how unpackDepth() consumes it, then reproduce the red-channel-only result in the test. Done means depth values are correctly packed across the expected channels and unpackDepth() returns the intended depth.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.