POV-Ray : Newsgroups : povray.binaries.images : Another SSS technique (28k jpg) : Re: Another SSS technique (28k jpg) Server Time
1 Aug 2024 10:16:22 EDT (-0400)
  Re: Another SSS technique (28k jpg)  
From: stbenge
Date: 8 Aug 2008 18:07:02
Message: <489cc386@news.povray.org>
Blue Herring wrote:
> Really neat!  I've been banging my head on this a lot lately and 
> achieved only mediocre results with high render times to boot.  It would 
> great to hear how you did it, or see some code, if you feel like giving 
> an explanation a shot.

Okay, here goes.

Imagine a virtual df3 setup where a 3d grid pattern exists around a 
specified object. For this setup I used three planar patterns, each 
oriented along the x, y and z axes. I placed loops within the 
pigment_maps for each planar pattern so that I could test each "cell" 
within the virtual density map.

For each cell a ray is shot from a specified point in space where the 
light_source resides. If a ray lands on the object within the cell, that 
part of the density pattern is given a white value. If the ray doesn't 
hit the object in that cell, the entry is left black.

The result is an approximation of where the light lands on the surface 
of the object. Imagine how this would look like as a density pattern. It 
doesn't look too great, as there is major stair-stepping present.

To reduce the stair-stepping effect, I go through the above steps at 
different sample rates. For instance, I could start off with a density 
map with <3,3,3> elements. I could then sample at <4,4,4>, <5,5,5>, and 
so on, and average the results to produce a smoother end result. This is 
all done automatically, otherwise the setup would be painfully tedious 
to use. All these tests are averaged together into one pigment pattern.

The long parse times come when I test an object many times. For the 
image I attached in the original post, I tested the object 30 times 
starting with <3,2,3> samples and ending with <24,16,24> samples. 
Remember, for each cell a call to trace() is performed. That's a lot of 
tests! Not only that, but with 30 averaged pigments comes a hit on 
render time. For simple pigments this is no problem, but for textures 
with texture_maps, the rendering itself can take a long time.

I may try to make this code available. I'll need to write up some 
documentation. It would be bundled with the proximity pattern macros, as 
the SSS code stems from them.

Sam


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.