new: frame_time uniform

main
Dominik Madarász 2024-04-18 01:42:40 +02:00
parent 23c860ab99
commit 038386ef2d
3 changed files with 24 additions and 3 deletions

View File

@ -385943,6 +385943,14 @@ void model_set_uniforms(model_t m, int shader, mat44 mv, mat44 proj, mat44 view,
glUniform1i(loc, m.flags & MODEL_MATCAPS ? GL_TRUE:GL_FALSE);
}
if ((loc = glGetUniformLocation(shader, "frame_count")) >= 0) {
glUniform1i(loc, (unsigned)window_frame());
}
if ((loc = glGetUniformLocation(shader, "frame_time")) >= 0) {
glUniform1f(loc, (float)window_time());
}
if (m.shading == SHADING_PBR) {
handle old_shader = last_shader;
shader_bind(shader);
@ -385961,7 +385969,6 @@ void model_set_uniforms(model_t m, int shader, mat44 mv, mat44 proj, mat44 view,
shader_texture( "tex_skyenv", m.sky_env );
}
shader_texture( "tex_brdf_lut", brdf_lut() );
shader_uint( "frame_count", (unsigned)window_frame() );
shader_bind(old_shader);
}
}

View File

@ -3309,6 +3309,14 @@ void model_set_uniforms(model_t m, int shader, mat44 mv, mat44 proj, mat44 view,
glUniform1i(loc, m.flags & MODEL_MATCAPS ? GL_TRUE:GL_FALSE);
}
if ((loc = glGetUniformLocation(shader, "frame_count")) >= 0) {
glUniform1i(loc, (unsigned)window_frame());
}
if ((loc = glGetUniformLocation(shader, "frame_time")) >= 0) {
glUniform1f(loc, (float)window_time());
}
if (m.shading == SHADING_PBR) {
handle old_shader = last_shader;
shader_bind(shader);
@ -3327,7 +3335,6 @@ void model_set_uniforms(model_t m, int shader, mat44 mv, mat44 proj, mat44 view,
shader_texture( "tex_skyenv", m.sky_env );
}
shader_texture( "tex_brdf_lut", brdf_lut() );
shader_uint( "frame_count", (unsigned)window_frame() );
shader_bind(old_shader);
}
}

View File

@ -20482,6 +20482,14 @@ void model_set_uniforms(model_t m, int shader, mat44 mv, mat44 proj, mat44 view,
glUniform1i(loc, m.flags & MODEL_MATCAPS ? GL_TRUE:GL_FALSE);
}
if ((loc = glGetUniformLocation(shader, "frame_count")) >= 0) {
glUniform1i(loc, (unsigned)window_frame());
}
if ((loc = glGetUniformLocation(shader, "frame_time")) >= 0) {
glUniform1f(loc, (float)window_time());
}
if (m.shading == SHADING_PBR) {
handle old_shader = last_shader;
shader_bind(shader);
@ -20500,7 +20508,6 @@ void model_set_uniforms(model_t m, int shader, mat44 mv, mat44 proj, mat44 view,
shader_texture( "tex_skyenv", m.sky_env );
}
shader_texture( "tex_brdf_lut", brdf_lut() );
shader_uint( "frame_count", (unsigned)window_frame() );
shader_bind(old_shader);
}
}