Fix EEVEE-Next: Inverted world coordinates

Caused by 71dfcf4558
This commit is contained in:
Clément Foucault 2023-10-13 19:20:58 +02:00
parent 6484274048
commit 71835808d3
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ void main()
init_globals();
/* View position is passed to keep accuracy. */
g_data.N = normal_view_to_world(drw_view_incident_vector(interp.P));
g_data.N = drw_normal_view_to_world(drw_view_incident_vector(interp.P));
g_data.Ng = g_data.N;
g_data.P = -g_data.N;
attrib_load();

View File

@ -57,7 +57,7 @@ vec3 drw_world_incident_vector(vec3 P)
*/
vec3 drw_view_incident_vector(vec3 vP)
{
return drw_view_is_perspective() ? normalize(vP) : vec3(0.0, 0.0, -1.0);
return drw_view_is_perspective() ? normalize(-vP) : vec3(0.0, 0.0, 1.0);
}
/**