mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-12 09:09:47 +12:00
fix: incorrect depth map logic
This commit is contained in:
parent
13439699ee
commit
b8e155bd4a
1 changed files with 2 additions and 2 deletions
|
@ -156,12 +156,12 @@ vertex DrawVertexOutWithClip vertexDraw(DrawVertexIn in [[stage_in]], constant P
|
|||
out.position = in.position;
|
||||
// Flip the y position
|
||||
out.position.y = -out.position.y;
|
||||
out.position.xyz /= out.position.w;
|
||||
out.position.xy /= out.position.w;
|
||||
|
||||
// Apply depth uniforms
|
||||
out.position.z = out.position.z * depthUniforms.depthScale + depthUniforms.depthOffset;
|
||||
// TODO: is this correct?
|
||||
if (!depthUniforms.depthMapEnable) { // Divide z by w if depthmap enable == 0 (ie using W-buffering)
|
||||
if (depthUniforms.depthMapEnable) { // Divide z by w if depthmap enable == 0 (ie using W-buffering)
|
||||
out.position.z /= out.position.w;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue