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

Public Member Functions

void onSettingsChange (const std::string &name)
 
void setSky (Sky *sky)
 
 GameGlobalShaderUniformSetter (Sky *sky, Game *game)
 
 ~GameGlobalShaderUniformSetter ()
 
void onSetUniforms (video::IMaterialRendererServices *services) override
 Called when uniforms need to be updated.
 
void onSetMaterial (const video::SMaterial &material) override
 
- Public Member Functions inherited from IShaderUniformSetter
virtual ~IShaderUniformSetter ()=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"}
 
int m_crack_animation_length_i
 
CachedPixelShaderSetting< float > m_crack_animation_length {"crackAnimationLength"}
 
int m_crack_level_i = -1
 
CachedPixelShaderSetting< float > m_crack_level {"crackLevel"}
 
int m_crack_texture_scale_i = 0
 
CachedPixelShaderSetting< float > m_crack_texture_scale {"crackTextureScale"}
 
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"}
 
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

◆ GameGlobalShaderUniformSetter()

GameGlobalShaderUniformSetter::GameGlobalShaderUniformSetter ( Sky * sky,
Game * game )
inline

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

+ Here is the call graph for this function:

◆ ~GameGlobalShaderUniformSetter()

GameGlobalShaderUniformSetter::~GameGlobalShaderUniformSetter ( )
inline

References Settings::deregisterAllChangedCallbacks(), and g_settings.

+ Here is the call graph for this function:

Member Function Documentation

◆ onSetMaterial()

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

Reimplemented from IShaderUniformSetter.

References m_crack_level_i, m_crack_texture_scale_i, m_texel_size0, and MapBlockMesh::unpackCrackMaterialParam().

+ Here is the call graph for this function:

◆ onSettingsChange()

void GameGlobalShaderUniformSetter::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:

◆ onSetUniforms()

void GameGlobalShaderUniformSetter::onSetUniforms ( video::IMaterialRendererServices * services)
inlineoverridevirtual

Called when uniforms need to be updated.

Parameters
servicesinterface for setting uniforms

Implements IShaderUniformSetter.

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_crack_animation_length, m_crack_animation_length_i, m_crack_level, m_crack_level_i, m_crack_texture_scale, m_crack_texture_scale_i, 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_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:

◆ setSky()

void GameGlobalShaderUniformSetter::setSky ( Sky * sky)
inline

References m_sky.

◆ settingsCallback()

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

References onSettingsChange().

Referenced by GameGlobalShaderUniformSetter().

+ 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> GameGlobalShaderUniformSetter::m_animation_timer_delta_pixel {"animationTimerDelta"}
private

Referenced by onSetUniforms().

◆ m_animation_timer_delta_vertex

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

Referenced by onSetUniforms().

◆ m_animation_timer_pixel

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

Referenced by onSetUniforms().

◆ m_animation_timer_vertex

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

Referenced by onSetUniforms().

◆ m_bloom_enabled

bool GameGlobalShaderUniformSetter::m_bloom_enabled
private

◆ m_bloom_intensity_pixel

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

Referenced by onSetUniforms().

◆ m_bloom_radius_pixel

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

Referenced by onSetUniforms().

◆ m_bloom_strength_pixel

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

Referenced by onSetUniforms().

◆ m_camera_offset_pixel

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

Referenced by onSetUniforms().

◆ m_camera_offset_vertex

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

Referenced by onSetUniforms().

◆ m_camera_position_pixel

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

Referenced by onSetUniforms().

◆ m_camera_position_vertex

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

◆ m_client

Client* GameGlobalShaderUniformSetter::m_client
private

Referenced by onSetUniforms().

◆ m_crack_animation_length

CachedPixelShaderSetting<float> GameGlobalShaderUniformSetter::m_crack_animation_length {"crackAnimationLength"}
private

Referenced by onSetUniforms().

◆ m_crack_animation_length_i

int GameGlobalShaderUniformSetter::m_crack_animation_length_i
private

◆ m_crack_level

CachedPixelShaderSetting<float> GameGlobalShaderUniformSetter::m_crack_level {"crackLevel"}
private

Referenced by onSetUniforms().

◆ m_crack_level_i

int GameGlobalShaderUniformSetter::m_crack_level_i = -1
private

Referenced by onSetMaterial(), and onSetUniforms().

◆ m_crack_texture_scale

CachedPixelShaderSetting<float> GameGlobalShaderUniformSetter::m_crack_texture_scale {"crackTextureScale"}
private

Referenced by onSetUniforms().

◆ m_crack_texture_scale_i

int GameGlobalShaderUniformSetter::m_crack_texture_scale_i = 0
private

Referenced by onSetMaterial(), and onSetUniforms().

◆ m_day_light

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

Referenced by onSetUniforms().

◆ m_exposure_params_pixel

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

Referenced by onSetUniforms().

◆ m_minimap_yaw

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

Referenced by onSetUniforms().

◆ m_moon_brightness_pixel

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

Referenced by onSetUniforms().

◆ m_moon_position_pixel

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

Referenced by onSetUniforms().

◆ m_saturation_pixel

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

Referenced by onSetUniforms().

◆ m_sky

Sky* GameGlobalShaderUniformSetter::m_sky
private

Referenced by onSetUniforms(), and setSky().

◆ m_sun_brightness_pixel

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

Referenced by onSetUniforms().

◆ m_sun_position_pixel

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

Referenced by onSetUniforms().

◆ m_texel_size0

v2f GameGlobalShaderUniformSetter::m_texel_size0
private

Referenced by onSetMaterial(), and onSetUniforms().

◆ m_texel_size0_pixel

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

Referenced by onSetUniforms().

◆ m_texel_size0_vertex

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

Referenced by onSetUniforms().

◆ m_user_exposure_compensation

float GameGlobalShaderUniformSetter::m_user_exposure_compensation
private

◆ m_volumetric_light_enabled

bool GameGlobalShaderUniformSetter::m_volumetric_light_enabled
private

◆ m_volumetric_light_strength_pixel

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

Referenced by onSetUniforms().

◆ SETTING_CALLBACKS

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

Referenced by GameGlobalShaderUniformSetter().


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