Fix T62862 Eevee: Glitchy reflections in ortographic view
This was caused by sign(cubevec.xy) returning 0.0 when one component was 0. Thus making the resulting component component 0.0 instead of 0.0.
This commit is contained in:
parent
021333ae3a
commit
6d1921dd81
Notes:
blender-bot
2023-02-14 03:15:44 +01:00
Referenced by issue #62862, Materials in LookDev in Orthographic experience inconsistent shading.
|
@ -2,11 +2,12 @@
|
|||
vec2 mapping_octahedron(vec3 cubevec, vec2 texel_size)
|
||||
{
|
||||
/* projection onto octahedron */
|
||||
cubevec /= dot( vec3(1), abs(cubevec) );
|
||||
cubevec /= dot(vec3(1.0), abs(cubevec));
|
||||
|
||||
/* out-folding of the downward faces */
|
||||
if ( cubevec.z < 0.0 ) {
|
||||
cubevec.xy = (1.0 - abs(cubevec.yx)) * sign(cubevec.xy);
|
||||
if (cubevec.z < 0.0) {
|
||||
vec2 cubevec_sign = step(0.0, cubevec.xy) * 2.0 - 1.0;
|
||||
cubevec.xy = (1.0 - abs(cubevec.yx)) * cubevec_sign;
|
||||
}
|
||||
|
||||
/* mapping to [0;1]ˆ2 texture space */
|
||||
|
|
Loading…
Reference in New Issue