Keywords: Physically Based Rendering (PBR); Screen Space Reflection (SSR); Signed Distance Function (SDF)
PBR & SSR
PBR & SSR with screen-space Degree of Field (DOF)
Relative SDF operations:
Limited repeat
Symmetric
Smooth Edge
Reference:
vec3 subsurfaceColor(vec3 lightDir, vec3 normal, vec3 viewVec, float thin) {
vec3 scatterDir = lightDir + normal * DISTORTION; // Last term is tunable
float lightReachingEye = pow(clamp(dot(viewVec, -scatterDir),
0.0, 1.0), GLOW) * SCALE;
float attenuation = max(0.0, dot(normal, lightDir)
+ dot(viewVec, -lightDir));
float totalLight = attenuation * (lightReachingEye + AMBIENT) * thin;
return material.albedo * light.color * totalLight;
}