Lab 7: Gummy Bears

Goals

  • Implement a subsurface scattering model.
  • Reflect on the limitations of subsurface scattering.

The initial lab template can be accessed in the Lab 7 link on our discussion board. Part 1 mostly consists of following the equations we introduced to implement a subsurface scattering model. Part 2 will consist of reflecting on the video we started in class, and investigating some proposed strategies for addressing bias in computer graphics.

Part 1: implement a subsurface scattering model

When you open (and render) the initial template, the gummy bear (obtained here) will render using the Phong reflection model. There is a backlight with position xb and color cb which will contribute color through the gummy bear. Your task is to calculate the subsurface scattering component $c_{\mathrm{sss}}$ and then mix this with the Phong color $c_{\mathrm{phong}}$ (which is stored in cphong).

Part 1A: Cast a backlightRay from the surface intersection point (ixn.p) to the backlight xb. Then calculate the intersection point q of this backlight ray with the model (Part 1B). Note that the intersection call is already set up via model.intersect(backlightRay). The result is an object ixnBacklight with ixnBacklight.p (the intersection point) and ixnBacklight.n (the surface normal at the intersection point).

Part 1C: Then calculate the subsurface scattering color $c_{\mathrm{sss}}$ using the equations in the Chapter 8 reading. The coefficients ($k_m$: km, $\beta$: beta, $\gamma$: gamma, $\vec{x}_b$: xb, $c_b$: cb, $m$: m) are defined in the render function before the loop over the pixels. The eye $\vec{e}$ is defined by the eye variable and the clamp function is provided in the render.js file. When you calculate $s = \exp(-\gamma \lVert \vec{p} - \vec{q}\rVert^2 / \ell^2)$, note that $\ell$ is defined in the scale variable.

Also, note that $\alpha$ (alpha) is defined by the slider input which will allow you to investigate the effect of $\alpha$ on our model. The final color is:

$$ c = \alpha c_{\mathrm{phong}} + (1 - \alpha) c_{\mathrm{sss}}. $$

For $\alpha = 0.7$, the gummy bear should look like the picture at the top of the lab description.

Part 2: strategies for addressing bias in computer graphics

Think back to one of our main goals in computer graphics (see the notes from the first day, particularly slides 18 - 21, or pages 4 - 7 in the PDF). Please reflect on the implications of decades of computer graphics research focused on skin shaders that primarily apply to white skin, or hair simulations that primarily simulate straight hair. I would also suggest watching this other (short) video and note what Professor Kim says at the end.

For this part of the lab, you have two options. Pick one of the following:

  1. Watch the rest of the video we started in class (we stopped at about 24 minutes). Please summarize the strategies Professor Kim proposes in the "What do we do now" section of the presentation.

  2. Read this (very short) paper. What is the main suggestion in the "Proposed Anti-Racist Practices" section in the paper? What are the benefits and limitations of such an approach?

Please enter your response in the README.md file of your lab. There is no right or wrong answer for this part, so Part 2 will be graded as complete/incomplete. Please aim to write a paragraph of about 5 sentences.

Submission

The initial submission for the lab is due on Thursday 4/17 at 11:59pm EDT.

Please see the Setup page for instructions on how to commit and push your work to your GitHub repository and then submit your repository to Gradescope (in the Lab 7 assignment). I will then provide feedback within 1 week so you can edit your submission.

Remember, if you see a git error when you try to sync changes, you might need to run the following two commands in the Terminal before being able to sync (push) your changes:

git config --global pull.rebase true
git pull

© Philip Caplan, 2025