Current stable version: 0.1.1

SubSurface Scattering

 

Personal Information

Name: Yong Li
E-mail address: liyong03@gmail.com
IRC: ronnie @#yafaray


Idea to implement.

Synopsis and Goals. 

SubSurface Scattering material is very common in daily life, such as jade, marble, and human skin, and a lot of algorithms and models are proposed for rendering this material. However Yafaray still doesn't support this material up to now. So this project will implement subsurface scattering shader for Yafaray, and this shader should work across all Yafaray lighting methods. The main goal of this project is to make user could easily render organic materials, plastics, human skin, etc using this component.

Detailed description. 

For rendering subsurface scattering material, we can use traditional Monte Carlo method. But the main disadvantage of this method is very slow, it can take hours to simulate the physical phenomenon. Therefor I think this method is not proper for Yafaray, it only could be used as ground truth for comparing. For accelerating the rendering process, a lot of approximation methods are proposed [1][2][3][4][5].

After surveying, I decide to implement photon diffusion for Yafaray, which is introduced in [5]. There are some advantages of photon diffusion:

  • support dipole, multipole, quadpole diffusion approximation.
  • account for internal blocker, complex geometry translucent inter-scattering
  • support anisotropic surface profiles due to oblique illumination
  • support volumetric effects such as shadows and caustics
  • efficient

Because photon diffusion uses independent photon map, it can work well with existing lighting methods as caustics. For different inner scattering rate or absorb rate, user could specify a volumetric texture/map to configure them. Object's inner structure also can be added by volumetric texture/map. We also need implement new subsurface scattering material to Yafaray for working with photon diffusion and all lighting methods. Additionally I also want to try to implement the multi-layered translucent model[4] with photon diffusion. This multi-layered model can render skin, leaf, etc more realistically. For more efficient and better rendering subsurface scattering, another work should be done, this work is to improve the photons shooting process in Yafaray. Because the photons are shot uniformly in Yafaray's caustic map now. When the light source is area shape, the rendering result of caustic would be unclear. I think it need an adaptive method to shoot photon to improve solve this problem.

This project can be done by following steps:

  1. implement the new subsurface scattering material
  2. implement photon diffusion only support dipole and combine it within existing lighting methods.
  3. then add multipole and quadpole to photon diffusion
  4. improve the photon shooting process of caustic and subsurface scattering photon map
  5. add other features, such as roughness surface, multi-layered translucent material, etc

Implement detail.

For adding subsurface scattering rendering to Yafaray, I need to do four works: implementing SSS photon map, adding SSS material, changing all lighting methods(integrators), and improving Photon shooting.

Implementing SSS photon map:

The subsurface photon map is like caustic photon map which is independent with lighting methods. But there are some differences between them, SSS photon map is a volumetric map; and it need a new hierarchical approximation, such as octree; and it need gather photons from a sphere rather than a disc. So I need to implement a new photon map class SSSPhotonMap_t inherited from pthotonMap_t, and a new gather class SSSPhotonGather_t inherited from photonGather_t. 

Adding SSS material:

I should add a new subsurface scattering material class Transluency to Yafaray's material system. This material is inherited from class material_t. Meanwhile I need to override these functions, such as eval(), sample(), etc, which use SSSPhotonMap_t to implement sampling or evaluating, etc.

Changing all lighting methods(integrators):

I need add SSSPhotonMap_t to all existing light methods, because when there are translucent objects in scene, it need to create SSSPhotonMap_t. And maybe I need to implement a new volume integrator, because when integrating the shading color, subsurface scattering object need to compute single scattering and multiple scattering, and the single scattering need a volume integrator to estimate the shading color. 

Improving Photon shooting:

An adaptive method can be used to improve Photon shooting part of caustic and SSS photon map. The reason of worse caustic under area light is the number of photons shot to the caustic object is small because of uniformly sampling. So the solution is to let the user specify the number of gathered photons to make sure enough photons caustic need, then the program will adaptively shoot enough photons to relevant area.

(All these details are proposed under the current understanding of Yafaray's source code, it need to be updated after further learning the source code)

Risk Assessment.

The algorithm of photon diffusion with dipole, multipole and quadpole is clear and definite, and it's very suit for adding to Yafaray. I believe this part can be finished on time without any difficulty. But adding other features such as multi-layered translucent material maybe has potential risk. That's because the model of these feature is independent with photon diffusion, I need to do experiments to figure out whether these features can be used in photon diffusion and how to integrate them to Yafaray.

Workflow and Usabitily.

I think the using of subsurface scattering material will be as easy as other material, except maybe needs specify volumetric texture/map. The rendering algorithm will be transparent to user, the user just need add this new material to objects, and specify the surface integrator, then Yafaray will render it for user.

Temptative schedule. 

  • present - April 25: Continue reading source code and reference papers, design implementation of photon diffusion, discuss with mentors.
  • April 26 - July 04: Design the code structure and possible modification of Yafaray source code, then write a detailed design document
  • May 04 - July 04: Start coding, try to add photon diffusion with dipole to Yafaray before mid-term.
  • July 05 - July 12: Mid-term evaluation.
  • July 13 - July 20: Finish photon diffusion with multipole and quadpole.
  • July 21 - July 25: Tune the code and test it.
  • July 26 - August 15: Try to add other features such as multi-layered translucent material (potential risky).
  • August 16: Final evaluation.

What have done by now.

  • Collected references about subsurface scattering, and read most of them. 
  • Read some source code of Yafaray, and understood the architecture of Yafaray. 
  • Started doing some experiment with Yafaray source code.
  • Discussed with mentors about this project. 

 

Bio.

I'm Yong Li, a master student of computer science department at Tsinghua University in China. My research majors in Computer Graphics[6]. My previous research works concentrate on Rendering and Image Editing. :D 

CG background
I have almost 3 years' experience on rendering. I know most of popular algorithms of rendering, and I'm proficient at algorithm of real-time rendering. I learnt ray-tracing and photon mapping by reading the book "Physically Based Rendering: From Theory to Implementation"[7] and its source code. I also like to read siggraph papers and course notes to learn other knowledge about CG. 

I have been done some researches on subsurface scattering. In that project, we analyzed Jensen's model of subsurface scattering and proposed our algorithm for real-time editing translucent material (subsurface scattering material). Finally I coauthored a paper which was accepted by Eurographics 2007. The paper's title is "Real-time Homogenous Translucent Material Editing"[8]. Here is a result image:
Image

Because of my CG background and related experience, I chose to apply this project.

Software skill
I'm good at C, C++, Python, Object-C and Cocoa framework. I have been used C/C++ about 5 years and Python/Object-C for 3 years. In my research group[1], I have been done a lot of task of development. I finished almost all the software and demos of our research papers. And I also finished some cooperation projects between our group and companies. Besides, I like writing some software for myself. [9] is an IM client written myself and I have made it open source on Google code. 


References.

[1]:http://graphics.stanford.edu/papers/bssrdf/

[2]:http://graphics.stanford.edu/papers/scatteringeqns/

[3]:http://graphics.stanford.edu/papers/scatteringeqns/ 

[4]:http://graphics.ucsd.edu/papers/layered/ 

[5]:http://graphics.ucsd.edu/~henrik/papers/photon_diffusion/

[6]:http://cg.cs.tsinghua.edu.cn/

[7]:http://www.pbrt.org/

[8]:http://cg.cs.tsinghua.edu.cn/papers/DipoleEditting_final.pdf

[9]:http://code.google.com/p/cocoa-fetion/