#include <sky.h>
Public Member Functions | |
Sky (s32 id, ITextureSource *tsrc, IShaderSource *ssrc) | |
constructor More... | |
virtual void | OnRegisterSceneNode () |
virtual void | render () |
renders the node. More... | |
virtual const aabb3f & | getBoundingBox () const |
virtual video::SMaterial & | getMaterial (u32 i) |
virtual u32 | getMaterialCount () const |
void | update (float m_time_of_day, float time_brightness, float direct_brightness, bool sunlight_seen, CameraMode cam_mode, float yaw, float pitch) |
float | getBrightness () |
const video::SColor & | getBgColor () const |
const video::SColor & | getSkyColor () const |
void | setSunVisible (bool sun_visible) |
void | setSunTexture (std::string sun_texture, std::string sun_tonemap, ITextureSource *tsrc) |
void | setSunScale (f32 sun_scale) |
void | setSunriseVisible (bool glow_visible) |
void | setSunriseTexture (std::string sunglow_texture, ITextureSource *tsrc) |
void | setMoonVisible (bool moon_visible) |
void | setMoonTexture (std::string moon_texture, std::string moon_tonemap, ITextureSource *tsrc) |
void | setMoonScale (f32 moon_scale) |
void | setStarsVisible (bool stars_visible) |
void | setStarCount (u16 star_count, bool force_update) |
void | setStarColor (video::SColor star_color) |
void | setStarScale (f32 star_scale) |
bool | getCloudsVisible () const |
const video::SColorf & | getCloudColor () const |
void | setVisible (bool visible) |
void | setCloudsEnabled (bool clouds_enabled) |
void | setFallbackBgColor (const video::SColor &fallback_bg_color) |
void | overrideColors (const video::SColor &bgcolor, const video::SColor &skycolor) |
void | setSkyColors (const SkyColor &sky_color) |
void | setHorizonTint (video::SColor sun_tint, video::SColor moon_tint, std::string use_sun_tint) |
void | setInClouds (bool clouds) |
void | clearSkyboxTextures () |
void | addTextureToSkybox (std::string texture, int material_id, ITextureSource *tsrc) |
const video::SColorf & | getCurrentStarColor () const |
Private Member Functions | |
float | m_horizon_blend () |
video::SColor | m_mix_scolor (video::SColor col1, video::SColor col2, f32 factor) |
video::SColorf | m_mix_scolorf (video::SColorf col1, video::SColorf col2, f32 factor) |
void | updateStars () |
void | draw_sun (video::IVideoDriver *driver, float sunsize, const video::SColor &suncolor, const video::SColor &suncolor2, float wicked_time_of_day) |
void | draw_moon (video::IVideoDriver *driver, float moonsize, const video::SColor &mooncolor, const video::SColor &mooncolor2, float wicked_time_of_day) |
void | draw_sky_body (std::array< video::S3DVertex, 4 > &vertices, float pos_1, float pos_2, const video::SColor &c) |
void | draw_stars (video::IVideoDriver *driver, float wicked_time_of_day) |
void | place_sky_body (std::array< video::S3DVertex, 4 > &vertices, float horizon_position, float day_position) |
void | setSkyDefaults () |
Private Attributes | |
aabb3f | m_box |
video::SMaterial | m_materials [SKY_MATERIAL_COUNT] |
bool | m_visible = true |
video::SColor | m_fallback_bg_color = video::SColor(255, 255, 255, 255) |
bool | m_first_update = true |
float | m_time_of_day |
float | m_time_brightness |
bool | m_sunlight_seen |
float | m_brightness = 0.5f |
float | m_cloud_brightness = 0.5f |
bool | m_clouds_visible |
bool | m_clouds_enabled = true |
bool | m_directional_colored_fog |
bool | m_in_clouds = true |
bool | m_enable_shaders = false |
video::SColorf | m_bgcolor_bright_f = video::SColorf(1.0f, 1.0f, 1.0f, 1.0f) |
video::SColorf | m_skycolor_bright_f = video::SColorf(1.0f, 1.0f, 1.0f, 1.0f) |
video::SColorf | m_cloudcolor_bright_f = video::SColorf(1.0f, 1.0f, 1.0f, 1.0f) |
video::SColor | m_bgcolor |
video::SColor | m_skycolor |
video::SColorf | m_cloudcolor_f |
video::SColorf | m_cloudcolor_day_f = video::SColorf(1, 1, 1, 1) |
video::SColorf | m_cloudcolor_dawn_f |
SkyboxParams | m_sky_params |
SunParams | m_sun_params |
MoonParams | m_moon_params |
StarParams | m_star_params |
bool | m_default_tint = true |
u64 | m_seed = 0 |
irr_ptr< scene::SMeshBuffer > | m_stars |
video::SColorf | m_star_color |
video::ITexture * | m_sun_texture |
video::ITexture * | m_moon_texture |
video::ITexture * | m_sun_tonemap |
video::ITexture * | m_moon_tonemap |
Sky::Sky | ( | s32 | id, |
ITextureSource * | tsrc, | ||
IShaderSource * | ssrc | ||
) |
constructor
References baseMaterial(), g_settings, Settings::getBool(), IShaderSource::getShader(), IShaderSource::getShaderInfo(), ITextureSource::getTexture(), ITextureSource::getTextureForMesh(), ITextureSource::isKnownSourceImage(), m_box, m_directional_colored_fog, m_enable_shaders, m_materials, m_moon_params, m_moon_texture, m_moon_tonemap, m_sun_params, m_sun_texture, m_sun_tonemap, ShaderInfo::material, setSkyDefaults(), setStarCount(), SunParams::texture, MoonParams::texture, TILE_MATERIAL_ALPHA, SunParams::tonemap, and MoonParams::tonemap.
void Sky::addTextureToSkybox | ( | std::string | texture, |
int | material_id, | ||
ITextureSource * | tsrc | ||
) |
References baseMaterial(), ITextureSource::getTextureForMesh(), m_materials, m_sky_params, SKY_MATERIAL_COUNT, and SkyboxParams::textures.
Referenced by Game::handleClientEvent_SetSky().
|
inline |
References m_sky_params, and SkyboxParams::textures.
Referenced by Game::handleClientEvent_SetSky().
|
private |
References draw_sky_body(), m_materials, m_moon_params, m_moon_texture, m_moon_tonemap, place_sky_body(), and MoonParams::scale.
Referenced by render().
|
private |
|
private |
References irr_ptr< ReferenceCounted, class >::get(), m_materials, m_star_color, m_star_params, m_stars, and StarParams::starcolor.
Referenced by render().
|
private |
References draw_sky_body(), m_materials, m_sun_params, m_sun_texture, m_sun_tonemap, place_sky_body(), and SunParams::scale.
Referenced by render().
|
inline |
References m_bgcolor, m_fallback_bg_color, and m_visible.
Referenced by GameGlobalShaderConstantSetter::onSetConstants(), and Game::updateFrame().
|
inline |
References m_brightness.
Referenced by Game::updateFrame().
|
inline |
References m_cloudcolor_f.
Referenced by Game::updateFrame().
|
inline |
References m_clouds_enabled, and m_clouds_visible.
Referenced by Game::updateFrame().
|
inline |
References m_star_color.
Referenced by GameGlobalShaderConstantSetter::onSetConstants().
|
inlinevirtual |
References m_materials.
|
inlinevirtual |
References SKY_MATERIAL_COUNT.
|
inline |
References m_fallback_bg_color, m_skycolor, and m_visible.
Referenced by Game::updateFrame().
|
inlineprivate |
References m_sunlight_seen, and m_time_of_day.
Referenced by update().
|
inlineprivate |
|
inlineprivate |
|
virtual |
|
inline |
References m_bgcolor, and m_skycolor.
Referenced by Game::updateFrame().
|
private |
|
virtual |
renders the node.
References draw_moon(), draw_stars(), draw_sun(), easeCurve(), g_profiler, m_bgcolor, m_brightness, m_in_clouds, m_materials, m_moon_params, m_moon_tonemap, m_sky_params, m_skycolor, m_star_params, m_sun_params, m_sun_tonemap, m_sunlight_seen, m_time_brightness, m_time_of_day, m_visible, MYMAX, MYMIN, SPT_AVG, SunParams::sunrise_visible, SkyboxParams::textures, SunParams::visible, MoonParams::visible, and StarParams::visible.
|
inline |
References m_clouds_enabled.
Referenced by Game::handleClientEvent_SetSky().
|
inline |
References m_fallback_bg_color.
Referenced by Game::handleClientEvent_SetSky().
void Sky::setHorizonTint | ( | video::SColor | sun_tint, |
video::SColor | moon_tint, | ||
std::string | use_sun_tint | ||
) |
References SkyboxParams::fog_moon_tint, SkyboxParams::fog_sun_tint, m_default_tint, and m_sky_params.
Referenced by Game::handleClientEvent_SetSky().
|
inline |
References m_in_clouds.
Referenced by Game::updateFrame().
|
inline |
References m_moon_params, and MoonParams::scale.
Referenced by Game::handleClientEvent_SetMoon().
void Sky::setMoonTexture | ( | std::string | moon_texture, |
std::string | moon_tonemap, | ||
ITextureSource * | tsrc | ||
) |
References baseMaterial(), ITextureSource::getTexture(), ITextureSource::getTextureForMesh(), ITextureSource::isKnownSourceImage(), m_materials, m_moon_params, m_moon_texture, m_moon_tonemap, MoonParams::texture, and MoonParams::tonemap.
Referenced by Game::handleClientEvent_SetMoon().
|
inline |
References m_moon_params, and MoonParams::visible.
Referenced by Game::handleClientEvent_SetMoon().
void Sky::setSkyColors | ( | const SkyColor & | sky_color | ) |
References m_sky_params, and SkyboxParams::sky_color.
Referenced by Game::handleClientEvent_SetSky().
|
private |
References SkyboxDefaults::getMoonDefaults(), SkyboxDefaults::getSkyColorDefaults(), SkyboxDefaults::getStarDefaults(), SkyboxDefaults::getSunDefaults(), m_moon_params, m_sky_params, m_star_params, m_sun_params, and SkyboxParams::sky_color.
Referenced by Sky().
|
inline |
References m_star_params, and StarParams::starcolor.
Referenced by Game::handleClientEvent_SetStars().
void Sky::setStarCount | ( | u16 | star_count, |
bool | force_update | ||
) |
References StarParams::count, m_seed, m_star_params, myrand(), and updateStars().
Referenced by Sky(), and Game::handleClientEvent_SetStars().
|
inline |
References m_star_params, StarParams::scale, and updateStars().
Referenced by Game::handleClientEvent_SetStars().
|
inline |
References m_star_params, and StarParams::visible.
Referenced by Game::handleClientEvent_SetStars().
void Sky::setSunriseTexture | ( | std::string | sunglow_texture, |
ITextureSource * | tsrc | ||
) |
References ITextureSource::getTextureForMesh(), m_materials, m_sun_params, and SunParams::sunrise.
Referenced by Game::handleClientEvent_SetSun().
|
inline |
References m_sun_params, and SunParams::sunrise_visible.
Referenced by Game::handleClientEvent_SetSun().
|
inline |
References m_sun_params, and SunParams::scale.
Referenced by Game::handleClientEvent_SetSun().
void Sky::setSunTexture | ( | std::string | sun_texture, |
std::string | sun_tonemap, | ||
ITextureSource * | tsrc | ||
) |
References baseMaterial(), ITextureSource::getTexture(), ITextureSource::getTextureForMesh(), ITextureSource::isKnownSourceImage(), m_materials, m_sun_params, m_sun_texture, m_sun_tonemap, SunParams::texture, and SunParams::tonemap.
Referenced by Game::handleClientEvent_SetSun().
|
inline |
References m_sun_params, and SunParams::visible.
Referenced by Game::handleClientEvent_SetSun().
|
inline |
References m_visible.
Referenced by Game::handleClientEvent_SetSky().
void Sky::update | ( | float | m_time_of_day, |
float | time_brightness, | ||
float | direct_brightness, | ||
bool | sunlight_seen, | ||
CameraMode | cam_mode, | ||
float | yaw, | ||
float | pitch | ||
) |
References CAMERA_MODE_THIRD, SkyColor::dawn_horizon, SkyColor::dawn_sky, SkyColor::day_horizon, SkyColor::day_sky, SkyboxParams::fog_moon_tint, SkyboxParams::fog_sun_tint, SkyColor::indoors, m_bgcolor, m_bgcolor_bright_f, m_brightness, m_cloud_brightness, m_cloudcolor_bright_f, m_cloudcolor_dawn_f, m_cloudcolor_day_f, m_cloudcolor_f, m_clouds_visible, m_default_tint, m_directional_colored_fog, m_first_update, m_horizon_blend(), m_in_clouds, m_materials, m_mix_scolor(), m_mix_scolorf(), m_moon_tonemap, m_sky_params, m_skycolor, m_skycolor_bright_f, m_sun_tonemap, m_sunlight_seen, m_time_brightness, m_time_of_day, MYMIN, SkyColor::night_horizon, SkyColor::night_sky, rangelim, SkyboxParams::sky_color, and wrapDegrees_0_360().
Referenced by Game::updateFrame().
|
private |
References StarParams::count, m_seed, m_star_params, m_stars, p(), PcgRandom::range(), irr_ptr< ReferenceCounted, class >::reset(), StarParams::scale, StarParams::starcolor, and warningstream.
Referenced by setStarCount(), and setStarScale().
|
private |
Referenced by getBgColor(), overrideColors(), render(), and update().
|
private |
Referenced by update().
|
private |
Referenced by Sky(), and getBoundingBox().
|
private |
Referenced by getBrightness(), render(), and update().
|
private |
Referenced by update().
|
private |
Referenced by update().
|
private |
Referenced by update().
|
private |
Referenced by update().
|
private |
Referenced by getCloudColor(), and update().
|
private |
Referenced by getCloudsVisible(), and setCloudsEnabled().
|
private |
Referenced by getCloudsVisible(), and update().
|
private |
Referenced by setHorizonTint(), and update().
|
private |
Referenced by Sky().
|
private |
Referenced by getBgColor(), getSkyColor(), and setFallbackBgColor().
|
private |
Referenced by update().
|
private |
Referenced by render(), setInClouds(), and update().
|
private |
Referenced by Sky(), addTextureToSkybox(), draw_moon(), draw_stars(), draw_sun(), getMaterial(), render(), setMoonTexture(), setSunriseTexture(), setSunTexture(), and update().
|
private |
Referenced by Sky(), draw_moon(), render(), setMoonScale(), setMoonTexture(), setMoonVisible(), and setSkyDefaults().
|
private |
Referenced by Sky(), draw_moon(), and setMoonTexture().
|
private |
Referenced by Sky(), draw_moon(), render(), setMoonTexture(), and update().
|
private |
Referenced by setStarCount(), and updateStars().
|
private |
Referenced by addTextureToSkybox(), clearSkyboxTextures(), render(), setHorizonTint(), setSkyColors(), setSkyDefaults(), and update().
|
private |
Referenced by getSkyColor(), overrideColors(), render(), and update().
|
private |
Referenced by update().
|
private |
Referenced by draw_stars(), and getCurrentStarColor().
|
private |
Referenced by draw_stars(), render(), setSkyDefaults(), setStarColor(), setStarCount(), setStarScale(), setStarsVisible(), and updateStars().
|
private |
Referenced by draw_stars(), and updateStars().
|
private |
Referenced by Sky(), draw_sun(), render(), setSkyDefaults(), setSunriseTexture(), setSunriseVisible(), setSunScale(), setSunTexture(), and setSunVisible().
|
private |
Referenced by Sky(), draw_sun(), and setSunTexture().
|
private |
Referenced by Sky(), draw_sun(), render(), setSunTexture(), and update().
|
private |
Referenced by m_horizon_blend(), render(), and update().
|
private |
Referenced by m_horizon_blend(), render(), and update().
|
private |
Referenced by getBgColor(), getSkyColor(), render(), and setVisible().