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
If I'm doing this right, the linear interpolation should be this:
Where the blue dots represent layer depth and red dots are depth sampled from depth map. Then the interpolation is based on the similarity of these two triangles, and the maths goes to:
If I'm doing this right, the linear interpolation should be this:
Where the blue dots represent layer depth and red dots are depth sampled from depth map. Then the interpolation is based on the similarity of these two triangles, and the maths goes to:
float weight = abs(afterDepth) / (abs(afterDepth) + abs(beforeDepth));
The
abs
is for negative lengths. But in the fragment shader it is:LearnOpenGL/src/5.advanced_lighting/5.3.parallax_occlusion_mapping/5.3.parallax_mapping.fs
Line 54 in 3e94252
And the difference is visible:
Found the same formula here. It uses the sum first and then the subtracted form as a "boiling down". I wonder if this is a simplification or error.
The text was updated successfully, but these errors were encountered: