POV-Ray : Newsgroups : povray.binaries.images : Dome lights from image Server Time
18 Nov 2024 02:17:59 EST (-0500)
  Dome lights from image (Message 1 to 7 of 7)  
From: m1j
Subject: Dome lights from image
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


 

From: m1j
Subject: Re: Dome lights from image
Date: 3 Dec 2005 00:15:00
Message: <web.439128e8f7fee7d2f222b3b0@news.povray.org>
"m1j" <mik### [at] hotmailcom> wrote:
> 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 'building2.jpg' (33 KB)

Preview of image 'building2.jpg'
building2.jpg


 

From: m1j
Subject: Re: Dome lights from image
Date: 3 Dec 2005 00:15:00
Message: <web.43912900f7fee7d2f222b3b0@news.povray.org>


Post a reply to this message


Attachments:
Download 'building3.jpg' (17 KB)

Preview of image 'building3.jpg'
building3.jpg


 

From: m1j
Subject: Re: Dome lights from image
Date: 3 Dec 2005 09:40:01
Message: <web.4391adedf7fee7d2f222b3b0@news.povray.org>


Post a reply to this message


Attachments:
Download 'building4.jpg' (45 KB)

Preview of image 'building4.jpg'
building4.jpg


 

From: Alain
Subject: Re: Dome lights from image
Date: 3 Dec 2005 10:59:49
Message: <4391c0f5$1@news.povray.org>
m1j nous apporta ses lumieres en ce 2005-12-03 00:05:
>         #if(AREA) area_light  <AS, 0, 0> <0, 0, AS>   2, 2 adaptive 3
> jitter  circular  orient  #end
Just a little detail about adaptive area_ligh.
adaptive 0 try to use at least a 2*2 aray, adaptive 1 try to start with an 3*3 aray,
adaptive 2 try 
to start at 5*5, adaptive 3 at 9*9... (2^<adaptive value>+1)

In your case, adaptive 3 with a 2*2 aray is completely useless, as it want to start
with 9*9 but 
have only a 2*2 aray to work with. So it only use the 2*2 it have, and you never get
any speed 
improvement.

-- 
Alain
-------------------------------------------------
Change is inevitable, except from vending machines.


Post a reply to this message

From: m1j
Subject: Re: Dome lights from image
Date: 3 Dec 2005 14:50:01
Message: <web.4391f6a9f7fee7d2f222b3b0@news.povray.org>
I changed and fixed a few things!


#declare SP = 0.005;//sample spacing
#declare HEMI = 0.5;//percent of hemisphere from the top down
#declare ANGLE = 210;
#declare MULT = 0.003;//Light multiplier
#declare THRES = 0.50;//image intensity threshold
#declare SSAMP = 30;//Subsamples for spacing average
#declare RAD = 100;//radius of light dome
#declare AREA = no;//use area lights or not
#declare AS = 5;//size of area light
#declare LV = no; //lights are visible
#declare PIMAGE = function {pigment{image_map {hdr "Timage.hdr"}}}//grab
image


#declare X = 0;
#while(X < 1)
  #declare Y = HEMI;
  #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)
        #if(LV) looks_like{sphere{x*RAD,2 pigment{color COL}}} #end
        #if(AREA) area_light  <AS, 0, 0> <0, 0, AS>   3, 3 adaptive 1
jitter  circular  orient  #end
        rotate z*(Y*180-90)
        rotate y*((1-X)*360+ANGLE)
        translate y*0.1
      }
    #end
  #declare Y = Y + SP*2;
  #end
#declare X = X + SP;
#end


The image is the results of the changes compared to the last.


Post a reply to this message


Attachments:
Download 'building4.jpg' (36 KB)

Preview of image 'building4.jpg'
building4.jpg


 

From: m1j
Subject: Re: Dome lights from image
Date: 4 Dec 2005 01:30:01
Message: <web.43928c2df7fee7d2f222b3b0@news.povray.org>
An updated image with blurred reflection and photons.


Post a reply to this message


Attachments:
Download 'building5.jpg' (37 KB)

Preview of image 'building5.jpg'
building5.jpg


 

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