POV-Ray : Newsgroups : povray.unofficial.patches : Importance sampling of phong brdf Server Time
31 Oct 2024 21:30:24 EDT (-0400)
  Importance sampling of phong brdf (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: Mael
Subject: Importance sampling of phong brdf
Date: 14 Apr 2003 14:12:51
Message: <3e9afa23$1@news.povray.org>
Hello,

I've tried to write a patch to do importance sampling of the phong brdf (the
modified phong brdf actually). The patch uses the phong and phong_size of
finish{} to compute highlights even in radiosity lighted only parts of the
image (If there are real light sources then the highlight is the phong
contribution of those lights source + the contribution of the sampled phong
brdf)

Some images : http://195.221.122.126/radphong/rad_phong.html

M


Post a reply to this message

From: ingo
Subject: Re: Importance sampling of phong brdf
Date: 14 Apr 2003 14:29:22
Message: <Xns935DD0DEA9BD2seed7@povray.org>
in news:3e9afa23$1@news.povray.org Mael wrote:

> I've tried to write a patch to do importance sampling of the phong
> brdf (the modified phong brdf actually).

From the images I'd say you succeeded. This looks very good!

Ingo


Post a reply to this message

From: Christoph Hormann
Subject: Re: Importance sampling of phong brdf
Date: 14 Apr 2003 15:18:23
Message: <3E9B097E.E468B245@gmx.de>
Mael wrote:
> 
> Hello,
> 
> I've tried to write a patch to do importance sampling of the phong brdf (the
> modified phong brdf actually). The patch uses the phong and phong_size of
> finish{} to compute highlights even in radiosity lighted only parts of the
> image (If there are real light sources then the highlight is the phong
> contribution of those lights source + the contribution of the sampled phong
> brdf)

That looks very interesting, i have some troubles understanding how it
works though.  The phong model needs the light direction, how do you
determine it with radiosity lighting?

Concerning practical usage - it would be interesting to see a version with
reflective finish in comparison (which will also show highlights with
hdri).

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 28 Feb. 2003 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Mael
Subject: Re: Importance sampling of phong brdf
Date: 14 Apr 2003 16:14:38
Message: <3e9b16ae@news.povray.org>
> That looks very interesting, i have some troubles understanding how it
> works though.  The phong model needs the light direction, how do you
> determine it with radiosity lighting?

This sampling is independent of the radiosity inter-diffuse stuff. It occurs
at each intersection point if there is a non zero phong in the finish. An
adaptive number (calculated with phong_size and a global parameter rad_phong
(a kind of density)) of rays are shooted near the direction = incident ray
reflected (samples rays are choosed with an adequate probability density
function -see the images- that's why it's called importance sampling) and
light is gathered. Yes that sounds cpu consuming - and it is, but for high
phong_size the number of samples can be low.

> Concerning practical usage - it would be interesting to see a version with
> reflective finish in comparison (which will also show highlights with
> hdri).

you mean a comparison with finish with a small amount of blurred reflection
(this is what i've used in my irtc image..) ?
for high phong_size (small blur) the results should look quite similar, and
for lower phong_size (bigger blur) the uniform distribution of the sampling
resulting from the blurred reflection will probably introduce some
differences (and blurred reflections are more annoying to declare than
phong+phong_size ;)

M


Post a reply to this message

From: Apache
Subject: Re: Importance sampling of phong brdf
Date: 14 Apr 2003 17:59:38
Message: <3e9b2f4a$1@news.povray.org>
Good!
Good way of faking blurred reflection too.


Post a reply to this message

From: ceggi
Subject: Re: Importance sampling of phong brdf
Date: 14 Apr 2003 19:58:01
Message: <3e9b4b09@news.povray.org>
"Mael" <mae### [at] hotmailcom> ha scritto nel messaggio
news:3e9afa23$1@news.povray.org...
> Hello,
>
> I've tried to write a patch to do importance sampling of the phong brdf
(the
> modified phong brdf actually). The patch uses the phong and phong_size of
> finish{} to compute highlights even in radiosity lighted only parts of the
> image (If there are real light sources then the highlight is the phong
> contribution of those lights source + the contribution of the sampled
phong
> brdf)
>
> Some images : http://195.221.122.126/radphong/rad_phong.html
>
> M
>
Hi Mael,

it's wonderful !
Where is the new version?
I want to download.
Thanks.
Ceggi.


Post a reply to this message

From: Peter Popov
Subject: Re: Importance sampling of phong brdf
Date: 15 Apr 2003 03:27:32
Message: <k1dn9vgjlrtc5lff6utgsmlaj5al99b0tv@4ax.com>
Brilliant!

(Or should I say, "Phongey!")


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: George Pantazopoulos
Subject: Re: Importance sampling of phong brdf
Date: 15 Apr 2003 10:44:36
Message: <3e9c1ad4@news.povray.org>
Mael, this is great! Thanks for all your ongoing contributions :)

George


"Mael" <mae### [at] hotmailcom> wrote in message
news:3e9afa23$1@news.povray.org...
> Hello,
>
> I've tried to write a patch to do importance sampling of the phong brdf
(the
> modified phong brdf actually). The patch uses the phong and phong_size of
> finish{} to compute highlights even in radiosity lighted only parts of the
> image (If there are real light sources then the highlight is the phong
> contribution of those lights source + the contribution of the sampled
phong
> brdf)
>
> Some images : http://195.221.122.126/radphong/rad_phong.html
>
> M
>
>


Post a reply to this message

From: Christoph Hormann
Subject: Re: Importance sampling of phong brdf
Date: 15 Apr 2003 11:22:57
Message: <3E9C23D1.72C4B9C9@gmx.de>
Mael wrote:
> 
> > That looks very interesting, i have some troubles understanding how it
> > works though.  The phong model needs the light direction, how do you
> > determine it with radiosity lighting?
> 
> This sampling is independent of the radiosity inter-diffuse stuff. It occurs
> at each intersection point if there is a non zero phong in the finish. An
> adaptive number (calculated with phong_size and a global parameter rad_phong
> (a kind of density)) of rays are shooted near the direction = incident ray
> reflected (samples rays are choosed with an adequate probability density
> function -see the images- that's why it's called importance sampling) and
> light is gathered. Yes that sounds cpu consuming - and it is, but for high
> phong_size the number of samples can be low.

Very clever.

But i guess it is really quite awfully slow.  It could be worth
considering some caching function but that will probably be less helpful
than with diffuse radiosity since the result varies much stronger with
position and surface normal.

How does it look with very low sample counts? Does it look mostly noisy or
are there other artefacts?

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 28 Feb. 2003 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Mael
Subject: Re: Importance sampling of phong brdf
Date: 15 Apr 2003 13:47:20
Message: <3e9c45a8@news.povray.org>
> Very clever.

ehhm, to be honest this is really not rocket science and the patch is ~ 50
lines of C

> But i guess it is really quite awfully slow.

well as slow as blurred reflection, or things like this. I would say slow
but not awfully slow :)

> It could be worth
> considering some caching function but that will probably be less helpful
> than with diffuse radiosity since the result varies much stronger with
> position and surface normal.

I've not tried but i'm pretty sure caching is useless considering, as you
noted, the strong effect of normal and incident ray direction. A way to make
it faster would be to find another brdf which don't require a pow() call for
the distribution as it is quite cpu expensive (there are papers about such
brdf, see for example
http://dept-info.labri.u-bordeaux.fr/~schlick/DOC/eur2.html)

> How does it look with very low sample counts? Does it look mostly noisy or
> are there other artefacts?

in the current implementation the position of samples is fixed so low sample
counts may give artifacts. I think adding a random rotation of the samples
would result in noise.

M


Post a reply to this message

Goto Latest 10 Messages Next 5 Messages >>>

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