Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/shaders/cubemap_lib.glsl
| #ifdef GPU_ARB_texture_cube_map_array | /* Fallback implementation for hardware not supporting cubemap arrays. | ||||
| * `samplerCubeArray` fallback declaration as sampler2DArray in `glsl_shader_defines.glsl`*/ | |||||
| # define textureLod_cubemapArray(tex, co, lod) textureLod(tex, co, lod) | #ifndef GPU_ARB_texture_cube_map_array | ||||
| #else | |||||
| /* Fallback implementation for hardware not supporting cubemap arrays. */ | |||||
| # define samplerCubeArray sampler2DArray | |||||
| float cubemap_face_index(vec3 P) | float cubemap_face_index(vec3 P) | ||||
| { | { | ||||
| vec3 aP = abs(P); | vec3 aP = abs(P); | ||||
| if (all(greaterThan(aP.xx, aP.yz))) { | if (all(greaterThan(aP.xx, aP.yz))) { | ||||
| return (P.x > 0.0) ? 0.0 : 1.0; | return (P.x > 0.0) ? 0.0 : 1.0; | ||||
| } | } | ||||
| else if (all(greaterThan(aP.yy, aP.xz))) { | else if (all(greaterThan(aP.yy, aP.xz))) { | ||||
| ▲ Show 20 Lines • Show All 127 Lines • Show Last 20 Lines | |||||