POV-Ray : Newsgroups : povray.programming : Tracing Secondary Rays Server Time
21 Dec 2024 20:18:13 EST (-0500)
  Tracing Secondary Rays (Message 1 to 6 of 6)  
From: Pfingstei
Subject: Tracing Secondary Rays
Date: 14 Feb 2008 07:30:00
Message: <web.47b432e237b8fa124df537e50@news.povray.org>
Hello POV Ray community;

At the moment I'm busying myself with the source code of POV Ray since I want to
adapt it for some test purposes. During the last day, I was not able to answer
one basic question.


Let's assume the following situation in POV Ray:

- I follow a primary ray to its first intersection point (backward raytracing).

- There I compute the diffuse reflection component --> contribution A

- Then I construct the secondary ray (specular at intersection point).

- After that I follow the secondary ray to its first intersection point.

- There I calculate the diffuse reflection component --> contribution B


My question with respect to POV Ray is:

- is there any weight factor which takes into account that contribution B still
has to pass intersection point 1 to finally reach the image pixel (so weight
factor < 1 for considering some attenuation effects) or

- is the reflection of contribution B at intersection point 1 assumed to be
perfect specular (so weight factor = 1)?

As far as I can see, the weight factor computed in the function
"determine_reflectivity" is only used for testing secondary rays with respect
to the ADC value (adaptive depth control value) and not for scaling the diffuse
color contribution derived at intersection point 2.


So I would assume that POV Ray just adds diffuse reflection components of
primary and secondary rays without any weighting. Am I right with this
assumption?


It would be very helpful for me, if you could answer this question.

Thank you very much.

Stefan Auer


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Tracing Secondary Rays
Date: 14 Feb 2008 10:01:43
Message: <47b457d7$1@news.povray.org>
Pfingstei wrote:
> So I would assume that POV Ray just adds diffuse reflection components of
> primary and secondary rays without any weighting. Am I right with this
> assumption?

The weight is managed in a weight list, which is a bit complicated (and not 
really necessary, but that is another story). Either way, the texturing code 
manages that, but it also is used for secondary rays. The 3.7 source code 
might be a bit easier to follow in this regard (there you can also see why 
the list is not needed ... in case anybody wants to change that, I have some 
details about it which I should probably post somewhere).

	Thorsten


Post a reply to this message

From: Pfingstei
Subject: Re: Tracing Secondary Rays
Date: 14 Feb 2008 11:10:00
Message: <web.47b4671896e4f04a4df537e50@news.povray.org>
Thank you Thorsten.

Sorry for asking again, but I have to be sure.

diffuse component at intersection point 1 (primary ray): A
diffuse component at intersection point 2 (secondary ray): B


Pixel color C in image:

C = A + B            (1)

or

C = A + w*B          (2)

with w = weight factor

So your answer is: version (2) is correct?

To this end, it would be important for me to know, where this weight is applied
in the source code or how it is called (so I can search it in Microsoft Visual
Studio). So far I was looking in the functions
"compute_lighted_texture", "Reflect" and "Determine_Reflectivity"

I need to know this because I would like to test a different diffuse reflection
model. So I also need to know how the different reflection components (for
primary rays and secondary rays) are finally composed together to avoid errors.


Thorsten Froehlich <tho### [at] trfde> wrote:
> Pfingstei wrote:
> > So I would assume that POV Ray just adds diffuse reflection components of
> > primary and secondary rays without any weighting. Am I right with this
> > assumption?
>
> The weight is managed in a weight list, which is a bit complicated (and not
> really necessary, but that is another story). Either way, the texturing code
> manages that, but it also is used for secondary rays. The 3.7 source code
> might be a bit easier to follow in this regard (there you can also see why
> the list is not needed ... in case anybody wants to change that, I have some
> details about it which I should probably post somewhere).
>
>  Thorsten


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Tracing Secondary Rays
Date: 14 Feb 2008 13:32:36
Message: <47b48944$1@news.povray.org>
Pfingstei wrote:
> Thank you Thorsten.
> 
> Sorry for asking again, but I have to be sure.
> 
> diffuse component at intersection point 1 (primary ray): A
> diffuse component at intersection point 2 (secondary ray): B
> 
> 
> Pixel color C in image:
> 
> C = A + B            (1)
> 
> or
> 
> C = A + w*B          (2)

C = A*w1 + B*w2

	Thorsten


Post a reply to this message

From: Pfingstei
Subject: Re: Tracing Secondary Rays
Date: 21 Feb 2008 10:45:01
Message: <web.47bd9be596e4f04a4df537e50@news.povray.org>
So, these weight values are only scaling factors assigned to textures?

They do not depend on the incidence angle of the light rays with respect to the
illuminated surface?

Thorsten Froehlich <tho### [at] trfde> wrote:
> Pfingstei wrote:
> > Thank you Thorsten.
> >
> > Sorry for asking again, but I have to be sure.
> >
> > diffuse component at intersection point 1 (primary ray): A
> > diffuse component at intersection point 2 (secondary ray): B
> >
> >
> > Pixel color C in image:
> >
> > C = A + B            (1)
> >
> > or
> >
> > C = A + w*B          (2)
>
> C = A*w1 + B*w2
>
>  Thorsten


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Tracing Secondary Rays
Date: 21 Feb 2008 11:32:15
Message: <47bda78f@news.povray.org>
Pfingstei wrote:
> So, these weight values are only scaling factors assigned to textures?
> 
> They do not depend on the incidence angle of the light rays with respect to the
> illuminated surface?

They depend on whatever the used algorithm defines. The light models 
supported by POV-Ray are well known, so you can just look up in literature 
what exactly they do.

	Thorsten


Post a reply to this message

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