Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-01-21 19:25:10 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-01-22 01:16:59 +0300
commita507c251b23f2fd6ef7758e443939ce0c5c09e61 (patch)
tree9fe4e1ac28c23cb52e334cd0ec7b92c83f4ffd5a /source/blender/draw/engines/eevee/shaders/effect_subsurface_frag.glsl
parent790025c01ed76c06e69e6054f1a718ca57771e28 (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/effect_subsurface_frag.glsl')
-rw-r--r--source/blender/draw/engines/eevee/shaders/effect_subsurface_frag.glsl6
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/effect_subsurface_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_subsurface_frag.glsl
index a0c39c79048..184eac54c26 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_subsurface_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_subsurface_frag.glsl
@@ -8,7 +8,6 @@ layout(std140) uniform sssProfile {
int sss_samples;
};
-uniform float jitterThreshold;
uniform sampler2D depthBuffer;
uniform sampler2D sssData;
uniform sampler2D sssAlbedo;
@@ -22,7 +21,6 @@ uniform sampler2DArray utilTex;
out vec4 FragColor;
uniform mat4 ProjectionMatrix;
-uniform vec4 viewvecs[2];
float get_view_z_from_depth(float depth)
{
@@ -31,7 +29,7 @@ float get_view_z_from_depth(float depth)
return -ProjectionMatrix[3][2] / (d + ProjectionMatrix[2][2]);
}
else {
- return viewvecs[0].z + depth * viewvecs[1].z;
+ return viewVecs[0].z + depth * viewVecs[1].z;
}
}
@@ -66,7 +64,7 @@ void main(void)
vec3 accum = sss_data.rgb * kernel[0].rgb;
for (int i = 1; i < sss_samples && i < MAX_SSS_SAMPLES; i++) {
- vec2 sample_uv = uvs + kernel[i].a * finalStep * ((abs(kernel[i].a) > jitterThreshold) ? dir : dir_rand);
+ vec2 sample_uv = uvs + kernel[i].a * finalStep * ((abs(kernel[i].a) > sssJitterThreshold) ? dir : dir_rand);
vec3 color = texture(sssData, sample_uv).rgb;
float sample_depth = texture(depthBuffer, sample_uv).r;
sample_depth = get_view_z_from_depth(sample_depth);