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:
Diffstat (limited to 'source/blender/gpu/shaders/material/gpu_shader_material_anisotropic.glsl')
-rw-r--r--source/blender/gpu/shaders/material/gpu_shader_material_anisotropic.glsl26
1 files changed, 18 insertions, 8 deletions
diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_anisotropic.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_anisotropic.glsl
index ec49cc86761..77de9e096a6 100644
--- a/source/blender/gpu/shaders/material/gpu_shader_material_anisotropic.glsl
+++ b/source/blender/gpu/shaders/material/gpu_shader_material_anisotropic.glsl
@@ -1,17 +1,27 @@
-#ifndef VOLUMETRICS
+
void node_bsdf_anisotropic(vec4 color,
float roughness,
float anisotropy,
float rotation,
vec3 N,
vec3 T,
- const float use_multiscatter,
- const float ssr_id,
+ float weight,
+ const float do_multiscatter,
out Closure result)
{
- node_bsdf_glossy(color, roughness, N, use_multiscatter, ssr_id, result);
+ N = safe_normalize(N);
+ vec3 V = cameraVec(g_data.P);
+ float NV = dot(N, V);
+
+ vec2 split_sum = brdf_lut(NV, roughness);
+
+ ClosureReflection reflection_data;
+ reflection_data.weight = weight;
+ reflection_data.color = (do_multiscatter != 0.0) ?
+ F_brdf_multi_scatter(color.rgb, color.rgb, split_sum) :
+ F_brdf_single_scatter(color.rgb, color.rgb, split_sum);
+ reflection_data.N = N;
+ reflection_data.roughness = roughness;
+
+ result = closure_eval(reflection_data);
}
-#else
-/* Stub anisotropic because it is not compatible with volumetrics. */
-# define node_bsdf_anisotropic(a, b, c, d, e, f, g, h, result) (result = CLOSURE_DEFAULT)
-#endif