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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-02-08 18:19:04 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-02-09 21:58:42 +0300
commita6968e87f1338081f30725f8f2ca3460e280fea2 (patch)
tree0fdc61c15c86953fb431894871e7cf0a75dc5031 /intern/cycles/kernel/shaders
parent0df9b2c71517a98760a5e577f434d9d86e4e1910 (diff)
Cycles: add random walk subsurface scattering to Principled BSDF.
Differential Revision: https://developer.blender.org/D3054
Diffstat (limited to 'intern/cycles/kernel/shaders')
-rw-r--r--intern/cycles/kernel/shaders/node_principled_bsdf.osl11
1 files changed, 9 insertions, 2 deletions
diff --git a/intern/cycles/kernel/shaders/node_principled_bsdf.osl b/intern/cycles/kernel/shaders/node_principled_bsdf.osl
index 0e31dcedee4..fc0a1c894da 100644
--- a/intern/cycles/kernel/shaders/node_principled_bsdf.osl
+++ b/intern/cycles/kernel/shaders/node_principled_bsdf.osl
@@ -19,6 +19,7 @@
shader node_principled_bsdf(
string distribution = "Multiscatter GGX",
+ string subsurface_method = "burley",
color BaseColor = color(0.8, 0.8, 0.8),
float Subsurface = 0.0,
vector SubsurfaceRadius = vector(1.0, 1.0, 1.0),
@@ -58,8 +59,14 @@ shader node_principled_bsdf(
if (diffuse_weight > 1e-5) {
if (Subsurface > 1e-5) {
color mixed_ss_base_color = SubsurfaceColor * Subsurface + BaseColor * (1.0 - Subsurface);
- BSDF = mixed_ss_base_color * bssrdf("principled", Normal, Subsurface * SubsurfaceRadius, SubsurfaceColor, "roughness", Roughness);
- } else {
+ if (subsurface_method == "burley") {
+ BSDF = mixed_ss_base_color * bssrdf("principled", Normal, Subsurface * SubsurfaceRadius, SubsurfaceColor, "roughness", Roughness);
+ }
+ else {
+ BSDF = mixed_ss_base_color * bssrdf("principled_random_walk", Normal, Subsurface * SubsurfaceRadius, SubsurfaceColor, "roughness", Roughness);
+ }
+ }
+ else {
BSDF = BaseColor * principled_diffuse(Normal, Roughness);
}