86 |
|
#include <string.h> |
87 |
|
#include <ctype.h> |
88 |
|
#include "rtmath.h" |
89 |
+ |
#include "rtio.h" |
90 |
|
#include "resolu.h" |
91 |
|
#include "platform.h" |
92 |
|
#include "color.h" |
556 |
|
break; |
557 |
|
case 'f': |
558 |
|
for (j = 0; j < ntsteps; j++) { |
559 |
< |
fwrite(mtx_data+mtx_offset, sizeof(float), 3, |
559 |
> |
putbinary(mtx_data+mtx_offset, sizeof(float), 3, |
560 |
|
stdout); |
561 |
|
mtx_offset += 3*nskypatch; |
562 |
|
} |
567 |
|
ment[0] = mtx_data[mtx_offset]; |
568 |
|
ment[1] = mtx_data[mtx_offset+1]; |
569 |
|
ment[2] = mtx_data[mtx_offset+2]; |
570 |
< |
fwrite(ment, sizeof(double), 3, stdout); |
570 |
> |
putbinary(ment, sizeof(double), 3, stdout); |
571 |
|
mtx_offset += 3*nskypatch; |
572 |
|
} |
573 |
|
break; |
953 |
|
/* Convert illuminance to irradiance */ |
954 |
|
index = GetCategoryIndex(); |
955 |
|
diff_irrad = diff_illum / CalcDiffuseIllumRatio(index); |
956 |
< |
dir_irrad = dir_illum / CalcDirectIllumRatio(index); |
956 |
> |
dir_irrad = CalcDirectIllumRatio(index); |
957 |
> |
if (dir_irrad > 0.1) |
958 |
> |
dir_irrad = dir_illum / dir_irrad; |
959 |
|
|
960 |
|
/* Calculate sky brightness and clearness */ |
961 |
|
sky_brightness = CalcSkyBrightness(); |