subsurface.cpp
// Gaussian fit to dipole subsurface diffuse model of skin by d'Eon et. al.
// This is effectively the lookup table from "Pre-Integrated Skin Scattering" by Penner et. al. 
//
// ref: https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch14.html
//
Gaussian fit to dipole subsurface diffuse model of skin by d'Eon et. al.
This is effectively the lookup table from "Pre-Integrated Skin Scattering" by Penner et. al.


Gaussian fit to dipole subsurface diffuse model of skin by d ' Eon et . al . This is effectively the lookup table from " Pre - Integrated Skin Scattering " by Penner et . al .
vec3 pss_NVIDIA_SumOfGaussiansFit( float dist, float w )
{
    static vec4 gaussianFitTable[] = {
        vec4( 0.233f, 0.455f, 0.649f, 0.0064f ),
        vec4( 0.100f, 0.336f, 0.344f, 0.0484f ),
        vec4( 0.118f, 0.198f, 0.0f,   0.187f ),
        vec4( 0.113f, 0.007f, 0.007f, 0.567f ),
        vec4( 0.358f, 0.004f, 0.0f,   1.99f ),
        vec4( 0.078f, 0.0f,   0.0f,   7.41f )
    };
    vec3 totalWeight;
    for( auto g : gaussianFitTable ) {
        auto weight = pss_Gaussian( dist, w * g.w );
        totalWeight += weight * vec3( g.r, g.g, g.b );
    }
    return totalWeight;
}
vec3 pss_NVIDIA_SumOfGaussiansFit ( float dist , float w ) { static vec4 gaussianFitTable [ ] = { vec4 ( 0.233f , 0.455f , 0.649f , 0.0064f ) , vec4 ( 0.100f , 0.336f , 0.344f , 0.0484f ) , vec4 ( 0.118f , 0.198f , 0.0f , 0.187f ) , vec4 ( 0.113f , 0.007f , 0.007f , 0.567f ) , vec4 ( 0.358f , 0.004f , 0.0f , 1.99f ) , vec4 ( 0.078f , 0.0f , 0.0f , 7.41f ) } ; vec3 totalWeight ; for ( auto g : gaussianFitTable ) { auto weight = pss_Gaussian ( dist , w * g . w ) ; totalWeight += weight * vec3 ( g . r , g . g , g . b ) ; } return totalWeight ; }
Gaussian fit to dipole subsurface diffuse model of skin by d'Eon et.
Gaussian fit to dipole subsurface diffuse model of skin by d ' Eon et .