Skip to content

Commit

Permalink
Added a toggle for the correct_albedo behavior.
Browse files Browse the repository at this point in the history
  • Loading branch information
apanteleev committed Sep 4, 2021
1 parent a476da8 commit bebcee7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/refresh/vkpt/shader/global_ubo.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
UBO_CVAR_DO(pt_beam_softness, 1.0) /* beam softness */ \
UBO_CVAR_DO(pt_bump_scale, 1.0) /* scale for normal maps [0..1] */ \
UBO_CVAR_DO(pt_cameras, 1) /* switch for security cameras, 0 or 1 */ \
UBO_CVAR_DO(pt_correct_albedo, 1) /* enables the correct_albedo material setting, 0 or 1 */ \
UBO_CVAR_DO(pt_direct_polygon_lights, 1) /* switch for direct lighting from local polygon lights, 0 or 1 */ \
UBO_CVAR_DO(pt_direct_roughness_threshold, 0.18) /* roughness value where the path tracer switches direct light specular sampling from NDF based to light based, [0..1] */ \
UBO_CVAR_DO(pt_direct_sphere_lights, 1) /* switch for direct lighting from local sphere lights, 0 or 1 */ \
Expand Down
3 changes: 3 additions & 0 deletions src/refresh/vkpt/shader/path_tracer_rgen.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@ is_camera(uint material)
vec3
correct_albedo(vec3 albedo)
{
if (global_ubo.pt_correct_albedo == 0)
return albedo;

return max(vec3(0), pow(albedo, vec3(ALBEDO_TRANSFORM_POWER)) * ALBEDO_TRANSFORM_SCALE + vec3(ALBEDO_TRANSFORM_BIAS));
}

Expand Down

0 comments on commit bebcee7

Please sign in to comment.