You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in shaders/src/surface_light_reflection.fs, line 60, function traceScreenSpaceRay
// Project into screen space
highp vec4 H0 = mulMat4x4Float3(uvFromViewMatrix, vsOrigin);
highp vec4 H1 = mulMat4x4Float3(uvFromViewMatrix, vsEndPoint);
// There are a lot of divisions by w that can be turned into multiplications at some minor
// precision loss...and we need to interpolate these 1/w values anyway.
//
// Because the caller was required to clip to the near plane, this homogeneous division
// (projecting from 4D to 2D) is guaranteed to succeed.
highp float k0 = 1.0 / H0.w;
highp float k1 = 1.0 / H1.w;
// Switch the original points to values that interpolate linearly in 2D
highp vec3 Q0 = vsOrigin * k0;
highp vec3 Q1 = vsEndPoint * k1;
// Screen-space endpoints
highp vec2 P0 = H0.xy * k0;
highp vec2 P1 = H1.xy * k1;
here, k0 = -1/vsOrigin.z, and Q0.z = -1, and Q1.z = -1 too.
// Track the derivatives of Q and k
highp vec3 dQ = (Q1 - Q0) * invdx;
highp float dk = (k1 - k0) * invdx;
so dQ.z = 0 too.
so line 150, in for loop iterator, what does Q.z += dQ.z do?
btw, github.com's reference in a new issues can't work now...
The text was updated successfully, but these errors were encountered:
yejun81
changed the title
i think dQ.z = 0, iterator Q.z += dQ.z is meaningless at all
in traceScreenSpaceRay, i think dQ.z = 0, iterator Q.z += dQ.z is meaningless at all
Feb 11, 2025
in shaders/src/surface_light_reflection.fs, line 60, function traceScreenSpaceRay
here, k0 = -1/vsOrigin.z, and Q0.z = -1, and Q1.z = -1 too.
// Track the derivatives of Q and k
highp vec3 dQ = (Q1 - Q0) * invdx;
highp float dk = (k1 - k0) * invdx;
so dQ.z = 0 too.
so line 150, in for loop iterator, what does Q.z += dQ.z do?
btw, github.com's reference in a new issues can't work now...
The text was updated successfully, but these errors were encountered: