Browse Source

Fix error in lux_to_vmag function

master
C. J. Howard 3 years ago
parent
commit
30225a84c0
2 changed files with 3 additions and 1 deletions
  1. +1
    -1
      src/astro/illuminance.cpp
  2. +2
    -0
      src/renderer/passes/sky-pass.cpp

+ 1
- 1
src/astro/illuminance.cpp View File

@ -30,7 +30,7 @@ double vmag_to_lux(double mv)
double lux_to_vmag(double ev)
{
return -14.18 - 2.5 * std::log(ev);
return -14.18 - 2.5 * std::log10(ev);
}
} // namespace astro

+ 2
- 0
src/renderer/passes/sky-pass.cpp View File

@ -126,6 +126,8 @@ sky_pass::sky_pass(gl::rasterizer* rasterizer, const gl::framebuffer* framebuffe
// Convert apparent magnitude to lux
double vmag_lux = astro::vmag_to_lux(vmag);
std::cout << "mag: " << vmag << "; lux: " << vmag_lux << "remag: " << (astro::lux_to_vmag(vmag_lux)) << std::endl;
// Normalized color luminance and scale by apparent magnitude
double3 scaled_color = color_acescg * ((1.0 / color_luminance) * vmag_lux);

Loading…
Cancel
Save