View Full Version : SubSurface Scattering Shader Questions
Lyrid 06282005, 08:09 AM I want to program some subsurface scattering shaders with different method using mental ray. So I have read some articles for seeking the algorithm, included "A Parctical Model for Subsurface Light Transport" written by Henrik Wann Jensen, some papers about BSSRDF and so on. (not clearly unerstand)
And I know four different methods to simulate this effect:
1. ray tracing (related to that paper written by Jensen);
2. photon map.
3. shadow map.
4. light map.
The BSSRDF is divided into two parts: single scattering and multiple scattering. So the four methods must be able to calculate the two parts. But I'm not totally understand the algorithm and how to achieve it in programming.
For example: In ray tracing simulation, the dipole method was useded to calculate the multiple scattering. But how can I translate it into programming?
Or have someone the codes of subsurface scattering shaders?


rendermaniac
06282005, 09:21 AM
All those techniques use raytracing. Photon Maps and light maps are just a way of storing the result. And shadow maps are a way of raytracing if your renderer does not support it.
Simon
playmesumch00ns
06282005, 10:33 AM
I want to program some subsurface scattering shaders with different method using mental ray. So I have read some articles for seeking the algorithm, included "A Parctical Model for Subsurface Light Transport" written by Henrik Wann Jensen, some papers about BSSRDF and so on. (not clearly unerstand)
And I know four different methods to simulate this effect:
1. ray tracing (related to that paper written by Jensen);
2. photon map.
3. shadow map.
4. light map.
The BSSRDF is divided into two parts: single scattering and multiple scattering. So the four methods must be able to calculate the two parts. But I'm not totally understand the algorithm and how to achieve it in programming.
For example: In ray tracing simulation, the dipole method was useded to calculate the multiple scattering. But how can I translate it into programming?
Or have someone the codes of subsurface scattering shaders?
Single scattering is easiest to calculate using raytracing. You just trace a ray down into the surface, then intergrate along it, tracing shadow rays toward each light as you go. It's fairly trivial to do this using shadow maps too.
Multiple scattering is best calculated using a point cloud. This is the method jensen uses in both his papers on the subject. The dipole approximation is pretty trivial too: you just calculate sigma_tr, zr and zv from your input parameterseither using sigma_s_prime and sigma_a or using the alpha inversion methodthen loop over all the points in your point cloud and calculate the diffuse reflectane (equation 4 in "a practical model for subsurface light transport" ).
You can calculate a local approximation to multiple scattering using shadow maps, but this is only suitable for highly scattering materials like skin. Ryan Heniser's written a decent implementation of this with an accompanying tutorial here:
http://www.rendermanacademy.com/docs/ClassFrame01.php?sel=1
funfun
06282005, 07:53 PM
Jensen mentioned dr is the distance to the real light source and dv is the distance to the virtual light source, is the real light source = all light in the scene? what is the virtual light source?
In fiigure 3 of "A Parctical Model for Subsurface Light Transport", there are 2 lights sources and 1 virtual light source (negative ?) , what is the difference and any relation between these 3 lights?
playmesumch00ns
06292005, 12:39 PM
The real and virtual light sources are constructs for the dipole diffusion approximation. They don't have any physical meaning except as a visualiation aid. In the paper he shows how to calculate zr and zv:
zr = 1.0 / sigma_t_prime;
zv = zr + 4*A*D;
ThE_JacO
06292005, 12:49 PM
if you want to see how some of this translates into code, Daniel Rind wrote a pretty good SSS shader for MRay called diffusion, and the download comes with VS project and source code:
http://animus.brinkster.net/index.html
Lyrid
06302005, 08:11 AM
Thanks playmesumch00ns and ThE JacO!
That's what I need. I will study the code as much as I can :)
CGTalk Moderation
06302005, 08:11 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©20002014, Jelsoft Enterprises Ltd.