POV-Ray : Newsgroups : povray.advanced-users : Phong BRDF pigment { function{} } : Re: Phong BRDF pigment { function{} } Server Time
28 Mar 2024 04:34:57 EDT (-0400)
  Re: Phong BRDF pigment { function{} }  
From: Bald Eagle
Date: 14 Nov 2022 06:45:00
Message: <web.637229276d24d701f9dae3025979125@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:
> On 2022-11-13 18:47 (-4), Bald Eagle wrote:
> >
> > Maybe if someone has coded an entire basic (meta)raytracer in SDL, then I could
> > go that route.
>
> Did someone say "meta"?
>
>
https://wiki.povray.org/content/Documentation:Tutorial_Section_3.8#SDL_tutorial:_A_raytracer

Heh.   Shortly after that, I went hunting, and found exactly that.

That's written so that it cycles through all the light sources and
updates/accumulates all of the illumination calculations for a surface pixel,
doing a single analytical calculation for phong each time.

I'm guessing that I'd have to scrap that and go wholly with a global sampling of
the surface normal's hemisphere to have importance sampling make any sense?  Not
sure how I'd do that with point lights either.

At the moment, the Monte Carlo approach makes sense when you don't know WHAT the
illumination is, like when using a pigmented sky sphere or an HDR image.  Since
point lights seem to be an example of a Dirac delta function in this context, it
almost seems like there ought to be a mechanism to force sampling from _those
vectors_, or to explicitly block those vectors and do a second pass using
standard phong highlighting.

I've never played in the part of the pool, so I don't have enough context to
understand what to do with this tool, now that I've built it.

I guess I will keep web searching and reading and watching until I figure
something out...

Until then, I adjusted the raytracer code to just use two spheres, and I figured
I could use a flag to have one of them importance sampled, while the other was
stock Phong model for comparison.  Pretty neat - only takes 20 sec.


Post a reply to this message


Attachments:
Download 'raytraced_importancesampledphong.pov.txt' (7 KB)

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