Fixed point lights breaking for Krom Windows with shadow map atlas

https://github.com/armory3d/armory/issues/2110#issuecomment-787913813
This commit is contained in:
N8n5h 2021-03-01 18:37:54 -03:00
parent 5f8b92f9c3
commit cf99e5a382
2 changed files with 7 additions and 3 deletions

View file

@ -44,9 +44,13 @@ vec2 sampleCube(vec3 dir, out int faceIndex) {
// downscale uv a little to hide seams // downscale uv a little to hide seams
// transform coordinates from clip space to texture space // transform coordinates from clip space to texture space
#ifndef _FlipY #ifndef _FlipY
return uv * 0.9976 * ma + 0.5; return uv * 0.9976 * ma + 0.5;
#else #else
return vec2(uv.x * ma, uv.y * -ma) * 0.9976 + 0.5; #ifdef HLSL
return uv * 0.9976 * ma + 0.5;
#else
return vec2(uv.x * ma, uv.y * -ma) * 0.9976 + 0.5;
#endif
#endif #endif
} }
#endif #endif

View file

@ -537,7 +537,7 @@ def write_compiledglsl(defs, make_variants):
#endif #endif
""") """)
if state.target == 'html5': if state.target == 'html5' or arm.utils.get_gapi() == 'direct3d11':
f.write("#define _FlipY\n") f.write("#define _FlipY\n")
f.write("""const float PI = 3.1415926535; f.write("""const float PI = 3.1415926535;