Merge branch 'blender-v4.0-release' into main
This commit is contained in:
commit
1e567d05e9
|
@ -243,11 +243,15 @@ def do_versions(self):
|
||||||
layer.samples *= layer.samples
|
layer.samples *= layer.samples
|
||||||
cscene["use_square_samples"] = False
|
cscene["use_square_samples"] = False
|
||||||
|
|
||||||
# Disable light tree for existing scenes.
|
|
||||||
if version <= (3, 5, 3):
|
if version <= (3, 5, 3):
|
||||||
cscene = scene.cycles
|
cscene = scene.cycles
|
||||||
|
# Disable light tree for existing scenes.
|
||||||
if not cscene.is_property_set("use_light_tree"):
|
if not cscene.is_property_set("use_light_tree"):
|
||||||
cscene.use_light_tree = False
|
cscene.use_light_tree = False
|
||||||
|
# Sampling pattern settings are hidden behind a debug menu. Switch to the
|
||||||
|
# default faster and fully featured (Supports Scrambling Distance)
|
||||||
|
# Tabulated Sobol.
|
||||||
|
cscene.sampling_pattern = 'TABULATED_SOBOL'
|
||||||
|
|
||||||
# Lamps
|
# Lamps
|
||||||
for light in bpy.data.lights:
|
for light in bpy.data.lights:
|
||||||
|
|
|
@ -831,7 +831,7 @@ ccl_device void osl_closure_bssrdf_setup(KernelGlobals kg,
|
||||||
/* create one closure per color channel */
|
/* create one closure per color channel */
|
||||||
bssrdf->albedo = closure->albedo;
|
bssrdf->albedo = closure->albedo;
|
||||||
bssrdf->N = maybe_ensure_valid_specular_reflection(sd, closure->N);
|
bssrdf->N = maybe_ensure_valid_specular_reflection(sd, closure->N);
|
||||||
bssrdf->alpha = sqr(closure->roughness);
|
bssrdf->alpha = closure->roughness;
|
||||||
bssrdf->ior = closure->ior;
|
bssrdf->ior = closure->ior;
|
||||||
bssrdf->anisotropy = closure->anisotropy;
|
bssrdf->anisotropy = closure->anisotropy;
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ shader node_principled_bsdf(string distribution = "multi_ggx",
|
||||||
SubsurfaceScale * SubsurfaceRadius,
|
SubsurfaceScale * SubsurfaceRadius,
|
||||||
BaseColor,
|
BaseColor,
|
||||||
"roughness",
|
"roughness",
|
||||||
Roughness,
|
r2,
|
||||||
"ior",
|
"ior",
|
||||||
subsurface_ior,
|
subsurface_ior,
|
||||||
"anisotropy",
|
"anisotropy",
|
||||||
|
@ -82,14 +82,16 @@ shader node_principled_bsdf(string distribution = "multi_ggx",
|
||||||
BSDF = mix(BSDF, BaseColor * SubsurfBSDF, subsurface_weight);
|
BSDF = mix(BSDF, BaseColor * SubsurfBSDF, subsurface_weight);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Apply specular tint */
|
if (eta != 1.0) {
|
||||||
color F0 = f0 * specular_tint;
|
/* Apply specular tint */
|
||||||
color F90 = color(1.0);
|
color F0 = f0 * specular_tint;
|
||||||
|
color F90 = color(1.0);
|
||||||
|
|
||||||
BSDF = layer(
|
BSDF = layer(
|
||||||
generalized_schlick_bsdf(
|
generalized_schlick_bsdf(
|
||||||
Normal, T, color(1.0), color(0.0), alpha_x, alpha_y, F0, F90, -eta, distribution),
|
Normal, T, color(1.0), color(0.0), alpha_x, alpha_y, F0, F90, -eta, distribution),
|
||||||
BSDF);
|
BSDF);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
closure color TransmissionBSDF = 0;
|
closure color TransmissionBSDF = 0;
|
||||||
|
|
|
@ -327,8 +327,19 @@ ccl_device
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Apply IOR adjustment */
|
||||||
|
float eta = ior;
|
||||||
|
float f0 = F0_from_ior(eta);
|
||||||
|
if (specular_ior_level != 0.5f) {
|
||||||
|
f0 *= 2.0f * specular_ior_level;
|
||||||
|
eta = ior_from_F0(f0);
|
||||||
|
if (ior < 1.0f) {
|
||||||
|
eta = 1.0f / eta;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Specular component */
|
/* Specular component */
|
||||||
if (reflective_caustics) {
|
if (reflective_caustics && eta != 1.0f) {
|
||||||
ccl_private MicrofacetBsdf *bsdf = (ccl_private MicrofacetBsdf *)bsdf_alloc(
|
ccl_private MicrofacetBsdf *bsdf = (ccl_private MicrofacetBsdf *)bsdf_alloc(
|
||||||
sd, sizeof(MicrofacetBsdf), weight);
|
sd, sizeof(MicrofacetBsdf), weight);
|
||||||
ccl_private FresnelGeneralizedSchlick *fresnel =
|
ccl_private FresnelGeneralizedSchlick *fresnel =
|
||||||
|
@ -337,17 +348,6 @@ ccl_device
|
||||||
NULL;
|
NULL;
|
||||||
|
|
||||||
if (bsdf && fresnel) {
|
if (bsdf && fresnel) {
|
||||||
/* Apply IOR adjustment */
|
|
||||||
float eta = ior;
|
|
||||||
float f0 = F0_from_ior(eta);
|
|
||||||
if (specular_ior_level != 0.5f) {
|
|
||||||
f0 *= 2.0f * specular_ior_level;
|
|
||||||
eta = ior_from_F0(f0);
|
|
||||||
if (ior < 1.0f) {
|
|
||||||
eta = 1.0f / eta;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bsdf->N = valid_reflection_N;
|
bsdf->N = valid_reflection_N;
|
||||||
bsdf->ior = eta;
|
bsdf->ior = eta;
|
||||||
bsdf->T = T;
|
bsdf->T = T;
|
||||||
|
@ -383,7 +383,7 @@ ccl_device
|
||||||
bssrdf->albedo = rgb_to_spectrum(base_color);
|
bssrdf->albedo = rgb_to_spectrum(base_color);
|
||||||
bssrdf->N = maybe_ensure_valid_specular_reflection(sd, N);
|
bssrdf->N = maybe_ensure_valid_specular_reflection(sd, N);
|
||||||
bssrdf->alpha = sqr(roughness);
|
bssrdf->alpha = sqr(roughness);
|
||||||
bssrdf->ior = ior;
|
bssrdf->ior = eta;
|
||||||
bssrdf->anisotropy = stack_load_float(stack, data_subsurf.w);
|
bssrdf->anisotropy = stack_load_float(stack, data_subsurf.w);
|
||||||
if (subsurface_method == CLOSURE_BSSRDF_RANDOM_WALK_SKIN_ID) {
|
if (subsurface_method == CLOSURE_BSSRDF_RANDOM_WALK_SKIN_ID) {
|
||||||
bssrdf->ior = stack_load_float(stack, data_subsurf.x);
|
bssrdf->ior = stack_load_float(stack, data_subsurf.x);
|
||||||
|
|
Loading…
Reference in New Issue