POV-Ray : Newsgroups : povray.off-topic : ANN: New, open-source, free software rendering system for physically correc= : Re: ANN: New, open-source, free software rendering system for physically co= Server Time
11 Oct 2024 21:20:55 EDT (-0400)
  Re: ANN: New, open-source, free software rendering system for physically co=  
From: scott
Date: 26 Oct 2007 08:02:16
Message: <4721d748$1@news.povray.org>
> scott <sco### [at] laptopcom> wrote:
>> It does simply return the reflected colour, because the engine doesn't
>> actually display the reflected ray colour, does it?  It averages all the
>> rays together, including the refracted ones.
>
>  A reflection *adds* to the color of a surface, it's not averaged with it.

You're still thinking in terms of a traditional ray-tracer with separate 
diffuse and reflection components.  In real life and with more advanced 
ray-tracers they are the same thing.  For every photon of light that hits 
the surface there's only three choices, reflect, refract or get absorbed.

If you know the proportions of reflect, refract and absorb and the 
probability of them going in certain directions (ie the BRDF) then you just 
fire a load or rays in random directions from the surface and *average* the 
result.  The more rays you fire, the closer you get to the correct answer.

Reducing the direct reflection from 20% to 0% will not change the brightness 
of the diffuse reflection (as you thought) because still the same 
*proportion* of rays will be used in the average calculation for diffuse.

A very simple example follows, which has 10% direct reflection, 50% diffuse, 
and 10% transparency.

color = 0
for ray=1 to 1000
 r = random number between 0 and 1

 if 0<r<0.1
  color += surface_color * fire_reflection_ray

 if 0.1<r<0.6
  color += surface_color * fire_diffuse_ray_in_random_direction

 if 0.6<r<0.7
  color += surface_color * fire_refraction_ray

 if 0.7<r<1.0
  color += 0 // ie 30% absorbtion
next
pixel_color = color / 1000

Changing the reflection % to 20% is not going to affect the colour of the 
diffuse component, which is still fixed at 50%.  All the rays get averaged 
though.


Post a reply to this message

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