Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
shadowsshadercallbacks.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2021 Liso <anlismon@gmail.com>
4
5#pragma once
7#include <IMaterialRendererServices.h>
8#include <IShaderConstantSetCallBack.h>
9#include "client/shader.h"
10
11// Used by main game rendering
12
42
44{
45public:
47 return new ShadowConstantSetter();
48 }
49};
50
51// Used by depth shader
52
53class ShadowDepthShaderCB : public video::IShaderConstantSetCallBack
54{
55public:
56 void OnSetMaterial(const video::SMaterial &material) override {}
57
58 void OnSetConstants(video::IMaterialRendererServices *services,
59 s32 userData) override;
60
61 f32 MaxFar{2048.0f}, MapRes{1024.0f};
64
65private:
70 m_color_map_sampler_setting{"ColorMapSampler"};
75};
Definition shader.h:146
Definition shader.h:153
Definition shader.h:60
Definition shader.h:51
Definition shadowsshadercallbacks.h:44
virtual IShaderConstantSetter * create()
Definition shadowsshadercallbacks.h:46
Definition shadowsshadercallbacks.h:14
CachedPixelShaderSetting< f32 > m_perspective_bias0_pixel
Definition shadowsshadercallbacks.h:27
CachedPixelShaderSetting< f32, 3 > m_light_direction
Definition shadowsshadercallbacks.h:16
CachedPixelShaderSetting< f32 > m_perspective_bias1_pixel
Definition shadowsshadercallbacks.h:31
virtual void onSetConstants(video::IMaterialRendererServices *services) override
Definition shadowsshadercallbacks.cpp:8
CachedPixelShaderSetting< s32 > m_shadow_texture
Definition shadowsshadercallbacks.h:23
CachedPixelShaderSetting< f32, 3 > m_shadow_tint
Definition shadowsshadercallbacks.h:19
CachedPixelShaderSetting< f32 > m_perspective_zbias_pixel
Definition shadowsshadercallbacks.h:34
ShadowConstantSetter()=default
CachedPixelShaderSetting< f32, 4 > m_camera_pos
Definition shadowsshadercallbacks.h:22
CachedPixelShaderSetting< f32 > m_shadow_strength
Definition shadowsshadercallbacks.h:18
CachedVertexShaderSetting< f32 > m_perspective_bias0_vertex
Definition shadowsshadercallbacks.h:25
CachedVertexShaderSetting< f32 > m_perspective_zbias_vertex
Definition shadowsshadercallbacks.h:33
CachedPixelShaderSetting< f32 > m_shadowfar
Definition shadowsshadercallbacks.h:21
CachedPixelShaderSetting< f32 > m_time_of_day
Definition shadowsshadercallbacks.h:20
CachedVertexShaderSetting< f32 > m_perspective_bias1_vertex
Definition shadowsshadercallbacks.h:29
CachedPixelShaderSetting< f32 > m_texture_res
Definition shadowsshadercallbacks.h:17
~ShadowConstantSetter()=default
CachedPixelShaderSetting< f32, 16 > m_shadow_view_proj
Definition shadowsshadercallbacks.h:15
Definition shadowsshadercallbacks.h:54
CachedVertexShaderSetting< f32, 16 > m_light_mvp_setting
Definition shadowsshadercallbacks.h:66
CachedVertexShaderSetting< f32 > m_max_far_setting
Definition shadowsshadercallbacks.h:68
f32 MapRes
Definition shadowsshadercallbacks.h:61
void OnSetConstants(video::IMaterialRendererServices *services, s32 userData) override
Definition shadowsshadercallbacks.cpp:55
void OnSetMaterial(const video::SMaterial &material) override
Definition shadowsshadercallbacks.h:56
CachedVertexShaderSetting< f32 > m_perspective_zbias
Definition shadowsshadercallbacks.h:73
CachedVertexShaderSetting< f32 > m_perspective_bias1
Definition shadowsshadercallbacks.h:72
f32 PerspectiveBiasXY
Definition shadowsshadercallbacks.h:62
CachedVertexShaderSetting< f32 > m_perspective_bias0
Definition shadowsshadercallbacks.h:71
CachedVertexShaderSetting< f32 > m_map_resolution_setting
Definition shadowsshadercallbacks.h:67
CachedVertexShaderSetting< f32, 4 > m_cam_pos_setting
Definition shadowsshadercallbacks.h:74
f32 PerspectiveBiasZ
Definition shadowsshadercallbacks.h:62
f32 MaxFar
Definition shadowsshadercallbacks.h:61
CachedPixelShaderSetting< s32 > m_color_map_sampler_setting
Definition shadowsshadercallbacks.h:70
v3f CameraPos
Definition shadowsshadercallbacks.h:63
core::vector3df v3f
Definition irr_v3d.h:11