Fix #133229: Remove camera size optimization from SSS shader in Cycles
In Cycles, the subsurface scattering shader will switch to a diffuse shader under a few different conditions to improve performance and reduce noise. This commit removes the "switch back to diffuse if the scattering radius is less than a quarter of a pixel" optimization because in some scenes, this can result in noticable lines as the shader transitions between subsurface scattering and diffuse. Pull Request: https://projects.blender.org/blender/blender/pulls/133245
This commit is contained in:
@@ -305,20 +305,20 @@ ccl_device int bssrdf_setup(ccl_private ShaderData *sd,
|
||||
int bssrdf_channels = SPECTRUM_CHANNELS;
|
||||
Spectrum diffuse_weight = zero_spectrum();
|
||||
|
||||
/* Fall back to diffuse if the radius is smaller than a quarter pixel. */
|
||||
float min_radius = max(0.25f * sd->dP, BSSRDF_MIN_RADIUS);
|
||||
if (path_flag & PATH_RAY_DIFFUSE_ANCESTOR) {
|
||||
/* Always fall back to diffuse after a diffuse ancestor. Can't see it well then and adds
|
||||
/* Always fall back to diffuse after a diffuse ancestor. Can't see it that well and it adds
|
||||
* considerable noise due to probabilities of continuing the path getting lower and lower. */
|
||||
min_radius = FLT_MAX;
|
||||
bssrdf_channels = 0;
|
||||
diffuse_weight = bssrdf->weight;
|
||||
}
|
||||
|
||||
FOREACH_SPECTRUM_CHANNEL (i) {
|
||||
if (GET_SPECTRUM_CHANNEL(bssrdf->radius, i) < min_radius) {
|
||||
GET_SPECTRUM_CHANNEL(diffuse_weight, i) = GET_SPECTRUM_CHANNEL(bssrdf->weight, i);
|
||||
GET_SPECTRUM_CHANNEL(bssrdf->weight, i) = 0.0f;
|
||||
GET_SPECTRUM_CHANNEL(bssrdf->radius, i) = 0.0f;
|
||||
bssrdf_channels--;
|
||||
else {
|
||||
FOREACH_SPECTRUM_CHANNEL (i) {
|
||||
if (GET_SPECTRUM_CHANNEL(bssrdf->radius, i) < BSSRDF_MIN_RADIUS) {
|
||||
GET_SPECTRUM_CHANNEL(diffuse_weight, i) = GET_SPECTRUM_CHANNEL(bssrdf->weight, i);
|
||||
GET_SPECTRUM_CHANNEL(bssrdf->weight, i) = 0.0f;
|
||||
GET_SPECTRUM_CHANNEL(bssrdf->radius, i) = 0.0f;
|
||||
bssrdf_channels--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Submodule tests/data updated: 2e9d939dd2...c94e0deff0
Reference in New Issue
Block a user