From 76d1aa61fc5d13b9ea5a75fa0684e2d52efed976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marcos=20Mororo=20Costa?= <43460229+mororo250@users.noreply.github.com> Date: Mon, 31 Aug 2020 12:45:26 -0300 Subject: [PATCH] Fix Travis --- .../renderer/modeling/light/HosekSun.cpp | 21 ++-- .../renderer/modeling/light/PreethamSun.cpp | 114 +++++++++--------- 2 files changed, 70 insertions(+), 65 deletions(-) diff --git a/src/appleseed/renderer/modeling/light/HosekSun.cpp b/src/appleseed/renderer/modeling/light/HosekSun.cpp index f726b19f2b..238b1e9e78 100644 --- a/src/appleseed/renderer/modeling/light/HosekSun.cpp +++ b/src/appleseed/renderer/modeling/light/HosekSun.cpp @@ -57,9 +57,9 @@ #include // Forward declarations. -namespace foundation { class IAbortSwitch; } -namespace renderer { class Assembly; } -namespace renderer { class ShadingContext; } +namespace foundation { class IAbortSwitch; } +namespace renderer { class Assembly; } +namespace renderer { class ShadingContext; } using namespace foundation; @@ -72,9 +72,8 @@ namespace // Hosek & Wilkie model data. // - #include "renderer\modeling\light\ArHosekSkyModelData_Spectral.h" - - + #include "renderer/modeling/light/ArHosekSkyModelData_Spectral.h" + // // Hosek Sun light. // @@ -228,10 +227,12 @@ namespace void HosekSunLightFactory::release() { delete this; +} const char* HosekSunLightFactory::get_model() const { return Model; +} Dictionary HosekSunLightFactory::get_model_metadata() const { @@ -240,13 +241,17 @@ Dictionary HosekSunLightFactory::get_model_metadata() const .insert("name", Model) .insert("label", "Hosek Sun Light") .insert("help", "Hosek's Physically-based sun light"); +} DictionaryArray HosekSunLightFactory::get_input_metadata() const { - DictionaryArray metada + DictionaryArray metadata; + add_common_sun_input_metadata(metadata); - add_common_input_metadata(metadat + add_common_input_metadata(metadata); + return metadata; +} auto_release_ptr HosekSunLightFactory::create( const char* name, diff --git a/src/appleseed/renderer/modeling/light/PreethamSun.cpp b/src/appleseed/renderer/modeling/light/PreethamSun.cpp index 0c236dadb5..71cd529777 100644 --- a/src/appleseed/renderer/modeling/light/PreethamSun.cpp +++ b/src/appleseed/renderer/modeling/light/PreethamSun.cpp @@ -64,29 +64,29 @@ using namespace foundation; namespace renderer { - namespace - { - // - // Physically-based Sun light. - // - // References: - // - // http://www.cs.utah.edu/~shirley/papers/sunsky/sunsky.pdf - // http://ompf2.com/viewtopic.php?f=3&t=33 - // +namespace +{ + // + // Physically-based Sun light. + // + // References: + // + // http://www.cs.utah.edu/~shirley/papers/sunsky/sunsky.pdf + // http://ompf2.com/viewtopic.php?f=3&t=33 + // - const char* Model = "Preetham_sun_light"; + const char* Model = "Preetham_sun_light"; + + constexpr float SolidAngleSun = 6.807e-5f; - constexpr float SolidAngleSun = 6.807e-5f; - } class PreethamSunLight :public SunLight { public: PreethamSunLight( - const char* name, - const ParamArray& params) + const char* name, + const ParamArray& params) : SunLight(name, params) { } @@ -102,10 +102,10 @@ namespace renderer } bool on_frame_begin( - const Project& project, - const BaseGroup* parent, - OnFrameBeginRecorder& recorder, - IAbortSwitch* abort_switch) override + const Project& project, + const BaseGroup* parent, + OnFrameBeginRecorder& recorder, + IAbortSwitch* abort_switch) override { if (!SunLight::on_frame_begin(project, parent, recorder, abort_switch)) return false; @@ -115,16 +115,16 @@ namespace renderer return true; } - private: + private: RegularSpectrum31f m_k1; RegularSpectrum31f m_k2; void PreethamSunLight::compute_sun_radiance( - const Vector3d& outgoing, + const Vector3d& outgoing, const float turbidity, const float radiance_multiplier, - RegularSpectrum31f& radiance, + RegularSpectrum31f& radiance, const float squared_distance_to_center = 0.0f) const override { // Compute the relative optical mass. @@ -234,7 +234,7 @@ namespace renderer tau_a[i] * tau_o[i] * #ifdef COMPUTE_REDUNDANT - tau_g[i] * // always 1.0 + tau_g[i] * // always 1.0 #endif tau_wa[i] * limb_darkening * @@ -253,45 +253,45 @@ namespace renderer m_k2[i] = std::pow(g_light_wavelengths_um[i], -Alpha); } }; +} +// +// PreethamSunLightFactory class implementation. +// - // - // PreethamSunLightFactory class implementation. - // - - void PreethamSunLightFactory::release() - { - delete this; - } +void PreethamSunLightFactory::release() +{ + delete this; +} - const char* PreethamSunLightFactory::get_model() const - { - return Model; - } +const char* PreethamSunLightFactory::get_model() const +{ + return Model; +} - Dictionary PreethamSunLightFactory::get_model_metadata() const - { - return - Dictionary() - .insert("name", Model) - .insert("label", "Preetham sun Light") - .insert("help", "Preetham's Physically-based sun light"); - } - - DictionaryArray PreethamSunLightFactory::get_input_metadata() const - { - DictionaryArray metadata; +Dictionary PreethamSunLightFactory::get_model_metadata() const +{ + return + Dictionary() + .insert("name", Model) + .insert("label", "Preetham sun Light") + .insert("help", "Preetham's Physically-based sun light"); +} + +DictionaryArray PreethamSunLightFactory::get_input_metadata() const +{ + DictionaryArray metadata; - add_common_sun_input_metadata(metadata); - add_common_input_metadata(metadata); + add_common_sun_input_metadata(metadata); + add_common_input_metadata(metadata); - return metadata; - } + return metadata; +} - auto_release_ptr PreethamSunLightFactory::create( - const char* name, - const ParamArray& params) const - { - return auto_release_ptr(new PreethamSunLight(name, params)); - } +auto_release_ptr PreethamSunLightFactory::create( + const char* name, + const ParamArray& params) const +{ + return auto_release_ptr(new PreethamSunLight(name, params)); +} } // namespace renderer