Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/shaders/node_subsurface_scattering.osl
| Show All 13 Lines | |||||
| * limitations under the License. | * limitations under the License. | ||||
| */ | */ | ||||
| #include "stdcycles.h" | #include "stdcycles.h" | ||||
| shader node_subsurface_scattering(color Color = 0.8, | shader node_subsurface_scattering(color Color = 0.8, | ||||
| float Scale = 1.0, | float Scale = 1.0, | ||||
| vector Radius = vector(0.1, 0.1, 0.1), | vector Radius = vector(0.1, 0.1, 0.1), | ||||
| float TextureBlur = 0.0, | float IOR = 1.4, | ||||
| float Sharpness = 0.0, | float Anisotropy = 0.0, | ||||
| string falloff = "cubic", | string method = "random_walk", | ||||
| normal Normal = N, | normal Normal = N, | ||||
| output closure color BSSRDF = 0) | output closure color BSSRDF = 0) | ||||
| { | { | ||||
| if (falloff == "gaussian") | |||||
| BSSRDF = Color * | BSSRDF = Color * | ||||
| bssrdf("gaussian", Normal, Scale * Radius, Color, "texture_blur", TextureBlur); | bssrdf(method, Normal, Scale * Radius, Color, "ior", IOR, "anisotropy", Anisotropy); | ||||
| else if (falloff == "cubic") | |||||
| BSSRDF = Color * bssrdf("cubic", | |||||
| Normal, | |||||
| Scale * Radius, | |||||
| Color, | |||||
| "texture_blur", | |||||
| TextureBlur, | |||||
| "sharpness", | |||||
| Sharpness); | |||||
| else if (falloff == "burley") | |||||
| BSSRDF = Color * bssrdf("burley", Normal, Scale * Radius, Color, "texture_blur", TextureBlur); | |||||
| else | |||||
| BSSRDF = Color * | |||||
| bssrdf("random_walk", Normal, Scale * Radius, Color, "texture_blur", TextureBlur); | |||||
| } | } | ||||