Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/svm/svm_closure.h
| Show First 20 Lines • Show All 215 Lines • ▼ Show 20 Lines | # ifdef __SUBSURFACE__ | ||||
| PrincipledDiffuseBsdf *bsdf = (PrincipledDiffuseBsdf *)bsdf_alloc( | PrincipledDiffuseBsdf *bsdf = (PrincipledDiffuseBsdf *)bsdf_alloc( | ||||
| sd, sizeof(PrincipledDiffuseBsdf), diff_weight); | sd, sizeof(PrincipledDiffuseBsdf), diff_weight); | ||||
| if (bsdf) { | if (bsdf) { | ||||
| bsdf->N = N; | bsdf->N = N; | ||||
| bsdf->roughness = roughness; | bsdf->roughness = roughness; | ||||
| /* setup bsdf */ | /* setup bsdf */ | ||||
| sd->flag |= bsdf_principled_diffuse_setup(bsdf); | sd->flag |= bsdf_principled_diffuse_setup(bsdf, PRINCIPLED_DIFFUSE_FULL); | ||||
| } | } | ||||
| } | } | ||||
| else if (subsurface > CLOSURE_WEIGHT_CUTOFF) { | else if (subsurface > CLOSURE_WEIGHT_CUTOFF) { | ||||
| Bssrdf *bssrdf = bssrdf_alloc(sd, subsurf_weight); | Bssrdf *bssrdf = bssrdf_alloc(sd, subsurf_weight); | ||||
| if (bssrdf) { | if (bssrdf) { | ||||
| bssrdf->radius = subsurface_radius * subsurface; | bssrdf->radius = subsurface_radius * subsurface; | ||||
| bssrdf->albedo = mixed_ss_base_color; | bssrdf->albedo = mixed_ss_base_color; | ||||
| Show All 17 Lines | # else | ||||
| PrincipledDiffuseBsdf *bsdf = (PrincipledDiffuseBsdf *)bsdf_alloc( | PrincipledDiffuseBsdf *bsdf = (PrincipledDiffuseBsdf *)bsdf_alloc( | ||||
| sd, sizeof(PrincipledDiffuseBsdf), diff_weight); | sd, sizeof(PrincipledDiffuseBsdf), diff_weight); | ||||
| if (bsdf) { | if (bsdf) { | ||||
| bsdf->N = N; | bsdf->N = N; | ||||
| bsdf->roughness = roughness; | bsdf->roughness = roughness; | ||||
| /* setup bsdf */ | /* setup bsdf */ | ||||
| sd->flag |= bsdf_principled_diffuse_setup(bsdf); | sd->flag |= bsdf_principled_diffuse_setup(bsdf, PRINCIPLED_DIFFUSE_FULL); | ||||
| } | } | ||||
| } | } | ||||
| # endif | # endif | ||||
| /* sheen */ | /* sheen */ | ||||
| if (diffuse_weight > CLOSURE_WEIGHT_CUTOFF && sheen > CLOSURE_WEIGHT_CUTOFF) { | if (diffuse_weight > CLOSURE_WEIGHT_CUTOFF && sheen > CLOSURE_WEIGHT_CUTOFF) { | ||||
| float m_cdlum = linear_rgb_to_gray(kg, base_color); | float m_cdlum = linear_rgb_to_gray(kg, base_color); | ||||
| float3 m_ctint = m_cdlum > 0.0f ? | float3 m_ctint = m_cdlum > 0.0f ? | ||||
| ▲ Show 20 Lines • Show All 940 Lines • Show Last 20 Lines | |||||