-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
383 additions
and
1,376 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/appleseed/renderer/modeling/environmentedf/skymodelenvironmentedf.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
#include "skymodelenvironmentedf.h" | ||
|
||
namespace renderer | ||
{ | ||
SkyModelEnvironmentEDF::SkyModelEnvironmentEDF( | ||
const char* name, | ||
const ParamArray& params) | ||
: EnvironmentEDF(name, params), | ||
m_sun_positioner("Sun Positioner", params) | ||
{ | ||
} | ||
|
||
bool SkyModelEnvironmentEDF::on_frame_begin(const Project& project, const BaseGroup* parent, OnFrameBeginRecorder& recorder, foundation::IAbortSwitch* abort_switch) | ||
{ | ||
if (!EnvironmentEDF::on_frame_begin(project, parent, recorder, abort_switch)) | ||
return false; | ||
|
||
if (!m_sun_positioner.on_frame_begin(project, parent, recorder, abort_switch)) | ||
return false; | ||
|
||
m_sun_positioner.compute_sun_position(); | ||
|
||
return true; | ||
} | ||
|
||
} // namespace renderer |
57 changes: 57 additions & 0 deletions
57
src/appleseed/renderer/modeling/environmentedf/skymodelenvironmentedf.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#pragma once | ||
|
||
// appleseed.renderer headers. | ||
#include "renderer/modeling/environmentedf/environmentedf.h" | ||
#include "renderer/utility/solarpositionalgorithm.h" | ||
|
||
namespace renderer | ||
{ | ||
|
||
// | ||
// An Environment EDF Interface Class For Differents Sky Models implementation. | ||
// | ||
|
||
class APPLESEED_DLLSYMBOL SkyModelEnvironmentEDF | ||
: public EnvironmentEDF | ||
{ | ||
public: | ||
|
||
// Constructor. | ||
SkyModelEnvironmentEDF( | ||
const char* name, | ||
const ParamArray& params); | ||
|
||
bool on_frame_begin( | ||
const Project& project, | ||
const BaseGroup* parent, | ||
OnFrameBeginRecorder& recorder, | ||
foundation::IAbortSwitch* abort_switch = nullptr) override; | ||
|
||
float get_sun_theta() const; | ||
|
||
float get_sun_phi() const; | ||
|
||
float get_shift() const; | ||
|
||
protected: | ||
|
||
SunPositioner m_sun_positioner; | ||
float m_horizon_shift; | ||
}; | ||
|
||
inline float SkyModelEnvironmentEDF::get_sun_theta() const | ||
{ | ||
return static_cast<float>(m_sun_positioner.m_output_value.zenith); | ||
} | ||
|
||
inline float SkyModelEnvironmentEDF::get_sun_phi() const | ||
{ | ||
return static_cast<float>(m_sun_positioner.m_output_value.azimuth); | ||
} | ||
|
||
inline float SkyModelEnvironmentEDF::get_shift() const | ||
{ | ||
return m_horizon_shift; | ||
} | ||
|
||
} // namespace renderer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.