mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 12:12:28 +00:00
Merge pull request #94281 from mertkasar/3.x-ssr-orthogonal-warp-fix
[3.x] Fix SSR warp when using orthogonal camera
This commit is contained in:
commit
ff77fe81d1
@ -67,7 +67,11 @@ void main() {
|
||||
vec4 world_pos = inverse_projection * vec4(uv_interp * 2.0 - 1.0, depth_tex * 2.0 - 1.0, 1.0);
|
||||
vec3 vertex = world_pos.xyz / world_pos.w;
|
||||
|
||||
#ifdef USE_ORTHOGONAL_PROJECTION
|
||||
vec3 view_dir = vec3(0.0, 0.0, -1.0);
|
||||
#else
|
||||
vec3 view_dir = normalize(vertex);
|
||||
#endif
|
||||
vec3 ray_dir = normalize(reflect(view_dir, normal));
|
||||
|
||||
if (dot(ray_dir, normal) < 0.001) {
|
||||
|
Loading…
Reference in New Issue
Block a user