POV-Ray : Newsgroups : povray.advanced-users : Phong BRDF pigment { function{} } : Re: Phong BRDF pigment { function{} } Server Time
24 Apr 2024 18:24:13 EDT (-0400)
  Re: Phong BRDF pigment { function{} }  
From: Bald Eagle
Date: 13 Nov 2022 17:50:00
Message: <web.637174166d24d701f9dae3025979125@news.povray.org>
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 0-1 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 importance-sampled
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 source-code level thing that wouldn't be something doable
with a parse-time 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 single-pixel 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

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