POV-Ray : Newsgroups : povray.binaries.images : Dome lights : Re: Dome lights Server Time
5 Nov 2024 00:25:52 EST (-0500)
  Re: Dome lights  
From: Trevor G Quayle
Date: 17 Dec 2005 22:40:28
Message: <43a4da2c@news.povray.org>
Nice
From what I can gather from your code, is the light spacing based on the x-y 
coordinates of the un-wrapped HDRI?  This may cause you problems with lights 
close to the poles of the image as you would tend to get a higher density of 
lights in these areas, which is why I tried to do a geodesic dome 
configuration, to try to get a more even sampling around the dome.  I do 
like the supersampling idea, which I didn't try implementing.  One thing 
that you can do to help with the light brightness, is do 2 identical passes 
so you can get a light count on the first one and adjust the lights 
accordingly. BTW, I see you did get it macroed after all.  I would like to 
figure out some way to get better adaptive sampling.  With larger sampling 
spacing, you can miss smaller light sources and with finer sample spacing 
you can get too many lights, depending on the threshold level.  The random 
super sampling probably helps a bit with this.
My macro if you are interested:

//start
#macro MapLight(n,R,Map,SS,BR,TH, LI)
  #declare PIMAGE = function {pigment{image_map {hdr Map}}}
  union{
    #if (SS)
      sphere{0 R*1.01
        pigment {image_map {hdr MAP once interpolate 2 map_type 1} scale 
<1,1,-1>}
        finish {ambient BR diffuse 0}
      }
    #end
    #declare nL=pow(2,(n-1));
    #declare numL=0;
    #declare MaxB=0;
    #declare k=0; #while (k<=1)
      #declare i=-nL; #while (i<=nL)
        #declare nS=4*(nL-abs(i));
        #declare j=0; #while (j<=nS)
          #if (nS=0)
            #declare xp=0;
          #else
            #declare xp=2*j/nS-1;
          #end
            #declare yp=i/nL/2;
            #declare COL = PIMAGE(xp/2+0.5,yp+0.5,0);

            #if (COL.gray > MaxB) #declare MaxB=COL.gray; #end

            #if (COL.red>TH|COL.green>TH|COL.blue>TH)
              #if (k=0)
                #declare numL=numL+1;
              #else
                light_source{0 color (COL/numL)*LI fade_power 2 
fade_distance R translate<0,0,-R> rotate x*i*90/nL rotate y*j*360/nS rotate 
y*270}
              #end
            #end
        #declare j=j+1; #end
      #declare i=i+1; #end
    #declare k=k+1; #end
    #debug concat("NumLights:",str(numL,0,0),"/",str(2+pow(2,2*n),0,0)," 
(",str(numL/(2+pow(2,2*n))*100,0,1),"%)\n")
    #debug concat("MaxB-(",str(MaxB,0,3),")\n")
  }
#end
//end

I attached a few more scnes samples as well.
In the last one, I removed the HDRI sky sphere and used visible light 
sources instead to be able to see the distribution.


Post a reply to this message


Attachments:
Download 'HDRI2g.jpg' (81 KB) Download 'HDRI2h.jpg' (59 KB) Download 'HDRI2i.jpg' (38 KB) Download 'HDRI2.jpg' (65 KB)

Preview of image 'HDRI2g.jpg'
HDRI2g.jpg

Preview of image 'HDRI2h.jpg'
HDRI2h.jpg

Preview of image 'HDRI2i.jpg'
HDRI2i.jpg

Preview of image 'HDRI2.jpg'
HDRI2.jpg


 

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