X-Git-Url: https://gitweb.ps.run/subsurface_scattering/blobdiff_plain/c99ecda7bed596922125f6b1ef1ef2ae8f27703e..refs/heads/main:/shaders/frag_irradiance.glsl diff --git a/shaders/frag_irradiance.glsl b/shaders/frag_irradiance.glsl index b985acf..2a7edec 100644 --- a/shaders/frag_irradiance.glsl +++ b/shaders/frag_irradiance.glsl @@ -40,14 +40,12 @@ void main() // thickness float distanceToBackside = length(FragPos - Backside); - if (renderState == 2) { - if (distanceToBackside != 0) { - // add translucency by amplifying color inverse to the thickness - // (1 - diff) is part of the irradiance term, - // if the light hits the object straight at 90° - // most light is received - result += objectColor * pow(powBase, powFactor / pow(distanceToBackside, 0.6)) * transmittanceScale * (1 - diff); - } + if (distanceToBackside != 0) { + // add translucency by amplifying color inverse to the thickness + // (1 - diff) is part of the irradiance term, + // if the light hits the object straight at 90° + // most light is received + result += objectColor * pow(powBase, powFactor / pow(distanceToBackside, 0.6)) * transmittanceScale * (1 - diff); } FragColor = vec4(result, 1.0f);