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_hair.glsl')
-rw-r--r--source/blender/gpu/shaders/material/gpu_shader_material_hair.glsl46
1 files changed, 46 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_hair.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_hair.glsl
new file mode 100644
index 00000000000..7bf8795495a
--- /dev/null
+++ b/source/blender/gpu/shaders/material/gpu_shader_material_hair.glsl
@@ -0,0 +1,46 @@
+
+void node_bsdf_hair(vec4 color,
+ float offset,
+ float roughness_u,
+ float roughness_v,
+ vec3 T,
+ float weight,
+ out Closure result)
+{
+ ClosureHair hair_data;
+ hair_data.weight = weight;
+ hair_data.color = color.rgb;
+ hair_data.offset = offset;
+ hair_data.roughness = vec2(roughness_u, roughness_v);
+ hair_data.T = T;
+
+ result = closure_eval(hair_data);
+}
+
+void node_bsdf_hair_principled(vec4 color,
+ float melanin,
+ float melanin_redness,
+ vec4 tint,
+ vec3 absorption_coefficient,
+ float roughness,
+ float radial_roughness,
+ float coat,
+ float ior,
+ float offset,
+ float random_color,
+ float random_roughness,
+ float random,
+ float weight,
+ out Closure result)
+{
+ /* Placeholder closure.
+ * Some computation will have to happen here just like the Principled BSDF. */
+ ClosureHair hair_data;
+ hair_data.weight = weight;
+ hair_data.color = color.rgb;
+ hair_data.offset = offset;
+ hair_data.roughness = vec2(0.0);
+ hair_data.T = g_data.T;
+
+ result = closure_eval(hair_data);
+}