mirror of
https://github.com/minetest/minetest.git
synced 2025-01-08 22:37:32 +01:00
Minor rendering code fixes (#15399)
* Fix line numbers in shader errors * Fix uninitialized variables in shadow code
This commit is contained in:
parent
a5e3fca40c
commit
af61de7777
@ -730,19 +730,18 @@ ShaderInfo ShaderSource::generateShader(const std::string &name,
|
||||
shaders_header << "#define VOLUMETRIC_LIGHT 1\n";
|
||||
}
|
||||
|
||||
shaders_header << "#line 0\n"; // reset the line counter for meaningful diagnostics
|
||||
|
||||
std::string common_header = shaders_header.str();
|
||||
const char *final_header = "#line 0\n"; // reset the line counter for meaningful diagnostics
|
||||
|
||||
std::string vertex_shader = m_sourcecache.getOrLoad(name, "opengl_vertex.glsl");
|
||||
std::string fragment_shader = m_sourcecache.getOrLoad(name, "opengl_fragment.glsl");
|
||||
std::string geometry_shader = m_sourcecache.getOrLoad(name, "opengl_geometry.glsl");
|
||||
|
||||
vertex_shader = common_header + vertex_header + vertex_shader;
|
||||
fragment_shader = common_header + fragment_header + fragment_shader;
|
||||
vertex_shader = common_header + vertex_header + final_header + vertex_shader;
|
||||
fragment_shader = common_header + fragment_header + final_header + fragment_shader;
|
||||
const char *geometry_shader_ptr = nullptr; // optional
|
||||
if (!geometry_shader.empty()) {
|
||||
geometry_shader = common_header + geometry_header + geometry_shader;
|
||||
geometry_shader = common_header + geometry_header + final_header + geometry_shader;
|
||||
geometry_shader_ptr = geometry_shader.c_str();
|
||||
}
|
||||
|
||||
|
@ -21,8 +21,9 @@
|
||||
|
||||
ShadowRenderer::ShadowRenderer(IrrlichtDevice *device, Client *client) :
|
||||
m_smgr(device->getSceneManager()), m_driver(device->getVideoDriver()),
|
||||
m_client(client), m_current_frame(0),
|
||||
m_perspective_bias_xy(0.8), m_perspective_bias_z(0.5)
|
||||
m_client(client), m_shadow_strength(0.0f), m_shadow_tint(255, 0, 0, 0),
|
||||
m_time_day(0.0f), m_force_update_shadow_map(false), m_current_frame(0),
|
||||
m_perspective_bias_xy(0.8f), m_perspective_bias_z(0.5f)
|
||||
{
|
||||
(void) m_client;
|
||||
|
||||
|
@ -118,11 +118,11 @@ private:
|
||||
std::vector<NodeToApply> m_shadow_node_array;
|
||||
|
||||
float m_shadow_strength;
|
||||
video::SColor m_shadow_tint{ 255, 0, 0, 0 };
|
||||
video::SColor m_shadow_tint;
|
||||
float m_shadow_strength_gamma;
|
||||
float m_shadow_map_max_distance;
|
||||
float m_shadow_map_texture_size;
|
||||
float m_time_day{0.0f};
|
||||
float m_time_day;
|
||||
int m_shadow_samples;
|
||||
bool m_shadow_map_texture_32bit;
|
||||
bool m_shadows_enabled;
|
||||
@ -130,7 +130,7 @@ private:
|
||||
bool m_shadow_map_colored;
|
||||
bool m_force_update_shadow_map;
|
||||
u8 m_map_shadow_update_frames; /* Use this number of frames to update map shaodw */
|
||||
u8 m_current_frame{0}; /* Current frame */
|
||||
u8 m_current_frame; /* Current frame */
|
||||
f32 m_perspective_bias_xy;
|
||||
f32 m_perspective_bias_z;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user