Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
GameGlobalShaderConstantSetter Class Reference
+ Inheritance diagram for GameGlobalShaderConstantSetter:
+ Collaboration diagram for GameGlobalShaderConstantSetter:

Public Member Functions

void onSettingsChange (const std::string &name)
 
void setSky (Sky *sky)
 
 GameGlobalShaderConstantSetter (Sky *sky, Client *client)
 
 ~GameGlobalShaderConstantSetter ()
 
void onSetConstants (video::IMaterialRendererServices *services) override
 
void onSetMaterial (const video::SMaterial &material) override
 
- Public Member Functions inherited from IShaderConstantSetter
virtual ~IShaderConstantSetter ()=default
 

Static Public Member Functions

static void settingsCallback (const std::string &name, void *userdata)
 

Private Attributes

Skym_sky
 
Clientm_client
 
CachedVertexShaderSetting< float > m_animation_timer_vertex {"animationTimer"}
 
CachedPixelShaderSetting< float > m_animation_timer_pixel {"animationTimer"}
 
CachedVertexShaderSetting< float > m_animation_timer_delta_vertex {"animationTimerDelta"}
 
CachedPixelShaderSetting< float > m_animation_timer_delta_pixel {"animationTimerDelta"}
 
CachedPixelShaderSetting< float, 3 > m_day_light {"dayLight"}
 
CachedPixelShaderSetting< float, 3 > m_minimap_yaw {"yawVec"}
 
CachedPixelShaderSetting< float, 3 > m_camera_offset_pixel {"cameraOffset"}
 
CachedVertexShaderSetting< float, 3 > m_camera_offset_vertex {"cameraOffset"}
 
CachedPixelShaderSetting< float, 3 > m_camera_position_pixel { "cameraPosition" }
 
CachedVertexShaderSetting< float, 3 > m_camera_position_vertex { "cameraPosition" }
 
CachedPixelShaderSetting< SamplerLayer_tm_texture0 {"texture0"}
 
CachedPixelShaderSetting< SamplerLayer_tm_texture1 {"texture1"}
 
CachedPixelShaderSetting< SamplerLayer_tm_texture2 {"texture2"}
 
CachedPixelShaderSetting< SamplerLayer_tm_texture3 {"texture3"}
 
CachedVertexShaderSetting< float, 2 > m_texel_size0_vertex {"texelSize0"}
 
CachedPixelShaderSetting< float, 2 > m_texel_size0_pixel {"texelSize0"}
 
v2f m_texel_size0
 
CachedStructPixelShaderSetting< float, 7 > m_exposure_params_pixel
 
float m_user_exposure_compensation
 
bool m_bloom_enabled
 
CachedPixelShaderSetting< float > m_bloom_intensity_pixel {"bloomIntensity"}
 
CachedPixelShaderSetting< float > m_bloom_strength_pixel {"bloomStrength"}
 
CachedPixelShaderSetting< float > m_bloom_radius_pixel {"bloomRadius"}
 
CachedPixelShaderSetting< float > m_saturation_pixel {"saturation"}
 
bool m_volumetric_light_enabled
 
CachedPixelShaderSetting< float, 3 > m_sun_position_pixel {"sunPositionScreen"}
 
CachedPixelShaderSetting< float > m_sun_brightness_pixel {"sunBrightness"}
 
CachedPixelShaderSetting< float, 3 > m_moon_position_pixel {"moonPositionScreen"}
 
CachedPixelShaderSetting< float > m_moon_brightness_pixel {"moonBrightness"}
 
CachedPixelShaderSetting< float > m_volumetric_light_strength_pixel {"volumetricLightStrength"}
 

Static Private Attributes

static constexpr std::array< const char *, 1 > SETTING_CALLBACKS
 

Constructor & Destructor Documentation

◆ GameGlobalShaderConstantSetter()

GameGlobalShaderConstantSetter::GameGlobalShaderConstantSetter ( Sky * sky,
Client * client )
inline

References g_settings, Settings::getBool(), Settings::getFloat(), m_bloom_enabled, m_user_exposure_compensation, m_volumetric_light_enabled, Settings::registerChangedCallback(), SETTING_CALLBACKS, and settingsCallback().

+ Here is the call graph for this function:

◆ ~GameGlobalShaderConstantSetter()

GameGlobalShaderConstantSetter::~GameGlobalShaderConstantSetter ( )
inline

References Settings::deregisterAllChangedCallbacks(), and g_settings.

+ Here is the call graph for this function:

Member Function Documentation

◆ onSetConstants()

void GameGlobalShaderConstantSetter::onSetConstants ( video::IMaterialRendererServices * services)
inlineoverridevirtual

Implements IShaderConstantSetter.

References BS, AutoExposure::center_weight_power, AutoExposure::exposure_correction, get_sunlight_color(), Client::getCamera(), Camera::getCameraNode(), Environment::getDayNightRatio(), Client::getEnv(), ClientEnvironment::getFrameTime(), ClientEnvironment::getFrameTimeDelta(), LocalPlayer::getLighting(), ClientEnvironment::getLocalPlayer(), Client::getMinimap(), Sky::getMoonDirection(), Sky::getMoonVisible(), Camera::getOffset(), Camera::getPosition(), Sky::getSunDirection(), Sky::getSunVisible(), Minimap::getYawVec(), intToFloat(), AutoExposure::luminance_max, AutoExposure::luminance_min, m_animation_timer_delta_pixel, m_animation_timer_delta_vertex, m_animation_timer_pixel, m_animation_timer_vertex, m_bloom_enabled, m_bloom_intensity_pixel, m_bloom_radius_pixel, m_bloom_strength_pixel, m_camera_offset_pixel, m_camera_offset_vertex, m_camera_position_pixel, m_client, m_day_light, m_exposure_params_pixel, m_minimap_yaw, m_moon_brightness_pixel, m_moon_position_pixel, m_saturation_pixel, m_sky, m_sun_brightness_pixel, m_sun_position_pixel, m_texel_size0, m_texel_size0_pixel, m_texel_size0_vertex, m_texture0, m_texture1, m_texture2, m_texture3, m_user_exposure_compensation, m_volumetric_light_enabled, m_volumetric_light_strength_pixel, CachedShaderSetting< T, count, cache >::set(), AutoExposure::speed_bright_dark, and AutoExposure::speed_dark_bright.

+ Here is the call graph for this function:

◆ onSetMaterial()

void GameGlobalShaderConstantSetter::onSetMaterial ( const video::SMaterial & material)
inlineoverridevirtual

Reimplemented from IShaderConstantSetter.

References m_texel_size0.

◆ onSettingsChange()

void GameGlobalShaderConstantSetter::onSettingsChange ( const std::string & name)
inline

References g_settings, Settings::getFloat(), and m_user_exposure_compensation.

Referenced by settingsCallback().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSky()

void GameGlobalShaderConstantSetter::setSky ( Sky * sky)
inline

References m_sky.

◆ settingsCallback()

static void GameGlobalShaderConstantSetter::settingsCallback ( const std::string & name,
void * userdata )
inlinestatic

References onSettingsChange().

Referenced by GameGlobalShaderConstantSetter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_animation_timer_delta_pixel

CachedPixelShaderSetting<float> GameGlobalShaderConstantSetter::m_animation_timer_delta_pixel {"animationTimerDelta"}
private

Referenced by onSetConstants().

◆ m_animation_timer_delta_vertex

CachedVertexShaderSetting<float> GameGlobalShaderConstantSetter::m_animation_timer_delta_vertex {"animationTimerDelta"}
private

Referenced by onSetConstants().

◆ m_animation_timer_pixel

CachedPixelShaderSetting<float> GameGlobalShaderConstantSetter::m_animation_timer_pixel {"animationTimer"}
private

Referenced by onSetConstants().

◆ m_animation_timer_vertex

CachedVertexShaderSetting<float> GameGlobalShaderConstantSetter::m_animation_timer_vertex {"animationTimer"}
private

Referenced by onSetConstants().

◆ m_bloom_enabled

bool GameGlobalShaderConstantSetter::m_bloom_enabled
private

◆ m_bloom_intensity_pixel

CachedPixelShaderSetting<float> GameGlobalShaderConstantSetter::m_bloom_intensity_pixel {"bloomIntensity"}
private

Referenced by onSetConstants().

◆ m_bloom_radius_pixel

CachedPixelShaderSetting<float> GameGlobalShaderConstantSetter::m_bloom_radius_pixel {"bloomRadius"}
private

Referenced by onSetConstants().

◆ m_bloom_strength_pixel

CachedPixelShaderSetting<float> GameGlobalShaderConstantSetter::m_bloom_strength_pixel {"bloomStrength"}
private

Referenced by onSetConstants().

◆ m_camera_offset_pixel

CachedPixelShaderSetting<float, 3> GameGlobalShaderConstantSetter::m_camera_offset_pixel {"cameraOffset"}
private

Referenced by onSetConstants().

◆ m_camera_offset_vertex

CachedVertexShaderSetting<float, 3> GameGlobalShaderConstantSetter::m_camera_offset_vertex {"cameraOffset"}
private

Referenced by onSetConstants().

◆ m_camera_position_pixel

CachedPixelShaderSetting<float, 3> GameGlobalShaderConstantSetter::m_camera_position_pixel { "cameraPosition" }
private

Referenced by onSetConstants().

◆ m_camera_position_vertex

CachedVertexShaderSetting<float, 3> GameGlobalShaderConstantSetter::m_camera_position_vertex { "cameraPosition" }
private

◆ m_client

Client* GameGlobalShaderConstantSetter::m_client
private

Referenced by onSetConstants().

◆ m_day_light

CachedPixelShaderSetting<float, 3> GameGlobalShaderConstantSetter::m_day_light {"dayLight"}
private

Referenced by onSetConstants().

◆ m_exposure_params_pixel

CachedStructPixelShaderSetting<float, 7> GameGlobalShaderConstantSetter::m_exposure_params_pixel
private
Initial value:
{
"exposureParams",
std::array<const char*, 7> {
"luminanceMin", "luminanceMax", "exposureCorrection",
"speedDarkBright", "speedBrightDark", "centerWeightPower",
"compensationFactor"
}}

Referenced by onSetConstants().

◆ m_minimap_yaw

CachedPixelShaderSetting<float, 3> GameGlobalShaderConstantSetter::m_minimap_yaw {"yawVec"}
private

Referenced by onSetConstants().

◆ m_moon_brightness_pixel

CachedPixelShaderSetting<float> GameGlobalShaderConstantSetter::m_moon_brightness_pixel {"moonBrightness"}
private

Referenced by onSetConstants().

◆ m_moon_position_pixel

CachedPixelShaderSetting<float, 3> GameGlobalShaderConstantSetter::m_moon_position_pixel {"moonPositionScreen"}
private

Referenced by onSetConstants().

◆ m_saturation_pixel

CachedPixelShaderSetting<float> GameGlobalShaderConstantSetter::m_saturation_pixel {"saturation"}
private

Referenced by onSetConstants().

◆ m_sky

Sky* GameGlobalShaderConstantSetter::m_sky
private

Referenced by onSetConstants(), and setSky().

◆ m_sun_brightness_pixel

CachedPixelShaderSetting<float> GameGlobalShaderConstantSetter::m_sun_brightness_pixel {"sunBrightness"}
private

Referenced by onSetConstants().

◆ m_sun_position_pixel

CachedPixelShaderSetting<float, 3> GameGlobalShaderConstantSetter::m_sun_position_pixel {"sunPositionScreen"}
private

Referenced by onSetConstants().

◆ m_texel_size0

v2f GameGlobalShaderConstantSetter::m_texel_size0
private

Referenced by onSetConstants(), and onSetMaterial().

◆ m_texel_size0_pixel

CachedPixelShaderSetting<float, 2> GameGlobalShaderConstantSetter::m_texel_size0_pixel {"texelSize0"}
private

Referenced by onSetConstants().

◆ m_texel_size0_vertex

CachedVertexShaderSetting<float, 2> GameGlobalShaderConstantSetter::m_texel_size0_vertex {"texelSize0"}
private

Referenced by onSetConstants().

◆ m_texture0

CachedPixelShaderSetting<SamplerLayer_t> GameGlobalShaderConstantSetter::m_texture0 {"texture0"}
private

Referenced by onSetConstants().

◆ m_texture1

CachedPixelShaderSetting<SamplerLayer_t> GameGlobalShaderConstantSetter::m_texture1 {"texture1"}
private

Referenced by onSetConstants().

◆ m_texture2

CachedPixelShaderSetting<SamplerLayer_t> GameGlobalShaderConstantSetter::m_texture2 {"texture2"}
private

Referenced by onSetConstants().

◆ m_texture3

CachedPixelShaderSetting<SamplerLayer_t> GameGlobalShaderConstantSetter::m_texture3 {"texture3"}
private

Referenced by onSetConstants().

◆ m_user_exposure_compensation

float GameGlobalShaderConstantSetter::m_user_exposure_compensation
private

◆ m_volumetric_light_enabled

bool GameGlobalShaderConstantSetter::m_volumetric_light_enabled
private

◆ m_volumetric_light_strength_pixel

CachedPixelShaderSetting<float> GameGlobalShaderConstantSetter::m_volumetric_light_strength_pixel {"volumetricLightStrength"}
private

Referenced by onSetConstants().

◆ SETTING_CALLBACKS

std::array<const char*, 1> GameGlobalShaderConstantSetter::SETTING_CALLBACKS
staticconstexprprivate
Initial value:
= {
"exposure_compensation",
}

Referenced by GameGlobalShaderConstantSetter().


The documentation for this class was generated from the following file: