Skip to content

Commit aaec8d4

Browse files
committed
fixed projection hack
1 parent 4ad0a30 commit aaec8d4

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/engine/shaders/basic.vs.hlsl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ BASIC_PS_INPUT main(VS_INPUT input)
2727
output.position = mul(projectionMatrix, viewPosition);
2828

2929
// hack; GL to DX clip space
30-
output.position /= output.position.w;
31-
output.position.z = output.position.z * 0.5 + 0.5;
30+
output.position.z = (output.position.z + output.position.w) * 0.5;
3231

3332
output.worldPosition = worldPosition.xyz;
3433
output.eye = cameraPosition - worldPosition.xyz;

0 commit comments

Comments
 (0)