POV-Ray : Newsgroups : povray.binaries.images : Dome lights : Re: Dome lights Server Time
7 Aug 2024 19:23:10 EDT (-0400)
  Re: Dome lights  
From: m1j
Date: 20 Dec 2005 14:00:00
Message: <web.43a85487e93c309aed196ef10@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> I'm in the process of trying to implement subsampling and seeing what works
> best.  Not sure whether its better to go with a random sampling or a fixed
> subdivision.  I have added a type of adaptive subsampling that adds
> additional lights, this is done in a fixed rectangular subdivision of each
> vertex and its tributary area.  I'll post updated code when I get things a
> bit more refined.
>
> Ads a note for your routine, you may want to fix your subsamplig averaging
> method (unless it's meant to work as you've made it).  The way you've done
> it (ie iteratively adding a number then dividing by 2) doesn't give a true
> average.  For example, for the series (7,5,3,1,224) you get 10.1, whereas
> the average is 7.5.  You method gives more weighting to the numbers towrds
> the end of the series. If you want to change this:
>
> Instead of:
>     #while (CNT < SSAMP)
>            #local COL = (COL + PIMAGE(X+(rand(S)*SP),Y+(rand(S)*(SP)),0))/2;
>            #local CNT = CNT + 1;
>     #end
>
> Try:
>     #while (CNT < SSAMP)
>            #local COL = (COL + PIMAGE(X+(rand(S)*SP),Y+(rand(S)*(SP)),0));
>            #local CNT = CNT + 1;
>     #end
>     #local COL = COL/(SSAMP+1);
>
>
> I'm looking forward to seeing more of your progress.
>
> PS: I haven't tried adding photons, radiosity or AA yet as I'm not very
> patient at seeing results...
>
> -tgq

I was just about to try a new method of placing the lights using:

#macro PSURFACE1(PS,U,V)
// Evaluates the Bezier triangle at (u,v).
{
    #local w = 1 - U - V;
    #local u2 = U * U;
    #local v2 = V * V;
    #local w2 = w * w;
    (w2*PSX[0] + (2*U*w)*PSX[1] + u2*PSX[2] + (2*U*V)*PSX[3] + v2*PSX[4] +
(2*V*w)*PSX[5]);
#end


Four of these placed around a hemisphere should produce the proper spacing.
Sub sampling would take place by setting a total sampling value then using
another value to set at what level in the total samplings the lights should
be placed. This will also make the total number of lights easier to get (I
think).

I have not started yet but will soon.

I did make the change to my averaging code you provided above. I had not
even considered that it would be different than a standard average. This
shows my lack in critical math knowledge.


Post a reply to this message

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