Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/shaders/irradiance_lib.glsl
| Show All 18 Lines | struct IrradianceData { | ||||
| vec3 cubesides[3]; | vec3 cubesides[3]; | ||||
| }; | }; | ||||
| #endif | #endif | ||||
| /** \} */ | /** \} */ | ||||
| /* ---------------------------------------------------------------------- */ | /* ---------------------------------------------------------------------- */ | ||||
| /** \name Resources | |||||
| * \{ */ | |||||
| uniform sampler2DArray irradianceGrid; | |||||
| /** \} */ | |||||
| /* ---------------------------------------------------------------------- */ | |||||
| /** \name Functions | /** \name Functions | ||||
| * \{ */ | * \{ */ | ||||
| vec4 irradiance_encode(vec3 rgb) | vec4 irradiance_encode(vec3 rgb) | ||||
| { | { | ||||
| float maxRGB = max_v3(rgb); | float maxRGB = max_v3(rgb); | ||||
| float fexp = ceil(log2(maxRGB)); | float fexp = ceil(log2(maxRGB)); | ||||
| return vec4(rgb / exp2(fexp), (fexp + 128.0) / 255.0); | return vec4(rgb / exp2(fexp), (fexp + 128.0) / 255.0); | ||||
| ▲ Show 20 Lines • Show All 170 Lines • Show Last 20 Lines | |||||