POV-Ray : Newsgroups : povray.programming : We need Fresnel reflectance. : Re: We need Fresnel reflectance. Server Time
28 Jul 2024 22:29:04 EDT (-0400)
  Re: We need Fresnel reflectance.  
From: Steve H 
Date: 27 May 1999 01:59:35
Message: <374ccf6d.501658662@news.povray.org>
On 18 May 1999 13:12:23 -0500, par### [at] fwicom (Ron Parker) wrote:

>On Tue, 18 May 1999 16:52:34 GMT, Steve H. wrote:
>>On an aside question: 
>>
>>   Does anyone have the source for POV 3.1e, not 3.1a ,  for win95?
>
>Not yet.  I'm eagerly awaiting it as well, so I can get rid of all these
>people who are asking me why the superpatch doesn't work when the official
>3.1e is installed. (I get those questions by email as well as in newsgroups.
>It's driving me nuts.)
>

:)

Hey, since you are in the business of patching there is a small fix that you
can add to your patch that I found a long time ago.  In render.c  starting at
line 2332

 if (create_ray(Ray, x+dx, y+dy, nr))
      {
        Trace_Level = 1;

        Increase_Counter(stats[Number_Of_Samples]);

        Trace(Ray, C, 1.0);

        Clip_Colour(C, C);

         gamma_correct(C);

        Add_Colour(Colour, Colour, C);
      }
      else
      {
        Make_ColourA(C, 0.0, 0.0, 0.0, 0.0, 1.0);
      }


This snippet is in the function Focal_Blur().  It is inside a loop that is
tracing several samples for the blurring calculation.   Notice that it gamma
corrects each individual sample.   I was tracing a scene awhile back where I
was using alot of different focal blur settings.  I noticed that the higher I
took the blur sample the brighter the rendered picture would look.  You might
even consider this a "bug" of sorts.  

 There is a mathematical reason that this happens, namely, since gamma
correction is not a linear function, it cannot be distributed among a sum of
colors without error in the average color.  

To fix this problem, remove the gamma_correct(C); line altogethor.  And at the
end of the whole function do a gamma_correct(Colour) before returning.  Voila.

I posted a large message about this problem several months ago and it fell
between the newsgroup cracks, I suppose you could say, and went unnoticed.


>
>You might want to check out Wyzard's variable/blurred reflection patch first.
>It's supposed to do Fresnel reflectance.  It's included in the superpatch, or

>you can get a standalone POV 3.0 version.  Both are at 
>http://twysted.net/patchstation .
>

I got a URL Not Found for that one.  Maybe there is another place?  Thanks,

-----------
Steve H.


Post a reply to this message

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