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:21:34 EDT (-0400)
  Re: ANN: New, open-source, free software rendering system for physically co=  
From: Warp
Date: 26 Oct 2007 09:08:22
Message: <4721e6c2@news.povray.org>
scott <sco### [at] laptopcom> wrote:
> You're still thinking in terms of a traditional ray-tracer with separate 
> diffuse and reflection components.

  So does your algorithm you give below.

>  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.

  But photons arriving from different sources can gather up into a single
pixel in the final image, so they add up.

  For example, one photon may reflect from the surface and hit the image
at pixel (0, 0). Another different photon, coming from a completely
different part of the world, may refract from the surface and hit the
image at pixel (0, 0). Obviously the brightness of these two photons
are added (not averaged) in this pixel.

  Photons from different sources can also simply reflect from the surface
and hit the same image pixel even though their incoming angles were
different (due to the microscopic structure of the surface). This is
precisely what the phong lighting model simulates (ie. by having separate
diffuse and specular reflection components). It might not be 100% physically
accurate, but it's *close* to reality (and that's why the resulting images
are often quite realistic).

  Naturally if two photons reflect from the surface and end up hitting the
same image pixel, their brightness gets added, not averaged. There's no
such a thing as "averaging photons" in nature.

> 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

  That algorithm makes it impossible to render images like this:
http://warp.povusers.org/images/sphere.png

  That's because you are multiplying the surface color with the reflection
color. However, in specular reflection the reflected ray retains at least
part of its own color and is not completely filtered by the surface's
color. This is something which happens in nature.

-- 
                                                          - Warp


Post a reply to this message

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