From: Draco18s Majestic
Subsurface scatter. It's currently near impossible in 3D rendering as the physics of it not only need raytracing (OMG CPU intensive) but are exceedingly complex.
Old post, but I am going to comment on this one issue anyway. Subsurface scatter is ***not*** done via raytracing, it uses a cheat. The physics of it is in fact damn near impossible to do at all. "Real" subsurface scattering would involve a media, under the surface, with variable levels of color, reflection, density, etc. POV-Ray, which is an attempt to do a 100% physics based engine for 3D, has trouble doing this, and it **has** media.
In actuality, SSS is done far more simply. One uses two surfaces. The top surface is semi-transparent, the under surface is generally one without transparency, though one could make it semi-transparent too, to allow you to see stuff "below" that too. The trick is simply this. When a ray hits the surface, it normally bounces at a "predictable" angle. This angle with always be a set angle, depending one the properties of the surface it hit, and any things like IOR (internal refraction), which might "bend" the ray as it passes through the surface. SSS works by slightly randomizing where the ray gets bent. So, if you have an IOR of .8, the *actual* numbers generated, semi-randomly, across the surface may range between .7 and .9, or some such variation. Since the ray doesn't *enter* at the angle it would have normally, it picks up colors from the subsurface that do not match what it would have with "normal" IOR. The result looks like real skin.
Real "physics based" SSS would, as I said, use media. The problem being, *that* is mathematically intensive, nearly impossible to get right, and also not perfect, since its kind of hard to generate media with blood vessels, etc. running through it, at least not without a *huge* amount of extra meshes, multiple media types, etc. Not even Pixar or ILM would be insane enough to use that method. POV-Ray BTW doesn't support SSS at all, its not a "physics based" solution, so its not included as an option. Maya and the rest are not so picky, so they use SSS *instead* of media.
Now, just to be clear, this means that the difference in the math between "normal" traces and SSS is almost nothing:
Normal:
Did ray contact an object?
Yes - Get surface color. Is that color partly transparent?
Yes - Does it have IOR?
Yes - Bend the ray path by the IOR, then continue to the next surface.
Repeat 1-4, until you hit the light source instead.
SSS:
Did ray contact an object?
Yes - Get surface color. Is that color partly transparent?
Yes - Does it have IOR?
Yes - Bend the ray path by the IOR +- random scatter, then continue to the next surface.
Repeat 1-4, until you hit the light source instead.
Yeah, that single random number is going to cause **huge** lag. lol
Media, if someone uses that... Now that is going to take a scene that is done in a pure physics engine like POV-Ray, and renders in a half second, and make it render in anything from 5 minutes to 5 hours, depending on how much media there is, and other factors. Its also why IOR is "only" calculated based on when you hit the first and last side of an object, not throughout it, like the real world, and thus why you can't have objects with "variable" IOR, like exist in the real world. Figuring *that* would make calculating SSS via media look like building a 747 from rice grains, and probably take about as long to finish. lol