-
Notifications
You must be signed in to change notification settings - Fork 365
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Call the new subsurface_bssrdf closure in OSL v1.14 and above, falling back to the original closure signature in earlier versions. - Call the new chiang_hair_bsdf closure in OSL v1.14 and above, falling back to a dielectric_bsdf approximation in earlier versions. - Inline the OSL implementations of displacement nodes for simplicity. - Update the minimum OSL and MDL versions in libraries documentation.
- Loading branch information
1 parent
28b7ba8
commit fc388e4
Showing
6 changed files
with
23 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
void mx_chiang_hair_bsdf(color tint_R, color tint_TT, color tint_TRT, float ior, | ||
vector2 roughness_R, vector2 roughness_TT, vector2 roughness_TRT, | ||
float cuticle_angle, vector absorption_coefficient, normal N, vector U, output BSDF bsdf) | ||
{ | ||
#if OSL_VERSION_MAJOR >= 1 && OSL_VERSION_MINOR >= 14 | ||
bsdf = chiang_hair_bsdf(N, U, tint_R, tint_TT, tint_TRT, ior, | ||
roughness_R.x, roughness_TT.x, roughness_TRT.x, roughness_R.y, roughness_TT.y, roughness_TRT.y, | ||
cuticle_angle, absorption_coefficient); | ||
#else | ||
bsdf = dielectric_bsdf(N, U, color(1), color(0), 0.1, 0.1, ior, "ggx"); | ||
#endif | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
void mx_subsurface_bsdf(float weight, color _color, color radius, float anisotropy, normal N, output BSDF bsdf) | ||
void mx_subsurface_bsdf(float weight, color albedo, color radius, float anisotropy, normal N, output BSDF bsdf) | ||
{ | ||
// TODO: Subsurface closure is not supported by vanilla OSL. | ||
bsdf = _color * weight * diffuse(N); | ||
#if OSL_VERSION_MAJOR >= 1 && OSL_VERSION_MINOR >= 14 | ||
bsdf = subsurface_bssrdf(N, weight * albedo, radius, anisotropy); | ||
#else | ||
bsdf = subsurface_bssrdf(N, weight * albedo, 1.0, radius, anisotropy); | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters