EEVEE Next: Subsurface Scattering #107407

Merged
Miguel Pozo merged 24 commits from pragma37/blender:pull-eevee-next-sss into main 2023-06-15 15:49:12 +02:00
1 changed files with 7 additions and 0 deletions
Showing only changes of commit 07dce2224b - Show all commits

View File

@ -121,11 +121,18 @@ void SubsurfaceModule::precompute_transmittance_profile()
/* Normalize over the disk. */ /* Normalize over the disk. */
profile[i] /= area_accum; profile[i] /= area_accum;
} }
/** NOTE: There's something very wrong here.
* This should be a small remap,
* but current profile range goes from 0.0399098 to 0.0026898. */
/* Make a smooth gradient from 1 to 0. */ /* Make a smooth gradient from 1 to 0. */
float range = profile.first() - profile.last(); float range = profile.first() - profile.last();
float offset = profile.last(); float offset = profile.last();
for (float &value : profile) { for (float &value : profile) {
value = (value - offset) / range; value = (value - offset) / range;
/** HACK: Remap the curve to better fit Cycles values. */
value = std::pow(value, 1.6f);
} }
profile.first() = 1; profile.first() = 1;
profile.last() = 0; profile.last() = 0;