diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-01-21 19:25:10 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-01-22 01:16:59 +0300 |
commit | a507c251b23f2fd6ef7758e443939ce0c5c09e61 (patch) | |
tree | 9fe4e1ac28c23cb52e334cd0ec7b92c83f4ffd5a /source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl | |
parent | 790025c01ed76c06e69e6054f1a718ca57771e28 (diff) |
Eevee: Put all constant uniforms in a global UBO.
This is an optimization / cleanup commit.
The use of a global ubo remove lots of uniform lookups and only transfert data when needed.
Lots of renaming for more consistent codestyle.
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl index e914228aded..429f6ea92e4 100644 --- a/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl @@ -1,10 +1,7 @@ /* ----------- Uniforms --------- */ uniform sampler2DArray probePlanars; -uniform float lodPlanarMax; - uniform sampler2DArray probeCubes; -uniform float lodCubeMax; /* ----------- Structures --------- */ @@ -162,12 +159,12 @@ vec3 probe_evaluate_cube(float id, CubeData cd, vec3 W, vec3 R, float roughness) float fac = saturate(original_roughness * 2.0 - 1.0); R = mix(intersection, R, fac * fac); - return textureLod_octahedron(probeCubes, vec4(R, id), roughness * lodCubeMax, lodCubeMax).rgb; + return textureLod_octahedron(probeCubes, vec4(R, id), roughness * prbLodCubeMax, prbLodCubeMax).rgb; } vec3 probe_evaluate_world_spec(vec3 R, float roughness) { - return textureLod_octahedron(probeCubes, vec4(R, 0.0), roughness * lodCubeMax, lodCubeMax).rgb; + return textureLod_octahedron(probeCubes, vec4(R, 0.0), roughness * prbLodCubeMax, prbLodCubeMax).rgb; } vec3 probe_evaluate_planar( |