POV-Ray : Newsgroups : povray.off-topic : ANN: New, open-source, free software rendering system for physically correc= Server Time
11 Oct 2024 19:16:49 EDT (-0400)
  ANN: New, open-source, free software rendering system for physically correc= (Message 43 to 52 of 82)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Darren New
Subject: Re: ANN: New, open-source, free software rendering system for physicallyco=
Date: 26 Oct 2007 01:40:18
Message: <47217dc2$1@news.povray.org>
Darren New wrote:
> Warp wrote:
>> Darren New <dne### [at] sanrrcom> wrote:
>>> The yellow car as seen thru the windshield of the dark car is far 
>>> from completely smooth. :-) Altho that might just be the jpeg 
>>> compression or something
>>
>>   Jpeg compression doesn't add that kind of high-frequency noise.
> 
> I didn't think so, but I wasn't sure what other kind of problem it could 
> be. It looked like quantitization errors or dithering, but jpeg doesn't 
> need either of those.

Ah, I see from the explanation it's similar to blotchy radiosity 
sampling in POV's radiosity stuff. That makes more sense.

-- 
   Darren New / San Diego, CA, USA (PST)
     Remember the good old days, when we
     used to complain about cryptography
     being export-restricted?


Post a reply to this message

From: scott
Subject: Re: ANN: New, open-source, free software rendering system for physically co=
Date: 26 Oct 2007 03:29:40
Message: <47219764@news.povray.org>
>  I have been thinking about this, but there's one problem I can't think
> a solution for:
>
>  For approximately half of the rays which hit the surface only reflection
> is calculated (and for the rest of the rays only refraction). So basically
> for those rays the surface is only reflective, but not refractive. Or in
> other words, for those rays it's an *opaque* surface.
>
>  The problem is: For these rays, which see the object as opaque, what
> surface color should they use? They cannot simply return the color of
> the reflected ray because it may not be 100% reflection.

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.


Post a reply to this message

From: Warp
Subject: Re: ANN: New, open-source, free software rendering system for physically co=
Date: 26 Oct 2007 06:42:51
Message: <4721c4ab@news.povray.org>
Vincent Le Chevalier <gal### [at] libertyallsurfspamfr> wrote:
> As far as I understand, there is no mixing going on in these methods, 
> not at the ray level.

  There must be, because the surface can have its own color besides being
reflective and/or refractive.

  Let's assume that the surface is colored red and has a 50% of reflectivity.
If you simply calculate the reflective ray and it returns green, and you
return only this green to the camera ray, the red color of the surface has
been completely dropped. This would make the object 100% reflective, with
no own color.
  Naturally that's wrong. The red has to be mixed with the reflected color
somehow, to get a shade of yellow.

  Besides, the surface color is not only affected by its pigment, but also
by lighting. Where is that taken into account?

> You don't shoot one ray per pixel, you shoot many 
> of them, and make them bounce around surfaces or refract with 
> probabilities according to the transparency.

  I understood that, but I don't understand at which step the surface's
own coloring (affected by lighting) is taken into account.

> In your example, you would fire 100 rays, and have:
> ~80 that are refracted, and colored by the "transmitted" color of the 
> surface
> ~20 that are reflected, and colored by the "reflective" color of the surface

> In the end you average all the intensities, and you get, statistically, 
> the same result you'd get with a classical raytracer: 80% of refracted 
> ray color * "transmitted" color, 20% of reflected ray color * 
> "reflective" color.

  How about the surface's own color?

-- 
                                                          - Warp


Post a reply to this message

From: Warp
Subject: Re: ANN: New, open-source, free software rendering system for physically co=
Date: 26 Oct 2007 06:49:41
Message: <4721c644@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.
If a surface reflects a black surrounding, it doesn't become darker. It
can only become lighter if it's reflecting a light surrounding.
  Basically if you have a reflecting surface with nothing to reflect
(everything around it is completely black), that's more or less equivalent
to not having reflection at all. (Ok, this is the most basic reflectivity
model, and real-life surfaces might behave slightly differently, but not
too much. The basic reflectivity model is often good-enough for simple
images.)

  Now, if you simply averaged the black reflected rays with the refracted
rays the end result would be darker and more opaque. In regular raytracing
the reflecting rays wouldn't have any effect on the coloring.

  Additionally, at which step is the surface's own color taken into account?
It cannot simply be dropped. It has to be added to the mix somewhere.
(The surface's own color is not only affected by its pigment, but also
by lighting.)

-- 
                                                          - Warp


Post a reply to this message

From: Vincent Le Chevalier
Subject: Re: ANN: New, open-source, free software rendering system for physically co=
Date: 26 Oct 2007 07:46:20
Message: <4721d38c$1@news.povray.org>

> Vincent Le Chevalier <gal### [at] libertyallsurfspamfr> wrote:
>> In the end you average all the intensities, and you get, statistically, 
>> the same result you'd get with a classical raytracer: 80% of refracted 
>> ray color * "transmitted" color, 20% of reflected ray color * 
>> "reflective" color.
> 
>   How about the surface's own color?
> 

It is taken into account in the reflected rays, in fact. It's the same 
process.

It's just that if you have a mirror reflection, only rays following 
Descartes' law will contribute to the final color. If you have a diffuse 
surface, rays from everywhere will contribute to the color (including 
rays coming from the light sources). You can have a mix of both, with 
different colors, allowing any degree of blurry reflection.

It seems you keep on thinking about it with pure diffuse + pure 
reflection + refraction, when on these modern renderers, there is no 
need to separate diffuse and reflection. And no need for all the hacks 
to get highlights on the surface either.

And the model naturally conserves energy as a bonus :-)

-- 
Vincent


Post a reply to this message

From: Warp
Subject: Re: ANN: New, open-source, free software rendering system for physically co=
Date: 26 Oct 2007 07:57:15
Message: <4721d61a@news.povray.org>
Vincent Le Chevalier <gal### [at] libertyallsurfspamfr> wrote:
> >   How about the surface's own color?

> It is taken into account in the reflected rays, in fact. It's the same 
> process.

  But how exactly? If I simply mix the reflected ray color with the
surface color, that will make the surface more opaque than it was defined.
  What if the surface was also refractive? Should the surface color also
be mixed with the refracted ray?

  Besides, lighting must affect the surface coloring somehow. It doesn't
appear automatically all by itself. You have to mix the lighting of the
surface somehow.

  Could someone post an exact algorithm about how this is done?

  I'm not trolling here. I have access to the pov3.7 source and I'm helping
the pov-team develop it (eg. the new string comparison operators were added
by me). I would be interested in testing this kind of rendering to see if
it's feasible. Although unlikely, it's theoretically *possible* that I could
try adding some support for this to pov3.7, if I could just figure out the
algorithm how it's supposed to be done.

-- 
                                                          - Warp


Post a reply to this message

From: scott
Subject: Re: ANN: New, open-source, free software rendering system for physically co=
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

From: Warp
Subject: Re: ANN: New, open-source, free software rendering system for physically co=
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

From: Darren New
Subject: Re: ANN: New, open-source, free software rendering system for physically co=
Date: 26 Oct 2007 23:18:15
Message: <4722adf7$1@news.povray.org>
Warp wrote:
>   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.

Technically, there is, except you average them in a complex space (as in 
real+imaginary) instead of linearly.  ;-)   If you *really* wanna get 
physically correct.

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

Isn't that one of the things that makes a surface look metalic? That the 
reflected rays retain their own color because the photons are bouncing 
off the free valence electrons roaming around on the surface of the 
material, rather than hitting a bound electron in a particular "shell"?

-- 
   Darren New / San Diego, CA, USA (PST)
     Remember the good old days, when we
     used to complain about cryptography
     being export-restricted?


Post a reply to this message

From: Warp
Subject: Re: ANN: New, open-source, free software rendering system for physically co=
Date: 27 Oct 2007 02:50:43
Message: <4722dfc3@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Isn't that one of the things that makes a surface look metalic? That the 
> reflected rays retain their own color because the photons are bouncing 
> off the free valence electrons roaming around on the surface of the 
> material, rather than hitting a bound electron in a particular "shell"?

  Most materials reflect light at least partially specularly. That's why
you can see highlights of the light's own color on most surfaces, or at
least something closer to the light's color than to the surface's color.
The phong highlighting used in rendering is a cheap way of simulating this,
and it usually makes surfaces look like plastic, as most plastics have an
accentuated (blurred) specular reflection property.

  IIRC metals behave a bit differently and can affect specular reflection
in other ways, but I don't remember details.

-- 
                                                          - Warp


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

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