

OK, so here's an update.
(A lot of thinking out loud, hoping maybe to get some advice / feedback so I can
get to some sort of meaningful result quickly)
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Also, even though I'm doing
>
> function {min (max (Specular (x, y, z), 0), 1)}
>
> I still seem to be veering out of the 01 range when my shininess factor (the
> phong exponent) goes below 2. Weird.
I think this part of it just had to do with rejecting everything in the opposing
hemisphere by rejecting all negative dot product results using select ().
I have the basic implementation of importance sampling worked out  I really
should have been able to do it way back when...
I think I'm at the point where it looks like implementing an importancesampled
BRDF in a pigment function is an erroneous idea on my part, due a
mis(non)understanding of WHERE in the process of calculating a pixel brightness
that importance sampling is applied.
It appears to me that after watching only the first 1.5 minutes of
https://www.youtube.com/watch?v=xFsJMUS94Fs
that the importance sampled BRDF gets used in the rendering equation, which
probably means it's a sourcecode level thing that wouldn't be something doable
with a parsetime evaluated SDL function, but rather through an algorithm, which
would be macro based.
This tells me that to evaluate the surface illumination, I'll have to build my
surface out of singlepixel sized boxes or spheres, or maybe cones  or make a
triangle mesh and cycle through all of the triangles or vertices to determine
the color of each (smooth) triangle.
Does this sound right?
Alternatively, I suppose I could define a big function that uses a noise
function to determine psudorandom vectors to sample around the surface point
.....
I will have to think some more on this to decide what to start coding...
Maybe if someone has coded an entire basic (meta)raytracer in SDL, then I could
go that route.
Post a reply to this message

