From ac9c8be7c76f49d49260cc649c635343147c7f8c Mon Sep 17 00:00:00 2001 From: korenkonder Date: Tue, 6 Feb 2024 21:51:14 +0300 Subject: [PATCH] Renamed some uniforms --- src/CRE/mdl/draw_object.cpp | 20 ++++++++-------- src/CRE/render_context.cpp | 2 +- src/CRE/render_manager.cpp | 4 ++-- src/CRE/shader_ft.cpp | 48 ++++++++++++++++++------------------- src/CRE/static_var.hpp | 4 ++-- 5 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/CRE/mdl/draw_object.cpp b/src/CRE/mdl/draw_object.cpp index 108798d8..bcb09775 100644 --- a/src/CRE/mdl/draw_object.cpp +++ b/src/CRE/mdl/draw_object.cpp @@ -210,10 +210,10 @@ namespace mdl { rctx->obj_batch.set_transforms(mat4_identity, rctx->view_mat, rctx->proj_mat); - uniform_value[U_BONE_MAT] = 1; + uniform_value[U_SKINNING] = 1; gl_state_bind_vertex_array(vao); func(rctx, args); - uniform_value[U_BONE_MAT] = 0; + uniform_value[U_SKINNING] = 0; } else { mat4 _mat; @@ -224,7 +224,7 @@ namespace mdl { else _mat = *mat; - uniform_value[U_BONE_MAT] = 0; + uniform_value[U_SKINNING] = 0; gl_state_bind_vertex_array(vao); if (func != draw_sub_mesh_default || !args->instances_count) { draw_object_model_mat_load(rctx, _mat); @@ -232,7 +232,7 @@ namespace mdl { } else draw_sub_mesh_default_instanced(rctx, args, &_mat); - uniform_value[U_BONE_MAT] = 0; + uniform_value[U_SKINNING] = 0; } } @@ -1042,7 +1042,7 @@ static void draw_object_vertex_attrib_reset_default(const mdl::ObjSubMeshArgs* a obj_vertex_format vertex_format = mesh->vertex_format; if (vertex_format & OBJ_VERTEX_BONE_DATA) - uniform_value[U_BONE_MAT] = 0; + uniform_value[U_SKINNING] = 0; if (args->morph_vertex_buffer) { uniform_value[U_MORPH] = 0; @@ -1060,7 +1060,7 @@ static void draw_object_vertex_attrib_reset_reflect(const mdl::ObjSubMeshArgs* a obj_vertex_format vertex_format = mesh->vertex_format; if (vertex_format & OBJ_VERTEX_BONE_DATA) - uniform_value[U_BONE_MAT] = 0; + uniform_value[U_SKINNING] = 0; if (args->morph_vertex_buffer) { uniform_value[U_MORPH] = 0; @@ -1109,9 +1109,9 @@ static void draw_object_vertex_attrib_set_default(render_context* rctx, const md } if (vertex_format & OBJ_VERTEX_BONE_DATA) - uniform_value[U_BONE_MAT] = 1; + uniform_value[U_SKINNING] = 1; else - uniform_value[U_BONE_MAT] = 0; + uniform_value[U_SKINNING] = 0; if (args->morph_vertex_buffer) { uniform_value[U_MORPH] = 1; @@ -1154,9 +1154,9 @@ static void draw_object_vertex_attrib_set_reflect(render_context* rctx, const md } if (vertex_format & OBJ_VERTEX_BONE_DATA) - uniform_value[U_BONE_MAT] = 1; + uniform_value[U_SKINNING] = 1; else - uniform_value[U_BONE_MAT] = 0; + uniform_value[U_SKINNING] = 0; if (args->morph_vertex_buffer) { uniform_value[U_MORPH] = 1; diff --git a/src/CRE/render_context.cpp b/src/CRE/render_context.cpp index 256368d9..f2a81825 100644 --- a/src/CRE/render_context.cpp +++ b/src/CRE/render_context.cpp @@ -125,7 +125,7 @@ bool light_proj::set() { if (set_mat(false)) { rctx_ptr->draw_state->shader_index = SHADER_FT_SIL; - uniform_value[U0A] = 1; + uniform_value[U_DEPTH] = 1; return true; } else { diff --git a/src/CRE/render_manager.cpp b/src/CRE/render_manager.cpp index 276da2c6..a377e326 100644 --- a/src/CRE/render_manager.cpp +++ b/src/CRE/render_manager.cpp @@ -387,7 +387,7 @@ namespace rndr { rctx->disp_manager->draw(mdl::OBJ_TYPE_TRANSLUCENT); rctx->draw_state->shader_index = -1; - uniform_value[U0A] = 0; + uniform_value[U_DEPTH] = 0; draw_pass_shadow_filter(&rctx->litproj->shadow_texture[0], &rctx->litproj->shadow_texture[1], 0, 1.5f, 0.01f, true); @@ -1243,7 +1243,7 @@ static void draw_pass_shadow_begin_make_shadowmap(Shadow* shad, int32_t index, i mat4_look_at(view_point, interest, &rctx->view_mat); rctx->draw_state->shader_index = SHADER_FT_SIL; - uniform_value[U0A] = 0; + uniform_value[U_DEPTH] = 0; } static void draw_pass_shadow_end_make_shadowmap(Shadow* shad, int32_t index, int32_t a3) { diff --git a/src/CRE/shader_ft.cpp b/src/CRE/shader_ft.cpp index cfddbd33..06066633 100644 --- a/src/CRE/shader_ft.cpp +++ b/src/CRE/shader_ft.cpp @@ -2046,7 +2046,7 @@ static const shader_sub_table TRANSPARENCY_table[] = { // Added static const std::pair BLINN_uniform[] = { //{ U16 , true }, // 0th removed - { U_BONE_MAT , true }, + { U_SKINNING , true }, { U_TEXTURE_COUNT, false }, { U_LIGHT_0 , false }, { U_NORMAL , false }, @@ -2061,7 +2061,7 @@ static const std::pair BLINN_uniform[] = { static const std::pair ITEM_uniform[] = { //{ U16 , true }, // 0th removed - { U_BONE_MAT , true }, + { U_SKINNING , true }, { U_MORPH , true }, { U_SPECULAR_IBL , false }, { U_SPECULAR , false }, @@ -2078,7 +2078,7 @@ static const std::pair ITEM_uniform[] = { static const std::pair STAGE_uniform[] = { //{ U16 , true }, // 0th removed - { U_BONE_MAT , true }, + { U_SKINNING , true }, { U_MORPH , true }, { U_MORPH_COLOR , true }, { U_TEXTURE_COUNT, false }, @@ -2093,7 +2093,7 @@ static const std::pair STAGE_uniform[] = { static const std::pair SKIN_uniform[] = { //{ U16 , true }, // 0th removed - { U_BONE_MAT , true }, + { U_SKINNING , true }, { U_NORMAL , false }, { U_SELF_SHADOW , false }, { U_FOG , false }, @@ -2106,7 +2106,7 @@ static const std::pair SKIN_uniform[] = { static const std::pair SSS_SKIN_uniform[] = { //{ U16 , true }, // 0th removed - { U_BONE_MAT , true }, + { U_SKINNING , true }, { U37 , false }, { U_ALPHA_TEST , true }, { U_SELF_SHADOW , false }, @@ -2123,7 +2123,7 @@ static const std::pair SSS_FILT_uniform[] = { static const std::pair HAIR_uniform[] = { //{ U16 , true }, // 0th removed - { U_BONE_MAT , true }, + { U_SKINNING , true }, { U_SPECULAR_IBL , false }, { U_SPECULAR , false }, { U_NORMAL , false }, @@ -2141,7 +2141,7 @@ static const std::pair HAIR_uniform[] = { static const std::pair CLOTH_uniform[] = { //{ U16 , true }, // 0th removed - { U_BONE_MAT , true }, + { U_SKINNING , true }, { U_SPECULAR_IBL , false }, { U_SPECULAR , false }, { U_NORMAL , false }, @@ -2159,7 +2159,7 @@ static const std::pair CLOTH_uniform[] = { static const std::pair TIGHTS_uniform[] = { //{ U16 , true }, // 0th removed - { U_BONE_MAT , true }, + { U_SKINNING , true }, { U_SPECULAR , false }, { U_ENV_MAP , false }, { U_SELF_SHADOW , false }, @@ -2182,19 +2182,19 @@ static const std::pair SKY_uniform[] = { }; /*static const std::pair EYEBALL_uniform[] = { - { U_BONE_MAT , true }, + { U_SKINNING , true }, { U_ENV_MAP , false }, };*/ /*static const std::pair EYELENS_uniform[] = { - { U_BONE_MAT , true }, + { U_SKINNING , true }, { U_SPECULAR , false }, { U_ENV_MAP , false }, };*/ static const std::pair GLASEYE_uniform[] = { //{ U16 , true }, // 0th removed - { U_BONE_MAT , true }, + { U_SKINNING , true }, { U_SELF_SHADOW , false }, { U_FOG , false }, { U18 , false }, @@ -2204,13 +2204,13 @@ static const std::pair GLASEYE_uniform[] = { }; /*static const std::pair MEMBRAN_uniform[] = { - { U_BONE_MAT , true }, + { U_SKINNING , true }, { U_NORMAL , false }, { U_MEMBRANE , false }, };*/ /*static const std::pair SHDMAP_uniform[] = { - { U_BONE_MAT , true }, + { U_SKINNING , true }, { U_TEXTURE_COUNT, false }, { U_TRANSPARENCY , false }, { U_LIGHT_1 , false }, @@ -2219,7 +2219,7 @@ static const std::pair GLASEYE_uniform[] = { /*static const std::pair ESM_uniform[] = { //{ U16 , true }, // 0th removed - { U_BONE_MAT , true }, + { U_SKINNING , true }, { U_TEXTURE_COUNT, false }, { U_TRANSPARENCY , false }, };*/ @@ -2234,7 +2234,7 @@ static const std::pair ESMFILT_uniform[] = { static const std::pair LITPROJ_uniform[] = { //{ U16 , true }, // 0th removed - { U_BONE_MAT , true }, + { U_SKINNING , true }, { U_SPECULAR , false }, { U_NORMAL , false }, { U_TEXTURE_COUNT, false }, @@ -2244,7 +2244,7 @@ static const std::pair LITPROJ_uniform[] = { static const std::pair SIMPLE_uniform[] = { //{ U16 , true }, // 0th removed - { U_BONE_MAT , true }, + { U_SKINNING , true }, { U_TEXTURE_COUNT, false }, //{ U_NORMAL , false }, // 3rd removed //{ U_INSTANCE , false }, // 4th removed @@ -2253,18 +2253,18 @@ static const std::pair SIMPLE_uniform[] = { static const std::pair SIL_uniform[] = { //{ U16 , true }, // 0th removed - { U_BONE_MAT , true }, + { U_SKINNING , true }, { U_TRANSPARENCY , false }, { U_TEXTURE_COUNT, false }, { U_MORPH , true }, { U_MORPH_COLOR , true }, - { U0A , false }, + { U_DEPTH , true }, { U_ALPHA_TEST , true }, // 7th added }; static const std::pair LAMBERT_uniform[] = { //{ U16 , true }, // 0th removed - { U_BONE_MAT , true }, + { U_SKINNING , true }, { U_TEXTURE_COUNT, false }, { U_LIGHT_0 , false }, { U_FOG_HEIGHT , false }, @@ -2276,7 +2276,7 @@ static const std::pair LAMBERT_uniform[] = { static const std::pair CONSTANT_uniform[] = { //{ U16 , true }, // 0th removed - { U_BONE_MAT , true }, + { U_SKINNING , true }, { U_TEXTURE_COUNT, false }, { U_FOG_HEIGHT , false }, { U_MORPH , true }, @@ -2286,7 +2286,7 @@ static const std::pair CONSTANT_uniform[] = { /*static const std::pair PEEL_uniform[] = { { U_DEPTH_PEEL , false }, - { U_BONE_MAT , true }, + { U_SKINNING , true }, };*/ static const std::pair TONEMAP_uniform[] = { @@ -2421,7 +2421,7 @@ static const std::pair PUDDLE_uniform[] = { static const std::pair S_REFL_uniform[] = { //{ U16 , true }, // 0th removed - { U_BONE_MAT , true }, + { U_SKINNING , true }, { U_REFLECT , true }, { U_MORPH , true }, { U_MORPH_COLOR , true }, @@ -2433,7 +2433,7 @@ static const std::pair S_REFL_uniform[] = { }; static const std::pair S_REFR_uniform[] = { - { U_BONE_MAT , true }, + { U_SKINNING , true }, { U_TRANSPARENCY , false }, }; @@ -2476,7 +2476,7 @@ static const std::pair GLITTER_PT_uniform[] = { /*static const std::pair SHOW_VEC_uniform[] = { //{ U16 , true }, // 0th removed - { U_BONE_MAT , true }, + { U_SKINNING , true }, { U_SHOW_VECTOR , false }, };*/ diff --git a/src/CRE/static_var.hpp b/src/CRE/static_var.hpp index 79dc7fa8..7bb66150 100644 --- a/src/CRE/static_var.hpp +++ b/src/CRE/static_var.hpp @@ -38,7 +38,7 @@ enum uniform_name { U_CLIP_PLANE, U08, U_DEPTH_PEEL, - U0A, + U_DEPTH, U0B, U_ALPHA_BLEND, U_RIPPLE_EMIT, @@ -76,7 +76,7 @@ enum uniform_name { U2D, U2E, U_SHOW_VECTOR, - U_BONE_MAT, + U_SKINNING, U_SNOW_PARTICLE, U_SPECULAR_IBL, U_COMBINER,