|
|
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> I got interested in m1j's post about "dome lighting" based on HDRI maps
>
(http://news.povray.org/povray.binaries.images/thread/%3Cweb.43912795ae23e4252f222b3b0%40news.povray.org%3E/)
> so I had a try at it (using my own code however, based on a geodesic dome
> macro I wrote many years ago) with impressive results.
>
> HDRI2a.jpg shows a scene using HDRI with radiosity lighting (medium-low
> quality settings though)
> HDRI2c.jpg shows the same scene using the dome lighting based on the HDRI
> (with a threshold limit)
> the rest use the dome lighting using different HDRI maps. As a note, each
> took on average 10mins to render (no AA or rad)
>
> -tgq
Here is another one I did.
Here is my code:
//light dome from image.
#macro
DOMELITE(SP,HEMI,YANGLE,MULT,CLIPV,THRES,SSAMP,RAD,AREA,AS,LV,FNAME,FTYPE)
#switch(FTYPE )
#case(0)
#local PIMAGE = function {pigment{image_map {jpg FNAME}}}//grab image
#break
#case(1)
#local PIMAGE = function {pigment{image_map {png FNAME}}}//grab image
#break
#case(2)
#version unofficial megapov 1.21;
#local PIMAGE = function {pigment{image_map {hdr FNAME}}}//grab image
#break
#end
#local X = 0;
#while(X < (1-SP))
#local Y = HEMI;
#while(Y < 1-(SP*2))
#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(CLIPV.gray != 0) #local COL =
<min(COL.red,CLIPV.gray),min(COL.green,CLIPV.gray),min(COL.blue,CLIPV.gray)>;
#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> 4, 4 adaptive 1
jitter circular orient #end
#if(COL.gray > 0.85) photons {refraction on reflection on} #end
rotate z*(Y*180-90)
rotate y*((1-X)*360+YANGLE)
translate y*0.1
}
#end
#local Y = Y + SP*2;
#end
#local X = X + SP;
#end
#end
DOMELITE(0.04 /*SP*/, 0.5 /*HEMI*/, AG /*YANGLE*/, 0.035 /*MULT*/,1000000
/*CLIPV*/,0.1 /*THRES*/,30 /*SSAMP*/,100 /*RAD*/,yes /*AREA*/,20 /*AS*/,no
/*LV*/,IFNAME /*FNAME*/,2 /*FTYPE*/)
Post a reply to this message
Attachments:
Download 'building_d.jpg' (35 KB)
Preview of image 'building_d.jpg'
|
|