Skip to content

Conversation

@Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Oct 8, 2024

Related issue: -

Description

When working at SSRNode, I've realized that the current TSL version of getViewPosition() is implemented differently. In the original version, the * 2.0 - 1.0 is applied to all vector components, not just x and y.

Can we please determine which math is correct? If the original is wrong, we should fix the GLSL.

For comparison:

vec3 getViewPosition(const in vec2 screenPosition, const in float depth) {
vec4 clipSpacePosition = vec4(vec3(screenPosition, depth) * 2.0 - 1.0, 1.0);
vec4 viewSpacePosition = cameraProjectionMatrixInverse * clipSpacePosition;
return viewSpacePosition.xyz / viewSpacePosition.w;
}

@Mugen87 Mugen87 added this to the r170 milestone Oct 8, 2024
@Mugen87 Mugen87 marked this pull request as draft October 8, 2024 12:31
@Mugen87 Mugen87 changed the title GTAONode: Fix getViewPosition(). GTAONode: Potentially fix getViewPosition(). Oct 8, 2024
@Mugen87
Copy link
Collaborator Author

Mugen87 commented Oct 8, 2024

Ah wait, now I remember: #28844 (comment)

@Mugen87 Mugen87 closed this Oct 8, 2024
@Mugen87 Mugen87 removed this from the r170 milestone Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant