├── CMakeLists.txt ├── HosekSky ├── ArHosekSkyModel.cpp ├── ArHosekSkyModel.h ├── ArHosekSkyModelData_CIEXYZ.h ├── ArHosekSkyModelData_RGB.h ├── ArHosekSkyModelData_Spectral.h └── README.txt ├── README.md └── src ├── Geometry.h ├── Main.cpp ├── Renderer.cpp ├── Renderer.h ├── ShaderUtils.h ├── SkyModel.cpp ├── SkyModel.h └── tinyexr.h /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.4) 2 | project(ahPhysicalSky) 3 | 4 | if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") 5 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu11 -Wno-narrowing -march=native -m64 -O3 -static -funroll-loops") 6 | endif() 7 | 8 | FIND_PACKAGE( OpenMP REQUIRED) 9 | if(OPENMP_FOUND) 10 | message("OPENMP FOUND") 11 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") 12 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") 13 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}") 14 | endif() 15 | 16 | set(SOURCE_FILES 17 | src/Main.cpp 18 | src/Renderer.cpp 19 | src/SkyModel.cpp 20 | HosekSky/ArHosekSkyModel.cpp 21 | ) 22 | 23 | add_executable(ahPhysicalSky ${SOURCE_FILES}) 24 | -------------------------------------------------------------------------------- /HosekSky/ArHosekSkyModel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This source is published under the following 3-clause BSD license. 3 | 4 | Copyright (c) 2012 - 2013, Lukas Hosek and Alexander Wilkie 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | * None of the names of the contributors may be used to endorse or promote 16 | products derived from this software without specific prior written 17 | permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY 23 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | /* ============================================================================ 32 | 33 | This file is part of a sample implementation of the analytical skylight and 34 | solar radiance models presented in the SIGGRAPH 2012 paper 35 | 36 | 37 | "An Analytic Model for Full Spectral Sky-Dome Radiance" 38 | 39 | and the 2013 IEEE CG&A paper 40 | 41 | "Adding a Solar Radiance Function to the Hosek Skylight Model" 42 | 43 | both by 44 | 45 | Lukas Hosek and Alexander Wilkie 46 | Charles University in Prague, Czech Republic 47 | 48 | 49 | Version: 1.4a, February 22nd, 2013 50 | 51 | Version history: 52 | 53 | 1.4a February 22nd, 2013 54 | Removed unnecessary and counter-intuitive solar radius parameters 55 | from the interface of the colourspace sky dome initialisation functions. 56 | 57 | 1.4 February 11th, 2013 58 | Fixed a bug which caused the relative brightness of the solar disc 59 | and the sky dome to be off by a factor of about 6. The sun was too 60 | bright: this affected both normal and alien sun scenarios. The 61 | coefficients of the solar radiance function were changed to fix this. 62 | 63 | 1.3 January 21st, 2013 (not released to the public) 64 | Added support for solar discs that are not exactly the same size as 65 | the terrestrial sun. Also added support for suns with a different 66 | emission spectrum ("Alien World" functionality). 67 | 68 | 1.2a December 18th, 2012 69 | Fixed a mistake and some inaccuracies in the solar radiance function 70 | explanations found in ArHosekSkyModel.h. The actual source code is 71 | unchanged compared to version 1.2. 72 | 73 | 1.2 December 17th, 2012 74 | Native RGB data and a solar radiance function that matches the turbidity 75 | conditions were added. 76 | 77 | 1.1 September 2012 78 | The coefficients of the spectral model are now scaled so that the output 79 | is given in physical units: W / (m^-2 * sr * nm). Also, the output of the 80 | XYZ model is now no longer scaled to the range [0...1]. Instead, it is 81 | the result of a simple conversion from spectral data via the CIE 2 degree 82 | standard observer matching functions. Therefore, after multiplication 83 | with 683 lm / W, the Y channel now corresponds to luminance in lm. 84 | 85 | 1.0 May 11th, 2012 86 | Initial release. 87 | 88 | 89 | Please visit http://cgg.mff.cuni.cz/projects/SkylightModelling/ to check if 90 | an updated version of this code has been published! 91 | 92 | ============================================================================ */ 93 | 94 | /* 95 | 96 | All instructions on how to use this code are in the accompanying header file. 97 | 98 | */ 99 | 100 | #include "ArHosekSkyModel.h" 101 | #include "ArHosekSkyModelData_Spectral.h" 102 | #include "ArHosekSkyModelData_CIEXYZ.h" 103 | #include "ArHosekSkyModelData_RGB.h" 104 | #include 105 | #include 106 | #include 107 | #include 108 | 109 | // Some macro definitions that occur elsewhere in ART, and that have to be 110 | // replicated to make this a stand-alone module. 111 | 112 | #ifndef NIL 113 | #define NIL 0 114 | #endif 115 | 116 | #ifndef MATH_PI 117 | #define MATH_PI 3.141592653589793 118 | #endif 119 | 120 | #ifndef MATH_DEG_TO_RAD 121 | #define MATH_DEG_TO_RAD ( MATH_PI / 180.0 ) 122 | #endif 123 | 124 | #ifndef MATH_RAD_TO_DEG 125 | #define MATH_RAD_TO_DEG ( 180.0 / MATH_PI ) 126 | #endif 127 | 128 | #ifndef DEGREES 129 | #define DEGREES * MATH_DEG_TO_RAD 130 | #endif 131 | 132 | #ifndef TERRESTRIAL_SOLAR_RADIUS 133 | #define TERRESTRIAL_SOLAR_RADIUS ( ( 0.51 DEGREES ) / 2.0 ) 134 | #endif 135 | 136 | #ifndef ALLOC 137 | #define ALLOC(_struct) ((_struct *)malloc(sizeof(_struct))) 138 | #endif 139 | 140 | // internal definitions 141 | 142 | typedef double *ArHosekSkyModel_Dataset; 143 | typedef double *ArHosekSkyModel_Radiance_Dataset; 144 | 145 | // internal functions 146 | 147 | void ArHosekSkyModel_CookConfiguration( 148 | ArHosekSkyModel_Dataset dataset, 149 | ArHosekSkyModelConfiguration config, 150 | double turbidity, 151 | double albedo, 152 | double solar_elevation 153 | ) 154 | { 155 | double * elev_matrix; 156 | 157 | int int_turbidity = (int)turbidity; 158 | double turbidity_rem = turbidity - (double)int_turbidity; 159 | 160 | solar_elevation = pow(solar_elevation / (MATH_PI / 2.0), (1.0 / 3.0)); 161 | 162 | // alb 0 low turb 163 | 164 | elev_matrix = dataset + ( 9 * 6 * (int_turbidity-1) ); 165 | 166 | 167 | for( unsigned int i = 0; i < 9; ++i ) 168 | { 169 | //(1-t).^3* A1 + 3*(1-t).^2.*t * A2 + 3*(1-t) .* t .^ 2 * A3 + t.^3 * A4; 170 | config[i] = 171 | (1.0-albedo) * (1.0 - turbidity_rem) 172 | * ( pow(1.0-solar_elevation, 5.0) * elev_matrix[i] + 173 | 5.0 * pow(1.0-solar_elevation, 4.0) * solar_elevation * elev_matrix[i+9] + 174 | 10.0*pow(1.0-solar_elevation, 3.0)*pow(solar_elevation, 2.0) * elev_matrix[i+18] + 175 | 10.0*pow(1.0-solar_elevation, 2.0)*pow(solar_elevation, 3.0) * elev_matrix[i+27] + 176 | 5.0*(1.0-solar_elevation)*pow(solar_elevation, 4.0) * elev_matrix[i+36] + 177 | pow(solar_elevation, 5.0) * elev_matrix[i+45]); 178 | } 179 | 180 | // alb 1 low turb 181 | elev_matrix = dataset + (9*6*10 + 9*6*(int_turbidity-1)); 182 | for(unsigned int i = 0; i < 9; ++i) 183 | { 184 | //(1-t).^3* A1 + 3*(1-t).^2.*t * A2 + 3*(1-t) .* t .^ 2 * A3 + t.^3 * A4; 185 | config[i] += 186 | (albedo) * (1.0 - turbidity_rem) 187 | * ( pow(1.0-solar_elevation, 5.0) * elev_matrix[i] + 188 | 5.0 * pow(1.0-solar_elevation, 4.0) * solar_elevation * elev_matrix[i+9] + 189 | 10.0*pow(1.0-solar_elevation, 3.0)*pow(solar_elevation, 2.0) * elev_matrix[i+18] + 190 | 10.0*pow(1.0-solar_elevation, 2.0)*pow(solar_elevation, 3.0) * elev_matrix[i+27] + 191 | 5.0*(1.0-solar_elevation)*pow(solar_elevation, 4.0) * elev_matrix[i+36] + 192 | pow(solar_elevation, 5.0) * elev_matrix[i+45]); 193 | } 194 | 195 | if(int_turbidity == 10) 196 | return; 197 | 198 | // alb 0 high turb 199 | elev_matrix = dataset + (9*6*(int_turbidity)); 200 | for(unsigned int i = 0; i < 9; ++i) 201 | { 202 | //(1-t).^3* A1 + 3*(1-t).^2.*t * A2 + 3*(1-t) .* t .^ 2 * A3 + t.^3 * A4; 203 | config[i] += 204 | (1.0-albedo) * (turbidity_rem) 205 | * ( pow(1.0-solar_elevation, 5.0) * elev_matrix[i] + 206 | 5.0 * pow(1.0-solar_elevation, 4.0) * solar_elevation * elev_matrix[i+9] + 207 | 10.0*pow(1.0-solar_elevation, 3.0)*pow(solar_elevation, 2.0) * elev_matrix[i+18] + 208 | 10.0*pow(1.0-solar_elevation, 2.0)*pow(solar_elevation, 3.0) * elev_matrix[i+27] + 209 | 5.0*(1.0-solar_elevation)*pow(solar_elevation, 4.0) * elev_matrix[i+36] + 210 | pow(solar_elevation, 5.0) * elev_matrix[i+45]); 211 | } 212 | 213 | // alb 1 high turb 214 | elev_matrix = dataset + (9*6*10 + 9*6*(int_turbidity)); 215 | for(unsigned int i = 0; i < 9; ++i) 216 | { 217 | //(1-t).^3* A1 + 3*(1-t).^2.*t * A2 + 3*(1-t) .* t .^ 2 * A3 + t.^3 * A4; 218 | config[i] += 219 | (albedo) * (turbidity_rem) 220 | * ( pow(1.0-solar_elevation, 5.0) * elev_matrix[i] + 221 | 5.0 * pow(1.0-solar_elevation, 4.0) * solar_elevation * elev_matrix[i+9] + 222 | 10.0*pow(1.0-solar_elevation, 3.0)*pow(solar_elevation, 2.0) * elev_matrix[i+18] + 223 | 10.0*pow(1.0-solar_elevation, 2.0)*pow(solar_elevation, 3.0) * elev_matrix[i+27] + 224 | 5.0*(1.0-solar_elevation)*pow(solar_elevation, 4.0) * elev_matrix[i+36] + 225 | pow(solar_elevation, 5.0) * elev_matrix[i+45]); 226 | } 227 | } 228 | 229 | double ArHosekSkyModel_CookRadianceConfiguration( 230 | ArHosekSkyModel_Radiance_Dataset dataset, 231 | double turbidity, 232 | double albedo, 233 | double solar_elevation 234 | ) 235 | { 236 | double* elev_matrix; 237 | 238 | int int_turbidity = (int)turbidity; 239 | double turbidity_rem = turbidity - (double)int_turbidity; 240 | double res; 241 | solar_elevation = pow(solar_elevation / (MATH_PI / 2.0), (1.0 / 3.0)); 242 | 243 | // alb 0 low turb 244 | elev_matrix = dataset + (6*(int_turbidity-1)); 245 | //(1-t).^3* A1 + 3*(1-t).^2.*t * A2 + 3*(1-t) .* t .^ 2 * A3 + t.^3 * A4; 246 | res = (1.0-albedo) * (1.0 - turbidity_rem) * 247 | ( pow(1.0-solar_elevation, 5.0) * elev_matrix[0] + 248 | 5.0*pow(1.0-solar_elevation, 4.0)*solar_elevation * elev_matrix[1] + 249 | 10.0*pow(1.0-solar_elevation, 3.0)*pow(solar_elevation, 2.0) * elev_matrix[2] + 250 | 10.0*pow(1.0-solar_elevation, 2.0)*pow(solar_elevation, 3.0) * elev_matrix[3] + 251 | 5.0*(1.0-solar_elevation)*pow(solar_elevation, 4.0) * elev_matrix[4] + 252 | pow(solar_elevation, 5.0) * elev_matrix[5]); 253 | 254 | // alb 1 low turb 255 | elev_matrix = dataset + (6*10 + 6*(int_turbidity-1)); 256 | //(1-t).^3* A1 + 3*(1-t).^2.*t * A2 + 3*(1-t) .* t .^ 2 * A3 + t.^3 * A4; 257 | res += (albedo) * (1.0 - turbidity_rem) * 258 | ( pow(1.0-solar_elevation, 5.0) * elev_matrix[0] + 259 | 5.0*pow(1.0-solar_elevation, 4.0)*solar_elevation * elev_matrix[1] + 260 | 10.0*pow(1.0-solar_elevation, 3.0)*pow(solar_elevation, 2.0) * elev_matrix[2] + 261 | 10.0*pow(1.0-solar_elevation, 2.0)*pow(solar_elevation, 3.0) * elev_matrix[3] + 262 | 5.0*(1.0-solar_elevation)*pow(solar_elevation, 4.0) * elev_matrix[4] + 263 | pow(solar_elevation, 5.0) * elev_matrix[5]); 264 | if(int_turbidity == 10) 265 | return res; 266 | 267 | // alb 0 high turb 268 | elev_matrix = dataset + (6*(int_turbidity)); 269 | //(1-t).^3* A1 + 3*(1-t).^2.*t * A2 + 3*(1-t) .* t .^ 2 * A3 + t.^3 * A4; 270 | res += (1.0-albedo) * (turbidity_rem) * 271 | ( pow(1.0-solar_elevation, 5.0) * elev_matrix[0] + 272 | 5.0*pow(1.0-solar_elevation, 4.0)*solar_elevation * elev_matrix[1] + 273 | 10.0*pow(1.0-solar_elevation, 3.0)*pow(solar_elevation, 2.0) * elev_matrix[2] + 274 | 10.0*pow(1.0-solar_elevation, 2.0)*pow(solar_elevation, 3.0) * elev_matrix[3] + 275 | 5.0*(1.0-solar_elevation)*pow(solar_elevation, 4.0) * elev_matrix[4] + 276 | pow(solar_elevation, 5.0) * elev_matrix[5]); 277 | 278 | // alb 1 high turb 279 | elev_matrix = dataset + (6*10 + 6*(int_turbidity)); 280 | //(1-t).^3* A1 + 3*(1-t).^2.*t * A2 + 3*(1-t) .* t .^ 2 * A3 + t.^3 * A4; 281 | res += (albedo) * (turbidity_rem) * 282 | ( pow(1.0-solar_elevation, 5.0) * elev_matrix[0] + 283 | 5.0*pow(1.0-solar_elevation, 4.0)*solar_elevation * elev_matrix[1] + 284 | 10.0*pow(1.0-solar_elevation, 3.0)*pow(solar_elevation, 2.0) * elev_matrix[2] + 285 | 10.0*pow(1.0-solar_elevation, 2.0)*pow(solar_elevation, 3.0) * elev_matrix[3] + 286 | 5.0*(1.0-solar_elevation)*pow(solar_elevation, 4.0) * elev_matrix[4] + 287 | pow(solar_elevation, 5.0) * elev_matrix[5]); 288 | return res; 289 | } 290 | 291 | double ArHosekSkyModel_GetRadianceInternal( 292 | ArHosekSkyModelConfiguration configuration, 293 | double theta, 294 | double gamma 295 | ) 296 | { 297 | const double expM = exp(configuration[4] * gamma); 298 | const double rayM = cos(gamma)*cos(gamma); 299 | const double mieM = (1.0 + cos(gamma)*cos(gamma)) / pow((1.0 + configuration[8]*configuration[8] - 2.0*configuration[8]*cos(gamma)), 1.5); 300 | const double zenith = sqrt(cos(theta)); 301 | 302 | return (1.0 + configuration[0] * exp(configuration[1] / (cos(theta) + 0.01))) * 303 | (configuration[2] + configuration[3] * expM + configuration[5] * rayM + configuration[6] * mieM + configuration[7] * zenith); 304 | } 305 | 306 | // spectral version 307 | 308 | ArHosekSkyModelState * arhosekskymodelstate_alloc_init( 309 | const double solar_elevation, 310 | const double atmospheric_turbidity, 311 | const double ground_albedo 312 | ) 313 | { 314 | ArHosekSkyModelState * state = ALLOC(ArHosekSkyModelState); 315 | 316 | state->solar_radius = ( 0.51 DEGREES ) / 2.0; 317 | state->turbidity = atmospheric_turbidity; 318 | state->albedo = ground_albedo; 319 | state->elevation = solar_elevation; 320 | 321 | for( unsigned int wl = 0; wl < 11; ++wl ) 322 | { 323 | ArHosekSkyModel_CookConfiguration( 324 | datasets[wl], 325 | state->configs[wl], 326 | atmospheric_turbidity, 327 | ground_albedo, 328 | solar_elevation 329 | ); 330 | 331 | state->radiances[wl] = 332 | ArHosekSkyModel_CookRadianceConfiguration( 333 | datasetsRad[wl], 334 | atmospheric_turbidity, 335 | ground_albedo, 336 | solar_elevation 337 | ); 338 | 339 | state->emission_correction_factor_sun[wl] = 1.0; 340 | state->emission_correction_factor_sky[wl] = 1.0; 341 | } 342 | 343 | return state; 344 | } 345 | 346 | // 'blackbody_scaling_factor' 347 | // 348 | // Fudge factor, computed in Mathematica, to scale the results of the 349 | // following function to match the solar radiance spectrum used in the 350 | // original simulation. The scaling is done so their integrals over the 351 | // range from 380.0 to 720.0 nanometers match for a blackbody temperature 352 | // of 5800 K. 353 | // Which leaves the original spectrum being less bright overall than the 5.8k 354 | // blackbody radiation curve if the ultra-violet part of the spectrum is 355 | // also considered. But the visible brightness should be very similar. 356 | 357 | const double blackbody_scaling_factor = 3.19992 * 10E-11; 358 | 359 | // 'art_blackbody_dd_value()' function 360 | // 361 | // Blackbody radiance, Planck's formula 362 | 363 | double art_blackbody_dd_value( 364 | const double temperature, 365 | const double lambda 366 | ) 367 | { 368 | double c1 = 3.74177 * 10E-17; 369 | double c2 = 0.0143878; 370 | double value; 371 | 372 | value = ( c1 / ( pow( lambda, 5.0 ) ) ) 373 | * ( 1.0 / ( exp( c2 / ( lambda * temperature ) ) - 1.0 ) ); 374 | 375 | return value; 376 | } 377 | 378 | // 'originalSolarRadianceTable[]' 379 | // 380 | // The solar spectrum incident at the top of the atmosphere, as it was used 381 | // in the brute force path tracer that generated the reference results the 382 | // model was fitted to. We need this as the yardstick to compare any altered 383 | // Blackbody emission spectra for alien world stars to. 384 | 385 | // This is just the data from the Preetham paper, extended into the UV range. 386 | 387 | const double originalSolarRadianceTable[] = 388 | { 389 | 7500.0, 390 | 12500.0, 391 | 21127.5, 392 | 26760.5, 393 | 30663.7, 394 | 27825.0, 395 | 25503.8, 396 | 25134.2, 397 | 23212.1, 398 | 21526.7, 399 | 19870.8 400 | }; 401 | 402 | ArHosekSkyModelState * arhosekskymodelstate_alienworld_alloc_init( 403 | const double solar_elevation, 404 | const double solar_intensity, 405 | const double solar_surface_temperature_kelvin, 406 | const double atmospheric_turbidity, 407 | const double ground_albedo 408 | ) 409 | { 410 | ArHosekSkyModelState * state = ALLOC(ArHosekSkyModelState); 411 | 412 | state->turbidity = atmospheric_turbidity; 413 | state->albedo = ground_albedo; 414 | state->elevation = solar_elevation; 415 | 416 | for( unsigned int wl = 0; wl < 11; ++wl ) 417 | { 418 | // Basic init as for the normal scenario 419 | 420 | ArHosekSkyModel_CookConfiguration( 421 | datasets[wl], 422 | state->configs[wl], 423 | atmospheric_turbidity, 424 | ground_albedo, 425 | solar_elevation 426 | ); 427 | 428 | state->radiances[wl] = 429 | ArHosekSkyModel_CookRadianceConfiguration( 430 | datasetsRad[wl], 431 | atmospheric_turbidity, 432 | ground_albedo, 433 | solar_elevation 434 | ); 435 | 436 | // The wavelength of this band in nanometers 437 | 438 | double owl = ( 320.0 + 40.0 * wl ) * 10E-10; 439 | 440 | // The original intensity we just computed 441 | 442 | double osr = originalSolarRadianceTable[wl]; 443 | 444 | // The intensity of a blackbody with the desired temperature 445 | // The fudge factor described above is used to make sure the BB 446 | // function matches the used radiance data reasonably well 447 | // in magnitude. 448 | 449 | double nsr = 450 | art_blackbody_dd_value(solar_surface_temperature_kelvin, owl) 451 | * blackbody_scaling_factor; 452 | 453 | // Correction factor for this waveband is simply the ratio of 454 | // the two. 455 | 456 | state->emission_correction_factor_sun[wl] = nsr / osr; 457 | } 458 | 459 | // We then compute the average correction factor of all wavebands. 460 | 461 | // Theoretically, some weighting to favour wavelengths human vision is 462 | // more sensitive to could be introduced here - think V(lambda). But 463 | // given that the whole effort is not *that* accurate to begin with (we 464 | // are talking about the appearance of alien worlds, after all), simple 465 | // averaging over the visible wavelenghts (! - this is why we start at 466 | // WL #2, and only use 2-11) seems like a sane first approximation. 467 | 468 | double correctionFactor = 0.0; 469 | 470 | for ( unsigned int i = 2; i < 11; i++ ) 471 | { 472 | correctionFactor += 473 | state->emission_correction_factor_sun[i]; 474 | } 475 | 476 | // This is the average ratio in emitted energy between our sun, and an 477 | // equally large sun with the blackbody spectrum we requested. 478 | 479 | // Division by 9 because we only used 9 of the 11 wavelengths for this 480 | // (see above). 481 | 482 | double ratio = correctionFactor / 9.0; 483 | 484 | // This ratio is then used to determine the radius of the alien sun 485 | // on the sky dome. The additional factor 'solar_intensity' can be used 486 | // to make the alien sun brighter or dimmer compared to our sun. 487 | 488 | state->solar_radius = 489 | ( sqrt( solar_intensity ) * TERRESTRIAL_SOLAR_RADIUS ) 490 | / sqrt( ratio ); 491 | 492 | // Finally, we have to reduce the scaling factor of the sky by the 493 | // ratio used to scale the solar disc size. The rationale behind this is 494 | // that the scaling factors apply to the new blackbody spectrum, which 495 | // can be more or less bright than the one our sun emits. However, we 496 | // just scaled the size of the alien solar disc so it is roughly as 497 | // bright (in terms of energy emitted) as the terrestrial sun. So the sky 498 | // dome has to be reduced in brightness appropriately - but not in an 499 | // uniform fashion across wavebands. If we did that, the sky colour would 500 | // be wrong. 501 | 502 | for ( unsigned int i = 0; i < 11; i++ ) 503 | { 504 | state->emission_correction_factor_sky[i] = 505 | solar_intensity 506 | * state->emission_correction_factor_sun[i] / ratio; 507 | } 508 | 509 | return state; 510 | } 511 | 512 | void arhosekskymodelstate_free( 513 | ArHosekSkyModelState * state 514 | ) 515 | { 516 | free(state); 517 | } 518 | 519 | double arhosekskymodel_radiance( 520 | ArHosekSkyModelState * state, 521 | double theta, 522 | double gamma, 523 | double wavelength 524 | ) 525 | { 526 | int low_wl = (wavelength - 320.0 ) / 40.0; 527 | 528 | if ( low_wl < 0 || low_wl >= 11 ) 529 | return 0.0f; 530 | 531 | double interp = fmod((wavelength - 320.0 ) / 40.0, 1.0); 532 | 533 | double val_low = 534 | ArHosekSkyModel_GetRadianceInternal( 535 | state->configs[low_wl], 536 | theta, 537 | gamma 538 | ) 539 | * state->radiances[low_wl] 540 | * state->emission_correction_factor_sky[low_wl]; 541 | 542 | if ( interp < 1e-6 ) 543 | return val_low; 544 | 545 | double result = ( 1.0 - interp ) * val_low; 546 | 547 | if ( low_wl+1 < 11 ) 548 | { 549 | result += 550 | interp 551 | * ArHosekSkyModel_GetRadianceInternal( 552 | state->configs[low_wl+1], 553 | theta, 554 | gamma 555 | ) 556 | * state->radiances[low_wl+1] 557 | * state->emission_correction_factor_sky[low_wl+1]; 558 | } 559 | 560 | return result; 561 | } 562 | 563 | 564 | // xyz and rgb versions 565 | 566 | ArHosekSkyModelState * arhosek_xyz_skymodelstate_alloc_init( 567 | const double turbidity, 568 | const double albedo, 569 | const double elevation 570 | ) 571 | { 572 | ArHosekSkyModelState * state = ALLOC(ArHosekSkyModelState); 573 | 574 | state->solar_radius = TERRESTRIAL_SOLAR_RADIUS; 575 | state->turbidity = turbidity; 576 | state->albedo = albedo; 577 | state->elevation = elevation; 578 | 579 | for( unsigned int channel = 0; channel < 3; ++channel ) 580 | { 581 | ArHosekSkyModel_CookConfiguration( 582 | datasetsXYZ[channel], 583 | state->configs[channel], 584 | turbidity, 585 | albedo, 586 | elevation 587 | ); 588 | 589 | state->radiances[channel] = 590 | ArHosekSkyModel_CookRadianceConfiguration( 591 | datasetsXYZRad[channel], 592 | turbidity, 593 | albedo, 594 | elevation 595 | ); 596 | } 597 | 598 | return state; 599 | } 600 | 601 | 602 | ArHosekSkyModelState * arhosek_rgb_skymodelstate_alloc_init( 603 | const double turbidity, 604 | const double albedo, 605 | const double elevation 606 | ) 607 | { 608 | ArHosekSkyModelState* state = ALLOC(ArHosekSkyModelState); 609 | 610 | state->solar_radius = TERRESTRIAL_SOLAR_RADIUS; 611 | state->turbidity = turbidity; 612 | state->albedo = albedo; 613 | state->elevation = elevation; 614 | 615 | for( unsigned int channel = 0; channel < 3; ++channel ) 616 | { 617 | ArHosekSkyModel_CookConfiguration( 618 | datasetsRGB[channel], 619 | state->configs[channel], 620 | turbidity, 621 | albedo, 622 | elevation 623 | ); 624 | 625 | state->radiances[channel] = 626 | ArHosekSkyModel_CookRadianceConfiguration( 627 | datasetsRGBRad[channel], 628 | turbidity, 629 | albedo, 630 | elevation 631 | ); 632 | } 633 | 634 | return state; 635 | } 636 | 637 | double arhosek_tristim_skymodel_radiance( 638 | ArHosekSkyModelState * state, 639 | double theta, 640 | double gamma, 641 | int channel 642 | ) 643 | { 644 | return 645 | ArHosekSkyModel_GetRadianceInternal( 646 | state->configs[channel], 647 | theta, 648 | gamma 649 | ) 650 | * state->radiances[channel]; 651 | } 652 | 653 | const int pieces = 45; 654 | const int order = 4; 655 | 656 | double arhosekskymodel_sr_internal( 657 | ArHosekSkyModelState * state, 658 | int turbidity, 659 | int wl, 660 | double elevation 661 | ) 662 | { 663 | int pos = 664 | (int) (pow(2.0*elevation / MATH_PI, 1.0/3.0) * pieces); // floor 665 | 666 | if ( pos > 44 ) pos = 44; 667 | 668 | const double break_x = 669 | pow(((double) pos / (double) pieces), 3.0) * (MATH_PI * 0.5); 670 | 671 | const double * coefs = 672 | solarDatasets[wl] + (order * pieces * turbidity + order * (pos+1) - 1); 673 | 674 | double res = 0.0; 675 | const double x = elevation - break_x; 676 | double x_exp = 1.0; 677 | 678 | for (int i = 0; i < order; ++i) 679 | { 680 | res += x_exp * *coefs--; 681 | x_exp *= x; 682 | } 683 | 684 | return res * state->emission_correction_factor_sun[wl]; 685 | } 686 | 687 | double arhosekskymodel_solar_radiance_internal2( 688 | ArHosekSkyModelState * state, 689 | double wavelength, 690 | double elevation, 691 | double gamma 692 | ) 693 | { 694 | assert( 695 | wavelength >= 320.0 696 | && wavelength <= 720.0 697 | && state->turbidity >= 1.0 698 | && state->turbidity <= 10.0 699 | ); 700 | 701 | 702 | int turb_low = (int) state->turbidity - 1; 703 | double turb_frac = state->turbidity - (double) (turb_low + 1); 704 | 705 | if ( turb_low == 9 ) 706 | { 707 | turb_low = 8; 708 | turb_frac = 1.0; 709 | } 710 | 711 | int wl_low = (int) ((wavelength - 320.0) / 40.0); 712 | double wl_frac = fmod(wavelength, 40.0) / 40.0; 713 | 714 | if ( wl_low == 10 ) 715 | { 716 | wl_low = 9; 717 | wl_frac = 1.0; 718 | } 719 | 720 | double direct_radiance = 721 | ( 1.0 - turb_frac ) 722 | * ( (1.0 - wl_frac) 723 | * arhosekskymodel_sr_internal( 724 | state, 725 | turb_low, 726 | wl_low, 727 | elevation 728 | ) 729 | + wl_frac 730 | * arhosekskymodel_sr_internal( 731 | state, 732 | turb_low, 733 | wl_low+1, 734 | elevation 735 | ) 736 | ) 737 | + turb_frac 738 | * ( ( 1.0 - wl_frac ) 739 | * arhosekskymodel_sr_internal( 740 | state, 741 | turb_low+1, 742 | wl_low, 743 | elevation 744 | ) 745 | + wl_frac 746 | * arhosekskymodel_sr_internal( 747 | state, 748 | turb_low+1, 749 | wl_low+1, 750 | elevation 751 | ) 752 | ); 753 | 754 | double ldCoefficient[6]; 755 | 756 | for ( int i = 0; i < 6; i++ ) 757 | ldCoefficient[i] = 758 | (1.0 - wl_frac) * limbDarkeningDatasets[wl_low ][i] 759 | + wl_frac * limbDarkeningDatasets[wl_low+1][i]; 760 | 761 | // sun distance to diameter ratio, squared 762 | 763 | const double sol_rad_sin = sin(state->solar_radius); 764 | const double ar2 = 1 / ( sol_rad_sin * sol_rad_sin ); 765 | const double singamma = sin(gamma); 766 | double sc2 = 1.0 - ar2 * singamma * singamma; 767 | if (sc2 < 0.0 ) sc2 = 0.0; 768 | double sampleCosine = sqrt (sc2); 769 | 770 | // The following will be improved in future versions of the model: 771 | // here, we directly use fitted 5th order polynomials provided by the 772 | // astronomical community for the limb darkening effect. Astronomers need 773 | // such accurate fittings for their predictions. However, this sort of 774 | // accuracy is not really needed for CG purposes, so an approximated 775 | // dataset based on quadratic polynomials will be provided in a future 776 | // release. 777 | 778 | double darkeningFactor = 779 | ldCoefficient[0] 780 | + ldCoefficient[1] * sampleCosine 781 | + ldCoefficient[2] * pow( sampleCosine, 2.0 ) 782 | + ldCoefficient[3] * pow( sampleCosine, 3.0 ) 783 | + ldCoefficient[4] * pow( sampleCosine, 4.0 ) 784 | + ldCoefficient[5] * pow( sampleCosine, 5.0 ); 785 | 786 | direct_radiance *= darkeningFactor; 787 | 788 | return direct_radiance; 789 | } 790 | 791 | double arhosekskymodel_solar_radiance( 792 | ArHosekSkyModelState * state, 793 | double theta, 794 | double gamma, 795 | double wavelength 796 | ) 797 | { 798 | double direct_radiance = 799 | arhosekskymodel_solar_radiance_internal2( 800 | state, 801 | wavelength, 802 | ((MATH_PI/2.0)-theta), 803 | gamma 804 | ); 805 | 806 | double inscattered_radiance = 807 | arhosekskymodel_radiance( 808 | state, 809 | theta, 810 | gamma, 811 | wavelength 812 | ); 813 | 814 | return direct_radiance + inscattered_radiance; 815 | } 816 | 817 | -------------------------------------------------------------------------------- /HosekSky/ArHosekSkyModel.h: -------------------------------------------------------------------------------- 1 | /* 2 | This source is published under the following 3-clause BSD license. 3 | 4 | Copyright (c) 2012 - 2013, Lukas Hosek and Alexander Wilkie 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | * None of the names of the contributors may be used to endorse or promote 16 | products derived from this software without specific prior written 17 | permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY 23 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | 32 | /* ============================================================================ 33 | 34 | This file is part of a sample implementation of the analytical skylight and 35 | solar radiance models presented in the SIGGRAPH 2012 paper 36 | 37 | 38 | "An Analytic Model for Full Spectral Sky-Dome Radiance" 39 | 40 | and the 2013 IEEE CG&A paper 41 | 42 | "Adding a Solar Radiance Function to the Hosek Skylight Model" 43 | 44 | both by 45 | 46 | Lukas Hosek and Alexander Wilkie 47 | Charles University in Prague, Czech Republic 48 | 49 | 50 | Version: 1.4a, February 22nd, 2013 51 | 52 | Version history: 53 | 54 | 1.4a February 22nd, 2013 55 | Removed unnecessary and counter-intuitive solar radius parameters 56 | from the interface of the colourspace sky dome initialisation functions. 57 | 58 | 1.4 February 11th, 2013 59 | Fixed a bug which caused the relative brightness of the solar disc 60 | and the sky dome to be off by a factor of about 6. The sun was too 61 | bright: this affected both normal and alien sun scenarios. The 62 | coefficients of the solar radiance function were changed to fix this. 63 | 64 | 1.3 January 21st, 2013 (not released to the public) 65 | Added support for solar discs that are not exactly the same size as 66 | the terrestrial sun. Also added support for suns with a different 67 | emission spectrum ("Alien World" functionality). 68 | 69 | 1.2a December 18th, 2012 70 | Fixed a mistake and some inaccuracies in the solar radiance function 71 | explanations found in ArHosekSkyModel.h. The actual source code is 72 | unchanged compared to version 1.2. 73 | 74 | 1.2 December 17th, 2012 75 | Native RGB data and a solar radiance function that matches the turbidity 76 | conditions were added. 77 | 78 | 1.1 September 2012 79 | The coefficients of the spectral model are now scaled so that the output 80 | is given in physical units: W / (m^-2 * sr * nm). Also, the output of the 81 | XYZ model is now no longer scaled to the range [0...1]. Instead, it is 82 | the result of a simple conversion from spectral data via the CIE 2 degree 83 | standard observer matching functions. Therefore, after multiplication 84 | with 683 lm / W, the Y channel now corresponds to luminance in lm. 85 | 86 | 1.0 May 11th, 2012 87 | Initial release. 88 | 89 | 90 | Please visit http://cgg.mff.cuni.cz/projects/SkylightModelling/ to check if 91 | an updated version of this code has been published! 92 | 93 | ============================================================================ */ 94 | 95 | 96 | /* 97 | 98 | This code is taken from ART, a rendering research system written in a 99 | mix of C99 / Objective C. Since ART is not a small system and is intended to 100 | be inter-operable with other libraries, and since C does not have namespaces, 101 | the structures and functions in ART all have to have somewhat wordy 102 | canonical names that begin with Ar.../ar..., like those seen in this example. 103 | 104 | Usage information: 105 | ================== 106 | 107 | 108 | Model initialisation 109 | -------------------- 110 | 111 | A separate ArHosekSkyModelState has to be maintained for each spectral 112 | band you want to use the model for. So in a renderer with 'num_channels' 113 | bands, you would need something like 114 | 115 | ArHosekSkyModelState * skymodel_state[num_channels]; 116 | 117 | You then have to allocate and initialise these states. In the following code 118 | snippet, we assume that 'albedo' is defined as 119 | 120 | double albedo[num_channels]; 121 | 122 | with a ground albedo value between [0,1] for each channel. The solar elevation 123 | is given in radians. 124 | 125 | for ( unsigned int i = 0; i < num_channels; i++ ) 126 | skymodel_state[i] = 127 | arhosekskymodelstate_alloc_init( 128 | turbidity, 129 | albedo[i], 130 | solarElevation 131 | ); 132 | 133 | Note that starting with version 1.3, there is also a second initialisation 134 | function which generates skydome states for different solar emission spectra 135 | and solar radii: 'arhosekskymodelstate_alienworld_alloc_init()'. 136 | 137 | See the notes about the "Alien World" functionality provided further down for a 138 | discussion of the usefulness and limits of that second initalisation function. 139 | Sky model states that have been initialised with either function behave in a 140 | completely identical fashion during use and cleanup. 141 | 142 | Using the model to generate skydome samples 143 | ------------------------------------------- 144 | 145 | Generating a skydome radiance spectrum "skydome_result" for a given location 146 | on the skydome determined via the angles theta and gamma works as follows: 147 | 148 | double skydome_result[num_channels]; 149 | 150 | for ( unsigned int i = 0; i < num_channels; i++ ) 151 | skydome_result[i] = 152 | arhosekskymodel_radiance( 153 | skymodel_state[i], 154 | theta, 155 | gamma, 156 | channel_center[i] 157 | ); 158 | 159 | The variable "channel_center" is assumed to hold the channel center wavelengths 160 | for each of the num_channels samples of the spectrum we are building. 161 | 162 | 163 | Cleanup after use 164 | ----------------- 165 | 166 | After rendering is complete, the content of the sky model states should be 167 | disposed of via 168 | 169 | for ( unsigned int i = 0; i < num_channels; i++ ) 170 | arhosekskymodelstate_free( skymodel_state[i] ); 171 | 172 | 173 | CIE XYZ Version of the Model 174 | ---------------------------- 175 | 176 | Usage of the CIE XYZ version of the model is exactly the same, except that 177 | num_channels is of course always 3, and that ArHosekTristimSkyModelState and 178 | arhosek_tristim_skymodel_radiance() have to be used instead of their spectral 179 | counterparts. 180 | 181 | RGB Version of the Model 182 | ------------------------ 183 | 184 | The RGB version uses sRGB primaries with a linear gamma ramp. The same set of 185 | functions as with the XYZ data is used, except the model is initialized 186 | by calling arhosek_rgb_skymodelstate_alloc_init. 187 | 188 | Solar Radiance Function 189 | ----------------------- 190 | 191 | For each position on the solar disc, this function returns the entire radiance 192 | one sees - direct emission, as well as in-scattered light in the area of the 193 | solar disc. The latter is important for low solar elevations - nice images of 194 | the setting sun would not be possible without this. This is also the reason why 195 | this function, just like the regular sky dome model evaluation function, needs 196 | access to the sky dome data structures, as these provide information on 197 | in-scattered radiance. 198 | 199 | CAVEAT #1: in this release, this function is only provided in spectral form! 200 | RGB/XYZ versions to follow at a later date. 201 | 202 | CAVEAT #2: (fixed from release 1.3 onwards) 203 | 204 | CAVEAT #3: limb darkening renders the brightness of the solar disc 205 | inhomogeneous even for high solar elevations - only taking a single 206 | sample at the centre of the sun will yield an incorrect power 207 | estimate for the solar disc! Always take multiple random samples 208 | across the entire solar disc to estimate its power! 209 | 210 | CAVEAT #4: in this version, the limb darkening calculations still use a fairly 211 | computationally expensive 5th order polynomial that was directly 212 | taken from astronomical literature. For the purposes of Computer 213 | Graphics, this is needlessly accurate, though, and will be replaced 214 | by a cheaper approximation in a future release. 215 | 216 | "Alien World" functionality 217 | --------------------------- 218 | 219 | The Hosek sky model can be used to roughly (!) predict the appearance of 220 | outdoor scenes on earth-like planets, i.e. planets of a similar size and 221 | atmospheric make-up. Since the spectral version of our model predicts sky dome 222 | luminance patterns and solar radiance independently for each waveband, and 223 | since the intensity of each waveband is solely dependent on the input radiance 224 | from the star that the world in question is orbiting, it is trivial to re-scale 225 | the wavebands to match a different star radiance. 226 | 227 | At least in theory, the spectral version of the model has always been capable 228 | of this sort of thing, and the actual sky dome and solar radiance models were 229 | actually not altered at all in this release. All we did was to add some support 230 | functionality for doing this more easily with the existing data and functions, 231 | and to add some explanations. 232 | 233 | Just use 'arhosekskymodelstate_alienworld_alloc_init()' to initialise the sky 234 | model states (you will have to provide values for star temperature and solar 235 | intensity compared to the terrestrial sun), and do everything else as you 236 | did before. 237 | 238 | CAVEAT #1: we assume the emission of the star that illuminates the alien world 239 | to be a perfect blackbody emission spectrum. This is never entirely 240 | realistic - real star emission spectra are considerably more complex 241 | than this, mainly due to absorption effects in the outer layers of 242 | stars. However, blackbody spectra are a reasonable first assumption 243 | in a usage scenario like this, where 100% accuracy is simply not 244 | necessary: for rendering purposes, there are likely no visible 245 | differences between a highly accurate solution based on a more 246 | involved simulation, and this approximation. 247 | 248 | CAVEAT #2: we always use limb darkening data from our own sun to provide this 249 | "appearance feature", even for suns of strongly different 250 | temperature. Which is presumably not very realistic, but (as with 251 | the unaltered blackbody spectrum from caveat #1) probably not a bad 252 | first guess, either. If you need more accuracy than we provide here, 253 | please make inquiries with a friendly astro-physicst of your choice. 254 | 255 | CAVEAT #3: you have to provide a value for the solar intensity of the star 256 | which illuminates the alien world. For this, please bear in mind 257 | that there is very likely a comparatively tight range of absolute 258 | solar irradiance values for which an earth-like planet with an 259 | atmosphere like the one we assume in our model can exist in the 260 | first place! 261 | 262 | Too much irradiance, and the atmosphere probably boils off into 263 | space, too little, it freezes. Which means that stars of 264 | considerably different emission colour than our sun will have to be 265 | fairly different in size from it, to still provide a reasonable and 266 | inhabitable amount of irradiance. Red stars will need to be much 267 | larger than our sun, while white or blue stars will have to be 268 | comparatively tiny. The initialisation function handles this and 269 | computes a plausible solar radius for a given emission spectrum. In 270 | terms of absolute radiometric values, you should probably not stray 271 | all too far from a solar intensity value of 1.0. 272 | 273 | CAVEAT #4: although we now support different solar radii for the actual solar 274 | disc, the sky dome luminance patterns are *not* parameterised by 275 | this value - i.e. the patterns stay exactly the same for different 276 | solar radii! Which is of course not correct. But in our experience, 277 | solar discs up to several degrees in diameter (! - our own sun is 278 | half a degree across) do not cause the luminance patterns on the sky 279 | to change perceptibly. The reason we know this is that we initially 280 | used unrealistically large suns in our brute force path tracer, in 281 | order to improve convergence speeds (which in the beginning were 282 | abysmal). Later, we managed to do the reference renderings much 283 | faster even with realistically small suns, and found that there was 284 | no real difference in skydome appearance anyway. 285 | Conclusion: changing the solar radius should not be over-done, so 286 | close orbits around red supergiants are a no-no. But for the 287 | purposes of getting a fairly credible first impression of what an 288 | alien world with a reasonably sized sun would look like, what we are 289 | doing here is probably still o.k. 290 | 291 | HINT #1: if you want to model the sky of an earth-like planet that orbits 292 | a binary star, just super-impose two of these models with solar 293 | intensity of ~0.5 each, and closely spaced solar positions. Light is 294 | additive, after all. Tattooine, here we come... :-) 295 | 296 | P.S. according to Star Wars canon, Tattooine orbits a binary 297 | that is made up of a G and K class star, respectively. 298 | So ~5500K and ~4200K should be good first guesses for their 299 | temperature. Just in case you were wondering, after reading the 300 | previous paragraph. 301 | */ 302 | 303 | 304 | #ifndef _ARHOSEK_SKYMODEL_H_ 305 | #define _ARHOSEK_SKYMODEL_H_ 306 | 307 | #ifndef __cplusplus 308 | extern "C" { 309 | #endif 310 | 311 | typedef double ArHosekSkyModelConfiguration[9]; 312 | 313 | 314 | // Spectral version of the model 315 | 316 | /* ---------------------------------------------------------------------------- 317 | 318 | ArHosekSkyModelState struct 319 | --------------------------- 320 | 321 | This struct holds the pre-computation data for one particular albedo value. 322 | Most fields are self-explanatory, but users should never directly 323 | manipulate any of them anyway. The only consistent way to manipulate such 324 | structs is via the functions 'arhosekskymodelstate_alloc_init' and 325 | 'arhosekskymodelstate_free'. 326 | 327 | 'emission_correction_factor_sky' 328 | 'emission_correction_factor_sun' 329 | 330 | The original model coefficients were fitted against the emission of 331 | our local sun. If a different solar emission is desired (i.e. if the 332 | model is being used to predict skydome appearance for an earth-like 333 | planet that orbits a different star), these correction factors, which 334 | are determined during the alloc_init step, are applied to each waveband 335 | separately (they default to 1.0 in normal usage). This is the simplest 336 | way to retrofit this sort of capability to the existing model. The 337 | different factors for sky and sun are needed since the solar disc may 338 | be of a different size compared to the terrestrial sun. 339 | 340 | ---------------------------------------------------------------------------- */ 341 | 342 | typedef struct ArHosekSkyModelState 343 | { 344 | ArHosekSkyModelConfiguration configs[11]; 345 | double radiances[11]; 346 | double turbidity; 347 | double solar_radius; 348 | double emission_correction_factor_sky[11]; 349 | double emission_correction_factor_sun[11]; 350 | double albedo; 351 | double elevation; 352 | } 353 | ArHosekSkyModelState; 354 | 355 | /* ---------------------------------------------------------------------------- 356 | 357 | arhosekskymodelstate_alloc_init() function 358 | ------------------------------------------ 359 | 360 | Initialises an ArHosekSkyModelState struct for a terrestrial setting. 361 | 362 | ---------------------------------------------------------------------------- */ 363 | 364 | ArHosekSkyModelState * arhosekskymodelstate_alloc_init( 365 | const double solar_elevation, 366 | const double atmospheric_turbidity, 367 | const double ground_albedo 368 | ); 369 | 370 | 371 | /* ---------------------------------------------------------------------------- 372 | 373 | arhosekskymodelstate_alienworld_alloc_init() function 374 | ----------------------------------------------------- 375 | 376 | Initialises an ArHosekSkyModelState struct for an "alien world" setting 377 | with a sun of a surface temperature given in 'kelvin'. The parameter 378 | 'solar_intensity' controls the overall brightness of the sky, relative 379 | to the solar irradiance on Earth. A value of 1.0 yields a sky dome that 380 | is, on average over the wavelenghts covered in the model (!), as bright 381 | as the terrestrial sky in radiometric terms. 382 | 383 | Which means that the solar radius has to be adjusted, since the 384 | emissivity of a solar surface with a given temperature is more or less 385 | fixed. So hotter suns have to be smaller to be equally bright as the 386 | terrestrial sun, while cooler suns have to be larger. Note that there are 387 | limits to the validity of the luminance patterns of the underlying model: 388 | see the discussion above for more on this. In particular, an alien sun with 389 | a surface temperature of only 2000 Kelvin has to be very large if it is 390 | to be as bright as the terrestrial sun - so large that the luminance 391 | patterns are no longer a really good fit in that case. 392 | 393 | If you need information about the solar radius that the model computes 394 | for a given temperature (say, for light source sampling purposes), you 395 | have to query the 'solar_radius' variable of the sky model state returned 396 | *after* running this function. 397 | 398 | ---------------------------------------------------------------------------- */ 399 | 400 | ArHosekSkyModelState * arhosekskymodelstate_alienworld_alloc_init( 401 | const double solar_elevation, 402 | const double solar_intensity, 403 | const double solar_surface_temperature_kelvin, 404 | const double atmospheric_turbidity, 405 | const double ground_albedo 406 | ); 407 | 408 | void arhosekskymodelstate_free( 409 | ArHosekSkyModelState * state 410 | ); 411 | 412 | double arhosekskymodel_radiance( 413 | ArHosekSkyModelState * state, 414 | double theta, 415 | double gamma, 416 | double wavelength 417 | ); 418 | 419 | // CIE XYZ and RGB versions 420 | 421 | 422 | ArHosekSkyModelState * arhosek_xyz_skymodelstate_alloc_init( 423 | const double turbidity, 424 | const double albedo, 425 | const double elevation 426 | ); 427 | 428 | 429 | ArHosekSkyModelState * arhosek_rgb_skymodelstate_alloc_init( 430 | const double turbidity, 431 | const double albedo, 432 | const double elevation 433 | ); 434 | 435 | 436 | double arhosek_tristim_skymodel_radiance( 437 | ArHosekSkyModelState * state, 438 | double theta, 439 | double gamma, 440 | int channel 441 | ); 442 | 443 | // Delivers the complete function: sky + sun, including limb darkening. 444 | // Please read the above description before using this - there are several 445 | // caveats! 446 | 447 | double arhosekskymodel_solar_radiance( 448 | ArHosekSkyModelState * state, 449 | double theta, 450 | double gamma, 451 | double wavelength 452 | ); 453 | 454 | #ifndef __cplusplus 455 | } 456 | #endif 457 | 458 | #endif // _ARHOSEK_SKYMODEL_H_ 459 | -------------------------------------------------------------------------------- /HosekSky/ArHosekSkyModelData_RGB.h: -------------------------------------------------------------------------------- 1 | /* 2 | This source is published under the following 3-clause BSD license. 3 | 4 | Copyright (c) 2012 - 2013, Lukas Hosek and Alexander Wilkie 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | * None of the names of the contributors may be used to endorse or promote 16 | products derived from this software without specific prior written 17 | permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY 23 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | 32 | /* ============================================================================ 33 | 34 | This file is part of a sample implementation of the analytical skylight and 35 | solar radiance models presented in the SIGGRAPH 2012 paper 36 | 37 | 38 | "An Analytic Model for Full Spectral Sky-Dome Radiance" 39 | 40 | and the 2013 IEEE CG&A paper 41 | 42 | "Adding a Solar Radiance Function to the Hosek Skylight Model" 43 | 44 | both by 45 | 46 | Lukas Hosek and Alexander Wilkie 47 | Charles University in Prague, Czech Republic 48 | 49 | 50 | Version: 1.4a, February 22nd, 2013 51 | 52 | Version history: 53 | 54 | 1.4a February 22nd, 2013 55 | Removed unnecessary and counter-intuitive solar radius parameters 56 | from the interface of the colourspace sky dome initialisation functions. 57 | 58 | 1.4 February 11th, 2013 59 | Fixed a bug which caused the relative brightness of the solar disc 60 | and the sky dome to be off by a factor of about 6. The sun was too 61 | bright: this affected both normal and alien sun scenarios. The 62 | coefficients of the solar radiance function were changed to fix this. 63 | 64 | 1.3 January 21st, 2013 (not released to the public) 65 | Added support for solar discs that are not exactly the same size as 66 | the terrestrial sun. Also added support for suns with a different 67 | emission spectrum ("Alien World" functionality). 68 | 69 | 1.2a December 18th, 2012 70 | Fixed a mistake and some inaccuracies in the solar radiance function 71 | explanations found in ArHosekSkyModel.h. The actual source code is 72 | unchanged compared to version 1.2. 73 | 74 | 1.2 December 17th, 2012 75 | Native RGB data and a solar radiance function that matches the turbidity 76 | conditions were added. 77 | 78 | 1.1 September 2012 79 | The coefficients of the spectral model are now scaled so that the output 80 | is given in physical units: W / (m^-2 * sr * nm). Also, the output of the 81 | XYZ model is now no longer scaled to the range [0...1]. Instead, it is 82 | the result of a simple conversion from spectral data via the CIE 2 degree 83 | standard observer matching functions. Therefore, after multiplication 84 | with 683 lm / W, the Y channel now corresponds to luminance in lm. 85 | 86 | 1.0 May 11th, 2012 87 | Initial release. 88 | 89 | 90 | Please visit http://cgg.mff.cuni.cz/projects/SkylightModelling/ to check if 91 | an updated version of this code has been published! 92 | 93 | ============================================================================ */ 94 | 95 | 96 | /* 97 | 98 | This file contains the coefficient data for the RGB colour space version of 99 | the model. 100 | 101 | */ 102 | 103 | // uses Aug 23 dataset 104 | 105 | double datasetRGB1[] = 106 | { 107 | // albedo 0, turbidity 1 108 | -1.099459e+000, 109 | -1.335146e-001, 110 | -4.083223e+000, 111 | 5.919603e+000, 112 | -1.104166e-001, 113 | 1.600158e+000, 114 | -1.326538e-006, 115 | 4.917807e+000, 116 | 5.127716e-001, 117 | -1.169858e+000, 118 | -1.832793e-001, 119 | 9.694744e-001, 120 | 9.495762e-002, 121 | -4.738918e-002, 122 | 2.194171e-001, 123 | 1.095749e-001, 124 | 3.603604e+000, 125 | 3.815119e-001, 126 | -9.665225e-001, 127 | -1.403888e-001, 128 | 5.194457e+000, 129 | -1.107607e+000, 130 | -8.135181e-001, 131 | 4.969661e+000, 132 | -2.300508e-001, 133 | -2.489350e+000, 134 | 1.279158e+000, 135 | -1.292508e+000, 136 | -1.299552e-001, 137 | -2.071404e+000, 138 | -4.752482e-002, 139 | 1.215598e+000, 140 | -1.904179e+000, 141 | 3.027985e-001, 142 | 8.707768e+000, 143 | 6.332446e-002, 144 | -9.264666e-001, 145 | -1.696780e-001, 146 | 4.574070e+000, 147 | -4.232936e-001, 148 | -7.575833e+000, 149 | 5.079755e+000, 150 | -2.576343e-001, 151 | -4.506805e+000, 152 | 6.908129e-001, 153 | -1.139072e+000, 154 | -1.796056e-001, 155 | 1.923311e+000, 156 | 6.788529e+000, 157 | -2.364389e+000, 158 | -1.064041e+000, 159 | 1.717010e-001, 160 | 1.534681e+000, 161 | 5.015810e-001, 162 | // albedo 0, turbidity 2 163 | -1.107257e+000, 164 | -1.384411e-001, 165 | -4.285744e+000, 166 | 5.713157e+000, 167 | -1.015992e-001, 168 | 1.372638e+000, 169 | 6.555893e-002, 170 | 5.127514e+000, 171 | 6.550471e-001, 172 | -1.187337e+000, 173 | -1.969013e-001, 174 | 8.551048e-001, 175 | 5.289708e-002, 176 | -7.626406e-002, 177 | 1.733153e-002, 178 | 1.779454e-001, 179 | 3.801038e+000, 180 | 4.742709e-001, 181 | -9.685321e-001, 182 | -1.553308e-001, 183 | 4.732492e+000, 184 | -1.178935e+000, 185 | -7.852791e-001, 186 | 4.604492e+000, 187 | -2.666518e-001, 188 | -2.367663e+000, 189 | 1.177527e+000, 190 | -1.252817e+000, 191 | -5.129949e-002, 192 | -2.800433e+000, 193 | -1.295992e-002, 194 | 1.308964e+000, 195 | -2.204331e+000, 196 | 7.276011e-001, 197 | 8.699265e+000, 198 | 1.188388e-001, 199 | -9.459509e-001, 200 | -2.322133e-001, 201 | 4.375041e+000, 202 | -1.712018e-001, 203 | -7.451681e+000, 204 | 5.078019e+000, 205 | -4.223538e-001, 206 | -4.595561e+000, 207 | 1.074719e+000, 208 | -1.125092e+000, 209 | -1.796750e-001, 210 | 1.626399e+000, 211 | 6.989743e+000, 212 | -2.406382e+000, 213 | -9.060383e-001, 214 | 2.961611e-001, 215 | 1.337715e+000, 216 | 5.438140e-001, 217 | // albedo 0, turbidity 3 218 | -1.135338e+000, 219 | -1.716160e-001, 220 | -1.499253e+000, 221 | 2.373491e+000, 222 | -1.654023e-001, 223 | 9.566404e-001, 224 | 1.113453e-001, 225 | 4.528473e+000, 226 | 6.579439e-001, 227 | -1.132780e+000, 228 | -1.456214e-001, 229 | -1.736672e+000, 230 | 1.756589e+000, 231 | -1.087003e-001, 232 | 3.757927e-001, 233 | 2.525070e-001, 234 | 7.178513e+000, 235 | 5.003814e-001, 236 | -1.167176e+000, 237 | -2.927225e-001, 238 | 5.727667e+000, 239 | -3.139244e+000, 240 | -6.425204e-001, 241 | 2.822634e+000, 242 | -1.457812e-001, 243 | -6.787080e+000, 244 | 1.017072e+000, 245 | -1.042529e+000, 246 | 4.110823e-002, 247 | -4.000629e+000, 248 | 4.362364e+000, 249 | 1.090540e+000, 250 | -1.338674e+000, 251 | 8.246964e-001, 252 | 1.095249e+001, 253 | 2.912211e-001, 254 | -1.061598e+000, 255 | -2.096143e-001, 256 | 3.803155e+000, 257 | -7.977069e+000, 258 | -3.637880e+000, 259 | 3.707671e+000, 260 | -1.903128e-001, 261 | -3.397953e+000, 262 | 9.971500e-001, 263 | -1.073560e+000, 264 | -2.077964e-001, 265 | 1.492052e+000, 266 | 1.626322e+001, 267 | -5.015304e+000, 268 | -4.059889e-001, 269 | 2.659782e-001, 270 | 6.395380e-001, 271 | 5.634436e-001, 272 | // albedo 0, turbidity 4 273 | -1.172794e+000, 274 | -2.111186e-001, 275 | -1.360013e+000, 276 | 1.604080e+000, 277 | -8.473723e-002, 278 | 7.217312e-001, 279 | 1.548030e-001, 280 | 4.257010e+000, 281 | 6.328974e-001, 282 | -1.238374e+000, 283 | -2.670827e-001, 284 | 3.247678e-001, 285 | 5.466311e-001, 286 | -7.425952e-001, 287 | 5.276440e-001, 288 | 2.678026e-002, 289 | 5.484169e+000, 290 | 6.814734e-001, 291 | -1.176923e+000, 292 | -2.574586e-001, 293 | 2.304045e+000, 294 | -2.797678e+000, 295 | 1.464405e+000, 296 | 1.998552e+000, 297 | 2.550559e-001, 298 | -4.199772e+000, 299 | 7.544892e-001, 300 | -1.003284e+000, 301 | 1.943984e-002, 302 | -2.145066e+000, 303 | 1.030924e+001, 304 | -1.525413e+001, 305 | -2.023010e+000, 306 | 5.448699e-001, 307 | 8.159497e+000, 308 | 5.539148e-001, 309 | -1.060017e+000, 310 | -2.037206e-001, 311 | 2.483018e+000, 312 | -4.595459e+000, 313 | 6.526991e+000, 314 | 4.031804e+000, 315 | 1.206513e-001, 316 | -2.586527e+000, 317 | 7.875752e-001, 318 | -1.081141e+000, 319 | -2.123302e-001, 320 | 1.092275e+000, 321 | 2.683841e+000, 322 | -4.166938e+000, 323 | -1.396582e+000, 324 | 4.371205e-001, 325 | 1.030233e+000, 326 | 6.664862e-001, 327 | // albedo 0, turbidity 5 328 | -1.222392e+000, 329 | -2.651924e-001, 330 | -4.625037e-001, 331 | 3.521964e-001, 332 | 2.148855e-002, 333 | 5.078494e-001, 334 | 1.791590e-001, 335 | 3.852516e+000, 336 | 5.998216e-001, 337 | -1.424610e+000, 338 | -4.710155e-001, 339 | -1.826815e-001, 340 | 1.786277e+000, 341 | -1.952442e+000, 342 | 5.277612e-001, 343 | -1.773629e-002, 344 | 2.415874e+000, 345 | 6.701272e-001, 346 | -1.130655e+000, 347 | -1.358609e-001, 348 | 9.171203e-001, 349 | -4.660394e+000, 350 | 6.251162e+000, 351 | 1.904529e+000, 352 | 2.639668e-001, 353 | 1.856130e+000, 354 | 8.228440e-001, 355 | -9.739015e-001, 356 | -6.674749e-002, 357 | -4.768897e-001, 358 | 1.248589e+001, 359 | -1.994688e+001, 360 | -2.353043e+000, 361 | 5.885575e-001, 362 | 1.287251e+000, 363 | 4.830135e-001, 364 | -1.082178e+000, 365 | -1.974495e-001, 366 | 1.050245e+000, 367 | -4.792855e+000, 368 | 8.663406e+000, 369 | 3.246969e+000, 370 | 1.556731e-001, 371 | 8.117442e-001, 372 | 8.050376e-001, 373 | -1.063354e+000, 374 | -1.727108e-001, 375 | 9.681592e-001, 376 | 2.736077e+000, 377 | -4.969269e+000, 378 | -8.360570e-001, 379 | 5.994612e-001, 380 | 1.024039e+000, 381 | 6.786935e-001, 382 | // albedo 0, turbidity 6 383 | -1.261936e+000, 384 | -3.053676e-001, 385 | -4.262222e-001, 386 | 4.000196e-001, 387 | -2.059388e-002, 388 | 4.721802e-001, 389 | 1.480028e-001, 390 | 3.505343e+000, 391 | 6.121337e-001, 392 | -1.681088e+000, 393 | -6.971919e-001, 394 | -1.105652e-001, 395 | 7.437426e-001, 396 | -6.594399e-001, 397 | 2.254221e-001, 398 | 8.710195e-002, 399 | 1.263913e+000, 400 | 5.681865e-001, 401 | -9.453001e-001, 402 | 3.460388e-002, 403 | 6.067038e-001, 404 | -1.985128e+000, 405 | 3.457236e+000, 406 | 2.655483e+000, 407 | -1.162354e-002, 408 | 3.304716e+000, 409 | 1.001950e+000, 410 | -1.086609e+000, 411 | -2.029011e-001, 412 | -6.399170e-001, 413 | 6.926885e+000, 414 | -1.512189e+001, 415 | -3.793051e+000, 416 | 9.456120e-001, 417 | 2.222222e-001, 418 | 2.893725e-001, 419 | -1.041259e+000, 420 | -1.388790e-001, 421 | 1.147331e+000, 422 | 6.282086e+000, 423 | 3.679836e+000, 424 | 4.398314e+000, 425 | -1.355232e-001, 426 | 1.031134e+000, 427 | 9.273509e-001, 428 | -1.063473e+000, 429 | -1.916051e-001, 430 | 6.556979e-001, 431 | -3.371891e-003, 432 | -3.699664e+000, 433 | -1.926783e+000, 434 | 7.371154e-001, 435 | 1.179975e+000, 436 | 6.367068e-001, 437 | // albedo 0, turbidity 7 438 | -1.336390e+000, 439 | -3.778927e-001, 440 | -7.259477e-001, 441 | 2.270247e-001, 442 | 4.627513e-001, 443 | 1.366459e-001, 444 | 2.637347e-001, 445 | 3.292059e+000, 446 | 4.998211e-001, 447 | -2.119878e+000, 448 | -1.055472e+000, 449 | 5.422052e-001, 450 | 7.826648e-001, 451 | -1.286065e+000, 452 | 9.517905e-001, 453 | -1.432358e-001, 454 | -2.379816e-001, 455 | 5.910513e-001, 456 | -7.761432e-001, 457 | 2.124336e-001, 458 | -6.845184e-001, 459 | -9.812342e-001, 460 | 4.347257e+000, 461 | 9.671980e-001, 462 | 3.773150e-001, 463 | 5.789529e+000, 464 | 9.646598e-001, 465 | -1.118734e+000, 466 | -3.513815e-001, 467 | 5.500918e-001, 468 | 9.449627e-001, 469 | -1.262070e+001, 470 | -1.825280e+000, 471 | 4.731260e-001, 472 | -3.326892e+000, 473 | 3.568768e-001, 474 | -1.026437e+000, 475 | -8.257946e-002, 476 | 3.221701e-001, 477 | 1.198372e+001, 478 | 1.555130e+000, 479 | 2.560304e+000, 480 | 1.406465e-001, 481 | 2.912858e+000, 482 | 8.643181e-001, 483 | -1.069949e+000, 484 | -2.029607e-001, 485 | 5.825042e-001, 486 | -2.398595e-003, 487 | -3.278335e+000, 488 | -1.349882e+000, 489 | 7.208433e-001, 490 | 8.505164e-001, 491 | 6.625391e-001, 492 | // albedo 0, turbidity 8 493 | -1.392309e+000, 494 | -4.454945e-001, 495 | -5.664000e-001, 496 | 6.283393e-001, 497 | -3.761727e-001, 498 | 6.949802e-001, 499 | 7.748178e-002, 500 | 3.192797e+000, 501 | 5.968661e-001, 502 | -2.713405e+000, 503 | -1.395112e+000, 504 | 2.029230e-001, 505 | 1.877272e-001, 506 | -3.715859e-001, 507 | -1.652929e-001, 508 | 2.385861e-001, 509 | -4.150768e-001, 510 | 1.375467e-001, 511 | -9.588644e-001, 512 | 2.433900e-002, 513 | -1.527493e+000, 514 | -9.632874e-001, 515 | 5.496269e+000, 516 | 1.094931e+000, 517 | 2.004044e-001, 518 | 6.084554e+000, 519 | 1.369604e+000, 520 | -8.028546e-001, 521 | -2.473563e-001, 522 | 1.617898e+000, 523 | 2.073591e+000, 524 | -1.149446e+001, 525 | -8.394131e-001, 526 | 2.726847e-001, 527 | -4.634538e+000, 528 | 1.367293e-001, 529 | -1.198326e+000, 530 | -1.804865e-001, 531 | -3.565414e-001, 532 | 4.073200e+000, 533 | 1.662086e+000, 534 | 1.239770e+000, 535 | 3.367978e-001, 536 | 2.997402e+000, 537 | 9.360383e-001, 538 | -1.013531e+000, 539 | -1.859060e-001, 540 | 5.799857e-001, 541 | 1.331883e+001, 542 | -4.346873e+000, 543 | -1.113820e+000, 544 | 5.275714e-001, 545 | 8.045177e-001, 546 | 6.496373e-001, 547 | // albedo 0, turbidity 9 548 | -1.530103e+000, 549 | -6.107468e-001, 550 | -3.841771e-001, 551 | 1.881508e+000, 552 | -1.464807e+000, 553 | 6.654690e-001, 554 | -5.950797e-006, 555 | 2.738912e+000, 556 | 8.101012e-001, 557 | -2.415469e+000, 558 | -1.057499e+000, 559 | -4.161968e-001, 560 | -2.357548e+000, 561 | 6.300296e-001, 562 | 6.224915e-001, 563 | 1.545048e-002, 564 | 2.038561e+000, 565 | -1.339415e-001, 566 | -3.096796e+000, 567 | -1.465688e+000, 568 | -1.199232e+000, 569 | 4.567061e+000, 570 | 3.260980e+000, 571 | -9.794907e-001, 572 | 8.950491e-001, 573 | 2.049235e+000, 574 | 1.331015e+000, 575 | 2.713904e-001, 576 | 2.852852e-001, 577 | 1.202090e+000, 578 | -8.206784e+000, 579 | -5.805762e+000, 580 | 1.804431e+000, 581 | -6.090648e-001, 582 | -1.990902e+000, 583 | 3.288858e-001, 584 | -1.456580e+000, 585 | -3.455960e-001, 586 | -6.409257e-002, 587 | 1.667697e+001, 588 | -2.311094e+000, 589 | -9.771104e-001, 590 | 6.759863e-001, 591 | 1.245136e+000, 592 | 7.911932e-001, 593 | -9.860389e-001, 594 | -2.099564e-001, 595 | 2.946650e-001, 596 | -3.547800e-003, 597 | -2.268313e+000, 598 | -6.205647e-002, 599 | 4.705185e-001, 600 | 8.657995e-001, 601 | 6.856284e-001, 602 | // albedo 0, turbidity 10 603 | -1.971736e+000, 604 | -9.414047e-001, 605 | -3.400557e-001, 606 | 1.468763e+000, 607 | -1.474284e+000, 608 | 5.501062e-001, 609 | -1.109750e-005, 610 | 2.356370e+000, 611 | 9.001702e-001, 612 | -1.589845e+000, 613 | -7.797079e-001, 614 | -5.582240e-001, 615 | -8.137376e-001, 616 | 5.846617e-001, 617 | 1.129459e-001, 618 | -2.658005e-002, 619 | 2.707248e+000, 620 | -2.112486e-001, 621 | -6.940173e+000, 622 | -2.823963e+000, 623 | -1.620848e+000, 624 | 1.090696e+000, 625 | 2.391730e+000, 626 | 1.370047e+000, 627 | 5.890462e-001, 628 | 1.728400e+000, 629 | 1.331253e+000, 630 | 1.293144e+000, 631 | -1.919778e-003, 632 | 1.644206e+000, 633 | -8.666967e-001, 634 | -7.161953e+000, 635 | -1.385018e+000, 636 | -1.505374e-001, 637 | -1.388643e+000, 638 | 2.530122e-001, 639 | -1.488880e+000, 640 | -2.495496e-001, 641 | -2.377137e-001, 642 | 1.167714e+001, 643 | -8.617124e-001, 644 | 1.053828e+000, 645 | 1.992744e-001, 646 | 3.633564e-001, 647 | 8.553304e-001, 648 | -1.060891e+000, 649 | -4.035829e-001, 650 | 2.823207e-001, 651 | -2.369798e-003, 652 | -1.876577e+000, 653 | -5.950265e-001, 654 | 4.241017e-001, 655 | 3.140802e-001, 656 | 6.631669e-001, 657 | // albedo 1, turbidity 1 658 | -1.101204e+000, 659 | -1.351353e-001, 660 | -4.030882e+000, 661 | 6.096353e+000, 662 | -1.148599e-001, 663 | 1.606507e+000, 664 | -1.555474e-006, 665 | 4.436084e+000, 666 | 5.973715e-001, 667 | -1.154597e+000, 668 | -1.923378e-001, 669 | 8.512132e-001, 670 | 2.934895e-001, 671 | -6.522777e-002, 672 | 1.389077e-001, 673 | 9.091469e-002, 674 | 3.133307e+000, 675 | 2.108541e-001, 676 | -1.031588e+000, 677 | -1.546804e-001, 678 | 5.266214e+000, 679 | -9.491390e-001, 680 | -7.184867e-001, 681 | 4.875626e+000, 682 | -1.911907e-001, 683 | -2.865642e+000, 684 | 1.087895e+000, 685 | -1.159454e+000, 686 | -9.546699e-002, 687 | -1.508146e+000, 688 | -2.031411e-002, 689 | 1.040653e+000, 690 | -2.333508e+000, 691 | 2.540592e-001, 692 | 8.594981e+000, 693 | 9.316770e-002, 694 | -1.035940e+000, 695 | -2.021151e-001, 696 | 4.719343e+000, 697 | -9.019318e-001, 698 | -7.858046e+000, 699 | 3.901234e+000, 700 | -2.233137e-001, 701 | -4.344739e+000, 702 | 6.550733e-001, 703 | -1.096669e+000, 704 | -1.558196e-001, 705 | 2.057553e+000, 706 | 6.274495e+000, 707 | -2.678352e+000, 708 | -1.814927e+000, 709 | 1.550676e-001, 710 | 1.903276e+000, 711 | 4.998989e-001, 712 | // albedo 1, turbidity 2 713 | -1.114209e+000, 714 | -1.473531e-001, 715 | -7.602914e+000, 716 | 8.973685e+000, 717 | -4.980074e-002, 718 | 1.289198e+000, 719 | 8.366906e-002, 720 | 4.557987e+000, 721 | 6.118757e-001, 722 | -1.149397e+000, 723 | -1.981628e-001, 724 | 4.914096e+000, 725 | -3.498986e+000, 726 | -6.257090e-002, 727 | 1.667401e-001, 728 | 1.048980e-001, 729 | 2.284689e+000, 730 | 5.935965e-001, 731 | -1.056121e+000, 732 | -1.456172e-001, 733 | 4.272656e-001, 734 | 2.912649e+000, 735 | -5.501745e-001, 736 | 4.406542e+000, 737 | -1.387680e-001, 738 | 1.245555e+000, 739 | 9.733011e-001, 740 | -1.125047e+000, 741 | -4.003662e-002, 742 | 1.058457e+000, 743 | -3.462236e+000, 744 | 4.395278e-001, 745 | -2.395805e+000, 746 | 5.177589e-001, 747 | 4.866247e+000, 748 | 4.253189e-001, 749 | -1.051444e+000, 750 | -2.804541e-001, 751 | 3.364668e+000, 752 | 3.293787e+000, 753 | -1.015741e+001, 754 | 3.807407e+000, 755 | -3.592377e-001, 756 | -3.367415e+000, 757 | 7.900825e-001, 758 | -1.093847e+000, 759 | -1.436965e-001, 760 | 2.384780e+000, 761 | 5.787070e+000, 762 | -2.445987e+000, 763 | -1.311171e+000, 764 | 2.326563e-001, 765 | 1.158439e+000, 766 | 5.555416e-001, 767 | // albedo 1, turbidity 3 768 | -1.134824e+000, 769 | -1.680468e-001, 770 | -3.325620e+000, 771 | 4.458596e+000, 772 | -1.135063e-001, 773 | 1.104500e+000, 774 | 7.794544e-002, 775 | 4.609952e+000, 776 | 6.854854e-001, 777 | -1.143017e+000, 778 | -1.565926e-001, 779 | 3.014687e-001, 780 | -1.763027e-001, 781 | -3.557925e-002, 782 | -2.342406e-001, 783 | 2.528705e-001, 784 | 5.884085e+000, 785 | 4.750602e-001, 786 | -1.136801e+000, 787 | -2.907502e-001, 788 | 3.682423e+000, 789 | -4.061202e-001, 790 | -8.728159e-001, 791 | 4.001510e+000, 792 | -1.522202e-001, 793 | -5.528713e+000, 794 | 1.044847e+000, 795 | -1.063652e+000, 796 | 7.808107e-002, 797 | -1.983678e+000, 798 | 3.648078e-001, 799 | 2.102276e+000, 800 | -3.065050e+000, 801 | 8.431951e-001, 802 | 1.038830e+001, 803 | 2.662834e-001, 804 | -1.061015e+000, 805 | -2.859814e-001, 806 | 4.223615e+000, 807 | -2.290138e+000, 808 | -8.314010e+000, 809 | 4.405718e+000, 810 | -4.613627e-001, 811 | -4.502910e+000, 812 | 1.008383e+000, 813 | -1.106302e+000, 814 | -1.697123e-001, 815 | 2.087196e+000, 816 | 8.238929e+000, 817 | -2.992416e+000, 818 | -1.821776e+000, 819 | 3.434859e-001, 820 | 7.755179e-001, 821 | 5.341190e-001, 822 | // albedo 1, turbidity 4 823 | -1.171110e+000, 824 | -2.106304e-001, 825 | -1.614361e+000, 826 | 2.378103e+000, 827 | -1.625969e-001, 828 | 8.504483e-001, 829 | 1.059312e-001, 830 | 4.046256e+000, 831 | 6.618227e-001, 832 | -1.200480e+000, 833 | -2.235733e-001, 834 | 1.014390e+000, 835 | -1.174074e+000, 836 | -4.440180e-001, 837 | 2.262406e-001, 838 | 1.665868e-001, 839 | 5.461829e+000, 840 | 5.676310e-001, 841 | -1.223587e+000, 842 | -3.502622e-001, 843 | 1.699106e+000, 844 | 6.724266e-001, 845 | 1.268567e+000, 846 | 2.135102e+000, 847 | 8.039374e-004, 848 | -5.221111e+000, 849 | 9.445690e-001, 850 | -9.452673e-001, 851 | 1.468459e-001, 852 | -1.335034e+000, 853 | 4.346628e+000, 854 | -1.285652e+001, 855 | -1.807046e+000, 856 | 8.175243e-001, 857 | 9.301065e+000, 858 | 3.656798e-001, 859 | -1.134681e+000, 860 | -3.310951e-001, 861 | 3.571244e+000, 862 | -2.208948e+000, 863 | 6.041580e+000, 864 | 3.107577e+000, 865 | -3.112127e-001, 866 | -4.186351e+000, 867 | 9.188333e-001, 868 | -1.083237e+000, 869 | -1.831394e-001, 870 | 2.062654e+000, 871 | 1.385424e+000, 872 | -5.004950e+000, 873 | -1.332669e+000, 874 | 3.627352e-001, 875 | 3.323150e-001, 876 | 6.191181e-001, 877 | // albedo 1, turbidity 5 878 | -1.211527e+000, 879 | -2.590617e-001, 880 | -1.660874e-001, 881 | 3.627905e-001, 882 | -1.039258e-001, 883 | 4.697924e-001, 884 | 1.671653e-001, 885 | 3.507497e+000, 886 | 6.022506e-001, 887 | -1.433017e+000, 888 | -4.733592e-001, 889 | 1.724445e-001, 890 | 9.953236e-001, 891 | -1.874457e+000, 892 | 4.432099e-001, 893 | 1.715810e-002, 894 | 2.339272e+000, 895 | 6.441470e-001, 896 | -1.084920e+000, 897 | -1.587903e-001, 898 | 8.999585e-001, 899 | -2.537516e+000, 900 | 5.877859e+000, 901 | 2.014554e+000, 902 | 9.689141e-002, 903 | 3.177242e-001, 904 | 9.030399e-001, 905 | -1.008242e+000, 906 | 2.793030e-003, 907 | -3.507469e-001, 908 | 1.028300e+001, 909 | -2.080454e+001, 910 | -2.781026e+000, 911 | 8.995090e-001, 912 | 3.366951e+000, 913 | 3.473867e-001, 914 | -1.103151e+000, 915 | -2.799598e-001, 916 | 2.525791e+000, 917 | -4.255704e+000, 918 | 9.903388e+000, 919 | 3.722668e+000, 920 | -3.603941e-001, 921 | -1.303292e+000, 922 | 9.369454e-001, 923 | -1.102235e+000, 924 | -2.025061e-001, 925 | 2.085660e+000, 926 | 1.686787e+000, 927 | -5.010957e+000, 928 | -1.656458e+000, 929 | 4.584029e-001, 930 | -2.751759e-001, 931 | 6.184162e-001, 932 | // albedo 1, turbidity 6 933 | -1.256130e+000, 934 | -3.104904e-001, 935 | 1.639350e-001, 936 | 1.315502e-001, 937 | -7.297583e-001, 938 | 4.778480e-001, 939 | 1.259265e-001, 940 | 3.012108e+000, 941 | 6.202728e-001, 942 | -1.620114e+000, 943 | -6.552670e-001, 944 | -2.877157e-001, 945 | 1.094371e+000, 946 | 2.818914e-001, 947 | 3.696830e-001, 948 | 9.428521e-002, 949 | 1.450951e+000, 950 | 5.681308e-001, 951 | -9.686204e-001, 952 | -3.755647e-002, 953 | 1.469980e+000, 954 | -3.103414e+000, 955 | 2.856583e+000, 956 | 1.883209e+000, 957 | -5.746099e-002, 958 | 1.286383e+000, 959 | 1.001751e+000, 960 | -1.089377e+000, 961 | -1.023062e-001, 962 | -1.498891e+000, 963 | 1.066455e+001, 964 | -1.720184e+001, 965 | -2.759314e+000, 966 | 1.061258e+000, 967 | 2.910211e+000, 968 | 2.624701e-001, 969 | -1.044681e+000, 970 | -2.156857e-001, 971 | 3.230136e+000, 972 | -5.863862e-001, 973 | 6.096640e+000, 974 | 3.550019e+000, 975 | -4.255773e-001, 976 | -1.500033e+000, 977 | 9.687696e-001, 978 | -1.133658e+000, 979 | -2.505101e-001, 980 | 1.717840e+000, 981 | 8.480428e-003, 982 | -5.011789e+000, 983 | -1.740989e+000, 984 | 4.983430e-001, 985 | -2.081829e-001, 986 | 6.088641e-001, 987 | // albedo 1, turbidity 7 988 | -1.335366e+000, 989 | -3.863319e-001, 990 | -5.279971e-001, 991 | 3.638324e-001, 992 | 3.230699e-001, 993 | 8.339707e-002, 994 | 2.483293e-001, 995 | 2.678646e+000, 996 | 4.998346e-001, 997 | -2.004511e+000, 998 | -9.957121e-001, 999 | 1.250807e+000, 1000 | 1.625025e-002, 1001 | -3.410754e-001, 1002 | 7.858244e-001, 1003 | -9.506757e-002, 1004 | 2.651876e-002, 1005 | 5.788643e-001, 1006 | -8.714157e-001, 1007 | 1.192051e-001, 1008 | -8.486879e-001, 1009 | -3.702497e-001, 1010 | 1.818277e+000, 1011 | 1.103427e+000, 1012 | 2.454866e-001, 1013 | 3.841575e+000, 1014 | 9.847350e-001, 1015 | -1.042618e+000, 1016 | -2.285793e-001, 1017 | 3.620175e-001, 1018 | 2.983368e+000, 1019 | -9.776844e+000, 1020 | -1.971587e+000, 1021 | 6.691674e-001, 1022 | -7.901947e-001, 1023 | 3.213200e-001, 1024 | -1.099112e+000, 1025 | -1.869868e-001, 1026 | 2.044065e+000, 1027 | 2.062964e+000, 1028 | 1.265668e+000, 1029 | 2.710130e+000, 1030 | -1.099443e-001, 1031 | 2.179353e-001, 1032 | 9.024108e-001, 1033 | -1.106985e+000, 1034 | -2.396881e-001, 1035 | 1.809807e+000, 1036 | 8.523319e+000, 1037 | -5.011788e+000, 1038 | -1.590086e+000, 1039 | 3.248449e-001, 1040 | -1.003187e-001, 1041 | 6.550606e-001, 1042 | // albedo 1, turbidity 8 1043 | -1.421285e+000, 1044 | -4.767024e-001, 1045 | -3.885004e-001, 1046 | 8.274590e-001, 1047 | -3.644229e-001, 1048 | 6.999513e-001, 1049 | 5.196710e-002, 1050 | 2.578431e+000, 1051 | 6.246310e-001, 1052 | -2.611217e+000, 1053 | -1.398846e+000, 1054 | 4.527425e-001, 1055 | -5.932142e-001, 1056 | 2.224617e-001, 1057 | -5.593581e-001, 1058 | 3.389633e-001, 1059 | -7.767112e-001, 1060 | 6.536004e-002, 1061 | -9.881543e-001, 1062 | 4.684782e-002, 1063 | -8.616613e-001, 1064 | 8.799807e-001, 1065 | 4.003130e+000, 1066 | 1.739543e+000, 1067 | -8.098378e-002, 1068 | 5.524802e+000, 1069 | 1.499673e+000, 1070 | -7.544759e-001, 1071 | -2.314808e-001, 1072 | 8.125770e-001, 1073 | -7.724135e-001, 1074 | -9.577645e+000, 1075 | -1.629433e+000, 1076 | 6.790832e-001, 1077 | -4.193895e+000, 1078 | -2.526624e-002, 1079 | -1.273719e+000, 1080 | -2.187030e-001, 1081 | 1.401798e+000, 1082 | 5.231832e+000, 1083 | 7.405093e-001, 1084 | 1.775166e+000, 1085 | -7.269476e-002, 1086 | 1.996087e+000, 1087 | 1.057450e+000, 1088 | -1.046864e+000, 1089 | -2.247559e-001, 1090 | 1.679449e+000, 1091 | 1.140057e+001, 1092 | -4.948829e+000, 1093 | -1.182664e+000, 1094 | 3.241038e-001, 1095 | -2.470012e-001, 1096 | 6.115900e-001, 1097 | // albedo 1, turbidity 9 1098 | -1.514607e+000, 1099 | -5.985430e-001, 1100 | -1.877610e-001, 1101 | 1.756930e+000, 1102 | -1.314206e+000, 1103 | 6.115810e-001, 1104 | -5.970460e-006, 1105 | 2.412975e+000, 1106 | 8.124304e-001, 1107 | -2.308414e+000, 1108 | -1.083797e+000, 1109 | -1.179959e-001, 1110 | -1.728246e+000, 1111 | 7.784742e-001, 1112 | 5.494505e-001, 1113 | 6.203168e-003, 1114 | 9.326251e-001, 1115 | -1.419518e-001, 1116 | -3.230837e+000, 1117 | -1.438670e+000, 1118 | -9.868286e-001, 1119 | 2.974393e+000, 1120 | 1.949339e+000, 1121 | -6.337857e-001, 1122 | 8.160271e-001, 1123 | 3.278606e+000, 1124 | 1.354373e+000, 1125 | 5.149378e-001, 1126 | 2.754789e-001, 1127 | 1.040965e+000, 1128 | -4.501186e+000, 1129 | -3.399057e+000, 1130 | 9.661861e-001, 1131 | -4.736173e-001, 1132 | -4.037574e+000, 1133 | 2.794847e-001, 1134 | -1.621870e+000, 1135 | -3.192763e-001, 1136 | 8.786242e-001, 1137 | 9.785565e+000, 1138 | -2.727652e+000, 1139 | 1.903691e-002, 1140 | 5.521261e-001, 1141 | 2.138764e+000, 1142 | 8.419871e-001, 1143 | -9.951701e-001, 1144 | -2.550607e-001, 1145 | 1.498952e+000, 1146 | -2.737197e-003, 1147 | -3.101832e+000, 1148 | -5.921329e-001, 1149 | 2.864422e-001, 1150 | -4.405218e-001, 1151 | 6.631410e-001, 1152 | // albedo 1, turbidity 10 1153 | -1.902954e+000, 1154 | -9.056918e-001, 1155 | -2.069570e-001, 1156 | 1.191499e+000, 1157 | -1.092577e+000, 1158 | 5.849556e-001, 1159 | -9.649602e-006, 1160 | 2.048407e+000, 1161 | 9.001527e-001, 1162 | -1.271627e+000, 1163 | -7.193923e-001, 1164 | -1.136606e-002, 1165 | -1.167951e-001, 1166 | 3.286175e-003, 1167 | -5.262827e-002, 1168 | -2.473874e-002, 1169 | 1.716125e+000, 1170 | -2.187133e-001, 1171 | -7.647175e+000, 1172 | -3.114129e+000, 1173 | -1.490128e+000, 1174 | -5.266488e-001, 1175 | 3.063090e+000, 1176 | 1.474262e+000, 1177 | 5.481458e-001, 1178 | 2.052174e+000, 1179 | 1.353089e+000, 1180 | 2.191403e+000, 1181 | 3.421120e-001, 1182 | 1.446510e+000, 1183 | 2.170943e+000, 1184 | -7.768187e+000, 1185 | -1.471207e+000, 1186 | -1.456708e-001, 1187 | -1.753574e+000, 1188 | 2.310576e-001, 1189 | -1.932296e+000, 1190 | -3.814739e-001, 1191 | 6.245422e-001, 1192 | 6.748294e+000, 1193 | -3.060171e-001, 1194 | 1.067747e+000, 1195 | 2.500671e-001, 1196 | -1.252596e-001, 1197 | 8.614611e-001, 1198 | -9.471101e-001, 1199 | -4.052640e-001, 1200 | 1.300174e+000, 1201 | -3.951536e-003, 1202 | -1.908284e+000, 1203 | -5.385721e-001, 1204 | 2.133578e-001, 1205 | -6.250292e-001, 1206 | 6.658012e-001, 1207 | }; 1208 | 1209 | double datasetRGBRad1[] = 1210 | { 1211 | // albedo 0, turbidity 1 1212 | 1.962684e+000, 1213 | 1.159831e+000, 1214 | 4.450588e+000, 1215 | 5.079633e+000, 1216 | 4.437388e+000, 1217 | 4.324573e+000, 1218 | // albedo 0, turbidity 2 1219 | 1.946487e+000, 1220 | 1.287515e+000, 1221 | 3.703696e+000, 1222 | 8.782833e+000, 1223 | 3.440437e+000, 1224 | 5.160333e+000, 1225 | // albedo 0, turbidity 3 1226 | 1.882170e+000, 1227 | 1.335878e+000, 1228 | 2.648641e+000, 1229 | 1.358368e+001, 1230 | 3.105473e+000, 1231 | 5.907387e+000, 1232 | // albedo 0, turbidity 4 1233 | 1.738159e+000, 1234 | 1.624289e+000, 1235 | -8.786695e-003, 1236 | 2.118253e+001, 1237 | 2.770255e+000, 1238 | 7.055672e+000, 1239 | // albedo 0, turbidity 5 1240 | 1.571896e+000, 1241 | 2.301786e+000, 1242 | -4.028545e+000, 1243 | 2.966806e+001, 1244 | 1.630876e+000, 1245 | 8.711031e+000, 1246 | // albedo 0, turbidity 6 1247 | 1.475048e+000, 1248 | 2.679086e+000, 1249 | -6.311315e+000, 1250 | 3.377896e+001, 1251 | 2.140975e+000, 1252 | 9.385283e+000, 1253 | // albedo 0, turbidity 7 1254 | 1.326174e+000, 1255 | 3.378759e+000, 1256 | -9.831444e+000, 1257 | 3.942061e+001, 1258 | 2.852702e+000, 1259 | 1.082542e+001, 1260 | // albedo 0, turbidity 8 1261 | 1.153344e+000, 1262 | 3.967771e+000, 1263 | -1.265181e+001, 1264 | 4.195016e+001, 1265 | 7.468239e+000, 1266 | 1.221350e+001, 1267 | // albedo 0, turbidity 9 1268 | 9.746081e-001, 1269 | 4.051626e+000, 1270 | -1.298454e+001, 1271 | 3.754964e+001, 1272 | 1.749232e+001, 1273 | 1.420619e+001, 1274 | // albedo 0, turbidity 10 1275 | 8.448016e-001, 1276 | 3.181809e+000, 1277 | -8.757338e+000, 1278 | 2.197962e+001, 1279 | 3.524033e+001, 1280 | 1.639549e+001, 1281 | // albedo 1, turbidity 1 1282 | 2.029623e+000, 1283 | 1.364434e+000, 1284 | 4.201529e+000, 1285 | 5.415099e+000, 1286 | 9.825839e+000, 1287 | 1.063328e+001, 1288 | // albedo 1, turbidity 2 1289 | 2.023126e+000, 1290 | 1.494728e+000, 1291 | 3.420413e+000, 1292 | 9.072178e+000, 1293 | 9.205157e+000, 1294 | 1.186639e+001, 1295 | // albedo 1, turbidity 3 1296 | 1.956307e+000, 1297 | 1.648665e+000, 1298 | 2.039712e+000, 1299 | 1.430239e+001, 1300 | 9.039526e+000, 1301 | 1.330453e+001, 1302 | // albedo 1, turbidity 4 1303 | 1.825053e+000, 1304 | 1.985022e+000, 1305 | -8.036307e-001, 1306 | 2.202493e+001, 1307 | 9.415361e+000, 1308 | 1.517659e+001, 1309 | // albedo 1, turbidity 5 1310 | 1.650367e+000, 1311 | 2.593201e+000, 1312 | -4.469328e+000, 1313 | 2.969817e+001, 1314 | 9.410977e+000, 1315 | 1.744850e+001, 1316 | // albedo 1, turbidity 6 1317 | 1.555202e+000, 1318 | 2.962925e+000, 1319 | -6.608170e+000, 1320 | 3.329887e+001, 1321 | 1.064559e+001, 1322 | 1.850816e+001, 1323 | // albedo 1, turbidity 7 1324 | 1.412478e+000, 1325 | 3.439403e+000, 1326 | -9.196616e+000, 1327 | 3.685077e+001, 1328 | 1.345341e+001, 1329 | 2.003128e+001, 1330 | // albedo 1, turbidity 8 1331 | 1.252990e+000, 1332 | 3.820805e+000, 1333 | -1.115338e+001, 1334 | 3.721593e+001, 1335 | 2.014916e+001, 1336 | 2.182320e+001, 1337 | // albedo 1, turbidity 9 1338 | 1.091952e+000, 1339 | 3.663027e+000, 1340 | -1.031330e+001, 1341 | 2.978985e+001, 1342 | 3.296835e+001, 1343 | 2.375450e+001, 1344 | // albedo 1, turbidity 10 1345 | 9.501691e-001, 1346 | 2.664579e+000, 1347 | -5.545167e+000, 1348 | 1.281159e+001, 1349 | 5.154768e+001, 1350 | 2.574284e+001, 1351 | }; 1352 | 1353 | double datasetRGB2[] = 1354 | { 1355 | // albedo 0, turbidity 1 1356 | -1.140530e+000, 1357 | -1.982747e-001, 1358 | -7.512730e+000, 1359 | 8.403899e+000, 1360 | -5.699038e-002, 1361 | 9.015907e-001, 1362 | 3.392161e-002, 1363 | 4.772522e+000, 1364 | 5.111184e-001, 1365 | -1.165117e+000, 1366 | -1.852955e-001, 1367 | 2.963684e+000, 1368 | -2.262274e+000, 1369 | -1.571683e-001, 1370 | 6.339974e-001, 1371 | 4.977879e-002, 1372 | 7.243307e+000, 1373 | 4.220053e-001, 1374 | -1.169936e+000, 1375 | -3.357429e-001, 1376 | 1.911291e+000, 1377 | -2.391074e-001, 1378 | -4.791643e-001, 1379 | 1.446113e+000, 1380 | -9.178108e-002, 1381 | -4.700239e+000, 1382 | 8.096219e-001, 1383 | -1.060246e+000, 1384 | -1.051633e-001, 1385 | 5.013829e-001, 1386 | 2.832309e+000, 1387 | -3.707855e-001, 1388 | 1.523131e+000, 1389 | 9.163749e-002, 1390 | 5.604183e+000, 1391 | 7.208566e-001, 1392 | -1.089753e+000, 1393 | -2.382167e-001, 1394 | 2.360312e+000, 1395 | -5.902562e+000, 1396 | -8.799894e+000, 1397 | 1.377692e+000, 1398 | -6.131633e-002, 1399 | -1.415472e+000, 1400 | 6.124057e-001, 1401 | -1.075481e+000, 1402 | -1.242391e-001, 1403 | 1.425781e+000, 1404 | 8.810319e+000, 1405 | -2.922646e+000, 1406 | 1.486520e+000, 1407 | 3.270580e-002, 1408 | 3.889783e+000, 1409 | 4.999482e-001, 1410 | // albedo 0, turbidity 2 1411 | -1.149342e+000, 1412 | -2.076337e-001, 1413 | -7.446587e+000, 1414 | 8.014559e+000, 1415 | -4.866227e-002, 1416 | 8.203043e-001, 1417 | 6.386483e-002, 1418 | 4.894198e+000, 1419 | 5.452051e-001, 1420 | -1.120531e+000, 1421 | -1.513311e-001, 1422 | 2.735504e+000, 1423 | -2.417591e+000, 1424 | -1.361114e-001, 1425 | 4.296342e-001, 1426 | 9.427488e-002, 1427 | 8.171403e+000, 1428 | 4.102448e-001, 1429 | -1.226964e+000, 1430 | -3.516378e-001, 1431 | 1.308298e+000, 1432 | -5.097487e-002, 1433 | -4.846783e-001, 1434 | 1.654619e+000, 1435 | -1.134940e-001, 1436 | -3.347854e+000, 1437 | 1.131147e+000, 1438 | -9.664377e-001, 1439 | 2.767589e-002, 1440 | 1.658235e-001, 1441 | 2.407439e+000, 1442 | -1.300304e-001, 1443 | 9.170958e-001, 1444 | 2.742895e-001, 1445 | 6.642633e+000, 1446 | 2.550064e-001, 1447 | -1.153358e+000, 1448 | -3.126223e-001, 1449 | 2.078934e+000, 1450 | -5.857733e+000, 1451 | -8.659848e+000, 1452 | 1.758505e+000, 1453 | -9.616094e-002, 1454 | -1.230863e+000, 1455 | 9.663832e-001, 1456 | -1.053850e+000, 1457 | -1.330743e-001, 1458 | 1.481738e+000, 1459 | 1.049485e+001, 1460 | -3.528854e+000, 1461 | 9.142363e-001, 1462 | 1.244880e-001, 1463 | 2.644615e+000, 1464 | 5.001048e-001, 1465 | // albedo 0, turbidity 3 1466 | -1.173687e+000, 1467 | -2.360362e-001, 1468 | -3.741454e+000, 1469 | 4.088507e+000, 1470 | -7.528205e-002, 1471 | 6.645237e-001, 1472 | 7.718265e-002, 1473 | 4.651220e+000, 1474 | 5.586318e-001, 1475 | -1.213757e+000, 1476 | -2.589561e-001, 1477 | 7.132551e-001, 1478 | -4.259327e-001, 1479 | -1.980821e-001, 1480 | 3.627815e-001, 1481 | 4.666560e-002, 1482 | 5.807984e+000, 1483 | 5.847377e-001, 1484 | -1.108794e+000, 1485 | -2.259870e-001, 1486 | 1.574179e+000, 1487 | -3.753731e-001, 1488 | -5.984743e-001, 1489 | 1.659414e+000, 1490 | -1.681021e-002, 1491 | 6.785219e-001, 1492 | 8.647325e-001, 1493 | -1.060896e+000, 1494 | -1.346690e-002, 1495 | -7.529656e-001, 1496 | 1.711319e+000, 1497 | -9.792435e-001, 1498 | 2.022433e-001, 1499 | 3.826487e-001, 1500 | 5.725157e+000, 1501 | 5.290714e-001, 1502 | -1.085145e+000, 1503 | -2.840715e-001, 1504 | 2.088029e+000, 1505 | -4.935097e+000, 1506 | -9.056542e+000, 1507 | 1.976149e+000, 1508 | -3.912485e-002, 1509 | -8.636064e-001, 1510 | 7.452125e-001, 1511 | -1.077983e+000, 1512 | -1.416633e-001, 1513 | 1.100848e+000, 1514 | 1.015875e+001, 1515 | -2.943712e+000, 1516 | 5.255135e-001, 1517 | 2.164224e-001, 1518 | 2.941143e+000, 1519 | 6.699937e-001, 1520 | // albedo 0, turbidity 4 1521 | -1.223293e+000, 1522 | -2.867444e-001, 1523 | -1.624136e+000, 1524 | 1.668299e+000, 1525 | -9.537589e-002, 1526 | 5.015947e-001, 1527 | 1.130741e-001, 1528 | 4.244812e+000, 1529 | 5.082152e-001, 1530 | -1.325342e+000, 1531 | -4.280991e-001, 1532 | 4.705490e-001, 1533 | 6.926592e-002, 1534 | -4.572587e-001, 1535 | 5.344144e-001, 1536 | -2.554192e-002, 1537 | 3.093939e+000, 1538 | 6.639401e-001, 1539 | -1.113581e+000, 1540 | -1.192133e-001, 1541 | 4.011536e-001, 1542 | 7.011889e-001, 1543 | 2.052842e-001, 1544 | 9.880724e-001, 1545 | 1.807533e-002, 1546 | 4.690160e+000, 1547 | 8.576240e-001, 1548 | -1.016063e+000, 1549 | -1.038138e-001, 1550 | -2.280391e-001, 1551 | 7.898918e-001, 1552 | -1.127333e+001, 1553 | 2.074545e-001, 1554 | 5.388182e-001, 1555 | 1.364263e+000, 1556 | 4.660455e-001, 1557 | -1.099582e+000, 1558 | -2.228607e-001, 1559 | 1.332648e+000, 1560 | 5.135188e+000, 1561 | 1.653152e+000, 1562 | 1.417020e+000, 1563 | -1.087532e-001, 1564 | 1.809275e+000, 1565 | 8.080874e-001, 1566 | -1.064357e+000, 1567 | -1.520775e-001, 1568 | 8.207368e-001, 1569 | -1.323565e-003, 1570 | -5.009523e+000, 1571 | 3.946298e-001, 1572 | 4.337902e-001, 1573 | 2.593198e+000, 1574 | 6.719172e-001, 1575 | // albedo 0, turbidity 5 1576 | -1.278702e+000, 1577 | -3.512866e-001, 1578 | -4.511055e-001, 1579 | 3.895760e-001, 1580 | -2.429672e-001, 1581 | 4.270577e-001, 1582 | 1.135348e-001, 1583 | 3.719130e+000, 1584 | 4.998867e-001, 1585 | -1.580069e+000, 1586 | -7.095475e-001, 1587 | -3.198904e-001, 1588 | 1.715748e+000, 1589 | -1.185915e+000, 1590 | 4.523161e-001, 1591 | -1.026159e-002, 1592 | 7.927188e-001, 1593 | 5.538350e-001, 1594 | -9.474023e-001, 1595 | 1.173703e-001, 1596 | 4.881381e-001, 1597 | -2.618684e+000, 1598 | 3.251661e+000, 1599 | 1.213931e+000, 1600 | -1.736274e-002, 1601 | 8.000768e+000, 1602 | 1.025998e+000, 1603 | -1.129091e+000, 1604 | -3.287694e-001, 1605 | -3.524077e-001, 1606 | 3.352892e+000, 1607 | -1.416073e+001, 1608 | -8.485617e-001, 1609 | 6.560766e-001, 1610 | -2.820937e+000, 1611 | 3.111303e-001, 1612 | -1.030884e+000, 1613 | -1.137581e-001, 1614 | 1.109855e+000, 1615 | 8.082276e+000, 1616 | 1.519214e+000, 1617 | 2.112433e+000, 1618 | -1.592299e-001, 1619 | 3.675905e+000, 1620 | 8.703367e-001, 1621 | -1.075192e+000, 1622 | -1.627166e-001, 1623 | 3.514910e-001, 1624 | 1.168164e+000, 1625 | -4.255822e+000, 1626 | -6.015348e-001, 1627 | 6.265776e-001, 1628 | 2.884818e+000, 1629 | 6.548384e-001, 1630 | // albedo 0, turbidity 6 1631 | -1.316017e+000, 1632 | -3.889652e-001, 1633 | -5.030854e-001, 1634 | 4.488704e-001, 1635 | -3.186800e-001, 1636 | 4.570763e-001, 1637 | 8.909201e-002, 1638 | 3.659274e+000, 1639 | 5.011746e-001, 1640 | -1.731876e+000, 1641 | -8.493806e-001, 1642 | 1.194871e-001, 1643 | 2.002781e+000, 1644 | -2.006547e+000, 1645 | 4.872233e-001, 1646 | -2.854606e-002, 1647 | 2.662137e-001, 1648 | 4.611629e-001, 1649 | -9.273680e-001, 1650 | 1.380954e-001, 1651 | -3.302179e-001, 1652 | -3.553265e+000, 1653 | 4.633345e+000, 1654 | 9.696729e-001, 1655 | 8.799775e-002, 1656 | 8.291129e+000, 1657 | 1.094451e+000, 1658 | -1.099377e+000, 1659 | -3.325392e-001, 1660 | 2.501063e-001, 1661 | 2.613712e+000, 1662 | -1.328142e+001, 1663 | -5.579527e-001, 1664 | 4.992081e-001, 1665 | -3.504402e+000, 1666 | 3.022924e-001, 1667 | -1.048420e+000, 1668 | -1.227773e-001, 1669 | 5.845373e-001, 1670 | 1.105869e+001, 1671 | 3.813151e-002, 1672 | 1.330409e+000, 1673 | 1.978131e-002, 1674 | 3.959430e+000, 1675 | 8.396439e-001, 1676 | -1.063233e+000, 1677 | -1.560639e-001, 1678 | 2.840033e-001, 1679 | 8.751565e-001, 1680 | -3.411820e+000, 1681 | -1.436564e-001, 1682 | 5.846580e-001, 1683 | 2.899292e+000, 1684 | 6.799095e-001, 1685 | // albedo 0, turbidity 7 1686 | -1.376715e+000, 1687 | -4.541567e-001, 1688 | -1.445491e+000, 1689 | 1.569898e+000, 1690 | -1.390627e-001, 1691 | 5.558270e-001, 1692 | 4.109877e-002, 1693 | 3.349451e+000, 1694 | 5.516123e-001, 1695 | -1.953391e+000, 1696 | -1.035869e+000, 1697 | 1.690563e+000, 1698 | -1.964690e-001, 1699 | -7.787096e-001, 1700 | 5.799605e-001, 1701 | 2.945626e-002, 1702 | 4.217906e-002, 1703 | 2.451373e-001, 1704 | -1.012422e+000, 1705 | 7.136451e-002, 1706 | -1.862534e+000, 1707 | -7.228653e-001, 1708 | 1.947997e-001, 1709 | 2.091805e-001, 1710 | 6.399233e-002, 1711 | 7.928994e+000, 1712 | 1.290733e+000, 1713 | -9.706708e-001, 1714 | -2.880950e-001, 1715 | 1.107797e+000, 1716 | -2.731734e+000, 1717 | -8.445995e+000, 1718 | 4.296774e-001, 1719 | 5.117648e-001, 1720 | -3.824277e+000, 1721 | 1.761207e-001, 1722 | -1.110611e+000, 1723 | -1.789409e-001, 1724 | 2.108488e-001, 1725 | 2.071430e+001, 1726 | -1.763174e+000, 1727 | 9.554695e-002, 1728 | -2.943103e-002, 1729 | 3.422079e+000, 1730 | 8.815496e-001, 1731 | -1.048334e+000, 1732 | -1.614087e-001, 1733 | 2.475184e-001, 1734 | 2.146938e-002, 1735 | -2.983901e+000, 1736 | 2.538224e-001, 1737 | 5.601370e-001, 1738 | 2.461925e+000, 1739 | 6.777394e-001, 1740 | // albedo 0, turbidity 8 1741 | -1.393719e+000, 1742 | -5.002724e-001, 1743 | -2.408940e+000, 1744 | 2.680983e+000, 1745 | -1.362825e-001, 1746 | 7.395067e-001, 1747 | -3.300343e-006, 1748 | 3.260889e+000, 1749 | 8.132057e-001, 1750 | -2.128663e+000, 1751 | -1.151182e+000, 1752 | 2.923026e+000, 1753 | -1.931838e+000, 1754 | -4.426170e-001, 1755 | 2.309983e-001, 1756 | -5.485890e-003, 1757 | 3.279529e-001, 1758 | -2.229467e-001, 1759 | -1.618022e+000, 1760 | -3.766490e-001, 1761 | -3.163544e+000, 1762 | 1.611608e+000, 1763 | -3.967476e-001, 1764 | 3.933680e-001, 1765 | 3.006742e-001, 1766 | 6.835177e+000, 1767 | 1.613765e+000, 1768 | -5.669064e-001, 1769 | -1.481749e-001, 1770 | 2.071817e+000, 1771 | -8.157422e+000, 1772 | -5.988088e+000, 1773 | 2.387202e-001, 1774 | 1.447191e-001, 1775 | -4.296385e+000, 1776 | 5.011258e-002, 1777 | -1.241724e+000, 1778 | -2.519348e-001, 1779 | -1.908609e-001, 1780 | 2.952235e+001, 1781 | -3.333660e+000, 1782 | -1.837651e-002, 1783 | 1.022249e-001, 1784 | 2.929320e+000, 1785 | 8.867262e-001, 1786 | -1.021670e+000, 1787 | -1.667327e-001, 1788 | 1.789771e-001, 1789 | -2.178108e-003, 1790 | -2.641572e+000, 1791 | -5.641484e-002, 1792 | 5.303758e-001, 1793 | 2.138196e+000, 1794 | 6.780350e-001, 1795 | // albedo 0, turbidity 9 1796 | -1.669332e+000, 1797 | -7.588708e-001, 1798 | -2.993557e+000, 1799 | 3.178760e+000, 1800 | -8.066442e-002, 1801 | 6.544672e-001, 1802 | -8.089880e-006, 1803 | 2.628924e+000, 1804 | 9.001272e-001, 1805 | -1.755806e+000, 1806 | -8.735348e-001, 1807 | 3.258881e+000, 1808 | -2.504785e+000, 1809 | -3.300791e-001, 1810 | 1.180565e-001, 1811 | -9.315982e-003, 1812 | 1.785154e+000, 1813 | -3.205824e-001, 1814 | -3.720277e+000, 1815 | -1.733350e+000, 1816 | -3.332272e+000, 1817 | 1.515869e+000, 1818 | 1.734218e-001, 1819 | 8.011956e-001, 1820 | 1.995440e-001, 1821 | 3.817666e+000, 1822 | 1.638502e+000, 1823 | 4.724641e-001, 1824 | 3.209828e-001, 1825 | 2.051443e+000, 1826 | -5.105574e+000, 1827 | -6.509139e+000, 1828 | -4.232041e-001, 1829 | 2.598931e-001, 1830 | -2.151756e+000, 1831 | -3.493910e-003, 1832 | -1.525600e+000, 1833 | -4.897606e-001, 1834 | -9.891121e-002, 1835 | 2.346818e+001, 1836 | -2.278152e+000, 1837 | 1.681219e-001, 1838 | -4.469389e-002, 1839 | 1.051000e+000, 1840 | 9.294666e-001, 1841 | -9.908649e-001, 1842 | -2.008182e-001, 1843 | 1.605143e-001, 1844 | -2.463113e-003, 1845 | -2.477349e+000, 1846 | -1.218647e-001, 1847 | 4.750121e-001, 1848 | 1.460813e+000, 1849 | 6.661364e-001, 1850 | // albedo 0, turbidity 10 1851 | -2.122119e+000, 1852 | -1.125475e+000, 1853 | -3.066599e+000, 1854 | 3.145078e+000, 1855 | -5.411593e-002, 1856 | 5.133628e-001, 1857 | -7.823408e-006, 1858 | 2.268448e+000, 1859 | 9.001416e-001, 1860 | -1.528158e+000, 1861 | -9.370249e-001, 1862 | 2.567559e+000, 1863 | -1.591439e+000, 1864 | -3.634460e-001, 1865 | 1.763256e-001, 1866 | 1.119624e-003, 1867 | 1.811848e+000, 1868 | -2.637929e-001, 1869 | -6.524387e+000, 1870 | -2.673507e+000, 1871 | -2.940472e+000, 1872 | -6.025609e-001, 1873 | 7.852067e-001, 1874 | 1.073499e+000, 1875 | -3.540435e-002, 1876 | 3.517416e+000, 1877 | 1.490466e+000, 1878 | 8.886026e-001, 1879 | -9.681828e-002, 1880 | 1.430554e+000, 1881 | 4.993717e+000, 1882 | -6.071355e+000, 1883 | -6.053986e-001, 1884 | 5.092997e-001, 1885 | -1.273010e+000, 1886 | 7.491329e-002, 1887 | -1.481997e+000, 1888 | -5.897282e-001, 1889 | 2.659264e-001, 1890 | 1.267239e+000, 1891 | -5.741291e-001, 1892 | 5.983011e-002, 1893 | -2.217312e-001, 1894 | -3.016452e-001, 1895 | 9.260830e-001, 1896 | -1.010943e+000, 1897 | -2.075134e-001, 1898 | 5.066749e-002, 1899 | 1.470708e+001, 1900 | -3.780501e+000, 1901 | 7.253223e-002, 1902 | 4.045458e-001, 1903 | 1.320164e+000, 1904 | 6.559925e-001, 1905 | // albedo 1, turbidity 1 1906 | -1.129907e+000, 1907 | -1.884011e-001, 1908 | -8.047670e+000, 1909 | 9.035776e+000, 1910 | -5.539419e-002, 1911 | 8.823349e-001, 1912 | 3.197135e-002, 1913 | 4.839388e+000, 1914 | 5.042822e-001, 1915 | -1.133821e+000, 1916 | -1.510781e-001, 1917 | 3.362822e+000, 1918 | -2.453381e+000, 1919 | -1.463925e-001, 1920 | 4.728708e-001, 1921 | 5.958140e-002, 1922 | 7.636300e+000, 1923 | 4.805162e-001, 1924 | -1.176518e+000, 1925 | -3.549902e-001, 1926 | 1.729044e+000, 1927 | -2.160966e-001, 1928 | -5.075865e-001, 1929 | 1.675584e+000, 1930 | -8.906902e-002, 1931 | -5.386842e+000, 1932 | 5.452218e-001, 1933 | -1.043563e+000, 1934 | -7.520975e-002, 1935 | 8.750644e-001, 1936 | 2.510518e+000, 1937 | 7.584882e-003, 1938 | 9.361250e-001, 1939 | 7.889083e-002, 1940 | 6.066644e+000, 1941 | 5.813108e-001, 1942 | -1.081304e+000, 1943 | -2.222253e-001, 1944 | 2.517638e+000, 1945 | -4.453820e+000, 1946 | -8.663691e+000, 1947 | 8.662558e-001, 1948 | -4.802657e-002, 1949 | -8.965449e-001, 1950 | 4.886656e-001, 1951 | -1.083774e+000, 1952 | -1.375469e-001, 1953 | 1.685818e+000, 1954 | 5.631120e+000, 1955 | -3.100752e+000, 1956 | 4.045941e-001, 1957 | 2.346895e-002, 1958 | 3.390321e+000, 1959 | 5.008309e-001, 1960 | // albedo 1, turbidity 2 1961 | -1.143158e+000, 1962 | -2.058334e-001, 1963 | -9.660198e+000, 1964 | 1.062394e+001, 1965 | -4.434119e-002, 1966 | 8.607615e-001, 1967 | 3.177325e-002, 1968 | 4.416481e+000, 1969 | 5.918162e-001, 1970 | -1.146773e+000, 1971 | -1.727385e-001, 1972 | 4.626048e+000, 1973 | -4.684602e+000, 1974 | -8.307137e-002, 1975 | 1.619616e-001, 1976 | 1.484866e-001, 1977 | 7.572868e+000, 1978 | 2.681126e-001, 1979 | -1.151324e+000, 1980 | -3.099303e-001, 1981 | 4.125596e-001, 1982 | 2.340752e+000, 1983 | -4.214444e-001, 1984 | 1.987375e+000, 1985 | -1.913410e-001, 1986 | -3.845978e+000, 1987 | 1.337311e+000, 1988 | -1.034258e+000, 1989 | -7.778759e-003, 1990 | 7.050094e-001, 1991 | -8.036369e-001, 1992 | 3.138570e-001, 1993 | 2.469452e-001, 1994 | 3.559970e-001, 1995 | 7.485917e+000, 1996 | 4.790329e-002, 1997 | -1.096568e+000, 1998 | -2.673169e-001, 1999 | 2.575654e+000, 2000 | -8.057121e-001, 2001 | -8.884928e+000, 2002 | 1.416170e+000, 2003 | -2.091315e-001, 2004 | -1.543494e+000, 2005 | 1.065445e+000, 2006 | -1.083304e+000, 2007 | -1.528265e-001, 2008 | 1.697727e+000, 2009 | 2.503702e+000, 2010 | -2.885296e+000, 2011 | -1.298500e-001, 2012 | 1.548870e-001, 2013 | 2.479652e+000, 2014 | 5.066496e-001, 2015 | // albedo 1, turbidity 3 2016 | -1.165736e+000, 2017 | -2.329945e-001, 2018 | -5.967964e+000, 2019 | 6.705959e+000, 2020 | -5.931355e-002, 2021 | 7.485638e-001, 2022 | 3.913878e-002, 2023 | 4.221591e+000, 2024 | 6.183926e-001, 2025 | -1.212422e+000, 2026 | -2.545910e-001, 2027 | 2.418626e+000, 2028 | -2.266104e+000, 2029 | -1.102014e-001, 2030 | 1.363887e-002, 2031 | 1.055411e-001, 2032 | 5.648062e+000, 2033 | 4.557412e-001, 2034 | -1.070436e+000, 2035 | -2.163341e-001, 2036 | 7.098718e-001, 2037 | 7.843075e-001, 2038 | -4.323930e-001, 2039 | 2.109823e+000, 2040 | -9.589700e-002, 2041 | -1.985193e-001, 2042 | 1.060428e+000, 2043 | -1.104879e+000, 2044 | -3.013622e-002, 2045 | 2.976276e-002, 2046 | 1.069707e+000, 2047 | 1.410000e-001, 2048 | -4.880020e-001, 2049 | 4.452288e-001, 2050 | 6.418590e+000, 2051 | 3.195986e-001, 2052 | -1.048969e+000, 2053 | -2.655317e-001, 2054 | 2.689426e+000, 2055 | -3.941038e+000, 2056 | -9.506461e+000, 2057 | 1.837119e+000, 2058 | -1.892124e-001, 2059 | -1.562146e+000, 2060 | 9.043414e-001, 2061 | -1.106145e+000, 2062 | -1.601642e-001, 2063 | 1.544544e+000, 2064 | 7.388492e+000, 2065 | -2.924600e+000, 2066 | -4.328453e-001, 2067 | 1.763161e-001, 2068 | 2.523111e+000, 2069 | 5.851902e-001, 2070 | // albedo 1, turbidity 4 2071 | -1.203666e+000, 2072 | -2.776587e-001, 2073 | -2.084286e+000, 2074 | 2.450840e+000, 2075 | -8.746613e-002, 2076 | 5.258507e-001, 2077 | 7.983316e-002, 2078 | 3.860055e+000, 2079 | 5.486167e-001, 2080 | -1.340448e+000, 2081 | -4.230590e-001, 2082 | 3.462849e-001, 2083 | 4.707607e-001, 2084 | -2.512626e-001, 2085 | 1.530746e-001, 2086 | 2.724218e-002, 2087 | 3.035216e+000, 2088 | 5.876133e-001, 2089 | -1.014554e+000, 2090 | -1.168790e-001, 2091 | 9.477794e-001, 2092 | -1.061218e+000, 2093 | -4.196730e-001, 2094 | 2.058832e+000, 2095 | -5.989624e-002, 2096 | 3.058168e+000, 2097 | 9.763861e-001, 2098 | -1.137388e+000, 2099 | -9.854030e-002, 2100 | -2.984893e-001, 2101 | 3.647820e+000, 2102 | -6.585571e-001, 2103 | -1.479180e+000, 2104 | 6.102932e-001, 2105 | 3.265914e+000, 2106 | 3.480333e-001, 2107 | -1.021816e+000, 2108 | -2.344957e-001, 2109 | 2.463671e+000, 2110 | -7.240685e+000, 2111 | -8.862697e+000, 2112 | 2.514058e+000, 2113 | -2.122768e-001, 2114 | -3.313968e-002, 2115 | 9.028136e-001, 2116 | -1.126581e+000, 2117 | -1.874347e-001, 2118 | 1.454154e+000, 2119 | 1.034398e+001, 2120 | -3.237393e+000, 2121 | -8.654927e-001, 2122 | 2.457248e-001, 2123 | 1.845769e+000, 2124 | 6.002482e-001, 2125 | // albedo 1, turbidity 5 2126 | -1.263727e+000, 2127 | -3.439354e-001, 2128 | -1.786388e-001, 2129 | 3.980166e-001, 2130 | -3.349517e-001, 2131 | 3.825166e-001, 2132 | 1.029225e-001, 2133 | 3.331096e+000, 2134 | 4.998955e-001, 2135 | -1.530010e+000, 2136 | -6.879698e-001, 2137 | 2.380415e-001, 2138 | 1.608216e+000, 2139 | -1.682679e+000, 2140 | 3.546360e-001, 2141 | -3.915220e-003, 2142 | 4.517655e-001, 2143 | 5.128605e-001, 2144 | -9.685659e-001, 2145 | 9.480403e-002, 2146 | 6.076844e-002, 2147 | -3.217561e+000, 2148 | 4.568074e+000, 2149 | 1.069299e+000, 2150 | 2.083638e-002, 2151 | 7.301088e+000, 2152 | 1.072165e+000, 2153 | -1.113925e+000, 2154 | -3.112382e-001, 2155 | 3.954133e-001, 2156 | 5.105907e+000, 2157 | -1.456866e+001, 2158 | -4.917378e-001, 2159 | 5.289909e-001, 2160 | -2.678374e+000, 2161 | 3.014709e-001, 2162 | -1.046864e+000, 2163 | -1.215754e-001, 2164 | 1.778308e+000, 2165 | 4.661489e+000, 2166 | 2.565583e-001, 2167 | 1.353680e+000, 2168 | -1.175767e-001, 2169 | 3.415972e+000, 2170 | 8.457746e-001, 2171 | -1.104480e+000, 2172 | -1.940913e-001, 2173 | 1.343668e+000, 2174 | -1.759206e-003, 2175 | -5.009204e+000, 2176 | -4.186951e-001, 2177 | 3.125710e-001, 2178 | 1.628183e+000, 2179 | 6.720408e-001, 2180 | // albedo 1, turbidity 6 2181 | -1.286902e+000, 2182 | -3.781238e-001, 2183 | -8.977253e-002, 2184 | 3.545393e-001, 2185 | -4.866515e-001, 2186 | 3.843664e-001, 2187 | 8.281675e-002, 2188 | 3.122231e+000, 2189 | 5.046991e-001, 2190 | -1.712597e+000, 2191 | -8.549112e-001, 2192 | 4.809286e-001, 2193 | 1.515398e+000, 2194 | -2.212211e+000, 2195 | 2.539029e-001, 2196 | 2.335997e-002, 2197 | -6.089466e-002, 2198 | 4.268444e-001, 2199 | -8.807283e-001, 2200 | 1.646097e-001, 2201 | -4.437898e-001, 2202 | -3.188247e+000, 2203 | 5.984417e+000, 2204 | 1.334779e+000, 2205 | -4.026975e-002, 2206 | 7.546431e+000, 2207 | 1.175751e+000, 2208 | -1.147253e+000, 2209 | -3.538199e-001, 2210 | 6.101836e-001, 2211 | 4.437780e+000, 2212 | -1.559813e+001, 2213 | -1.103222e+000, 2214 | 6.242039e-001, 2215 | -3.091472e+000, 2216 | 2.174290e-001, 2217 | -1.038230e+000, 2218 | -1.213475e-001, 2219 | 1.547505e+000, 2220 | 5.893176e+000, 2221 | 1.368738e+000, 2222 | 1.663127e+000, 2223 | -1.377130e-001, 2224 | 3.185279e+000, 2225 | 8.736453e-001, 2226 | -1.101026e+000, 2227 | -1.874907e-001, 2228 | 1.272667e+000, 2229 | 3.596524e+000, 2230 | -5.007243e+000, 2231 | -6.352483e-001, 2232 | 3.048985e-001, 2233 | 1.931613e+000, 2234 | 6.788844e-001, 2235 | // albedo 1, turbidity 7 2236 | -1.342753e+000, 2237 | -4.384971e-001, 2238 | -1.213491e+000, 2239 | 1.621399e+000, 2240 | -1.551441e-001, 2241 | 5.614218e-001, 2242 | 2.591739e-002, 2243 | 2.958967e+000, 2244 | 5.782132e-001, 2245 | -1.937684e+000, 2246 | -1.066019e+000, 2247 | 1.913336e+000, 2248 | -7.347719e-001, 2249 | -5.916167e-001, 2250 | 1.587590e-001, 2251 | 1.092568e-001, 2252 | -6.275002e-001, 2253 | 1.599071e-001, 2254 | -9.302391e-001, 2255 | 1.486187e-001, 2256 | -1.603835e+000, 2257 | 1.783713e-001, 2258 | 1.100461e+000, 2259 | 1.174181e+000, 2260 | -1.602361e-001, 2261 | 7.868331e+000, 2262 | 1.468971e+000, 2263 | -1.053631e+000, 2264 | -3.727050e-001, 2265 | 1.114117e+000, 2266 | -9.603286e-001, 2267 | -1.062469e+001, 2268 | -1.162140e+000, 2269 | 7.952797e-001, 2270 | -4.478765e+000, 2271 | -4.440862e-002, 2272 | -1.083629e+000, 2273 | -1.261405e-001, 2274 | 1.229344e+000, 2275 | 1.127825e+001, 2276 | 1.319010e-001, 2277 | 1.624729e+000, 2278 | -2.825898e-001, 2279 | 3.661082e+000, 2280 | 1.036911e+000, 2281 | -1.093950e+000, 2282 | -2.067455e-001, 2283 | 1.258035e+000, 2284 | 7.548645e+000, 2285 | -4.598387e+000, 2286 | -8.944932e-001, 2287 | 3.292634e-001, 2288 | 1.311304e+000, 2289 | 6.291871e-001, 2290 | // albedo 1, turbidity 8 2291 | -1.385867e+000, 2292 | -5.068139e-001, 2293 | -1.486490e+000, 2294 | 1.969049e+000, 2295 | -1.698025e-001, 2296 | 6.629167e-001, 2297 | -5.289365e-006, 2298 | 2.760315e+000, 2299 | 8.644368e-001, 2300 | -2.107367e+000, 2301 | -1.175639e+000, 2302 | 2.313241e+000, 2303 | -1.001653e+000, 2304 | -4.843139e-001, 2305 | 1.124485e-001, 2306 | 3.901494e-005, 2307 | -3.502469e-001, 2308 | -3.204780e-001, 2309 | -1.475244e+000, 2310 | -2.833055e-001, 2311 | -2.085824e+000, 2312 | 1.192563e+000, 2313 | -7.645200e-001, 2314 | 8.380081e-001, 2315 | 2.203580e-001, 2316 | 7.157885e+000, 2317 | 1.753702e+000, 2318 | -6.644372e-001, 2319 | -2.549735e-001, 2320 | 1.600273e+000, 2321 | -8.589034e+000, 2322 | -6.144718e+000, 2323 | -7.599731e-001, 2324 | 2.898370e-001, 2325 | -5.770923e+000, 2326 | -9.656242e-002, 2327 | -1.211687e+000, 2328 | -1.653494e-001, 2329 | 8.393400e-001, 2330 | 2.792988e+001, 2331 | -3.395461e+000, 2332 | 9.933752e-001, 2333 | -3.976877e-002, 2334 | 3.776659e+000, 2335 | 9.546526e-001, 2336 | -1.063757e+000, 2337 | -2.037563e-001, 2338 | 1.117207e+000, 2339 | -1.252806e-003, 2340 | -3.332330e+000, 2341 | -6.971409e-001, 2342 | 3.388719e-001, 2343 | 1.311398e+000, 2344 | 6.635171e-001, 2345 | // albedo 1, turbidity 9 2346 | -1.678889e+000, 2347 | -7.992295e-001, 2348 | -2.421687e+000, 2349 | 2.871029e+000, 2350 | -7.662842e-002, 2351 | 6.046208e-001, 2352 | -7.598099e-006, 2353 | 2.002314e+000, 2354 | 9.001307e-001, 2355 | -1.692144e+000, 2356 | -8.804250e-001, 2357 | 3.060895e+000, 2358 | -2.000009e+000, 2359 | -3.183563e-001, 2360 | 8.385862e-002, 2361 | -6.326713e-003, 2362 | 1.206639e+000, 2363 | -3.369967e-001, 2364 | -3.676795e+000, 2365 | -1.719207e+000, 2366 | -2.534697e+000, 2367 | 1.005285e+000, 2368 | 1.550407e-001, 2369 | 1.072910e+000, 2370 | 1.318094e-001, 2371 | 3.717018e+000, 2372 | 1.689191e+000, 2373 | 5.424542e-001, 2374 | 3.263528e-001, 2375 | 1.551055e+000, 2376 | -3.841058e+000, 2377 | -6.598996e+000, 2378 | -1.201779e+000, 2379 | 3.530669e-001, 2380 | -2.542945e+000, 2381 | -6.482523e-002, 2382 | -1.553849e+000, 2383 | -4.576860e-001, 2384 | 9.324676e-001, 2385 | 1.950982e+001, 2386 | -2.344516e+000, 2387 | 1.121020e+000, 2388 | -1.221537e-001, 2389 | 7.285496e-001, 2390 | 9.582816e-001, 2391 | -1.020650e+000, 2392 | -2.215797e-001, 2393 | 1.009774e+000, 2394 | -2.056855e-003, 2395 | -2.740338e+000, 2396 | -8.122355e-001, 2397 | 3.328967e-001, 2398 | 8.982766e-001, 2399 | 6.594676e-001, 2400 | // albedo 1, turbidity 10 2401 | -2.247360e+000, 2402 | -1.221267e+000, 2403 | -3.072346e+000, 2404 | 3.385139e+000, 2405 | -4.387559e-002, 2406 | 5.084887e-001, 2407 | -7.418833e-006, 2408 | 1.750107e+000, 2409 | 9.001401e-001, 2410 | -1.248499e+000, 2411 | -8.442718e-001, 2412 | 3.062611e+000, 2413 | -2.020314e+000, 2414 | -2.815341e-001, 2415 | 5.254745e-002, 2416 | 3.345008e-003, 2417 | 1.433225e+000, 2418 | -2.835911e-001, 2419 | -7.004119e+000, 2420 | -2.927978e+000, 2421 | -2.649852e+000, 2422 | 7.971894e-001, 2423 | 5.466893e-001, 2424 | 1.442667e+000, 2425 | -6.063912e-002, 2426 | 2.806194e+000, 2427 | 1.547429e+000, 2428 | 1.434882e+000, 2429 | 9.114639e-002, 2430 | 1.170089e+000, 2431 | 3.512808e-002, 2432 | -5.861915e+000, 2433 | -1.411843e+000, 2434 | 5.400486e-001, 2435 | -7.746522e-001, 2436 | 2.386984e-002, 2437 | -1.559053e+000, 2438 | -5.502302e-001, 2439 | 1.200396e+000, 2440 | 1.347741e+001, 2441 | -2.344397e+000, 2442 | 8.868907e-001, 2443 | -3.292661e-001, 2444 | -1.362105e+000, 2445 | 9.217826e-001, 2446 | -1.044436e+000, 2447 | -2.360719e-001, 2448 | 7.054471e-001, 2449 | -2.904518e-003, 2450 | -2.092829e+000, 2451 | -5.119668e-001, 2452 | 4.174861e-001, 2453 | 9.687435e-001, 2454 | 6.588427e-001, 2455 | }; 2456 | 2457 | double datasetRGBRad2[] = 2458 | { 2459 | // albedo 0, turbidity 1 2460 | 1.590330e+000, 2461 | 1.355401e+000, 2462 | 1.151412e+000, 2463 | 1.359116e+001, 2464 | 5.857714e+000, 2465 | 8.090833e+000, 2466 | // albedo 0, turbidity 2 2467 | 1.552540e+000, 2468 | 1.510040e+000, 2469 | 1.276413e-001, 2470 | 1.604643e+001, 2471 | 5.912162e+000, 2472 | 8.350009e+000, 2473 | // albedo 0, turbidity 3 2474 | 1.470871e+000, 2475 | 1.880464e+000, 2476 | -1.865398e+000, 2477 | 2.030808e+001, 2478 | 5.471461e+000, 2479 | 9.109834e+000, 2480 | // albedo 0, turbidity 4 2481 | 1.356563e+000, 2482 | 2.373866e+000, 2483 | -4.653245e+000, 2484 | 2.570922e+001, 2485 | 5.686009e+000, 2486 | 1.009480e+001, 2487 | // albedo 0, turbidity 5 2488 | 1.244232e+000, 2489 | 2.851519e+000, 2490 | -7.130942e+000, 2491 | 2.993449e+001, 2492 | 6.382120e+000, 2493 | 1.114578e+001, 2494 | // albedo 0, turbidity 6 2495 | 1.173693e+000, 2496 | 3.120604e+000, 2497 | -8.491886e+000, 2498 | 3.187393e+001, 2499 | 7.290615e+000, 2500 | 1.180066e+001, 2501 | // albedo 0, turbidity 7 2502 | 1.091845e+000, 2503 | 3.368888e+000, 2504 | -9.722083e+000, 2505 | 3.268508e+001, 2506 | 1.032424e+001, 2507 | 1.236508e+001, 2508 | // albedo 0, turbidity 8 2509 | 9.858985e-001, 2510 | 3.500541e+000, 2511 | -1.026328e+001, 2512 | 3.092956e+001, 2513 | 1.610881e+001, 2514 | 1.331222e+001, 2515 | // albedo 0, turbidity 9 2516 | 8.864993e-001, 2517 | 3.172888e+000, 2518 | -8.687550e+000, 2519 | 2.362161e+001, 2520 | 2.621851e+001, 2521 | 1.474967e+001, 2522 | // albedo 0, turbidity 10 2523 | 7.946973e-001, 2524 | 2.189355e+000, 2525 | -4.207953e+000, 2526 | 9.399091e+000, 2527 | 4.062849e+001, 2528 | 1.681753e+001, 2529 | // albedo 1, turbidity 1 2530 | 1.711696e+000, 2531 | 1.657311e+000, 2532 | 9.328021e-001, 2533 | 1.317880e+001, 2534 | 1.506751e+001, 2535 | 1.863556e+001, 2536 | // albedo 1, turbidity 2 2537 | 1.666968e+000, 2538 | 1.849993e+000, 2539 | -2.088601e-001, 2540 | 1.586653e+001, 2541 | 1.486880e+001, 2542 | 1.940719e+001, 2543 | // albedo 1, turbidity 3 2544 | 1.584846e+000, 2545 | 2.170022e+000, 2546 | -2.019597e+000, 2547 | 1.970826e+001, 2548 | 1.490684e+001, 2549 | 2.045055e+001, 2550 | // albedo 1, turbidity 4 2551 | 1.469412e+000, 2552 | 2.524017e+000, 2553 | -4.197267e+000, 2554 | 2.365249e+001, 2555 | 1.664588e+001, 2556 | 2.134477e+001, 2557 | // albedo 1, turbidity 5 2558 | 1.369714e+000, 2559 | 2.843548e+000, 2560 | -6.059031e+000, 2561 | 2.634993e+001, 2562 | 1.881361e+001, 2563 | 2.232186e+001, 2564 | // albedo 1, turbidity 6 2565 | 1.310477e+000, 2566 | 2.984444e+000, 2567 | -6.831686e+000, 2568 | 2.682340e+001, 2569 | 2.123267e+001, 2570 | 2.259755e+001, 2571 | // albedo 1, turbidity 7 2572 | 1.222552e+000, 2573 | 3.176523e+000, 2574 | -7.731496e+000, 2575 | 2.671760e+001, 2576 | 2.484358e+001, 2577 | 2.336863e+001, 2578 | // albedo 1, turbidity 8 2579 | 1.115781e+000, 2580 | 3.130635e+000, 2581 | -7.581744e+000, 2582 | 2.336531e+001, 2583 | 3.171048e+001, 2584 | 2.413859e+001, 2585 | // albedo 1, turbidity 9 2586 | 1.013181e+000, 2587 | 2.699342e+000, 2588 | -5.602709e+000, 2589 | 1.500158e+001, 2590 | 4.217613e+001, 2591 | 2.515957e+001, 2592 | // albedo 1, turbidity 10 2593 | 8.976323e-001, 2594 | 1.726948e+000, 2595 | -1.296120e+000, 2596 | 1.183675e+000, 2597 | 5.503215e+001, 2598 | 2.643066e+001, 2599 | }; 2600 | 2601 | double datasetRGB3[] = 2602 | { 2603 | // albedo 0, turbidity 1 2604 | -1.372629e+000, 2605 | -4.905585e-001, 2606 | -4.100789e+001, 2607 | 4.122169e+001, 2608 | -7.389360e-003, 2609 | 4.839359e-001, 2610 | 6.474757e-003, 2611 | 3.471755e+000, 2612 | 5.092936e-001, 2613 | -1.523025e+000, 2614 | -6.497084e-001, 2615 | 6.249857e+000, 2616 | -5.662543e+000, 2617 | -1.908402e-002, 2618 | 5.512810e-001, 2619 | -2.181049e-005, 2620 | 2.507663e+000, 2621 | 4.339598e-001, 2622 | -1.035567e+000, 2623 | -7.478740e-002, 2624 | 9.221030e-001, 2625 | -2.140047e+000, 2626 | -2.374146e-002, 2627 | 3.795517e-001, 2628 | -1.769134e-002, 2629 | 7.479831e+000, 2630 | 7.729303e-001, 2631 | -1.271086e+000, 2632 | -5.588190e-001, 2633 | 6.908023e-001, 2634 | 2.096832e+000, 2635 | -2.453967e-001, 2636 | 1.410648e+000, 2637 | 4.475036e-002, 2638 | -4.719115e+000, 2639 | 5.741186e-001, 2640 | -9.712598e-001, 2641 | -7.033926e-002, 2642 | 9.167274e-001, 2643 | -9.502097e-001, 2644 | 3.004684e-001, 2645 | 4.547054e-001, 2646 | -5.929017e-002, 2647 | 5.266196e+000, 2648 | 7.204135e-001, 2649 | -1.087457e+000, 2650 | -1.888896e-001, 2651 | 8.156686e-001, 2652 | 3.101712e-001, 2653 | -2.155419e+000, 2654 | 1.422205e+000, 2655 | 9.692261e-002, 2656 | 3.122404e+000, 2657 | 4.999430e-001, 2658 | // albedo 0, turbidity 2 2659 | -1.425280e+000, 2660 | -5.413508e-001, 2661 | -3.454883e+001, 2662 | 3.481142e+001, 2663 | -8.686975e-003, 2664 | 4.914268e-001, 2665 | -2.479243e-006, 2666 | 3.239879e+000, 2667 | 6.094201e-001, 2668 | -1.688557e+000, 2669 | -8.070865e-001, 2670 | 7.018459e+000, 2671 | -6.244574e+000, 2672 | -2.149341e-002, 2673 | 3.993971e-001, 2674 | 1.252502e-002, 2675 | 1.630662e+000, 2676 | 1.097860e-001, 2677 | -8.664152e-001, 2678 | 7.869125e-002, 2679 | -5.236535e-001, 2680 | -1.218960e+000, 2681 | -2.059093e-002, 2682 | 6.684898e-001, 2683 | -5.584112e-002, 2684 | 8.602299e+000, 2685 | 1.410496e+000, 2686 | -1.319763e+000, 2687 | -5.985323e-001, 2688 | 1.253918e+000, 2689 | 1.914706e+000, 2690 | -3.216739e-001, 2691 | 9.011213e-001, 2692 | 1.324845e-001, 2693 | -5.252749e+000, 2694 | 6.231252e-002, 2695 | -9.706008e-001, 2696 | -5.914059e-002, 2697 | 5.693150e-001, 2698 | -1.175362e+000, 2699 | 5.221644e-001, 2700 | 7.518213e-001, 2701 | -8.247655e-002, 2702 | 5.875635e+000, 2703 | 9.850863e-001, 2704 | -1.085330e+000, 2705 | -1.956105e-001, 2706 | 8.019605e-001, 2707 | 5.338101e-001, 2708 | -3.423464e+000, 2709 | 1.110444e+000, 2710 | 1.507923e-001, 2711 | 2.864942e+000, 2712 | 4.999481e-001, 2713 | // albedo 0, turbidity 3 2714 | -1.431967e+000, 2715 | -5.478935e-001, 2716 | -3.286288e+001, 2717 | 3.305288e+001, 2718 | -8.380797e-003, 2719 | 4.772050e-001, 2720 | -3.044274e-006, 2721 | 3.289973e+000, 2722 | 5.976303e-001, 2723 | -1.801361e+000, 2724 | -9.315889e-001, 2725 | 5.391756e+000, 2726 | -4.588592e+000, 2727 | -2.040076e-002, 2728 | 4.144684e-001, 2729 | 1.814534e-002, 2730 | 1.051795e+000, 2731 | 1.145651e-001, 2732 | -7.905357e-001, 2733 | 1.451332e-001, 2734 | -1.605661e-001, 2735 | -1.592174e+000, 2736 | 4.561348e-004, 2737 | 3.380323e-001, 2738 | -7.770275e-002, 2739 | 8.775384e+000, 2740 | 1.489512e+000, 2741 | -1.308575e+000, 2742 | -5.539232e-001, 2743 | 9.184133e-001, 2744 | 2.011479e+000, 2745 | -3.842472e-001, 2746 | 1.432274e+000, 2747 | 1.637153e-001, 2748 | -4.408856e+000, 2749 | 5.272957e-002, 2750 | -9.829872e-001, 2751 | -8.183048e-002, 2752 | 4.464556e-001, 2753 | -1.442716e+000, 2754 | 1.029641e+000, 2755 | -6.991617e-002, 2756 | 8.702356e-003, 2757 | 5.706417e+000, 2758 | 9.116452e-001, 2759 | -1.087130e+000, 2760 | -2.038013e-001, 2761 | 7.260801e-001, 2762 | 9.164376e-001, 2763 | -5.006183e+000, 2764 | 1.511271e+000, 2765 | 1.257134e-001, 2766 | 2.715439e+000, 2767 | 6.201652e-001, 2768 | // albedo 0, turbidity 4 2769 | -1.448662e+000, 2770 | -5.799075e-001, 2771 | -2.833268e+001, 2772 | 2.858023e+001, 2773 | -9.134061e-003, 2774 | 4.404783e-001, 2775 | -2.709026e-006, 2776 | 3.029357e+000, 2777 | 5.540071e-001, 2778 | -2.061772e+000, 2779 | -1.145190e+000, 2780 | 7.918478e+000, 2781 | -7.212525e+000, 2782 | -2.020760e-002, 2783 | 2.962715e-001, 2784 | 4.689670e-002, 2785 | 8.517209e-001, 2786 | 2.334587e-001, 2787 | -6.413755e-001, 2788 | 1.780425e-001, 2789 | -2.412919e+000, 2790 | 1.064484e+000, 2791 | -1.949986e-002, 2792 | 6.769741e-001, 2793 | -1.752760e-001, 2794 | 7.262714e+000, 2795 | 1.325869e+000, 2796 | -1.304871e+000, 2797 | -3.975581e-001, 2798 | 1.219002e+000, 2799 | 7.285178e-001, 2800 | -2.710105e-001, 2801 | 7.779727e-001, 2802 | 3.247139e-001, 2803 | -8.818168e-001, 2804 | 1.839517e-001, 2805 | -1.001104e+000, 2806 | -1.994801e-001, 2807 | 3.676742e-001, 2808 | -1.409737e+000, 2809 | 2.901555e-001, 2810 | 2.506940e-001, 2811 | 2.468899e-003, 2812 | 3.398923e+000, 2813 | 8.584645e-001, 2814 | -1.111552e+000, 2815 | -2.487204e-001, 2816 | 7.410842e-001, 2817 | 1.703749e+000, 2818 | -5.007855e+000, 2819 | 1.057763e+000, 2820 | 1.354511e-001, 2821 | 2.088715e+000, 2822 | 6.600013e-001, 2823 | // albedo 0, turbidity 5 2824 | -1.547227e+000, 2825 | -6.679466e-001, 2826 | -1.861465e+001, 2827 | 1.884045e+001, 2828 | -1.242210e-002, 2829 | 4.157339e-001, 2830 | -2.432805e-006, 2831 | 2.812423e+000, 2832 | 5.446957e-001, 2833 | -2.043890e+000, 2834 | -1.149081e+000, 2835 | 2.304118e+000, 2836 | -1.715757e+000, 2837 | -2.433628e-002, 2838 | 2.816836e-001, 2839 | 7.185458e-002, 2840 | 1.064860e+000, 2841 | 2.706789e-001, 2842 | -9.040720e-001, 2843 | -8.274472e-002, 2844 | -2.555676e-001, 2845 | -6.326215e-001, 2846 | -2.770880e-002, 2847 | 6.676024e-001, 2848 | -2.513532e-001, 2849 | 5.903839e+000, 2850 | 1.241452e+000, 2851 | -1.000013e+000, 2852 | -1.010774e-001, 2853 | 3.699166e-001, 2854 | 8.774526e-001, 2855 | -3.042007e-001, 2856 | 6.951053e-001, 2857 | 4.361813e-001, 2858 | 6.793421e-001, 2859 | 2.573892e-001, 2860 | -1.171332e+000, 2861 | -3.768188e-001, 2862 | 3.701377e-001, 2863 | -1.470757e+000, 2864 | 5.525942e-001, 2865 | 2.991456e-002, 2866 | 1.581823e-002, 2867 | 2.365233e+000, 2868 | 8.214514e-001, 2869 | -1.068667e+000, 2870 | -2.326330e-001, 2871 | 6.725059e-001, 2872 | 2.243733e+000, 2873 | -4.614370e+000, 2874 | 1.033677e+000, 2875 | 1.376291e-001, 2876 | 2.013334e+000, 2877 | 6.865304e-001, 2878 | // albedo 0, turbidity 6 2879 | -1.592991e+000, 2880 | -7.246948e-001, 2881 | -2.598204e+001, 2882 | 2.621960e+001, 2883 | -8.365176e-003, 2884 | 4.207571e-001, 2885 | -2.742772e-006, 2886 | 2.623735e+000, 2887 | 5.873190e-001, 2888 | -2.271349e+000, 2889 | -1.280884e+000, 2890 | 6.308739e+000, 2891 | -5.758350e+000, 2892 | -1.977049e-002, 2893 | 3.671835e-001, 2894 | 6.698038e-002, 2895 | 1.150597e+000, 2896 | 1.759218e-001, 2897 | -6.368620e-001, 2898 | -7.436052e-003, 2899 | -2.230026e+000, 2900 | 1.640997e+000, 2901 | -1.548497e-002, 2902 | 3.145331e-001, 2903 | -2.492644e-001, 2904 | 5.083843e+000, 2905 | 1.260215e+000, 2906 | -1.177925e+000, 2907 | -9.628114e-002, 2908 | 3.051152e-001, 2909 | -3.749544e-002, 2910 | -2.713209e-001, 2911 | 1.164226e+000, 2912 | 4.559969e-001, 2913 | 2.175429e+000, 2914 | 2.874284e-001, 2915 | -1.078500e+000, 2916 | -3.801779e-001, 2917 | 4.788906e-001, 2918 | -4.795969e-001, 2919 | 5.977621e-001, 2920 | -4.488535e-001, 2921 | 3.386874e-002, 2922 | 1.538143e+000, 2923 | 8.062054e-001, 2924 | -1.108028e+000, 2925 | -2.596892e-001, 2926 | 5.162202e-001, 2927 | 1.557081e+000, 2928 | -4.265039e+000, 2929 | 1.182535e+000, 2930 | 1.563762e-001, 2931 | 2.095084e+000, 2932 | 6.883383e-001, 2933 | // albedo 0, turbidity 7 2934 | -1.668427e+000, 2935 | -7.908511e-001, 2936 | -2.779690e+001, 2937 | 2.799746e+001, 2938 | -7.186935e-003, 2939 | 3.757766e-001, 2940 | -3.326858e-006, 2941 | 2.563421e+000, 2942 | 5.439687e-001, 2943 | -2.156175e+000, 2944 | -1.220004e+000, 2945 | 3.585732e+000, 2946 | -3.235988e+000, 2947 | -1.086239e-002, 2948 | 1.846143e-001, 2949 | 1.046017e-001, 2950 | 1.234427e+000, 2951 | 2.842191e-001, 2952 | -1.117051e+000, 2953 | -4.101627e-001, 2954 | -8.463730e-001, 2955 | 7.671472e-001, 2956 | -2.226609e-002, 2957 | 8.574943e-001, 2958 | -3.434124e-001, 2959 | 4.475715e+000, 2960 | 1.154824e+000, 2961 | -7.444840e-001, 2962 | 2.312078e-001, 2963 | -5.393724e-001, 2964 | 1.574213e-001, 2965 | -1.763914e-001, 2966 | 2.751692e-001, 2967 | 5.564200e-001, 2968 | 2.217672e+000, 2969 | 3.483932e-001, 2970 | -1.273036e+000, 2971 | -5.275562e-001, 2972 | 4.902512e-001, 2973 | -4.498436e-002, 2974 | 4.339366e-001, 2975 | 2.386682e-001, 2976 | 2.380879e-002, 2977 | 1.413444e+000, 2978 | 7.855923e-001, 2979 | -1.084192e+000, 2980 | -2.936753e-001, 2981 | 4.719432e-001, 2982 | 1.384436e+000, 2983 | -3.257789e+000, 2984 | 6.119543e-001, 2985 | 1.681884e-001, 2986 | 1.650441e+000, 2987 | 6.936631e-001, 2988 | // albedo 0, turbidity 8 2989 | -1.848490e+000, 2990 | -9.512670e-001, 2991 | -3.005251e+001, 2992 | 3.024315e+001, 2993 | -5.635304e-003, 2994 | 3.447780e-001, 2995 | -2.782999e-006, 2996 | 2.309422e+000, 2997 | 5.643559e-001, 2998 | -2.300008e+000, 2999 | -1.252335e+000, 3000 | -1.218876e+000, 3001 | 1.493730e+000, 3002 | -6.107100e-003, 3003 | 7.974860e-002, 3004 | 1.023449e-001, 3005 | 1.505934e+000, 3006 | 2.360948e-001, 3007 | -1.483705e+000, 3008 | -8.547575e-001, 3009 | -7.797146e-001, 3010 | 6.447971e-001, 3011 | -2.678052e-002, 3012 | 1.091263e+000, 3013 | -3.344889e-001, 3014 | 3.830416e+000, 3015 | 1.189425e+000, 3016 | -5.348005e-001, 3017 | 3.982733e-001, 3018 | -4.071573e-001, 3019 | 3.265569e-001, 3020 | -8.658789e-002, 3021 | -2.370892e-001, 3022 | 5.369097e-001, 3023 | 1.478279e+000, 3024 | 3.143303e-001, 3025 | -1.320401e+000, 3026 | -6.043247e-001, 3027 | 3.019196e-001, 3028 | -7.732911e-002, 3029 | 4.768381e-001, 3030 | 6.745764e-001, 3031 | 3.694098e-002, 3032 | 1.158234e+000, 3033 | 8.169056e-001, 3034 | -1.101040e+000, 3035 | -3.420019e-001, 3036 | 3.775661e-001, 3037 | 1.769338e+000, 3038 | -2.990515e+000, 3039 | 1.649529e-001, 3040 | 1.970125e-001, 3041 | 1.453355e+000, 3042 | 6.759757e-001, 3043 | // albedo 0, turbidity 9 3044 | -2.251946e+000, 3045 | -1.229349e+000, 3046 | -3.271808e+001, 3047 | 3.283114e+001, 3048 | -4.252027e-003, 3049 | 3.372289e-001, 3050 | -3.001937e-006, 3051 | 2.154046e+000, 3052 | 5.842674e-001, 3053 | -1.867834e+000, 3054 | -9.531252e-001, 3055 | -1.229365e+001, 3056 | 1.269149e+001, 3057 | -6.844772e-003, 3058 | 1.185107e-001, 3059 | 7.539587e-002, 3060 | 1.846381e+000, 3061 | 1.899412e-001, 3062 | -3.398629e+000, 3063 | -2.180862e+000, 3064 | 2.335213e+000, 3065 | -3.382823e+000, 3066 | -8.613985e-003, 3067 | 8.431602e-001, 3068 | -2.393567e-001, 3069 | 3.112460e+000, 3070 | 1.218556e+000, 3071 | 5.708381e-001, 3072 | 9.406030e-001, 3073 | -6.890113e-001, 3074 | 2.746233e+000, 3075 | -5.772068e-002, 3076 | 1.096005e-001, 3077 | 3.491978e-001, 3078 | 7.281453e-001, 3079 | 3.212049e-001, 3080 | -1.705909e+000, 3081 | -8.517224e-001, 3082 | 1.131160e-001, 3083 | -2.141434e+000, 3084 | 4.274043e-001, 3085 | 3.397600e-001, 3086 | 1.786490e-001, 3087 | 9.026101e-001, 3088 | 7.882800e-001, 3089 | -1.012865e+000, 3090 | -3.495551e-001, 3091 | 3.369038e-001, 3092 | 3.724205e+000, 3093 | -3.089586e+000, 3094 | 1.266964e-001, 3095 | 1.461790e-001, 3096 | 1.170199e+000, 3097 | 6.931052e-001, 3098 | // albedo 0, turbidity 10 3099 | -2.890318e+000, 3100 | -1.665573e+000, 3101 | -3.493756e+001, 3102 | 3.500369e+001, 3103 | -2.984251e-003, 3104 | 2.622419e-001, 3105 | -4.259360e-006, 3106 | 1.947681e+000, 3107 | 6.905752e-001, 3108 | -1.956022e+000, 3109 | -1.062900e+000, 3110 | -1.919714e+001, 3111 | 1.975164e+001, 3112 | -8.865396e-003, 3113 | 2.165540e-001, 3114 | 5.475637e-002, 3115 | 1.761134e+000, 3116 | 3.164249e-003, 3117 | -5.612198e+000, 3118 | -3.101371e+000, 3119 | 4.098034e+000, 3120 | -6.144001e+000, 3121 | 9.944958e-003, 3122 | 2.905472e-001, 3123 | -1.707110e-001, 3124 | 3.199107e+000, 3125 | 1.337660e+000, 3126 | 8.353756e-001, 3127 | 4.855943e-001, 3128 | -1.243589e+000, 3129 | 5.147385e+000, 3130 | -7.013963e-002, 3131 | 9.380410e-001, 3132 | 2.335714e-001, 3133 | 1.727744e-001, 3134 | 2.802696e-001, 3135 | -1.524329e+000, 3136 | -7.388547e-001, 3137 | 3.259025e-001, 3138 | -4.050634e+000, 3139 | 4.058549e-001, 3140 | -2.591384e-001, 3141 | 1.898299e-001, 3142 | 3.556071e-001, 3143 | 7.884126e-001, 3144 | -1.070371e+000, 3145 | -4.207858e-001, 3146 | 1.739862e-001, 3147 | 5.293410e+000, 3148 | -3.136757e+000, 3149 | 2.323856e-001, 3150 | 1.673706e-001, 3151 | 1.007227e+000, 3152 | 6.844287e-001, 3153 | // albedo 1, turbidity 1 3154 | -1.341720e+000, 3155 | -4.834889e-001, 3156 | -4.633447e+001, 3157 | 4.682148e+001, 3158 | -6.137296e-003, 3159 | 4.599216e-001, 3160 | 7.047323e-003, 3161 | 2.895798e+000, 3162 | 4.999398e-001, 3163 | -1.529104e+000, 3164 | -6.498631e-001, 3165 | 1.534103e+001, 3166 | -1.450675e+001, 3167 | -1.531439e-002, 3168 | 3.280082e-001, 3169 | 1.682926e-002, 3170 | 1.901587e+000, 3171 | 5.013227e-001, 3172 | -1.014776e+000, 3173 | -1.454495e-001, 3174 | -4.071085e+000, 3175 | 2.954982e+000, 3176 | -2.630348e-002, 3177 | 5.681531e-001, 3178 | -3.016505e-002, 3179 | 6.773854e+000, 3180 | 5.003504e-001, 3181 | -1.172413e+000, 3182 | -4.026320e-001, 3183 | 2.960428e+000, 3184 | 2.020710e-001, 3185 | -2.004947e-001, 3186 | 9.375572e-001, 3187 | 5.998168e-002, 3188 | -4.945934e+000, 3189 | 4.502898e-001, 3190 | -9.898161e-001, 3191 | -5.772814e-002, 3192 | 4.470024e-001, 3193 | -5.786656e-001, 3194 | 1.158168e-001, 3195 | 3.468040e-001, 3196 | -5.043360e-002, 3197 | 6.867947e+000, 3198 | 8.012363e-001, 3199 | -1.085111e+000, 3200 | -1.882675e-001, 3201 | 1.223748e+000, 3202 | 3.565495e-001, 3203 | -3.688357e+000, 3204 | 5.653723e-001, 3205 | 6.727646e-002, 3206 | 2.690130e+000, 3207 | 4.999400e-001, 3208 | // albedo 1, turbidity 2 3209 | -1.389119e+000, 3210 | -5.290250e-001, 3211 | -4.055774e+001, 3212 | 4.105972e+001, 3213 | -7.062577e-003, 3214 | 4.560060e-001, 3215 | -1.736334e-006, 3216 | 2.775512e+000, 3217 | 6.671455e-001, 3218 | -1.584641e+000, 3219 | -7.200619e-001, 3220 | 1.248067e+001, 3221 | -1.156028e+001, 3222 | -1.659568e-002, 3223 | 3.050029e-001, 3224 | 1.099895e-002, 3225 | 1.438927e+000, 3226 | -2.138015e-002, 3227 | -9.826068e-001, 3228 | -8.887254e-002, 3229 | -2.960031e+000, 3230 | 1.808816e+000, 3231 | -2.478159e-002, 3232 | 6.035733e-001, 3233 | -4.868441e-002, 3234 | 7.347705e+000, 3235 | 1.584739e+000, 3236 | -1.150423e+000, 3237 | -4.073793e-001, 3238 | 2.412991e+000, 3239 | 4.870840e-001, 3240 | -2.337902e-001, 3241 | 8.295114e-001, 3242 | 1.129914e-001, 3243 | -5.150045e+000, 3244 | -9.016643e-002, 3245 | -1.016933e+000, 3246 | -6.311501e-002, 3247 | 5.218937e-001, 3248 | -5.716430e-001, 3249 | 1.250993e-001, 3250 | 3.601524e-001, 3251 | -5.497586e-002, 3252 | 7.060139e+000, 3253 | 1.018333e+000, 3254 | -1.073151e+000, 3255 | -1.845444e-001, 3256 | 1.155394e+000, 3257 | 3.004486e-001, 3258 | -3.431711e+000, 3259 | 4.657031e-001, 3260 | 9.401223e-002, 3261 | 2.688620e+000, 3262 | 4.999544e-001, 3263 | // albedo 1, turbidity 3 3264 | -1.391257e+000, 3265 | -5.365815e-001, 3266 | -4.255881e+001, 3267 | 4.299132e+001, 3268 | -5.838466e-003, 3269 | 4.229134e-001, 3270 | -2.760038e-006, 3271 | 2.775531e+000, 3272 | 6.234597e-001, 3273 | -1.780062e+000, 3274 | -9.228880e-001, 3275 | 1.376172e+001, 3276 | -1.260946e+001, 3277 | -1.507526e-002, 3278 | 3.117435e-001, 3279 | 2.205045e-002, 3280 | 6.093731e-001, 3281 | 3.463446e-002, 3282 | -7.388169e-001, 3283 | 1.275670e-001, 3284 | -3.999528e+000, 3285 | 2.223993e+000, 3286 | -1.856853e-002, 3287 | 5.439310e-001, 3288 | -8.834054e-002, 3289 | 8.037139e+000, 3290 | 1.645951e+000, 3291 | -1.322387e+000, 3292 | -5.320143e-001, 3293 | 2.659359e+000, 3294 | 1.086712e+000, 3295 | -2.129712e-001, 3296 | 8.704649e-001, 3297 | 1.800315e-001, 3298 | -4.967241e+000, 3299 | -1.383720e-001, 3300 | -9.378288e-001, 3301 | -1.599895e-002, 3302 | 3.607555e-001, 3303 | -1.980561e+000, 3304 | 3.791456e-001, 3305 | 1.212268e-001, 3306 | -2.845992e-002, 3307 | 6.825542e+000, 3308 | 1.059139e+000, 3309 | -1.100832e+000, 3310 | -2.172313e-001, 3311 | 1.211561e+000, 3312 | 2.002721e+000, 3313 | -5.010011e+000, 3314 | 5.717583e-001, 3315 | 6.777702e-002, 3316 | 2.160006e+000, 3317 | 5.676392e-001, 3318 | // albedo 1, turbidity 4 3319 | -1.409373e+000, 3320 | -5.708751e-001, 3321 | -3.034974e+001, 3322 | 3.079809e+001, 3323 | -7.280715e-003, 3324 | 3.723304e-001, 3325 | -2.436279e-006, 3326 | 2.577348e+000, 3327 | 5.913377e-001, 3328 | -1.954312e+000, 3329 | -1.116510e+000, 3330 | 5.399148e+000, 3331 | -4.299553e+000, 3332 | -1.724739e-002, 3333 | 3.742824e-001, 3334 | 4.187077e-002, 3335 | 1.044883e-001, 3336 | 1.232727e-001, 3337 | -6.772215e-001, 3338 | 2.001396e-001, 3339 | -3.670523e-001, 3340 | -1.014628e+000, 3341 | -3.497152e-003, 3342 | 4.099858e-001, 3343 | -1.584633e-001, 3344 | 7.750400e+000, 3345 | 1.514559e+000, 3346 | -1.291600e+000, 3347 | -4.977437e-001, 3348 | 9.641914e-001, 3349 | 1.562420e+000, 3350 | -3.227782e-001, 3351 | 9.055427e-001, 3352 | 3.046444e-001, 3353 | -3.385619e+000, 3354 | 9.546291e-003, 3355 | -9.750857e-001, 3356 | -8.770560e-002, 3357 | 9.054256e-001, 3358 | -1.429236e+000, 3359 | 8.974777e-001, 3360 | -1.217961e-001, 3361 | -5.194608e-002, 3362 | 4.909409e+000, 3363 | 9.589153e-001, 3364 | -1.088007e+000, 3365 | -1.959301e-001, 3366 | 9.745799e-001, 3367 | 1.260761e+000, 3368 | -5.008864e+000, 3369 | 7.271248e-001, 3370 | 1.096661e-001, 3371 | 2.717295e+000, 3372 | 6.340731e-001, 3373 | // albedo 1, turbidity 5 3374 | -1.456050e+000, 3375 | -6.223072e-001, 3376 | -2.228088e+001, 3377 | 2.269604e+001, 3378 | -9.340812e-003, 3379 | 4.118308e-001, 3380 | -2.418083e-006, 3381 | 2.442117e+000, 3382 | 5.589638e-001, 3383 | -2.176449e+000, 3384 | -1.302416e+000, 3385 | 2.222836e+000, 3386 | -1.222730e+000, 3387 | -1.728051e-002, 3388 | 1.323513e-001, 3389 | 7.027731e-002, 3390 | 4.835745e-002, 3391 | 2.093351e-001, 3392 | -5.789641e-001, 3393 | 2.215407e-001, 3394 | 2.142291e-001, 3395 | -1.201725e+000, 3396 | -1.185728e-002, 3397 | 8.122982e-001, 3398 | -2.380420e-001, 3399 | 6.706841e+000, 3400 | 1.404146e+000, 3401 | -1.307463e+000, 3402 | -4.515174e-001, 3403 | 6.447827e-001, 3404 | 1.223841e+000, 3405 | -2.902391e-001, 3406 | 4.986588e-001, 3407 | 4.073652e-001, 3408 | -1.706696e+000, 3409 | 1.060885e-001, 3410 | -9.698678e-001, 3411 | -1.307094e-001, 3412 | 9.389347e-001, 3413 | -1.522852e+000, 3414 | 7.768797e-001, 3415 | -1.368595e-001, 3416 | -3.857426e-002, 3417 | 3.676935e+000, 3418 | 8.980966e-001, 3419 | -1.104349e+000, 3420 | -2.380323e-001, 3421 | 1.047043e+000, 3422 | 1.865421e+000, 3423 | -5.011664e+000, 3424 | 7.014954e-001, 3425 | 9.622701e-002, 3426 | 1.891360e+000, 3427 | 6.687354e-001, 3428 | // albedo 1, turbidity 6 3429 | -1.502249e+000, 3430 | -6.724523e-001, 3431 | -2.888092e+001, 3432 | 2.930360e+001, 3433 | -6.685766e-003, 3434 | 3.685464e-001, 3435 | -2.469442e-006, 3436 | 2.310797e+000, 3437 | 5.566754e-001, 3438 | -2.217125e+000, 3439 | -1.364924e+000, 3440 | 4.048243e+000, 3441 | -3.111333e+000, 3442 | -1.317747e-002, 3443 | 1.921948e-001, 3444 | 8.627702e-002, 3445 | 1.981769e-003, 3446 | 2.213689e-001, 3447 | -6.215757e-001, 3448 | 1.687995e-001, 3449 | -5.949131e-001, 3450 | -1.551293e-001, 3451 | 3.356129e-004, 3452 | 6.897657e-001, 3453 | -2.855053e-001, 3454 | 6.271042e+000, 3455 | 1.363084e+000, 3456 | -1.216317e+000, 3457 | -3.489429e-001, 3458 | 7.566226e-001, 3459 | 5.409809e-001, 3460 | -2.830843e-001, 3461 | 6.191825e-001, 3462 | 4.755163e-001, 3463 | -9.131387e-001, 3464 | 1.383909e-001, 3465 | -1.030437e+000, 3466 | -2.034064e-001, 3467 | 8.335995e-001, 3468 | -1.050947e+000, 3469 | 8.689093e-001, 3470 | -3.672310e-001, 3471 | -4.056183e-002, 3472 | 3.111269e+000, 3473 | 8.856842e-001, 3474 | -1.078984e+000, 3475 | -2.070549e-001, 3476 | 9.683145e-001, 3477 | 1.497022e+000, 3478 | -5.007653e+000, 3479 | 7.702541e-001, 3480 | 1.285822e-001, 3481 | 2.225188e+000, 3482 | 6.587911e-001, 3483 | // albedo 1, turbidity 7 3484 | -1.559291e+000, 3485 | -7.374039e-001, 3486 | -3.596311e+001, 3487 | 3.634470e+001, 3488 | -4.667132e-003, 3489 | 3.277964e-001, 3490 | -2.487945e-006, 3491 | 2.215652e+000, 3492 | 5.764681e-001, 3493 | -2.356929e+000, 3494 | -1.444755e+000, 3495 | 6.244526e+000, 3496 | -5.540162e+000, 3497 | -8.794510e-003, 3498 | 1.792100e-001, 3499 | 9.578517e-002, 3500 | 3.737676e-001, 3501 | 1.922194e-001, 3502 | -6.589752e-001, 3503 | -2.926910e-002, 3504 | -1.831779e+000, 3505 | 1.869962e+000, 3506 | -2.030095e-003, 3507 | 7.552089e-001, 3508 | -3.168157e-001, 3509 | 4.632196e+000, 3510 | 1.294054e+000, 3511 | -1.161046e+000, 3512 | -1.472506e-001, 3513 | 6.494138e-001, 3514 | -8.327174e-001, 3515 | -2.320724e-001, 3516 | 3.391212e-001, 3517 | 5.269637e-001, 3518 | 9.376341e-001, 3519 | 2.458573e-001, 3520 | -1.034427e+000, 3521 | -3.062504e-001, 3522 | 8.975634e-001, 3523 | 3.203531e-001, 3524 | 8.565142e-001, 3525 | -1.250162e-001, 3526 | -4.094017e-002, 3527 | 1.861304e+000, 3528 | 8.223468e-001, 3529 | -1.109954e+000, 3530 | -2.740277e-001, 3531 | 1.063811e+000, 3532 | 7.077398e-001, 3533 | -4.695734e+000, 3534 | 5.621696e-001, 3535 | 1.248956e-001, 3536 | 1.297723e+000, 3537 | 6.789720e-001, 3538 | // albedo 1, turbidity 8 3539 | -1.788293e+000, 3540 | -9.368751e-001, 3541 | -4.382980e+001, 3542 | 4.424963e+001, 3543 | -3.652530e-003, 3544 | 3.094331e-001, 3545 | -2.810503e-006, 3546 | 1.904402e+000, 3547 | 5.861599e-001, 3548 | -2.268206e+000, 3549 | -1.312676e+000, 3550 | 2.863082e+000, 3551 | -2.373727e+000, 3552 | -5.144980e-003, 3553 | 1.711072e-001, 3554 | 9.316041e-002, 3555 | 9.309598e-001, 3556 | 1.791683e-001, 3557 | -1.376966e+000, 3558 | -7.418582e-001, 3559 | -1.349589e+000, 3560 | 1.563419e+000, 3561 | -3.124219e-003, 3562 | 6.967139e-001, 3563 | -3.061887e-001, 3564 | 3.602731e+000, 3565 | 1.255669e+000, 3566 | -6.017540e-001, 3567 | 2.815928e-001, 3568 | 5.424052e-001, 3569 | -6.885450e-001, 3570 | -1.620001e-001, 3571 | 2.980046e-001, 3572 | 4.995571e-001, 3573 | 7.371203e-001, 3574 | 2.812466e-001, 3575 | -1.278853e+000, 3576 | -5.245326e-001, 3577 | 7.870520e-001, 3578 | 3.125067e-001, 3579 | 7.748105e-001, 3580 | -7.788581e-002, 3581 | 3.490956e-003, 3582 | 1.283748e+000, 3583 | 8.130190e-001, 3584 | -1.050930e+000, 3585 | -2.786331e-001, 3586 | 1.056344e+000, 3587 | 1.053002e+000, 3588 | -4.047789e+000, 3589 | 4.432174e-001, 3590 | 1.169077e-001, 3591 | 9.532621e-001, 3592 | 6.806764e-001, 3593 | // albedo 1, turbidity 9 3594 | -2.084927e+000, 3595 | -1.203954e+000, 3596 | -4.881638e+001, 3597 | 4.920160e+001, 3598 | -2.896045e-003, 3599 | 2.882977e-001, 3600 | -3.073517e-006, 3601 | 1.702211e+000, 3602 | 6.374180e-001, 3603 | -2.328567e+000, 3604 | -1.238023e+000, 3605 | -1.891019e+000, 3606 | 2.451520e+000, 3607 | -5.847581e-003, 3608 | 2.084702e-001, 3609 | 7.848130e-002, 3610 | 1.211048e+000, 3611 | 8.095008e-002, 3612 | -2.634632e+000, 3613 | -1.789460e+000, 3614 | -1.370558e-001, 3615 | -3.326435e-001, 3616 | 2.783737e-003, 3617 | 5.239451e-001, 3618 | -2.548881e-001, 3619 | 2.896327e+000, 3620 | 1.324116e+000, 3621 | 6.882616e-002, 3622 | 5.997821e-001, 3623 | 1.535398e-001, 3624 | 1.375209e+000, 3625 | -1.267285e-001, 3626 | 4.239743e-001, 3627 | 4.013122e-001, 3628 | 1.794675e-001, 3629 | 2.395382e-001, 3630 | -1.430918e+000, 3631 | -6.439041e-001, 3632 | 8.325980e-001, 3633 | -1.705612e+000, 3634 | 7.236426e-001, 3635 | -5.567593e-002, 3636 | 6.408718e-002, 3637 | 6.836524e-001, 3638 | 8.388887e-001, 3639 | -1.037956e+000, 3640 | -3.215402e-001, 3641 | 9.457349e-001, 3642 | 3.178114e+000, 3643 | -4.152156e+000, 3644 | 2.230992e-001, 3645 | 1.156198e-001, 3646 | 7.606223e-001, 3647 | 6.656923e-001, 3648 | // albedo 1, turbidity 10 3649 | -2.967314e+000, 3650 | -1.728778e+000, 3651 | -3.730988e+001, 3652 | 3.755578e+001, 3653 | -2.588835e-003, 3654 | 2.927966e-001, 3655 | -3.935038e-006, 3656 | 1.592161e+000, 3657 | 6.868694e-001, 3658 | -2.123311e+000, 3659 | -1.175148e+000, 3660 | -1.314988e+001, 3661 | 1.386882e+001, 3662 | -7.828537e-003, 3663 | 1.852026e-001, 3664 | 5.481038e-002, 3665 | 1.294309e+000, 3666 | 2.428177e-002, 3667 | -5.443597e+000, 3668 | -3.156344e+000, 3669 | 2.110838e+000, 3670 | -3.421556e+000, 3671 | 1.181890e-002, 3672 | 1.196951e-001, 3673 | -1.742902e-001, 3674 | 2.404353e+000, 3675 | 1.272805e+000, 3676 | 1.029898e+000, 3677 | 5.912521e-001, 3678 | -3.983531e-001, 3679 | 3.286069e+000, 3680 | -9.252065e-002, 3681 | 1.331381e+000, 3682 | 2.560642e-001, 3683 | 8.001754e-001, 3684 | 3.624178e-001, 3685 | -1.547574e+000, 3686 | -7.881604e-001, 3687 | 1.020902e+000, 3688 | -2.897069e+000, 3689 | 5.213470e-001, 3690 | -9.242315e-001, 3691 | 1.185594e-001, 3692 | -1.150721e+000, 3693 | 7.317211e-001, 3694 | -9.621043e-001, 3695 | -1.991406e-001, 3696 | 6.531287e-001, 3697 | 3.925839e+000, 3698 | -3.596904e+000, 3699 | 6.317332e-001, 3700 | 1.531334e-001, 3701 | 1.457846e+000, 3702 | 6.966285e-001, 3703 | }; 3704 | 3705 | double datasetRGBRad3[] = 3706 | { 3707 | // albedo 0, turbidity 1 3708 | 9.926518e-001, 3709 | 1.999494e+000, 3710 | -4.136109e+000, 3711 | 1.856270e+001, 3712 | 1.351028e+001, 3713 | 1.390238e+001, 3714 | // albedo 0, turbidity 2 3715 | 9.634366e-001, 3716 | 2.119694e+000, 3717 | -4.614523e+000, 3718 | 1.919701e+001, 3719 | 1.376644e+001, 3720 | 1.418731e+001, 3721 | // albedo 0, turbidity 3 3722 | 9.446537e-001, 3723 | 2.171610e+000, 3724 | -4.915556e+000, 3725 | 1.918240e+001, 3726 | 1.537135e+001, 3727 | 1.400530e+001, 3728 | // albedo 0, turbidity 4 3729 | 9.073074e-001, 3730 | 2.330536e+000, 3731 | -5.577596e+000, 3732 | 1.961615e+001, 3733 | 1.688365e+001, 3734 | 1.446955e+001, 3735 | // albedo 0, turbidity 5 3736 | 8.739124e-001, 3737 | 2.388682e+000, 3738 | -5.842995e+000, 3739 | 1.923265e+001, 3740 | 1.887735e+001, 3741 | 1.485698e+001, 3742 | // albedo 0, turbidity 6 3743 | 8.563688e-001, 3744 | 2.391534e+000, 3745 | -5.769133e+000, 3746 | 1.828709e+001, 3747 | 2.097209e+001, 3748 | 1.469587e+001, 3749 | // albedo 0, turbidity 7 3750 | 8.270533e-001, 3751 | 2.342790e+000, 3752 | -5.558071e+000, 3753 | 1.684993e+001, 3754 | 2.356498e+001, 3755 | 1.505975e+001, 3756 | // albedo 0, turbidity 8 3757 | 7.908339e-001, 3758 | 2.190341e+000, 3759 | -4.852571e+000, 3760 | 1.374862e+001, 3761 | 2.806846e+001, 3762 | 1.548444e+001, 3763 | // albedo 0, turbidity 9 3764 | 7.403619e-001, 3765 | 1.783998e+000, 3766 | -2.983854e+000, 3767 | 7.622563e+000, 3768 | 3.507610e+001, 3769 | 1.615805e+001, 3770 | // albedo 0, turbidity 10 3771 | 6.840111e-001, 3772 | 1.154457e+000, 3773 | -2.393830e-001, 3774 | -7.896893e-001, 3775 | 4.282765e+001, 3776 | 1.779469e+001, 3777 | // albedo 1, turbidity 1 3778 | 1.168300e+000, 3779 | 1.860993e+000, 3780 | -2.129074e+000, 3781 | 1.251952e+001, 3782 | 3.032499e+001, 3783 | 2.938716e+001, 3784 | // albedo 1, turbidity 2 3785 | 1.150338e+000, 3786 | 1.918813e+000, 3787 | -2.413527e+000, 3788 | 1.274862e+001, 3789 | 3.087134e+001, 3790 | 2.951432e+001, 3791 | // albedo 1, turbidity 3 3792 | 1.114719e+000, 3793 | 1.964689e+000, 3794 | -2.625423e+000, 3795 | 1.247837e+001, 3796 | 3.237949e+001, 3797 | 2.943596e+001, 3798 | // albedo 1, turbidity 4 3799 | 1.077948e+000, 3800 | 2.006292e+000, 3801 | -2.846934e+000, 3802 | 1.190195e+001, 3803 | 3.459293e+001, 3804 | 2.937492e+001, 3805 | // albedo 1, turbidity 5 3806 | 1.035143e+000, 3807 | 1.986681e+000, 3808 | -2.752584e+000, 3809 | 1.060972e+001, 3810 | 3.722185e+001, 3811 | 2.918594e+001, 3812 | // albedo 1, turbidity 6 3813 | 1.015992e+000, 3814 | 1.992054e+000, 3815 | -2.812626e+000, 3816 | 1.001416e+001, 3817 | 3.847300e+001, 3818 | 2.924624e+001, 3819 | // albedo 1, turbidity 7 3820 | 9.756887e-001, 3821 | 1.939897e+000, 3822 | -2.533281e+000, 3823 | 8.319176e+000, 3824 | 4.083907e+001, 3825 | 2.925586e+001, 3826 | // albedo 1, turbidity 8 3827 | 9.264164e-001, 3828 | 1.716454e+000, 3829 | -1.597044e+000, 3830 | 4.739725e+000, 3831 | 4.507683e+001, 3832 | 2.878915e+001, 3833 | // albedo 1, turbidity 9 3834 | 8.595191e-001, 3835 | 1.346034e+000, 3836 | -2.801895e-002, 3837 | -6.582906e-001, 3838 | 5.017523e+001, 3839 | 2.852953e+001, 3840 | // albedo 1, turbidity 10 3841 | 7.754116e-001, 3842 | 7.709245e-001, 3843 | 2.200201e+000, 3844 | -7.487661e+000, 3845 | 5.436622e+001, 3846 | 2.893432e+001, 3847 | }; 3848 | 3849 | double* datasetsRGB[] = 3850 | { 3851 | datasetRGB1, 3852 | datasetRGB2, 3853 | datasetRGB3 3854 | }; 3855 | 3856 | double* datasetsRGBRad[] = 3857 | { 3858 | datasetRGBRad1, 3859 | datasetRGBRad2, 3860 | datasetRGBRad3 3861 | }; 3862 | -------------------------------------------------------------------------------- /HosekSky/README.txt: -------------------------------------------------------------------------------- 1 | This file is part of a sample implementation of the analytical skylight and 2 | solar radiance models presented in the SIGGRAPH 2012 paper 3 | 4 | 5 | "An Analytic Model for Full Spectral Sky-Dome Radiance" 6 | 7 | and the 2013 IEEE CG&A paper 8 | 9 | "Adding a Solar Radiance Function to the Hosek Skylight Model" 10 | 11 | both by 12 | 13 | Lukas Hosek and Alexander Wilkie 14 | Charles University in Prague, Czech Republic 15 | 16 | 17 | Version: 1.4a, February 22nd, 2013 18 | 19 | Version history: 20 | 21 | 1.4a February 22nd, 2013 22 | Removed unnecessary and counter-intuitive solar radius parameters 23 | from the interface of the colourspace sky dome initialisation functions. 24 | 25 | 1.4 February 11th, 2013 26 | Fixed a bug which caused the relative brightness of the solar disc 27 | and the sky dome to be off by a factor of about 6. The sun was too 28 | bright: this affected both normal and alien sun scenarios. The 29 | coefficients of the solar radiance function were changed to fix this. 30 | 31 | 1.3 January 21st, 2013 (not released to the public) 32 | Added support for solar discs that are not exactly the same size as 33 | the terrestrial sun. Also added support for suns with a different 34 | emission spectrum ("Alien World" functionality). 35 | 36 | 1.2a December 18th, 2012 37 | Fixed a mistake and some inaccuracies in the solar radiance function 38 | explanations found in ArHosekSkyModel.h. The actual source code is 39 | unchanged compared to version 1.2. 40 | 41 | 1.2 December 17th, 2012 42 | Native RGB data and a solar radiance function that matches the turbidity 43 | conditions were added. 44 | 45 | 1.1 September 2012 46 | The coefficients of the spectral model are now scaled so that the output 47 | is given in physical units: W / (m^-2 * sr * nm). Also, the output of the 48 | XYZ model is now no longer scaled to the range [0...1]. Instead, it is 49 | the result of a simple conversion from spectral data via the CIE 2 degree 50 | standard observer matching functions. Therefore, after multiplication 51 | with 683 lm / W, the Y channel now corresponds to luminance in lm. 52 | 53 | 1.0 May 11th, 2012 54 | Initial release. 55 | 56 | 57 | Please visit http://cgg.mff.cuni.cz/projects/SkylightModelling/ to check if 58 | an updated version of this code has been published! 59 | 60 | This archive contains the following files: 61 | 62 | README.txt This file. 63 | 64 | ArHosekSkyModel.h Header file for the reference functions. Their 65 | usage is explained there, and sample code for 66 | calling them is given. 67 | 68 | ArHosekSkyModel.c Implementation of the functions. 69 | 70 | ArHosekSkyModelData_Spectral.h Spectral coefficient data. 71 | ArHosekSkyModelData_CIEXYZ.h CIE XYZ coefficient data. 72 | ArHosekSkyModelData_RGB.h RGB coefficient data. 73 | 74 | Please note that the source files are in C99, and you have to set appropriate 75 | compiler flags for them to work. For example, when compiling this code with 76 | gcc, you have to add the "-std=c99" or "-std=gnu99" flags. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ahPhysicalSky 2 | This program renders the Hosek-Wilkie Sky Model in high-dynamic range to XYZ tristimulus values. Depending on user input, this can be converted to either sRGB, ACEScg or ACES2065-1 for use in wide-colour gamut CG renders. The images are saved out to .exr files and can be unwrapped and used directly as SkyDome textures in either raytracers or real-time engines. 3 | 4 | # Features 5 | * High-dynamic range, wide-color gamut rendering 6 | * exr output 7 | * Support for variable turbidity, ground albedo, sky tint and sun tint values 8 | 9 | # Renders 10 | ![village_morning](https://user-images.githubusercontent.com/10408010/48678182-a06e0300-eb77-11e8-8269-9990764cf30b.png) 11 | ![village](https://user-images.githubusercontent.com/10408010/48678185-a95ed480-eb77-11e8-80ac-90f5225b3fd5.png) 12 | ![village_evening](https://user-images.githubusercontent.com/10408010/48678188-b24fa600-eb77-11e8-98d7-3cf262d4b48f.png) 13 | ![fisheye1](https://user-images.githubusercontent.com/10408010/48678247-add7bd00-eb78-11e8-9ac8-e418ee4225bf.png) 14 | ![fisheye2](https://user-images.githubusercontent.com/10408010/48678255-b7612500-eb78-11e8-8fef-09cf0066ee5c.png) 15 | ![fisheye3](https://user-images.githubusercontent.com/10408010/48678258-bc25d900-eb78-11e8-8078-ca904802678d.png) 16 | 17 | # Run 18 | 19 | ``` 20 | >>> mkdir build 21 | >>> cd build 22 | >>> cmake .. 23 | >>> make 24 | >>> ./ahPhysicalSky 25 | ``` 26 | 27 | # TODO 28 | * Add solar disc rendering 29 | * Add aerial perspective 30 | -------------------------------------------------------------------------------- /src/Geometry.h: -------------------------------------------------------------------------------- 1 | #ifndef GEOMETRY_H 2 | #define GEOMETRY_H 3 | 4 | // Code for Vector math from Scratchapixel: https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/geometry 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #ifndef M_PI 13 | #define M_PI (3.14159265358979323846f) 14 | #endif 15 | 16 | #ifndef M_PI_2 17 | #define M_PI_2 (1.570796327f) 18 | #endif 19 | 20 | template 21 | class Vector3 22 | { 23 | public: 24 | Vector3() : x(T(0)), y(T(0)), z(T(0)) {} 25 | Vector3(T xx) : x(xx), y(xx), z(xx) {} 26 | Vector3(T xx, T yy, T zz) : x(xx), y(yy), z(zz) {} 27 | 28 | // const operators 29 | Vector3 operator + (const Vector3 &v) const 30 | { 31 | return Vector3(x + v.x, y + v.y, z + v.z); 32 | } 33 | Vector3 operator - (const Vector3 &v) const 34 | { 35 | return Vector3(x - v.x, y - v.y, z - v.z); 36 | } 37 | Vector3 operator - () const 38 | { 39 | return Vector3(-x, -y, -z); 40 | } 41 | Vector3 operator * (const T &r) const 42 | { 43 | return Vector3(x * r, y * r, z * r); 44 | } 45 | Vector3 operator * (const Vector3 &v) const 46 | { 47 | return Vector3(x * v.x, y * v.y, z * v.z); 48 | } 49 | T dotProduct(const Vector3 &v) const 50 | { 51 | return x * v.x + y * v.y + z * v.z; 52 | } 53 | Vector3 operator / (const T &r) const 54 | { 55 | return Vector3(x / r, y / r, z / r); 56 | } 57 | 58 | Vector3& operator /= (const T &r) 59 | { 60 | x /= r, y /= r, z /= r; return *this; 61 | } 62 | Vector3& operator *= (const T &r) 63 | { 64 | x *= r, y *= r, z *= r; return *this; 65 | } 66 | Vector3& operator += (const Vector3 &v) 67 | { 68 | x += v.x, y += v.y, z += v.z; return *this; 69 | } 70 | 71 | Vector3 crossProduct(const Vector3 &v) const 72 | { 73 | return Vector3(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x); 74 | } 75 | T norm() const 76 | { 77 | return x * x + y * y + z * z; 78 | } 79 | T length() const 80 | { 81 | return sqrt(norm()); 82 | } 83 | 84 | 85 | const T& operator [] (uint8_t i) const { return (&x)[i]; } 86 | T& operator [] (uint8_t i) { return (&x)[i]; } 87 | Vector3& normalize() 88 | { 89 | T n = norm(); 90 | if (n > 0) { 91 | T factor = 1 / sqrt(n); 92 | x *= factor, y *= factor, z *= factor; 93 | } 94 | 95 | return *this; 96 | } 97 | 98 | friend Vector3 operator * (const T &r, const Vector3 &v) 99 | { 100 | return Vector3(v.x * r, v.y * r, v.z * r); 101 | } 102 | friend Vector3 operator / (const T &r, const Vector3 &v) 103 | { 104 | return Vector3(r / v.x, r / v.y, r / v.z); 105 | } 106 | 107 | friend std::ostream& operator << (std::ostream &s, const Vector3 &v) 108 | { 109 | return s << '[' << v.x << ' ' << v.y << ' ' << v.z << ']'; 110 | } 111 | 112 | T x, y, z; 113 | }; 114 | 115 | typedef Vector3 Vector3f; 116 | typedef Vector3 Vector3i; 117 | 118 | #endif 119 | -------------------------------------------------------------------------------- /src/Main.cpp: -------------------------------------------------------------------------------- 1 | #include "Renderer.h" 2 | 3 | int main() 4 | { 5 | Renderer render; 6 | 7 | // Options 8 | render.Width = 1080; 9 | render.Height = 1080; 10 | render.Colorspace = ACEScg; 11 | render.SunSize = 0.27f; 12 | render.Turbidity = 4.0f; 13 | render.SunTint = Vector3f(1); 14 | render.SkyTint = Vector3f(1); 15 | render.GroundAlbedo = Vector3f(0.18); 16 | render.SunColor = Vector3f(20000); 17 | render.bEnableSun = 1; 18 | render.Samples = 128; 19 | 20 | std::cout<<">>> Rendering Colorspaces, 0 - XYZ, 1 - sRGB, 2 - ACEScg, 3 = ACES 2065-1 "<>> Rendering with colorspace : "<>> Rendering Hosek-Wilkie Sky Model image %d. Angle = %0.2f\n", i, angle * 180.0f / M_PI); 28 | 29 | render.RenderSkyDome(Vector3f(0, cos(angle), -sin(angle)), 30 | filename, 31 | render.Width, 32 | render.Height, 33 | render.SunSize, 34 | render.SunColor, 35 | render.GroundAlbedo, 36 | render.Turbidity, 37 | render.SkyTint, 38 | render.SunTint, 39 | render.bEnableSun, 40 | render.Colorspace); 41 | 42 | } 43 | 44 | return EXIT_SUCCESS; 45 | } -------------------------------------------------------------------------------- /src/Renderer.cpp: -------------------------------------------------------------------------------- 1 | #include "Renderer.h" 2 | 3 | #define TINYEXR_IMPLEMENTATION 4 | #include "tinyexr.h" 5 | 6 | void Renderer::RenderSkyDome(Vector3f sunDir, const char *filename, unsigned width, unsigned height, float sunSize, Vector3f sunColor, Vector3f groundAlbedo, float turbidity, Vector3f skyTint, Vector3f sunTint, bool bEnableSun, ColorSpace colorspace) 7 | { 8 | SkyModel sky; 9 | sky.SetupSky(sunDir, 10 | sunSize, 11 | sunColor, 12 | groundAlbedo, 13 | turbidity, 14 | colorspace); 15 | 16 | #if 1 17 | Vector3f *image = new Vector3f[width * height], *p = image; 18 | memset(image, 0x0, sizeof(Vector3f) * width * height); 19 | for (unsigned j = 0; j < height; ++j) { 20 | float y = 2.0f * (j + 0.5f) / float(height - 1) - 1.0f; 21 | for (unsigned i = 0; i < width; ++i, ++p) { 22 | float x = 2.0f * (i + 0.5f) / float(width - 1) - 1.0f; 23 | float z2 = x * x + y * y; 24 | if (z2 <= 1) { 25 | float phi = std::atan2(y, x); 26 | float theta = std::acos(1 - z2); 27 | Vector3f dir(sin(theta) * cos(phi), cos(theta), sin(theta) * sin(phi)); 28 | // 1 meter above sea level 29 | *p = sky.Sample(dir, bEnableSun, skyTint, sunTint); 30 | } 31 | } 32 | } 33 | #endif 34 | // EXR 35 | EXRHeader header; 36 | InitEXRHeader(&header); 37 | EXRImage img; 38 | InitEXRImage(&img); 39 | img.num_channels = 3; 40 | std::vector images[3]; 41 | images[0].resize(width * height); 42 | images[1].resize(width * height); 43 | images[2].resize(width * height); 44 | // EXR 45 | 46 | p = image; 47 | int a = 0; 48 | for (unsigned j = 0; j < height; ++j) { 49 | for (unsigned i = 0; i < width; ++i, ++p) { 50 | 51 | // EXR 52 | images[0][a] = (*p)[0]; 53 | images[1][a] = (*p)[1]; 54 | images[2][a] = (*p)[2]; 55 | // EXR 56 | a += 1; 57 | 58 | } 59 | } 60 | 61 | // EXR 62 | float *image_ptr[3]; 63 | image_ptr[0] = &(images[2].at(0)); // B 64 | image_ptr[1] = &(images[1].at(0)); // G 65 | image_ptr[2] = &(images[0].at(0)); // R 66 | 67 | img.images = (unsigned char**)image_ptr; 68 | img.width = width; 69 | img.height = height; 70 | 71 | header.num_channels = 3; 72 | header.channels = (EXRChannelInfo *)malloc(sizeof(EXRChannelInfo) * header.num_channels); 73 | // Must be (A)BGR order, since most of EXR viewers expect this channel order. 74 | strncpy(header.channels[0].name, "B", 255); header.channels[0].name[strlen("B")] = '\0'; 75 | strncpy(header.channels[1].name, "G", 255); header.channels[1].name[strlen("G")] = '\0'; 76 | strncpy(header.channels[2].name, "R", 255); header.channels[2].name[strlen("R")] = '\0'; 77 | 78 | header.pixel_types = (int *)malloc(sizeof(int) * header.num_channels); 79 | header.requested_pixel_types = (int *)malloc(sizeof(int) * header.num_channels); 80 | for (int i = 0; i < header.num_channels; ++i) { 81 | header.pixel_types[i] = TINYEXR_PIXELTYPE_FLOAT; // pixel type of the input 82 | header.requested_pixel_types[i] = TINYEXR_PIXELTYPE_HALF; // Pixel type of output image to be stored in .exr 83 | } 84 | 85 | const char *err = nullptr; 86 | int ret = SaveEXRImageToFile(&img, &header, filename, &err); 87 | if (ret != TINYEXR_SUCCESS) { 88 | fprintf(stderr, "EXR SAVE ERRROR: %s\n", err); 89 | FreeEXRErrorMessage(err); // Frees buffer for an error message 90 | std::cout << ret << std::endl; 91 | } 92 | 93 | free(header.channels); 94 | free(header.pixel_types); 95 | free(header.requested_pixel_types); 96 | // EXR 97 | } -------------------------------------------------------------------------------- /src/Renderer.h: -------------------------------------------------------------------------------- 1 | #ifndef RENDERER_H 2 | #define RENDERER_H 3 | 4 | #include "SkyModel.h" 5 | 6 | struct Renderer { 7 | 8 | ~Renderer() {}; 9 | 10 | unsigned Width, Height, Samples; 11 | float SunSize; 12 | Vector3f SunColor; 13 | Vector3f GroundAlbedo; 14 | float Turbidity; 15 | Vector3f SkyTint; 16 | Vector3f SunTint; 17 | bool bEnableSun; 18 | ColorSpace Colorspace; 19 | 20 | void RenderSkyDome(Vector3f sunDir, const char *filename, unsigned width, unsigned height, float sunSize, Vector3f sunColor, Vector3f groundAlbedo, float turbidity, Vector3f skyTint, Vector3f sunTint, bool bEnableSun, ColorSpace colorspace); 21 | }; 22 | 23 | #endif -------------------------------------------------------------------------------- /src/ShaderUtils.h: -------------------------------------------------------------------------------- 1 | #ifndef SHADERUTILS_H 2 | #define SHADERUTILS_H 3 | 4 | #include "Geometry.h" 5 | #include 6 | 7 | enum ColorSpace { XYZ, sRGB, ACEScg, ACES2065_1 }; 8 | 9 | // Scale factor used for storing physical light units in fp16 floats (equal to 2^-10) 10 | static const float FP16Scale = 0.0009765625f; 11 | static const float FP16Max = 65000.0f; 12 | 13 | // Useful shader functions 14 | inline float Deg2Rad(float deg) { return deg * (1.0f / 180.0f) * M_PI; } 15 | inline float Rad2Deg(float rad) { return rad * (1.0f / M_PI) * 180.0f; } 16 | inline float Clamp(float val, float min, float max) { assert(max >= min); val = val < min ? min : val > max ? max : val; return val; } 17 | inline static float AngleBetween(const Vector3f &dir0, const Vector3f &dir1) { return std::acos(std::max(dir0.dotProduct(dir1), 0.00001f)); } 18 | inline float Mix(float x, float y, float s) { return x + (y - x) * s; } 19 | 20 | inline Vector3f XYZ_to_ACES2065_1(Vector3f color) 21 | { 22 | Vector3f out = Vector3f(0); 23 | out.x = color.x * 1.0498110175f + color.y * 0.0000000000f + color.z * -0.0000974845f; 24 | out.y = color.x * -0.4959030231f + color.y * 1.3733130458f + color.z * 0.0982400361f; 25 | out.z = color.x * 0.0000000000f + color.y * 0.0000000000f + color.z * 0.9912520182f; 26 | 27 | return out; 28 | } 29 | 30 | inline Vector3f ACES2065_1_to_ACEScg(Vector3f color) 31 | { 32 | Vector3f out = Vector3f(0); 33 | out.x = color.x * 1.4514393161f + color.y * -0.2365107469f + color.z * -0.2149285693f; 34 | out.y = color.x * -0.0765537733f + color.y * 1.1762296998f + color.z * -0.0996759265f; 35 | out.z = color.x * 0.0083161484f + color.y * -0.0060324498f + color.z * 0.9977163014f; 36 | 37 | return out; 38 | } 39 | 40 | inline Vector3f ACES2065_1_to_sRGB(Vector3f color) 41 | { 42 | Vector3f out = Vector3f(0); 43 | out.x = color.x * 2.5216494298f + color.y * -1.1368885542f + color.z * -0.3849175932f; 44 | out.y = color.x * -0.2752135512f + color.y * 1.3697051510f + color.z * -0.0943924508f; 45 | out.z = color.x * -0.0159250101f + color.y * -0.1478063681f + color.z * 1.1638058159f; 46 | 47 | return out; 48 | 49 | } 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/SkyModel.cpp: -------------------------------------------------------------------------------- 1 | #include "ShaderUtils.h" 2 | #include "SkyModel.h" 3 | #include "../HosekSky/ArHosekSkyModel.h" 4 | #include 5 | #include 6 | 7 | // Actual physical size of the sun, expressed as an angular radius in radians 8 | static const float PhysicalSunSize = Deg2Rad(0.27f); 9 | static const float CosPhysicalSunSize = std::cos(PhysicalSunSize); 10 | 11 | void SkyModel::SetupSky(const Vector3f &_sunDir, float _sunSize, Vector3f _sunRenderColor, const Vector3f _groundAlbedo, float _turbidity, ColorSpace _colorspace) 12 | { 13 | Vector3f sunDir = _sunDir; 14 | Vector3f groundAlbedo = _groundAlbedo; 15 | sunDir.y = Clamp(sunDir.y, 0.0, 1.0); 16 | sunDir = sunDir.normalize(); 17 | _turbidity = Clamp(_turbidity, 1.0f, 32.0f); 18 | groundAlbedo = Vector3f(Clamp(groundAlbedo.x, 0.0, 1.0), Clamp(groundAlbedo.y, 0.0, 1.0), Clamp(groundAlbedo.z, 0.0, 1.0)); 19 | _sunSize = std::max(_sunSize, 0.01f); 20 | 21 | Colorspace = _colorspace; 22 | 23 | Shutdown(); 24 | 25 | float thetaS = AngleBetween(sunDir, Vector3f(0, 1, 0)); 26 | float elevation = M_PI_2 - thetaS; 27 | StateX = arhosek_xyz_skymodelstate_alloc_init(_turbidity, groundAlbedo.x, elevation); 28 | StateY = arhosek_xyz_skymodelstate_alloc_init(_turbidity, groundAlbedo.y, elevation); 29 | StateZ = arhosek_xyz_skymodelstate_alloc_init(_turbidity, groundAlbedo.z, elevation); 30 | 31 | Albedo = groundAlbedo; 32 | Elevation = elevation; 33 | SunDir = sunDir; 34 | Turbidity = _turbidity; 35 | SunSize = std::cos(Deg2Rad(_sunSize)); 36 | SunRenderColor = _sunRenderColor; 37 | 38 | } 39 | 40 | void SkyModel::Shutdown() 41 | { 42 | if (StateX != nullptr) 43 | { 44 | arhosekskymodelstate_free(StateX); 45 | StateX = nullptr; 46 | } 47 | 48 | if (StateY != nullptr) 49 | { 50 | arhosekskymodelstate_free(StateY); 51 | StateY = nullptr; 52 | } 53 | 54 | if (StateZ != nullptr) 55 | { 56 | arhosekskymodelstate_free(StateZ); 57 | StateZ = nullptr; 58 | } 59 | 60 | } 61 | 62 | Vector3f SkyModel::Sample(Vector3f _sampleDir, bool _bEnableSun, Vector3f _skyTint, Vector3f _sunTint) const 63 | { 64 | assert(StateX != nullptr); 65 | 66 | float gamma = AngleBetween(_sampleDir, SunDir); 67 | float theta = AngleBetween(_sampleDir, Vector3f(0, 1, 0)); 68 | 69 | Vector3f radiance; 70 | 71 | radiance.x = float(arhosek_tristim_skymodel_radiance(StateX, theta, gamma, 0)); 72 | radiance.y = float(arhosek_tristim_skymodel_radiance(StateY, theta, gamma, 1)); 73 | radiance.z = float(arhosek_tristim_skymodel_radiance(StateZ, theta, gamma, 2)); 74 | 75 | // If raw XYZ values are required 76 | if (Colorspace == XYZ) 77 | return radiance; 78 | 79 | // Move to workable RGB color space 80 | radiance = XYZ_to_ACES2065_1(radiance); 81 | 82 | radiance.x *= _skyTint.x; 83 | radiance.y *= _skyTint.y; 84 | radiance.z *= _skyTint.z; 85 | 86 | 87 | if (_bEnableSun) { 88 | float cosGamma = _sampleDir.dotProduct(SunDir); 89 | if (cosGamma >= SunSize) 90 | radiance += SunRenderColor * _sunTint; 91 | } 92 | 93 | 94 | // Multiply by standard luminous effiacy of 683 lm/W to bring us in line with photometric units used during rendering 95 | //radiance *= 683.0f 96 | 97 | // Color space conversion. Default is ACES2065-1 98 | if (Colorspace == sRGB) 99 | radiance = ACES2065_1_to_sRGB(radiance); 100 | 101 | if (Colorspace == ACEScg) 102 | radiance = ACES2065_1_to_ACEScg(radiance); 103 | 104 | radiance *= 50.0f; 105 | 106 | return radiance * FP16Scale; 107 | } 108 | 109 | -------------------------------------------------------------------------------- /src/SkyModel.h: -------------------------------------------------------------------------------- 1 | #ifndef SKYMODEL_H 2 | #define SKYMODEL_H 3 | 4 | #include "ShaderUtils.h" 5 | 6 | // Hosek Sky Model forward declare 7 | struct ArHosekSkyModelState; 8 | 9 | struct SkyModel 10 | { 11 | 12 | ArHosekSkyModelState *StateX = nullptr; 13 | ArHosekSkyModelState *StateY = nullptr; 14 | ArHosekSkyModelState *StateZ = nullptr; 15 | 16 | Vector3f SunDir; 17 | Vector3f SunRadiance; 18 | Vector3f SunIrradiance; 19 | Vector3f SunRenderColor; 20 | float SunSize = 0.0f; 21 | float Turbidity = 0.0f; 22 | Vector3f Albedo; 23 | float Elevation = 0.0f; 24 | ColorSpace Colorspace; 25 | 26 | void Shutdown(); 27 | ~SkyModel() {}; 28 | void SetupSky(const Vector3f &_sunDir, float _sunSize, Vector3f _sunRenderColor, const Vector3f _groundAlbedo, float _turbidity, ColorSpace _colorspace); 29 | bool Initialized() const { return StateX != nullptr; } 30 | Vector3f Sample(Vector3f _sampleDir, bool _bEnableSun, Vector3f _skyTint, Vector3f _sunTint) const; 31 | }; 32 | 33 | #endif 34 | --------------------------------------------------------------------------------