Skip to content
This repository has been archived by the owner on Dec 21, 2021. It is now read-only.

Commit

Permalink
Added missing file from last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregungory committed Sep 1, 2018
1 parent 22b84c2 commit a46558b
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/notes/ReleaseNotes
Original file line number Diff line number Diff line change
Expand Up @@ -2232,3 +2232,6 @@ for comparing BSDFs.

Fixed issue with pfilt -m option and uneven image size changes pointed
out by Rob Shakespeare.

Updates to evalglare and gendaylit from Jan Wienold, including new
colored sky option.
77 changes: 77 additions & 0 deletions src/gen/perezlum_c.cal
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{ RCSid $Id: perezlum_c.cal,v 1.1 2018/09/01 16:42:39 greg Exp $ }

{
All-weather Angular Sky Luminance Distribution . Modiefied for colored sky. Model by Aicha Diakite (TU-Berlin), implementation by J. Wienold (EPFL)

Additional arguments required for calculation of skybright:

A1 - diffus normalization
A2 - ground brightness
A3,A4,A5,A6,A7 - coefficients for the Perez model
A8,A9,A10 - sun direction
A11 - perez parameter epsilon
A12-A22 - locus values
}

A11 = arg(11);
A12 = arg(12);
A13 = arg(13);
A14 = arg(14);
A15 = arg(15);
A16 = arg(16);
A17 = arg(17);
A18 = arg(18);
A19 = arg(19);
A20 = arg(20);
A21 = arg(21);
A22 = arg(22);

al= -180.956;
be= 78.648;




skybright_r = 2.5693*X_CIE-1.1668*lum-0.3984*Z_CIE;
skybright_g = -1.0221*X_CIE+1.9783*lum+0.0438*Z_CIE;
skybright_b =-0.0747*X_CIE-0.2519*lum+1.1772*Z_CIE;



X_CIE=lum*xd/yd;
Z_CIE=lum*(1-xd-yd)/yd;


yd=A20*xd*xd+A21*xd+A22;

xd = if((cct-7000),xd2,xd1);

xd1 = A12/(cct*cct*cct) +A13/(cct*cct) +A14/cct + A15;

xd2 = A16/(cct*cct*cct) +A17/(cct*cct) +A18/cct + A19;

cct = if((1.065-A11),6191,1000000/(al+be*(log10(lum))));




lum = skybright ;

skybright = wmean((Dz+1.01)^10, intersky, (Dz+1.01)^-10, A2 );

wmean(a, x, b, y) = (a*x+b*y)/(a+b);

intersky = if( (Dz-0.01),
A1 * (1 + A3*Exp(A4/Dz) ) * ( 1 + A5*Exp(A6*gamma) + A7*cosgamma*cosgamma ),
A1 * (1 + A3*Exp(A4/0.01) ) * ( 1 + A5*Exp(A6*gamma) + A7*cosgamma*cosgamma ) );




cosgamma = Dx*A8 + Dy*A9 + Dz*A10;

gamma = Acos(cosgamma); { angle from sun to this point in sky }

zt = Acos(A10); { angle from zenith to sun }

eta = Acos(Dz); { angle from zenith to this point in sky }

0 comments on commit a46558b

Please sign in to comment.