Subsurface scattering shader in OGL assembly?

Hello,

I know the basics on how to write fragment programs for Doom 3, and I've done a few, but could someone point me in the right direction as to how I'd write a subsurface scattering shader?

I know Doom doesn't support different light interaction shaders, but from what i've done, Doom's materials system is pretty flexible in terms of surface programs (l've written a metallic surface shader and applied it to specific materials). Would a subsurface scattering shader be like this or will I truly need a second interaction program?

Thanks, guys!
 
I don't know much about Doom3's material system, but there are a few different ways to write a sub-surface scattering shader...

Among them, there's the simple straight forward approach which uses a mere HG phase function, and which can be implemented as a simple shader (no multipass, no need for precomputing). It works, but it's a tad slow - although on a latest generation card, real-time is achievable.

For this approach, I believe you'll find Matt Pharr's Renderman skin shader is a good starting point.

Other approaches includes using precomputed sub-surface scattering (spherical harmonics, requires precomputing, best for static or semi-static objects) or using a mere blurr in texture space (using the matrix3 trick, à-la Ruby, requires multipasses).
 
Back
Top