POV-Ray : Newsgroups : povray.binaries.images : Dome lights from image : Dome lights from image Server Time
7 Aug 2024 21:26:06 EDT (-0400)
  Dome lights from image  
From: m1j
Date: 3 Dec 2005 00:10:01
Message: <web.43912795ae23e4252f222b3b0@news.povray.org>
I worked out a way to build a dome of lights from an image. Truespace has a
feature like this. This allows the finish properties to react with the
colors of the image better. I used a very low quality radiosity setting.
Render times are around 20min on a amd 64 3200 with 1gig, windows32 and
megapov. Megapov is only needed for the hdr image. Any image could be used.

I wanted to make it a macro but ran into a snag with the file spec keyword.
If any one has an idea for that let me know.


//Light Dome---------

#declare SP = 0.0175;//sample spacing
#declare HEMI = 0.5;//percent of hemisphere from the top down
#declare MULT = 0.24;//Light multiplier
#declare THRES = 0.45;//image intensity threshold
#declare SSAMP = 30;//Subsamples for spacing average
#declare RAD = 60;//radius of light dome
#declare AREA = yes;//use area lights or not
#declare AS = 5;//size of area light
#declare PIMAGE = function {pigment{image_map {hdr "Timage.hdr"}}}//grab
image

#declare X = HEMI;
#while(X < 1)
  #declare Y = 0;
  #while(Y < 1)
    #local S = seed(10);

    #local CNT = 0;
    #local COL = PIMAGE(X,Y,0);
    #while (CNT < SSAMP)
           #local COL = (COL + PIMAGE(X+(rand(S)*SP),Y+(rand(S)*SP),0))/2;
           #local CNT = CNT + 1;
    #end


    #if(COL.gray > THRES)
      light_source{x*RAD
        color (COL*MULT)
        looks_like{sphere{x*RAD,1 pigment{color COL}}}
        #if(AREA) area_light  <AS, 0, 0> <0, 0, AS>   2, 2 adaptive 3
jitter  circular  orient  #end
        fade_distance 1
        fade_power 1
        rotate z*(X*180-90)
        rotate y*(Y*360)
        translate y*1
      }
    #end
  #declare Y = Y + SP;
  #end
#declare X = X + SP;
#end


Post a reply to this message


Attachments:
Download 'building1.jpg' (34 KB)

Preview of image 'building1.jpg'
building1.jpg


 

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