|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> Thanks, I go to try this when my render in works will stop.
OK but I still find it odd you get an error when using Y as a parameter.
What is the exact error you get, can you copy and paste it here for us
to see?
If you copy the below code into an empty POV document (so just 1 line) -
does it work?
#local xyYtoR = function (x,y,Y){ x+y+Y }
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
scott <sco### [at] scottcom> wrote:
> > Thanks, I go to try this when my render in works will stop.
>
> OK but I still find it odd you get an error when using Y as a parameter.
> What is the exact error you get, can you copy and paste it here for us
> to see?
>
> If you copy the below code into an empty POV document (so just 1 line) -
> does it work?
>
> #local xyYtoR = function (x,y,Y){ x+y+Y }
It work with a simple scene, I can't understand what's happens!!! With
sky_sim.inc ...
OOOPS!!! I've find, I have a variable declared Y... Excuse me...
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
scott <sco### [at] scottcom> wrote:
> > Thanks, I go to try this when my render in works will stop.
>
> OK but I still find it odd you get an error when using Y as a parameter.
> What is the exact error you get, can you copy and paste it here for us
> to see?
>
> If you copy the below code into an empty POV document (so just 1 line) -
> does it work?
>
> #local xyYtoR = function (x,y,Y){ x+y+Y }
OOOPS!!! after trying this (its work) I have re-read my code and I've seen a Y
declared by me (I know, #local is better than #declare).
I'm a stupID!!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
>> #local xyYtoR = function (x,y,Y){ x+y+Y }
>
> OOOPS!!! after trying this (its work) I have re-read my code and I've seen a Y
> declared by me (I know, #local is better than #declare).
> I'm a stupID!!
Not your fault, no matter what variable name you choose to use there is
always the chance someone else is using that same name elsewhere.
Another reason to stick to x,y,z for function parameters.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> See example images posted in p.b.i
>
> SkySim.inc is the macro, SkySimTestGround.pov is a simple example of a
> scene using the macro.
Updated .inc file attached to fix the bug found by Thomas in p.b.i
Post a reply to this message
Attachments:
Download 'windows-1252' (7 KB)
|
|
| |
| |
|
|
|
|
| |
| |
|
|
scott <sco### [at] scottcom> wrote:
> >> #local xyYtoR = function (x,y,Y){ x+y+Y }
> >
> > OOOPS!!! after trying this (its work) I have re-read my code and I've seen a Y
> > declared by me (I know, #local is better than #declare).
> > I'm a stupID!!
You are not stupid, Fractracer. It is a design flaw in POV-Ray.
> Not your fault, no matter what variable name you choose to use there is
> always the chance someone else is using that same name elsewhere.
> Another reason to stick to x,y,z for function parameters.
If the ideal of using meaningful identifier names isn't reason enough, sticking
to x, y, and z won't help if the function has more than three arguments. That's
why I do things like this:
#declare RE_fn_Wheel = function (x, y, z, RE_P0_RMajor, RE_P1_rMinor)
Where "RE_" is a prefix reserved by the include file (i.e., users are instructed
not to declare any identifiers that begin with "RE_"). Cumbersome yes, but
accidents are avoided.
This happens whenever you declare an identifier and then later use that same
name as a function argument. (I mentioned this in the p.b.i thread where a
similar issue turned up with macro names.) Oddly, it doesn't happen if you
declare the identifier /after/ the function is defined.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Great work!
I was just about to do the same thing but while struggling with the math
to express the pigment functions I luckily found your implementation ;)
But I'm wondering: while you cite the Preetham paper you do use
different values for the A to C parameters and also for the Perez
formulation.
Actually I do like the resulting renders better with the original values
from the Preetham paper (might very well just be a matter of individual
taste) but I'm curious where the other values did come from.
Also I'm wondering about the multiplication factor of 1000 for the
zenith luminance. As far as I understand it this formula return the
luminance in cd/m2 therefore this additional multiplication just makes
the exposure factor unnecessary small.
Here is what I do use (with the originalPreetham/Perez values):
// constant factors
#local AY = 0.1787*Turbidity- 1.4630;
#local BY =-0.3554*Turbidity+ 0.4275;
#local CY =-0.0227*Turbidity+ 5.3251;
#local DY = 0.1206*Turbidity- 2.5771;
#local EY =-0.0670*Turbidity+ 0.3703;
#local Ax =-0.0193*Turbidity- 0.2592;
#local Bx =-0.0665*Turbidity+ 0.0008;
#local Cx =-0.0004*Turbidity+ 0.2125;
#local Dx =-0.0641*Turbidity- 0.8989;
#local Ex =-0.0033*Turbidity+ 0.0452;
#local Ay =-0.0167*Turbidity- 0.2608;
#local By =-0.0950*Turbidity+ 0.0092;
#local Cy =-0.0079*Turbidity+ 0.2102;
#local Dy =-0.0441*Turbidity- 1.6537;
#local Ey =-0.0109*Turbidity+ 0.0529;
#macro computeZenithColor(T,thetas)
// Calculate luminance
#local zenithLuminance = ((4.0453*T - 4.9710) * tan( (4.0/9.0 - T/120)
* (pi-2*thetas) ) - 0.2155*T + 2.4192);
#if(zenithLuminance<=0)
#local zenithLuminance=1e-11;
#end
// Calculate colour
#local thetas2 = thetas*thetas;
#local thetas3 = thetas*thetas2;
#local T2 = T*T;
#local zx= ( 0.00166*thetas3 - 0.00375*thetas2 + 0.00209*thetas) * T2 +
(-0.02903*thetas3 + 0.06377*thetas2 - 0.03202*thetas +
0.00394) * T +
( 0.11693*thetas3 - 0.21196*thetas2 + 0.06052*thetas +
0.25886);
#local zy= ( 0.00275*thetas3 - 0.00610*thetas2 + 0.00317*thetas) * T2 +
(-0.04214*thetas3 + 0.08970*thetas2 - 0.04153*thetas +
0.00516) * T +
( 0.15346*thetas3 - 0.26756*thetas2 + 0.06670*thetas +
0.26688);
<zx,zy,zenithLuminance>
#end
-Ive
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> But I'm wondering: while you cite the Preetham paper you do use
> different values for the A to C parameters and also for the Perez
> formulation.
I took the values that the Stellarium source code used rather than the
paper itself, I guess the authors of Stellarium tweaked them a bit. I
guess you can use whichever set look better for you.
> Also I'm wondering about the multiplication factor of 1000 for the
> zenith luminance. As far as I understand it this formula return the
> luminance in cd/m2 therefore this additional multiplication just makes
> the exposure factor unnecessary small.
The formula in the paper gives the luminance in K cd/m2, that's why the
1000 factor is in there.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
scott <sco### [at] scottcom> wrote:
> > But I'm wondering: while you cite the Preetham paper you do use
> > different values for the A to C parameters and also for the Perez
> > formulation.
>
> I took the values that the Stellarium source code used rather than the
> paper itself, I guess the authors of Stellarium tweaked them a bit. I
> guess you can use whichever set look better for you.
>
> > Also I'm wondering about the multiplication factor of 1000 for the
> > zenith luminance. As far as I understand it this formula return the
> > luminance in cd/m2 therefore this additional multiplication just makes
> > the exposure factor unnecessary small.
>
> The formula in the paper gives the luminance in K cd/m2, that's why the
> 1000 factor is in there.
Quick question:
How do I convert the units of ExposureFactor to my scene?
In my scene, 20 units = 1 foot.
Thanks!!
Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> scott <sco### [at] scottcom> wrote:
>>> But I'm wondering: while you cite the Preetham paper you do use
>>> different values for the A to C parameters and also for the Perez
>>> formulation.
>>
>> I took the values that the Stellarium source code used rather than the
>> paper itself, I guess the authors of Stellarium tweaked them a bit. I
>> guess you can use whichever set look better for you.
>>
>>> Also I'm wondering about the multiplication factor of 1000 for the
>>> zenith luminance. As far as I understand it this formula return the
>>> luminance in cd/m2 therefore this additional multiplication just makes
>>> the exposure factor unnecessary small.
>>
>> The formula in the paper gives the luminance in K cd/m2, that's why the
>> 1000 factor is in there.
>
> Quick question:
>
> How do I convert the units of ExposureFactor to my scene?
>
> In my scene, 20 units = 1 foot.
>
> Thanks!!
>
>
> Mike
>
The formula use meter, a meter = about 39 inches, or 3 feet and 3 inches
(3.25 feet in 1 m).
There are 10.5625 square feet in a square meter.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |