diff --git a/src/CRE/Glitter/render_scene.cpp b/src/CRE/Glitter/render_scene.cpp index e06a01da..ec3c8054 100644 --- a/src/CRE/Glitter/render_scene.cpp +++ b/src/CRE/Glitter/render_scene.cpp @@ -1002,13 +1002,13 @@ namespace Glitter { case PARTICLE_QUAD: switch (rend_group->fog_type) { default: - uniform_value[U_FOG_HEIGHT] = 0; + uniform_value[U_FOG_STAGE] = 0; break; case Glitter::FOG_DEPTH: - uniform_value[U_FOG_HEIGHT] = 1; + uniform_value[U_FOG_STAGE] = 1; break; case Glitter::FOG_HEIGHT: - uniform_value[U_FOG_HEIGHT] = 2; + uniform_value[U_FOG_STAGE] = 2; break; } @@ -1031,7 +1031,7 @@ namespace Glitter { gl_state_disable_cull_face(); break; case PARTICLE_LINE: - uniform_value[U_FOG_HEIGHT] = 0; + uniform_value[U_FOG_STAGE] = 0; uniform_value[U_ALPHA_BLEND] = 2; gl_state_enable_depth_test(); @@ -1040,7 +1040,7 @@ namespace Glitter { gl_state_set_cull_face_mode(GL_BACK); break; case PARTICLE_LOCUS: - uniform_value[U_FOG_HEIGHT] = 0; + uniform_value[U_FOG_STAGE] = 0; uniform_value[U_ALPHA_BLEND] = 2; gl_state_enable_depth_test(); @@ -1049,9 +1049,13 @@ namespace Glitter { break; } + rctx_ptr->obj_shader.set_shader_flags(uniform_value); + rctx_ptr->obj_shader_ubo.WriteMemory(rctx_ptr->obj_shader); + shaders_ft.set(SHADER_FT_GLITTER_PT); - rctx_ptr->obj_scene_ubo.Bind(0); - rctx_ptr->glitter_batch_ubo.Bind(2); + rctx_ptr->obj_shader_ubo.Bind(0); + rctx_ptr->obj_scene_ubo.Bind(1); + rctx_ptr->glitter_batch_ubo.Bind(3); switch (rend_group->type) { case PARTICLE_QUAD: gl_state_bind_vertex_array(rend_group->vao); @@ -2108,13 +2112,13 @@ namespace Glitter { switch (rend_group->fog_type) { default: - uniform_value[U_FOG_HEIGHT] = 0; + uniform_value[U_FOG_STAGE] = 0; break; case Glitter::FOG_DEPTH: - uniform_value[U_FOG_HEIGHT] = 1; + uniform_value[U_FOG_STAGE] = 1; break; case Glitter::FOG_HEIGHT: - uniform_value[U_FOG_HEIGHT] = 2; + uniform_value[U_FOG_STAGE] = 2; break; } @@ -2140,9 +2144,13 @@ namespace Glitter { else gl_state_disable_cull_face(); + rctx_ptr->obj_shader.set_shader_flags(uniform_value); + rctx_ptr->obj_shader_ubo.WriteMemory(rctx_ptr->obj_shader); + shaders_ft.set(SHADER_FT_GLITTER_PT); - rctx_ptr->obj_scene_ubo.Bind(0); - rctx_ptr->glitter_batch_ubo.Bind(2); + rctx_ptr->obj_shader_ubo.Bind(0); + rctx_ptr->obj_scene_ubo.Bind(1); + rctx_ptr->glitter_batch_ubo.Bind(3); switch (rend_group->type) { case PARTICLE_QUAD: gl_state_bind_vertex_array(rend_group->vao); diff --git a/src/CRE/effect.cpp b/src/CRE/effect.cpp index 6ea625e0..d1c26e29 100644 --- a/src/CRE/effect.cpp +++ b/src/CRE/effect.cpp @@ -4087,7 +4087,7 @@ void water_particle::draw(mat4* mat) { shaders_ft.set(SHADER_FT_W_PTCL); gl_state_bind_vertex_array(rctx_ptr->common_vao); - water_particle_scene_ubo.Bind(4); + water_particle_scene_ubo.Bind(5); ssbo.Bind(0); texture* tex = texture_manager_get_texture(splash_tex_id); if (tex) diff --git a/src/CRE/mdl/disp_manager.cpp b/src/CRE/mdl/disp_manager.cpp index 998c6158..5acd8a5e 100644 --- a/src/CRE/mdl/disp_manager.cpp +++ b/src/CRE/mdl/disp_manager.cpp @@ -2016,9 +2016,10 @@ namespace mdl { uniform_value_reset(); gl_state_get(); - rctx->obj_scene_ubo.Bind(0); - rctx->obj_batch_ubo.Bind(1); - rctx->obj_skinning_ubo.Bind(3); + rctx->obj_shader_ubo.Bind(0); + rctx->obj_scene_ubo.Bind(1); + rctx->obj_batch_ubo.Bind(2); + rctx->obj_skinning_ubo.Bind(4); switch (type) { case OBJ_TYPE_TRANSLUCENT: @@ -2177,9 +2178,10 @@ namespace mdl { uniform_value_reset(); gl_state_get(); - rctx->obj_scene_ubo.Bind(0); - rctx->obj_batch_ubo.Bind(1); - rctx->obj_skinning_ubo.Bind(3); + rctx->obj_shader_ubo.Bind(0); + rctx->obj_scene_ubo.Bind(1); + rctx->obj_batch_ubo.Bind(2); + rctx->obj_skinning_ubo.Bind(4); switch (type) { case OBJ_TYPE_TRANSLUCENT_ALPHA_ORDER_1: diff --git a/src/CRE/mdl/draw_object.cpp b/src/CRE/mdl/draw_object.cpp index eb3e709e..c739b52f 100644 --- a/src/CRE/mdl/draw_object.cpp +++ b/src/CRE/mdl/draw_object.cpp @@ -50,7 +50,10 @@ namespace mdl { GL_UNSIGNED_INT, }; + rctx->obj_shader.set_shader_flags(uniform_value); + rctx->obj_shader_ubo.WriteMemory(rctx->obj_shader); rctx->obj_batch_ubo.WriteMemory(rctx->obj_batch); + if (primitive_type == OBJ_PRIMITIVE_TRIANGLE_STRIP && index_format == OBJ_INDEX_U16) shaders_ft.draw_range_elements(GL_TRIANGLE_STRIP, start, end, count, GL_UNSIGNED_SHORT, (void*)indices); @@ -325,7 +328,6 @@ namespace mdl { if (!rctx->render_manager->npr_param) chara = true; break; - //case SHADER_FT_EYEBALL: case SHADER_FT_GLASEYE: uniform_value[U_NPR_NORMAL] = 0; chara = true; @@ -417,7 +419,6 @@ namespace mdl { draw_object_material_set_uniform(material, false); if (material->material.attrib.m.alpha_texture) uniform_value[U_TEXTURE_COUNT] = 0; - rctx->obj_batch.g_texture_blend = { (float_t)uniform_value[U_TEXTURE_BLEND], 0.0f, 0.0f, 0.0f }; shaders_ft.set(rctx->draw_state->shader_index); } @@ -589,7 +590,7 @@ static bool draw_object_blend_set(render_context* rctx, } } - if (draw_object_blend_set_check_use_default_blend(shader_index)){ + if (draw_object_blend_set_check_use_default_blend(shader_index)) { src_blend_factor = GL_SRC_ALPHA; dst_blend_factor = GL_ONE_MINUS_SRC_ALPHA; } @@ -602,11 +603,10 @@ static bool draw_object_blend_set(render_context* rctx, static bool draw_object_blend_set_check_use_default_blend(int32_t index) { bool use_default_blend[] = { false, false, true, false, true, false, false, true, true, true, false, false, - false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, - false, false, false + false, false, false, }; if (index >= 0 && index < SHADER_FT_MAX) @@ -627,11 +627,8 @@ static void draw_object_chara_color_fog_set(render_context* rctx, const mdl::Obj obj_material_attrib_member attrib = args->material->material.attrib.m; if (!attrib.no_fog && !disable_fog) { - if (attrib.has_fog_height) - uniform_value[U_FOG_HEIGHT] = 2 + attrib.fog_height; - else - uniform_value[U_FOG_HEIGHT] = 1; - uniform_value[U_FOG] = rctx->draw_state->fog_height ? 2 : 1; + uniform_value[U_FOG_STAGE] = attrib.has_fog_height ? (attrib.fog_height ? 3 : 2) : 1; + uniform_value[U_FOG_CHARA] = rctx->draw_state->fog_height ? 2 : 1; } } @@ -658,17 +655,16 @@ static void draw_object_material_set_default(render_context* rctx, const mdl::Ob material->material.shader_info.get_lighting_type(); bool disable_fog = draw_object_blend_set(rctx, args, lighting_type); draw_object_material_set_uniform(material, false); - if (!rctx->draw_state->light) - uniform_value[U_LIGHT_0] = 0; + if (!rctx->draw_state->shadow) + uniform_value[U_STAGE_SHADOW] = 0; else if (args->self_shadow) - uniform_value[U_LIGHT_0] = 1; + uniform_value[U_STAGE_SHADOW] = 1; else - uniform_value[U_LIGHT_0] = args->sub_mesh->attrib.m.recieve_shadow ? 1 : 0; - uniform_value[U_SHADOW] = 0; - uniform_value[U_SELF_SHADOW] = rctx->draw_state->self_shadow ? 1 : 0; + uniform_value[U_STAGE_SHADOW] = args->sub_mesh->attrib.m.recieve_shadow ? 1 : 0; + uniform_value[U_CHARA_SHADOW2] = args->shadow > SHADOW_CHARA ? 1 : 0; + uniform_value[U_CHARA_SHADOW] = rctx->draw_state->self_shadow ? 1 : 0; const obj_material_texture_data* texdata = material->material.texdata; - uniform_value[U_SHADOW] = args->shadow > SHADOW_CHARA; for (int32_t i = 0, j = 0; i < 8; i++, texdata++) { if (texdata->tex_index == -1) continue; @@ -813,10 +809,9 @@ static void draw_object_material_set_default(render_context* rctx, const mdl::Ob else shaders_ft.set(SHADER_FT_CONSTANT); - rctx->obj_batch.g_texture_blend = { (float_t)uniform_value[U_TEXTURE_BLEND], 0.0f, 0.0f, 0.0f }; if (lighting_type != OBJ_MATERIAL_SHADER_LIGHTING_CONSTANT) { float_t material_shininess; - if (material->material.shader.index == SHADER_FT_GLASEYE/*SHADER_FT_EYEBALL*/) + if (material->material.shader.index == SHADER_FT_GLASEYE) material_shininess = 10.0f; else { material_shininess = (material->material.color.shininess - 16.0f) * (float_t)(1.0 / 112.0); @@ -963,7 +958,6 @@ static void draw_object_material_set_reflect(render_context* rctx, const mdl::Ob } draw_object_material_set_uniform(material, true); - rctx->obj_batch.g_texture_blend = { (float_t)uniform_value[U_TEXTURE_BLEND], 0.0f, 0.0f, 0.0f }; shaders_ft.set(rctx->draw_state->shader_index); rctx->obj_batch.g_material_state_ambient = ambient; rctx->obj_batch.g_material_state_diffuse = diffuse; diff --git a/src/CRE/render.cpp b/src/CRE/render.cpp index 5b97c3d4..57113bd6 100644 --- a/src/CRE/render.cpp +++ b/src/CRE/render.cpp @@ -1578,35 +1578,8 @@ namespace rndr { uniform_value[U_TONE_MAP] = (int32_t)tone_map; uniform_value[U_FLARE] = 0; - uniform_value[U_SCENE_FADE] = scene_fade_alpha[scene_fade_index] > 0.01f ? 1 : 0; uniform_value[U_AET_BACK] = 0; uniform_value[U_LIGHT_PROJ] = 0; - //uniform_value[U25] = 0; - - gl_state_active_bind_texture_2d(0, rend_texture[0].GetColorTex()); - gl_state_active_bind_texture_2d(1, reduce_tex_draw); - gl_state_active_bind_texture_2d(2, tonemap_lut_texture); - gl_state_active_bind_texture_2d(3, exposure_tex); - gl_state_active_bind_texture_2d(4, rctx->empty_texture_2d); - gl_state_active_bind_texture_2d(5, rctx->empty_texture_2d); - gl_state_active_bind_texture_2d(6, rctx->empty_texture_2d); - gl_state_bind_sampler(0, rctx->render_samplers[1]); - gl_state_bind_sampler(1, rctx->render_samplers[2]); - gl_state_bind_sampler(2, rctx->render_samplers[0]); - gl_state_bind_sampler(3, rctx->render_samplers[3]); - gl_state_bind_sampler(4, rctx->render_samplers[2]); - gl_state_bind_sampler(5, rctx->render_samplers[2]); - gl_state_bind_sampler(6, rctx->render_samplers[2]); - - if (aet_back) { - gl_state_active_bind_texture_2d(6, aet_back_tex->glid); - uniform_value[U_AET_BACK] = 1; - } - - if (light_proj_tex) { - gl_state_active_bind_texture_2d(6, light_proj_tex->glid); - uniform_value[U_LIGHT_PROJ] = 1; - } int32_t scene_fade_blend_func = this->scene_fade_blend_func[scene_fade_index]; @@ -1633,14 +1606,26 @@ namespace rndr { shader_data.g_texcoord_transforms[2] = { 1.0f, 0.0f, 0.0f, 0.0f }; shader_data.g_texcoord_transforms[3] = { 0.0f, 1.0f, 0.0f, 0.0f }; - if (lens_flare_texture) { - static const vec4 border_color = 0.0f; + gl_state_active_bind_texture_2d(0, rend_texture[0].GetColorTex()); + gl_state_bind_sampler(0, rctx->render_samplers[1]); + gl_state_active_bind_texture_2d(1, reduce_tex_draw); + gl_state_bind_sampler(1, rctx->render_samplers[2]); + if (tone_map == TONE_MAP_YCC_EXPONENT) { + gl_state_active_bind_texture_2d(2, tonemap_lut_texture); + gl_state_bind_sampler(2, rctx->render_samplers[0]); + } + + gl_state_active_bind_texture_2d(3, exposure_tex); + gl_state_bind_sampler(3, rctx->render_samplers[3]); + + if (lens_flare_texture) { const float_t aspect = (float_t)height / (float_t)width; uniform_value[U_FLARE] = 1; gl_state_active_bind_texture_2d(4, lens_flare_texture); gl_state_bind_sampler(4, rctx->render_samplers[2]); + mat4 mat; mat4_translate(0.5f, 0.5f, 0.0f, &mat); mat4_scale_rot(&mat, 0.75f, 0.75f, 1.0f, &mat); @@ -1657,6 +1642,7 @@ namespace rndr { uniform_value[U_FLARE] = 2; gl_state_active_bind_texture_2d(5, lens_shaft_texture); gl_state_bind_sampler(5, rctx->render_samplers[2]); + mat4_translate(0.5f, 0.5f, 0.0f, &mat); mat4_scale_rot(&mat, lens_shaft_scale, lens_shaft_scale, 1.0f, &mat); mat4_mul_rotate_z(&mat, (lens_flare_pos.x / (float_t)width) @@ -1669,31 +1655,47 @@ namespace rndr { shader_data.g_texcoord_transforms[7] = mat.row1; } else { + gl_state_active_bind_texture_2d(5, rctx->empty_texture_2d); + gl_state_bind_sampler(5, rctx->render_samplers[2]); + shader_data.g_texcoord_transforms[6] = { 1.0f, 0.0f, 0.0f, 0.0f }; shader_data.g_texcoord_transforms[7] = { 0.0f, 1.0f, 0.0f, 0.0f }; } } else { + gl_state_active_bind_texture_2d(4, rctx->empty_texture_2d); + gl_state_bind_sampler(4, rctx->render_samplers[2]); + gl_state_active_bind_texture_2d(5, rctx->empty_texture_2d); + gl_state_bind_sampler(5, rctx->render_samplers[2]); + shader_data.g_texcoord_transforms[4] = { 1.0f, 0.0f, 0.0f, 0.0f }; shader_data.g_texcoord_transforms[5] = { 0.0f, 1.0f, 0.0f, 0.0f }; shader_data.g_texcoord_transforms[6] = { 1.0f, 0.0f, 0.0f, 0.0f }; shader_data.g_texcoord_transforms[7] = { 0.0f, 1.0f, 0.0f, 0.0f }; } - if (npr_param == 1) { - gl_state_active_bind_texture_2d(14, rend_texture[0].GetDepthTex()); - /*gl_state_active_bind_texture_2d(16, sss_contour_texture->GetColorTex()); - gl_state_active_bind_texture_2d(17, sss_contour_texture->GetDepthTex());*/ - } - else { - gl_state_active_bind_texture_2d(14, rctx_ptr->empty_texture_2d); - /*gl_state_active_bind_texture_2d(16, rctx_ptr->empty_texture_2d); - gl_state_active_bind_texture_2d(17, srctx_ptr->empty_texture_2d);*/ + if (aet_back) { + gl_state_active_bind_texture_2d(6, aet_back_tex->glid); + gl_state_bind_sampler(6, rctx->render_samplers[2]); + uniform_value[U_AET_BACK] = 1; } - gl_state_bind_sampler(14, rctx->render_samplers[1]); - /*gl_state_bind_sampler(16, rctx->render_samplers[1]); - gl_state_bind_sampler(17, rctx->render_samplers[1]);*/ + if (light_proj_tex) { + uniform_value[U_LIGHT_PROJ] = 1; + gl_state_active_bind_texture_2d(7, light_proj_tex->glid); + gl_state_bind_sampler(7, rctx->render_samplers[2]); + + shader_data.g_flare_coef.z = 1.0f; + } + else { + gl_state_active_bind_texture_2d(7, rctx->empty_texture_2d); + gl_state_bind_sampler(7, rctx->render_samplers[2]); + } + + if (aet_back && npr_param == 1) { + gl_state_active_bind_texture_2d(14, rend_texture[0].GetDepthTex()); + gl_state_bind_sampler(14, rctx->render_samplers[1]); + } rctx->tone_map_ubo.WriteMemory(shader_data); diff --git a/src/CRE/render_context.cpp b/src/CRE/render_context.cpp index 7ed0cefd..190a315c 100644 --- a/src/CRE/render_context.cpp +++ b/src/CRE/render_context.cpp @@ -50,7 +50,7 @@ void draw_state_stats::reset() { field_1C = 0; } -draw_state::draw_state() : wireframe(), wireframe_overlay(), light(), self_shadow(), +draw_state::draw_state() : wireframe(), wireframe_overlay(), shadow(), self_shadow(), shader_debug_flag(), use_global_material(), fog_height(), ex_data_mat(), field_68() { shader = true; shader_index = -1; @@ -195,6 +195,81 @@ bool light_proj::set_mat(bool set_mat) { return true; } +void obj_shader_shader_data::set_shader_flags(int32_t* shader_flags) { + g_shader_flags.x.m.alpha_mask = shader_flags[U_ALPHA_MASK]; + g_shader_flags.x.m.alpha_test = shader_flags[U_ALPHA_TEST]; + g_shader_flags.x.m.aniso = shader_flags[U_ANISO]; + g_shader_flags.x.m.aet_back = shader_flags[U_AET_BACK]; + g_shader_flags.x.m.texture_blend = shader_flags[U_TEXTURE_BLEND]; + g_shader_flags.x.m.unk = 0; //shader_flags[U_UNK_NEW_IN_MM_IDK_WHAT_TO_DO_WITH_IT]; + g_shader_flags.x.m.chara_color = shader_flags[U_CHARA_COLOR]; + g_shader_flags.x.m.clip_plane = shader_flags[U_CLIP_PLANE]; + g_shader_flags.x.m.u08 = shader_flags[U08]; + g_shader_flags.x.m.depth_peel = shader_flags[U_DEPTH_PEEL]; + g_shader_flags.x.m.depth = shader_flags[U_DEPTH]; + g_shader_flags.x.m.u0b = shader_flags[U0B]; + g_shader_flags.x.m.alpha_blend = shader_flags[U_ALPHA_BLEND]; + g_shader_flags.x.m.ripple_emit = shader_flags[U_RIPPLE_EMIT]; + g_shader_flags.x.m.esm_filter = shader_flags[U_ESM_FILTER]; + g_shader_flags.x.m.exposure = shader_flags[U_EXPOSURE]; + g_shader_flags.x.m.scene_fade = shader_flags[U_SCENE_FADE]; + g_shader_flags.x.m.fade = shader_flags[U_FADE]; + g_shader_flags.x.m.stage_ambient = shader_flags[U_STAGE_AMBIENT]; + g_shader_flags.x.m.flare = shader_flags[U_FLARE]; + g_shader_flags.y.m.fog_stage = shader_flags[U_FOG_STAGE]; + g_shader_flags.y.m.fog_chara = shader_flags[U_FOG_CHARA]; + g_shader_flags.y.m.u16 = shader_flags[U16]; + g_shader_flags.y.m.gauss = shader_flags[U_GAUSS]; + g_shader_flags.y.m.eyeball = shader_flags[U_EYEBALL]; + g_shader_flags.y.m.image_filter = shader_flags[U_IMAGE_FILTER]; + g_shader_flags.y.m.instance = shader_flags[U_INSTANCE]; + g_shader_flags.y.m.tone_curve = shader_flags[U_TONE_CURVE]; + g_shader_flags.y.m.light_proj = shader_flags[U_LIGHT_PROJ]; + g_shader_flags.y.m.magnify = shader_flags[U_MAGNIFY]; + g_shader_flags.y.m.membrane = shader_flags[U_MEMBRANE]; + g_shader_flags.y.m.mlaa = shader_flags[U_MLAA]; + g_shader_flags.y.m.mlaa_search = shader_flags[U_MLAA_SEARCH]; + g_shader_flags.y.m.morph_color = shader_flags[U_MORPH_COLOR]; + g_shader_flags.y.m.morph = shader_flags[U_MORPH]; + g_shader_flags.y.m.movie = shader_flags[U_MOVIE]; + g_shader_flags.y.m.u24 = shader_flags[U24]; + g_shader_flags.y.m.u25 = shader_flags[U25]; + g_shader_flags.y.m.npr_normal = shader_flags[U_NPR_NORMAL]; + g_shader_flags.z.m.npr = shader_flags[U_NPR]; + g_shader_flags.z.m.stage_shadow2 = shader_flags[U_STAGE_SHADOW2]; + g_shader_flags.z.m.reflect = shader_flags[U_REFLECT]; + g_shader_flags.z.m.reduce = shader_flags[U_REDUCE]; + g_shader_flags.z.m.chara_shadow = shader_flags[U_CHARA_SHADOW]; + g_shader_flags.z.m.chara_shadow2 = shader_flags[U_CHARA_SHADOW2]; + g_shader_flags.z.m.u2d = shader_flags[U2D]; + g_shader_flags.z.m.u2e = shader_flags[U2E]; + g_shader_flags.z.m.show_vector = shader_flags[U_SHOW_VECTOR]; + g_shader_flags.z.m.skinning = shader_flags[U_SKINNING]; + g_shader_flags.z.m.snow_particle = shader_flags[U_SNOW_PARTICLE]; + g_shader_flags.z.m.specular_ibl = shader_flags[U_SPECULAR_IBL]; + g_shader_flags.z.m.combiner = shader_flags[U_COMBINER]; + g_shader_flags.z.m.tex_0_type = shader_flags[U_TEX_0_TYPE]; + g_shader_flags.z.m.tex_1_type = shader_flags[U_TEX_1_TYPE]; + g_shader_flags.z.m.sss_filter = shader_flags[U_SSS_FILTER]; + g_shader_flags.w.m.sss_chara = shader_flags[U_SSS_CHARA]; + g_shader_flags.w.m.star = shader_flags[U_STAR]; + g_shader_flags.w.m.texture_count = shader_flags[U_TEXTURE_COUNT]; + g_shader_flags.w.m.env_map = shader_flags[U_ENV_MAP]; + g_shader_flags.w.m.ripple = shader_flags[U_RIPPLE]; + g_shader_flags.w.m.translucency = shader_flags[U_TRANSLUCENCY]; + g_shader_flags.w.m.normal = shader_flags[U_NORMAL]; + g_shader_flags.w.m.transparency = shader_flags[U_TRANSPARENCY]; + g_shader_flags.w.m.water_reflect = shader_flags[U_WATER_REFLECT]; + g_shader_flags.w.m.u40 = shader_flags[U40]; + g_shader_flags.w.m.u41 = shader_flags[U41]; + g_shader_flags.w.m.stage_shadow = shader_flags[U_STAGE_SHADOW]; + g_shader_flags.w.m.specular = shader_flags[U_SPECULAR]; + g_shader_flags.w.m.tone_map = shader_flags[U_TONE_MAP]; + g_shader_flags.w.m.u45 = shader_flags[U45]; + g_shader_flags.w.m.dof = shader_flags[U_DOF]; // Added + g_shader_flags.w.m.dof_stage = shader_flags[U_DOF_STAGE]; // Added +} + void obj_scene_shader_data::set_g_irradiance_r_transforms(const mat4& mat) { mat4 temp; mat4_transpose(&mat, &temp); @@ -418,9 +493,11 @@ sprite_width(), sprite_height(), screen_x_offset(), screen_y_offset(), screen_wi tone_map_ubo.Create(sizeof(tone_map_shader_data)); transparency_batch_ubo.Create(sizeof(transparency_batch_shader_data)); + obj_shader = {}; obj_scene = {}; obj_batch = {}; obj_skinning = {}; + obj_shader_ubo.Create(sizeof(obj_shader_shader_data)); obj_scene_ubo.Create(sizeof(obj_scene_shader_data)); obj_batch_ubo.Create(sizeof(obj_batch_shader_data)); obj_skinning_ubo.Create(sizeof(obj_skinning_shader_data)); @@ -554,6 +631,7 @@ render_context::~render_context() { obj_skinning_ubo.Destroy(); obj_batch_ubo.Destroy(); obj_scene_ubo.Destroy(); + obj_shader_ubo.Destroy(); tone_map_ubo.Destroy(); transparency_batch_ubo.Destroy(); diff --git a/src/CRE/render_context.hpp b/src/CRE/render_context.hpp index aa0e5ebe..bb77add1 100644 --- a/src/CRE/render_context.hpp +++ b/src/CRE/render_context.hpp @@ -43,7 +43,7 @@ struct draw_state { draw_state_stats stats_prev; bool wireframe; bool wireframe_overlay; - bool light; + bool shadow; bool self_shadow; bool shader_debug_flag; bool use_global_material; @@ -156,6 +156,105 @@ struct glitter_batch_shader_data { vec4 g_state_material_emission; }; +struct obj_shader_shader_data { + struct { + union { + struct { + uint32_t alpha_mask : 1; // bit 0 + uint32_t alpha_test : 1; // bit 1 + uint32_t aniso : 2; // bit 2:3 + uint32_t aet_back : 1; // bit 4 + uint32_t texture_blend : 3; // bit 5:7 + uint32_t unk : 2; // bit 8:9 + uint32_t chara_color : 1; // bit 10 + uint32_t clip_plane : 1; // bit 11 + uint32_t u08 : 1; // bit 12 + uint32_t depth_peel : 1; // bit 13 + uint32_t depth : 1; // bit 14 + uint32_t u0b : 1; // bit 15 + uint32_t alpha_blend : 3; // bit 16:18 + uint32_t ripple_emit : 1; // bit 19 + uint32_t esm_filter : 2; // bit 20:21 + uint32_t exposure : 2; // bit 22:23 + uint32_t scene_fade : 1; // bit 24 + uint32_t fade : 3; // bit 25:27 + uint32_t stage_ambient : 1; // bit 28 + uint32_t flare : 2; // bit 29:30 + } m; + uint32_t w; + } x; + union { + struct { + uint32_t fog_stage : 2; // bit 32+0:1 + uint32_t fog_chara : 2; // bit 32+2:3 + uint32_t u16 : 1; // bit 32+4 + uint32_t gauss : 2; // bit 32+5:6 + uint32_t eyeball : 1; // bit 32+7 + uint32_t image_filter : 3; // bit 32+8:10 + uint32_t instance : 1; // bit 32+11 + uint32_t tone_curve : 1; // bit 32+12 + uint32_t light_proj : 1; // bit 32+13 + uint32_t magnify : 4; // bit 32+14:17 + uint32_t membrane : 2; // bit 32+18:19 + uint32_t mlaa : 2; // bit 32+20:21 + uint32_t mlaa_search : 2; // bit 32+22:23 + uint32_t morph_color : 1; // bit 32+24 + uint32_t morph : 1; // bit 32+25 + uint32_t movie : 2; // bit 32+26:27 + uint32_t u24 : 2; // bit 32+28:29 + uint32_t u25 : 1; // bit 32+30 + uint32_t npr_normal : 1; // bit 32+31 + } m; + uint32_t w; + } y; + union { + struct { + uint32_t npr : 1; // bit 64+0 + uint32_t stage_shadow2 : 2; // bit 64+1:2 + uint32_t reflect : 2; // bit 64+3:4 + uint32_t reduce : 4; // bit 64+5:8 + uint32_t chara_shadow : 1; // bit 64+9 + uint32_t chara_shadow2 : 2; // bit 64+10:11 + uint32_t u2d : 3; // bit 64+12:14 + uint32_t u2e : 2; // bit 64+15:16 + uint32_t show_vector : 2; // bit 64+17:18 + uint32_t skinning : 1; // bit 64+19 + uint32_t snow_particle : 2; // bit 64+20:21 + uint32_t specular_ibl : 2; // bit 64+22:23 + uint32_t combiner : 1; // bit 64+24 + uint32_t tex_0_type : 2; // bit 64+25:26 + uint32_t tex_1_type : 2; // bit 64+27:28 + uint32_t sss_filter : 2; // bit 64+29:30 + } m; + uint32_t w; + } z; + union { + struct { + uint32_t sss_chara : 1; // bit 96+0 + uint32_t star : 1; // bit 96+1 + uint32_t texture_count : 2; // bit 96+2:3 + uint32_t env_map : 1; // bit 96+4 + uint32_t ripple : 2; // bit 96+5:6 + uint32_t translucency : 1; // bit 96+7 + uint32_t normal : 1; // bit 96+8 + uint32_t transparency : 1; // bit 96+9 + uint32_t water_reflect : 1; // bit 96+10 + uint32_t u40 : 1; // bit 96+11 + uint32_t u41 : 1; // bit 96+12 + uint32_t stage_shadow : 1; // bit 96+13 + uint32_t specular : 1; // bit 96+14 + uint32_t tone_map : 2; // bit 96+15 + uint32_t u45 : 1; // bit 96+16 + uint32_t dof : 1; // bit 96+17 // Added + uint32_t dof_stage : 3; // bit 96+18 // Added + } m; + uint32_t w; + } w; + } g_shader_flags; + + void set_shader_flags(int32_t* shader_flags); +}; + struct obj_scene_shader_data { vec4 g_irradiance_r_transforms[4]; vec4 g_irradiance_g_transforms[4]; @@ -243,7 +342,6 @@ struct obj_batch_shader_data { vec4 g_bump_depth; vec4 g_intensity; vec4 g_reflect_uv_scale; - vec4 g_texture_blend; void set_g_joint(const mat4& mat); void set_g_texcoord_transforms(int32_t index, const mat4& mat); @@ -279,7 +377,7 @@ struct sun_quad_shader_data { struct tone_map_shader_data { vec4 g_exposure; - vec4 g_flare_coef; + vec4 g_flare_coef; //xy=flare_coef, z=light_proj vec4 g_fade_color; vec4 g_tone_scale; //xyz=tone_scale, w=fade_func vec4 g_tone_offset; //xyz=tone_offset, w=inv_tone @@ -343,9 +441,11 @@ struct render_context { GL::UniformBuffer transparency_batch_ubo; GL::UniformBuffer tone_map_ubo; + obj_shader_shader_data obj_shader; obj_scene_shader_data obj_scene; obj_batch_shader_data obj_batch; obj_skinning_shader_data obj_skinning; + GL::UniformBuffer obj_shader_ubo; GL::UniformBuffer obj_scene_ubo; GL::UniformBuffer obj_batch_ubo; GL::UniformBuffer obj_skinning_ubo; diff --git a/src/CRE/render_manager.cpp b/src/CRE/render_manager.cpp index d8e451dc..a53eaeb3 100644 --- a/src/CRE/render_manager.cpp +++ b/src/CRE/render_manager.cpp @@ -1243,7 +1243,7 @@ static void draw_pass_shadow_end_make_shadowmap(Shadow* shad, int32_t index, int gl_state_disable_scissor_test(); rctx->draw_state->shader_index = -1; - if (a3 == shad->num_light - 1) { + if (a3 == shad->num_shadow - 1) { draw_pass_shadow_filter(&shad->render_textures[3], &shad->render_textures[4], shad->curr_render_textures[0], shad->field_2DC, shad->field_2E0 / (shad->field_208 * 2.0f), false); @@ -1606,11 +1606,11 @@ static void draw_pass_3d_shadow_reset(render_context* rctx) { rctx->obj_scene.set_g_self_shadow_receivers(0, mat4_identity); rctx->obj_scene.set_g_self_shadow_receivers(1, mat4_identity); rctx->draw_state->self_shadow = false; - rctx->draw_state->light = false; + rctx->draw_state->shadow = false; } static void draw_pass_3d_shadow_set(Shadow* shad, render_context* rctx) { - if (shad->self_shadow && shad->num_light > 0) { + if (shad->self_shadow && shad->num_shadow > 0) { gl_state_active_bind_texture_2d(19, shad->render_textures[3].GetColorTex()); gl_state_active_bind_texture_2d(20, shad->render_textures[5].GetColorTex()); gl_state_active_texture(0); @@ -1628,9 +1628,9 @@ static void draw_pass_3d_shadow_set(Shadow* shad, render_context* rctx) { gl_state_bind_sampler(19, rctx->render_samplers[0]); gl_state_bind_sampler(20, rctx->render_samplers[0]); - if (shad->num_light > 0) { - rctx->draw_state->light = true; - uniform_value[U_LIGHT_1] = shad->num_light > 1 ? 1 : 0; + if (shad->num_shadow > 0) { + rctx->draw_state->shadow = true; + uniform_value[U_STAGE_SHADOW2] = shad->num_shadow > 1 ? 1 : 0; float_t shadow_range = shad->get_shadow_range(); for (int32_t i = 0; i < 2; i++) { @@ -1667,7 +1667,7 @@ static void draw_pass_3d_shadow_set(Shadow* shad, render_context* rctx) { int32_t j = 0; for (int32_t i = 0; i < 2; i++) - if (shad->light_enable[i]) { + if (shad->shadow_enable[i]) { gl_state_active_bind_texture_2d(6 + j, shad->curr_render_textures[1 + i]->GetColorTex()); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 16.0f); j++; @@ -1690,7 +1690,7 @@ static void draw_pass_3d_shadow_set(Shadow* shad, render_context* rctx) { rctx->obj_scene.g_shadow_ambient1 = { 1.0f - ambient.x, 1.0f - ambient.y, 1.0f - ambient.z, 0.0f }; } else { - rctx->draw_state->light = false; + rctx->draw_state->shadow = false; for (int32_t i = 0; i < 2; i++) gl_state_active_bind_texture_2d(6 + i, shad->curr_render_textures[1 + i]->GetColorTex()); diff --git a/src/CRE/shader.cpp b/src/CRE/shader.cpp index 300aa59e..4e0d42b4 100644 --- a/src/CRE/shader.cpp +++ b/src/CRE/shader.cpp @@ -26,7 +26,7 @@ static bool shader_load_binary_shader(program_binary* bin, GLuint* program, cons static void shader_update_data(shader_set_data* set); int32_t shader::bind(shader_set_data* set, uint32_t sub_index) { - set->curr_shader = 0; + set->curr_program = 0; if (num_sub < 1) return -1; @@ -40,33 +40,23 @@ int32_t shader::bind(shader_set_data* set, uint32_t sub_index) { int32_t unival_shad_curr = 1; int32_t unival_shad = 0; - int32_t uniform_val[SHADER_MAX_UNIFORM_VALUES] = {}; if (num_uniform > 0) { const int32_t* vp_unival_max = sub_shader->vp_unival_max; const int32_t* fp_unival_max = sub_shader->fp_unival_max; int32_t i = 0; - for (i = 0; i < num_uniform && i < sizeof(uniform_val) / sizeof(int32_t); i++) { - const int32_t unival = uniform_value[use_uniform[i].first]; - const int32_t unival_max = use_uniform[i].second - ? max_def(vp_unival_max[i], fp_unival_max[i]) : 0; + for (i = 0; i < num_uniform; i++) { + const int32_t unival = uniform_value[use_uniform[i]]; + const int32_t unival_max = max_def(vp_unival_max[i], fp_unival_max[i]); unival_shad += unival_shad_curr * min_def(unival, unival_max); unival_shad_curr *= unival_max + 1; - - int32_t unival_max_glsl = max_def(vp_unival_max[i], fp_unival_max[i]); - uniform_val[i] = min_def(unival, unival_max_glsl); } } - shader_sub_shader* shader = &sub_shader->shaders[unival_shad]; - set->curr_shader = shader; + GLuint program = sub_shader->programs[unival_shad]; + set->curr_program = program; - gl_state_use_program(shader->program); - if (shader->has_uniform_val - && memcmp(shader->uniform_val, uniform_val, sizeof(uniform_val))) { - memcpy(shader->uniform_val, uniform_val, sizeof(uniform_val)); - shader->uniform_val_update = true; - } + gl_state_use_program(program); return 0; } @@ -286,7 +276,7 @@ void shader::unbind() { gl_state_use_program(0); } -shader_set_data::shader_set_data() : size(), shaders(), curr_shader(), primitive_restart(), +shader_set_data::shader_set_data() : size(), shaders(), curr_program(), primitive_restart(), primitive_restart_index(), get_index_by_name_func(), get_name_by_index_func() { } @@ -496,13 +486,12 @@ void shader_set_data::load(farc* f, bool ignore_cache, uint32_t uniform_vert_flags = 0; uint32_t uniform_frag_flags = 0; - for (int32_t k = 0; k < shader->num_uniform; k++) - if (shader->use_uniform[k].second) { - if (sub_table->vp_unival_max[k] > 0) - uniform_vert_flags |= 1 << k; - if (sub_table->fp_unival_max[k] > 0) - uniform_frag_flags |= 1 << k; - } + for (int32_t k = 0; k < shader->num_uniform; k++) { + if (sub_table->vp_unival_max[k] > 0) + uniform_vert_flags |= 1 << k; + if (sub_table->fp_unival_max[k] > 0) + uniform_frag_flags |= 1 << k; + } char uniform_vert_flags_buf[9]; char uniform_frag_flags_buf[9]; @@ -567,17 +556,16 @@ void shader_set_data::load(farc* f, bool ignore_cache, const int32_t* vp_unival_max = sub_table->vp_unival_max; const int32_t* fp_unival_max = sub_table->fp_unival_max; for (int32_t k = 0; k < num_uniform; k++) { - const int32_t unival_max = shader->use_uniform[k].second - ? max_def(vp_unival_max[k], fp_unival_max[k]) : 0; + const int32_t unival_max = max_def(vp_unival_max[k], fp_unival_max[k]); unival_shad_count += unival_shad_curr * unival_max; unival_shad_curr *= unival_max + 1; } if (!ignore_cache) program_data_binary.reserve(unival_shad_count); - shader_sub_shader* shaders = force_malloc(unival_shad_count); - sub->shaders = shaders; - if (shaders) { + GLuint* programs = force_malloc(unival_shad_count); + sub->programs = programs; + if (programs) { strcpy_s(vert_buf, sizeof(vert_buf), sub_table->vp); size_t vert_buf_pos = utf8_length(vert_buf); vert_buf[vert_buf_pos++] = '.'; @@ -596,38 +584,36 @@ void shader_set_data::load(farc* f, bool ignore_cache, for (int32_t k = 0; k < unival_shad_count; k++) { for (int32_t l = 0, m = k; l < num_uniform; l++) { - int32_t unival_max = (shader->use_uniform[l].second - ? max_def(vp_unival_max[l], fp_unival_max[l]) : 0) + 1; + int32_t unival_max = max_def(vp_unival_max[l], fp_unival_max[l]) + 1; vec_vert_data[l] = min_def(m % unival_max, vp_unival_max[l]); m /= unival_max; vert_buf[vert_buf_pos + l] = (char)('0' + vec_vert_data[l]); } for (int32_t l = 0, m = k; l < num_uniform; l++) { - int32_t unival_max = (shader->use_uniform[l].second - ? max_def(vp_unival_max[l], fp_unival_max[l]) : 0) + 1; + int32_t unival_max = max_def(vp_unival_max[l], fp_unival_max[l]) + 1; vec_frag_data[l] = min_def(m % unival_max, fp_unival_max[l]); m /= unival_max; frag_buf[frag_buf_pos + l] = (char)('0' + vec_frag_data[l]); } if (!bin || !bin->binary_format || !bin->length - || !shader_load_binary_shader(bin, &shaders[k].program, vert_buf, frag_buf)) { + || !shader_load_binary_shader(bin, &programs[k], vert_buf, frag_buf)) { bool vert_succ = shader::parse_define(vert_data, num_uniform, vec_vert_data, &temp_vert, &temp_vert_size); bool frag_succ = shader::parse_define(frag_data, num_uniform, vec_frag_data, &temp_frag, &temp_frag_size); if (ignore_cache) - shaders[k].program = shader_compile(vert_succ ? temp_vert : 0, + programs[k] = shader_compile(vert_succ ? temp_vert : 0, frag_succ ? temp_frag : 0, vert_buf, frag_buf); else { program_data_binary.push_back({}); - shaders[k].program = shader_compile_binary(vert_succ ? temp_vert : 0, + programs[k] = shader_compile_binary(vert_succ ? temp_vert : 0, frag_succ ? temp_frag : 0, vert_buf, frag_buf, &program_data_binary.back(), &buffer_size, &binary); } - shader_cache_changed |= shaders[k].program ? true : false; + shader_cache_changed |= programs[k] ? true : false; } else { program_data_binary.push_back({}); @@ -638,10 +624,6 @@ void shader_set_data::load(farc* f, bool ignore_cache, memcpy((void*)b->binary, (void*)((size_t)bin + bin->binary), bin->length); } - shaders[k].has_uniform_val = false; - if (shaders[k].program) - shaders[k].has_uniform_val = glGetUniformLocation(shaders[k].program, "uniform_val") >= 0; - if (!ignore_cache && bin) bin++; } @@ -649,29 +631,29 @@ void shader_set_data::load(farc* f, bool ignore_cache, } else { program_data_binary.reserve(1); - shader_sub_shader* shaders = force_malloc(); - sub->shaders = shaders; - if (shaders) { + GLuint* programs = force_malloc(); + sub->programs = programs; + if (programs) { strcpy_s(vert_buf, sizeof(vert_buf), sub_table->vp); strcpy_s(frag_buf, sizeof(vert_buf), sub_table->fp); strcat_s(vert_buf, sizeof(vert_buf), "..vert"); strcat_s(frag_buf, sizeof(vert_buf), "..frag"); if (!bin || !bin->binary_format || !bin->length - || !shader_load_binary_shader(bin, &shaders[0].program, vert_buf, frag_buf)) { + || !shader_load_binary_shader(bin, &programs[0], vert_buf, frag_buf)) { bool vert_succ = shader::parse_define(vert_data, &temp_vert, &temp_vert_size); bool frag_succ = shader::parse_define(frag_data, &temp_frag, &temp_frag_size); if (ignore_cache) - shaders[0].program = shader_compile(vert_succ ? temp_vert : 0, + programs[0] = shader_compile(vert_succ ? temp_vert : 0, frag_succ ? temp_frag : 0, vert_buf, frag_buf); else { program_data_binary.push_back({}); - shaders[0].program = shader_compile_binary(vert_succ ? temp_vert : 0, + programs[0] = shader_compile_binary(vert_succ ? temp_vert : 0, frag_succ ? temp_frag : 0, vert_buf, frag_buf, &program_data_binary.back(), &buffer_size, &binary); } - shader_cache_changed |= shaders[0].program ? true : false; + shader_cache_changed |= programs[0] ? true : false; } else { program_data_binary.push_back({}); @@ -682,10 +664,6 @@ void shader_set_data::load(farc* f, bool ignore_cache, memcpy((void*)b->binary, (void*)((size_t)bin + bin->binary), bin->length); } - shaders[0].has_uniform_val = false; - if (shaders[0].program) - shaders[0].has_uniform_val = glGetUniformLocation(shaders[0].program, "uniform_val") >= 0; - if (!ignore_cache && bin) bin++; } @@ -782,19 +760,18 @@ void shader_set_data::unload() { const int32_t* vp_unival_max = sub->vp_unival_max; const int32_t* fp_unival_max = sub->fp_unival_max; for (int32_t k = 0; k < num_uniform; k++) { - const int32_t unival_max = shader->use_uniform[k].second - ? max_def(vp_unival_max[k], fp_unival_max[k]) : 0; + const int32_t unival_max = max_def(vp_unival_max[k], fp_unival_max[k]); unival_shad_count += unival_shad_curr * unival_max; unival_shad_curr *= unival_max + 1; } } - if (sub->shaders) { - shader_sub_shader* shaders = sub->shaders; + if (sub->programs) { + GLuint* programs = sub->programs; for (int32_t k = 0; k < unival_shad_count; k++) - glDeleteProgram(shaders[k].program); - free(shaders); - sub->shaders = 0; + glDeleteProgram(programs[k]); + free(programs); + sub->programs = 0; } } free(shader->sub); @@ -1049,14 +1026,6 @@ static void shader_update_data(shader_set_data* set) { if (!set) return; - if (set->curr_shader) { - shader_sub_shader* shader = set->curr_shader; - if (shader->has_uniform_val && shader->uniform_val_update) { - glUniform1iv(0, SHADER_MAX_UNIFORM_VALUES, (GLint*)shader->uniform_val); - shader->uniform_val_update = false; - } - } - if (set->primitive_restart) { gl_state_enable_primitive_restart(); gl_state_set_primitive_restart_index(set->primitive_restart_index); diff --git a/src/CRE/shader.hpp b/src/CRE/shader.hpp index e1cbdc11..f224b4df 100644 --- a/src/CRE/shader.hpp +++ b/src/CRE/shader.hpp @@ -29,7 +29,7 @@ struct shader_table { int32_t num_sub; const shader_sub_table* sub; int32_t num_uniform; - const std::pair* use_uniform; + const uniform_name* use_uniform; }; struct shader; @@ -45,18 +45,11 @@ struct shader_bind_func { PFNSHADERBINDFUNCPROC bind_func; }; -struct shader_sub_shader { - GLuint program; - bool has_uniform_val; - int32_t uniform_val[SHADER_MAX_UNIFORM_VALUES]; - bool uniform_val_update; -}; - struct shader_sub { uint32_t sub_index; const int32_t* vp_unival_max; const int32_t* fp_unival_max; - shader_sub_shader* shaders; + GLuint* programs; }; struct shader { @@ -65,7 +58,7 @@ struct shader { int32_t num_sub; shader_sub* sub; int32_t num_uniform; - const std::pair* use_uniform; + const uniform_name* use_uniform; PFNSHADERBINDFUNCPROC bind_func; int32_t bind(shader_set_data* set, uint32_t sub_index); @@ -80,7 +73,7 @@ struct shader { struct shader_set_data { size_t size; shader* shaders; - shader_sub_shader* curr_shader; + GLuint curr_program; GLboolean primitive_restart; GLuint primitive_restart_index; diff --git a/src/CRE/shader_dev.cpp b/src/CRE/shader_dev.cpp index e4ea92ea..fe160f75 100644 --- a/src/CRE/shader_dev.cpp +++ b/src/CRE/shader_dev.cpp @@ -12,7 +12,6 @@ enum shader_dev_sub_enum { SHADER_DEV_SUB_SHADER_FFP = 0, SHADER_DEV_SUB_GLITTER_PT_WIREFRAME, - SHADER_DEV_SUB_GRID, SHADER_DEV_SUB_SHADER_END, }; @@ -24,8 +23,8 @@ static const int32_t glitter_particle_wireframe_fpt_unival_max[] = { -1, }; -static const std::pair GLITTER_PT_WIREFRAME_uniform[] = { - { U_INVALID , false,} +static const uniform_name GLITTER_PT_WIREFRAME_uniform[] = { + U_INVALID, }; static const shader_sub_table GLITTER_PT_WIREFRAME_table[] = { @@ -44,7 +43,7 @@ static const shader_sub_table GLITTER_PT_WIREFRAME_table[] = { SHADER_DEV_##n, \ sizeof(n##_table) / sizeof(shader_sub_table), \ n##_table, \ - sizeof(n##_uniform) / sizeof(std::pair), \ + n##_uniform[0] > 0 ? sizeof(n##_uniform) / sizeof(uniform_name) : 0, \ n##_uniform, \ } diff --git a/src/CRE/shader_ft.cpp b/src/CRE/shader_ft.cpp index 8bbe244d..27e670c9 100644 --- a/src/CRE/shader_ft.cpp +++ b/src/CRE/shader_ft.cpp @@ -17,26 +17,18 @@ enum shader_ft_sub_enum { SHADER_FT_SUB_STAGE_BLINN, SHADER_FT_SUB_SKIN_DEFAULT, SHADER_FT_SUB_SSS_SKIN, - //SHADER_FT_SUB_SSS_FILTER, SHADER_FT_SUB_SSS_FILTER_MIN, SHADER_FT_SUB_SSS_FILTER_MIN_NPR, SHADER_FT_SUB_SSS_FILTER_GAUSS_2D, SHADER_FT_SUB_HAIR_DEFAULT, - //SHADER_FT_SUB_HAIR_ANISO, SHADER_FT_SUB_HAIR_NPR1, SHADER_FT_SUB_CLOTH_DEFAULT, SHADER_FT_SUB_CLOTH_ANISO, SHADER_FT_SUB_CLOTH_NPR1, SHADER_FT_SUB_TIGHTS, SHADER_FT_SUB_SKY_DEFAULT, - //SHADER_FT_SUB_EYE_BALL, - //SHADER_FT_SUB_EYE_LENS, SHADER_FT_SUB_GLASS_EYE, - //SHADER_FT_SUB_MEMBRANE, - //SHADER_FT_SUB_SHADOWMAP, - //SHADER_FT_SUB_ESM, SHADER_FT_SUB_ESM_GAUSS, - //SHADER_FT_SUB_ESM_FILTER, SHADER_FT_SUB_ESM_FILTER_MIN, SHADER_FT_SUB_ESM_FILTER_EROSION, SHADER_FT_SUB_LIT_PROJ, @@ -44,10 +36,8 @@ enum shader_ft_sub_enum { SHADER_FT_SUB_SILHOUETTE, SHADER_FT_SUB_LAMBERT, SHADER_FT_SUB_CONSTANT, - //SHADER_FT_SUB_PEEL, SHADER_FT_SUB_TONEMAP, SHADER_FT_SUB_TONEMAP_NPR1, - //SHADER_FT_SUB_REDUCE_TEX, SHADER_FT_SUB_GHOST, SHADER_FT_SUB_REDUCE_TEX_REDUCE_2, SHADER_FT_SUB_REDUCE_TEX_REDUCE_2_ALPHAMASK, @@ -56,583 +46,393 @@ enum shader_ft_sub_enum { SHADER_FT_SUB_REDUCE_TEX_REDUCE_COMPOSITE_2, SHADER_FT_SUB_REDUCE_TEX_REDUCE_COMPOSITE_BLUR, SHADER_FT_SUB_REDUCE_TEX_REDUCE_COMPOSITE_4, - //SHADER_FT_SUB_MAGNIFY, SHADER_FT_SUB_MAGNIFY_CONE, SHADER_FT_SUB_MAGNIFY_CONE2, SHADER_FT_SUB_MAGNIFY_DIFF, SHADER_FT_SUB_MAGNIFY_DIFF2, SHADER_FT_SUB_MAGNIFY_LINEAR, - //SHADER_FT_SUB_MLAA, SHADER_FT_SUB_MLAA_EDGE, SHADER_FT_SUB_MLAA_AREA, SHADER_FT_SUB_MLAA_BLEND, SHADER_FT_SUB_CONTOUR, SHADER_FT_SUB_CONTOUR_NPR, - //SHADER_FT_SUB_EXPOSURE, SHADER_FT_SUB_EXPOSURE_MINIFY, SHADER_FT_SUB_EXPOSURE_MEASURE, SHADER_FT_SUB_EXPOSURE_AVERAGE, - //SHADER_FT_SUB_PP_GAUSS, SHADER_FT_SUB_PP_GAUSS_USUAL, SHADER_FT_SUB_PP_GAUSS_CONE, SHADER_FT_SUB_SUN, SHADER_FT_SUB_SUN_NO_TEXTURED, - //SHADER_FT_SUB_FADE, SHADER_FT_SUB_WATER01, - //SHADER_FT_SUB_WATER02, - //SHADER_FT_SUB_WATER_RING, SHADER_FT_SUB_WATER_PARTICLE, - //SHADER_FT_SUB_SNOW_PARTICLE, SHADER_FT_SUB_SNOW_PARTICLE, SHADER_FT_SUB_SNOW_PARTICLE_CPU, SHADER_FT_SUB_LEAF_PARTICLE, SHADER_FT_SUB_STAR, SHADER_FT_SUB_STAR_MILKY_WAY, - //SHADER_FT_SUB_SNOW_RING, - //SHADER_FT_SUB_SNOW_FOOTPRINT, - //SHADER_FT_SUB_SNOW_TEX_SPACE_LIGHT, - //SHADER_FT_SUB_SNOW_CALC_NORMAL, SHADER_FT_SUB_FLOOR, SHADER_FT_SUB_PUDDLE, SHADER_FT_SUB_SIMPLE_REFLECT, SHADER_FT_SUB_SIMPLE_REFRACT, SHADER_FT_SUB_RIPPLE_EMIT, SHADER_FT_SUB_RAIN, - //SHADER_FT_SUB_VOLUME_LIGHT, - //SHADER_FT_SUB_FENCE_ALPHA, SHADER_FT_SUB_RIPPLE, SHADER_FT_SUB_FOG_PTCL, SHADER_FT_SUB_PARTICLE, SHADER_FT_SUB_GLITTER_PARTICLE, - //SHADER_FT_SUB_SHOW_VECTOR, SHADER_FT_SUB_FONT, SHADER_FT_SUB_MOVIE, - //SHADER_FT_SUB_IMGFILTER, SHADER_FT_SUB_BOX4, SHADER_FT_SUB_BOX8, SHADER_FT_SUB_COPY, SHADER_FT_SUB_SPRITE, - SHADER_FT_SUB_DOF_RENDER_TILE, // Added - SHADER_FT_SUB_DOF_GATHER_TILE, // Added - SHADER_FT_SUB_DOF_DOWNSAMPLE, // Added - SHADER_FT_SUB_DOF_MAIN_FILTER, // Added - SHADER_FT_SUB_DOF_UPSAMPLE, // Added - SHADER_FT_SUB_TRANSPARENCY, // Added + SHADER_FT_SUB_DOF_RENDER_TILE, + SHADER_FT_SUB_DOF_GATHER_TILE, + SHADER_FT_SUB_DOF_DOWNSAMPLE, + SHADER_FT_SUB_DOF_MAIN_FILTER, + SHADER_FT_SUB_DOF_UPSAMPLE, + SHADER_FT_SUB_TRANSPARENCY, SHADER_FT_SUB_SHADER_END, }; static const int32_t blinn_vert_vpt_unival_max[] = { - //1, 1, 0, 1, 0, 0, 0, 3, 1, 1, 0, 0, // 11th added - 1, 0, 1, 0, 0, 0, 3, 1, 1, 0, 0, // 0th removed, 11th added -}; - -static const int32_t blinn_vert_fpt_unival_max[] = { - //0, 0, 2, 1, 0, 1, 1, 3, 0, 0, 1, 1, // 11th added - 0, 2, 1, 0, 1, 1, 3, 0, 0, 1, 1, // 0th removed, 11th added -}; - -static const int32_t blinn_frag_vpt_unival_max[] = { - //1, 1, 0, 1, 0, 0, 0, 3, 1, 1, 0, 0, // 11th added - 1, 0, 1, 0, 0, 0, 3, 1, 1, 0, 0, // 0th removed, 11th added -}; - -static const int32_t blinn_frag_fpt_unival_max[] = { - //0, 0, 2, 1, 1, 1, 1, 3, 0, 0, 1, 1, // 11th added - 0, 2, 1, 1, 1, 1, 3, 0, 0, 1, 1, // 0th removed, 11th added -}; - -static const int32_t item_blinn_vpt_unival_max[] = { - //1, 1, 1, 0, 0, 1, 0, 0, 0, 2, 0, 1, 0, 0, - 1, 1, 0, 0, 1, 0, 0, 0, 2, 0, 1, 0, 0, // 0th removed -}; - -static const int32_t item_blinn_fpt_unival_max[] = { - //1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, - 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, // 0th removed -}; - -static const int32_t stage_blinn_vpt_unival_max[] = { - //1, 1, 1, 1, 0, 0, 1, 0, 3, 0, 0, 0, // 11th added - 1, 1, 1, 0, 0, 1, 0, 3, 0, 0, 0, // 0th removed, 11th added -}; - -static const int32_t stage_blinn_fpt_unival_max[] = { - //0, 0, 0, 0, 2, 1, 1, 1, 3, 1, 1, 1, // 11th added - 0, 0, 0, 2, 1, 1, 1, 3, 1, 1, 1, // 0th removed, 11th added -}; - -static const int32_t skin_default_vpt_unival_max[] = { - //1, 1, 1, 0, 2, 0, 1, 0, 0, 0, - 1, 1, 0, 2, 0, 1, 0, 0, 0, // 0th removed -}; - -static const int32_t skin_default_fpt_unival_max[] = { - //1, 0, 1, 1, 0, 1, 0, 1, 1, 1, - 0, 1, 1, 0, 1, 0, 1, 1, 1, // 0th removed -}; - -static const int32_t sss_skin_vpt_unival_max[] = { - //1, 1, 0, 0, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, 0, // 0th removed -}; - -static const int32_t sss_skin_fpt_unival_max[] = { - //1, 0, 1, 1, 1, 0, 1, 1, - 0, 1, 1, 1, 0, 1, 1, // 0th removed -}; - -/*static const int32_t sss_filter_vpt_unival_max[] = { - //0, 3, 0, - 3, 0, // 0th removed -}; - -static const int32_t sss_filter_fpt_unival_max[] = { - //1, 3, 1, - 3, 1, // 0th removed -};*/ - -static const int32_t sss_filter_min_vpt_unival_max[] = { - //0, 0, 0, - 0, 0, // 0th removed -}; - -static const int32_t sss_filter_min_fpt_unival_max[] = { - //0, 0, 0, - 0, 0, // 0th removed -}; - -static const int32_t sss_filter_min_npr_vpt_unival_max[] = { - //0, 0, 0, - 0, 0, // 0th removed -}; - -static const int32_t sss_filter_min_npr_fpt_unival_max[] = { - //0, 0, 0, - 0, 0, // 0th removed -}; - -static const int32_t sss_filter_gauss_2d_vpt_unival_max[] = { - //0, 0, 0, - 0, 0, // 0th removed -}; - -static const int32_t sss_filter_gauss_2d_fpt_unival_max[] = { - //1, 0, 0, - 0, 0, // 0th removed -}; - -/*static const int32_t hair_default_vpt_unival_max[] = { - //1, 1, 0, 0, 1, 0, 0, 3, 0, 2, 1, 0, 0, 0, 0, // 14th added - 1, 0, 0, 1, 0, 0, 3, 0, 2, 1, 0, 0, 0, 0, // 0th removed, 14th added -}; - -static const int32_t hair_default_fpt_unival_max[] = { - //1, 0, 2, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, // 14th added - 0, 2, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, // 0th removed, 14th added -}; - -static const int32_t hair_aniso_vpt_unival_max[] = { - //1, 1, 0, 0, 1, 0, 0, 3, 0, 2, 1, 0, 0, 0, 0, // 14th added - 1, 0, 0, 1, 0, 0, 3, 0, 2, 1, 0, 0, 0, 0, // 0th removed, 14th added -}; - -static const int32_t hair_aniso_fpt_unival_max[] = { - //1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, // 14th added - 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, // 0th removed, 14th added -};*/ - -static const int32_t hair_default_vpt_unival_max[] = { - //1, 1, 0, 0, 1, 0, 0, 3, 0, 2, 1, 0, 0, 0, 0, // 14th added - 1, 0, 0, 1, 0, 0, 3, 0, 2, 1, 0, 0, 0, 0, // 0th removed, 14th added -}; - -static const int32_t hair_default_fpt_unival_max[] = { - //1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, // 14th added - 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, // 0th removed, 14th added -}; - -static const int32_t hair_npr1_vpt_unival_max[] = { - //1, 1, 0, 0, 1, 0, 0, 3, 0, 2, 1, 0, 0, 0, 0, // 14th added - 1, 0, 0, 1, 0, 0, 3, 0, 2, 1, 0, 0, 0, 0, // 0th removed, 14th added -}; - -static const int32_t hair_npr1_fpt_unival_max[] = { - //1, 0, 0, 0, 0, 1, 0, 3, 1, 0, 0, 0, 0, 0, 1, // 14th added - 0, 0, 0, 0, 1, 0, 3, 1, 0, 0, 0, 0, 0, 1, // 0th removed, 14th added -}; - -static const int32_t cloth_default_vpt_unival_max[] = { - //1, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, - 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, // 0th removed -}; - -static const int32_t cloth_default_fpt_unival_max[] = { - //1, 0, 2, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, - 0, 2, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, // 0th removed -}; - -static const int32_t cloth_aniso_vpt_unival_max[] = { - //1, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, - 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, // 0th removed -}; - -static const int32_t cloth_aniso_fpt_unival_max[] = { - //1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 3, 0, 0, 1, 1, - 0, 0, 1, 0, 1, 1, 1, 0, 1, 3, 0, 0, 1, 1, // 0th removed -}; - -static const int32_t cloth_npr1_vpt_unival_max[] = { - //1, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, - 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, // 0th removed -}; - -static const int32_t cloth_npr1_fpt_unival_max[] = { - //1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, // 0th removed -}; - -static const int32_t tights_vpt_unival_max[] = { - //1, 1, 0, 0, 0, 2, 0, 1, 0, 0, 0, - 1, 0, 0, 0, 2, 0, 1, 0, 0, 0, // 0th removed -}; - -static const int32_t tights_fpt_unival_max[] = { - //1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, - 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, // 0th removed -}; - -static const int32_t sky_default_vpt_unival_max[] = { - 0, 0, 0, 1, 1, 3, 0, // 6th added -}; - -static const int32_t sky_default_fpt_unival_max[] = { - 3, 3, 2, 0, 0, 3, 1, // 6th added -}; - -/*static const int32_t eye_ball_vpt_unival_max[] = { - 1, 0, -}; - -static const int32_t eye_ball_fpt_unival_max[] = { - 0, 1, -};*/ - -/*static const int32_t eye_lens_vpt_unival_max[] = { - 1, 0, 0, -}; - -static const int32_t eye_lens_fpt_unival_max[] = { - 0, 1, 1, -};*/ - -static const int32_t glass_eye_vpt_unival_max[] = { - //1, 1, 0, 2, 0, 1, 0, 0, - 1, 0, 2, 0, 1, 0, 0, // 0th removed -}; - -static const int32_t glass_eye_fpt_unival_max[] = { - //1, 1, 1, 0, 1, 0, 1, 1, - 1, 1, 0, 1, 0, 1, 1, // 0th removed -}; - -/*static const int32_t membrane_vpt_unival_max[] = { 1, 1, 0, }; -static const int32_t membrane_fpt_unival_max[] = { - 0, 1, 3, -};*/ - -/*static const int32_t shadowmap_vpt_unival_max[] = { - 1, 2, 1, 0, 0, +static const int32_t blinn_vert_fpt_unival_max[] = { + 0, 0, 1, }; -static const int32_t shadowmap_fpt_unival_max[] = { - 0, 2, 1, 1, 5, -};*/ - -/*static const int32_t esm_vpt_unival_max[] = { - //1, 1, 2, 1, - 1, 2, 1, // 0th removed +static const int32_t blinn_frag_vpt_unival_max[] = { + 1, 1, 0, }; -static const int32_t esm_fpt_unival_max[] = { - //0, 0, 2, 1, - 0, 2, 1, // 0th removed -};*/ - -static const int32_t esm_gauss_vpt_unival_max[] = { - 0, +static const int32_t blinn_frag_fpt_unival_max[] = { + 0, 0, 1, }; -static const int32_t esm_gauss_fpt_unival_max[] = { - 1, +static const int32_t item_blinn_vpt_unival_max[] = { + 1, 1, 0, }; -/*static const int32_t esm_filter_vpt_unival_max[] = { - 0, +static const int32_t item_blinn_fpt_unival_max[] = { + 0, 0, 1, }; -static const int32_t esm_filter_fpt_unival_max[] = { - 1, -};*/ - -static const int32_t esm_filter_min_vpt_unival_max[] = { - 0, +static const int32_t stage_blinn_vpt_unival_max[] = { + 1, 1, 0, }; -static const int32_t esm_filter_min_fpt_unival_max[] = { - 0, +static const int32_t stage_blinn_fpt_unival_max[] = { + 0, 0, 1, }; -static const int32_t esm_filter_erosion_vpt_unival_max[] = { - 0, +static const int32_t skin_default_vpt_unival_max[] = { + 1, 0, }; -static const int32_t esm_filter_erosion_fpt_unival_max[] = { - 0, -}; - -static const int32_t lit_proj_vpt_unival_max[] = { - //1, 1, 0, 1, 0, 0, 0, // 6th added - 1, 0, 1, 0, 0, 0, // 0th removed, 6th added -}; - -static const int32_t lit_proj_fpt_unival_max[] = { - //0, 0, 1, 1, 2, 1, 1, // 6th added - 0, 1, 1, 2, 1, 1, // 0th removed, 6th added -}; - -static const int32_t simple_vpt_unival_max[] = { - //1, 1, 0, 0, 1, 0, - 1, 0, // 0th removed, 3rd removed, 4th removed, 5th removed -}; - -static const int32_t simple_fpt_unival_max[] = { - //0, 0, 2, 0, 0, 3, - 0, 2, // 0th removed, 3rd removed, 4th removed, 5th removed -}; - -static const int32_t silhouette_vpt_unival_max[] = { - //1, 1, 1, 2, 1, 1, 0, 0, // 7th added - 1, 1, 2, 1, 1, 0, 0, // 0th removed, 7th added -}; - -static const int32_t silhouette_fpt_unival_max[] = { - //0, 0, 1, 0, 0, 0, 1, 1, // 7th added - 0, 1, 0, 0, 0, 1, 1, // 0th removed, 7th added -}; - -static const int32_t lambert_vpt_unival_max[] = { - //1, 1, 0, 1, 3, 1, 1, 0, 0, // 8th added - 1, 0, 1, 3, 1, 1, 0, 0, // 0th removed, 8th added -}; - -static const int32_t lambert_fpt_unival_max[] = { - //0, 0, 2, 1, 3, 0, 0, 1, 1, // 8th added - 0, 2, 1, 3, 0, 0, 1, 1, // 0th removed, 8th added -}; - -static const int32_t constant_vpt_unival_max[] = { - //1, 1, 0, 3, 1, 1, 0, // 6th added - 1, 0, 3, 1, 1, 0, // 0th removed, 6th added -}; - -static const int32_t constant_fpt_unival_max[] = { - //0, 0, 2, 3, 0, 0, 1, // 6th added - 0, 2, 3, 0, 0, 1, // 0th removed, 6th added -}; - -/*static const int32_t peel_vpt_unival_max[] = { +static const int32_t skin_default_fpt_unival_max[] = { 0, 1, }; -static const int32_t peel_fpt_unival_max[] = { +static const int32_t sss_skin_vpt_unival_max[] = { 1, 0, -};*/ +}; + +static const int32_t sss_skin_fpt_unival_max[] = { + 0, 1, +}; + +static const int32_t sss_filter_min_vpt_unival_max[] = { + -1, +}; + +static const int32_t sss_filter_min_fpt_unival_max[] = { + -1, +}; + +static const int32_t sss_filter_min_npr_vpt_unival_max[] = { + -1, +}; + +static const int32_t sss_filter_min_npr_fpt_unival_max[] = { + -1, +}; + +static const int32_t sss_filter_gauss_2d_vpt_unival_max[] = { + -1, +}; + +static const int32_t sss_filter_gauss_2d_fpt_unival_max[] = { + -1, +}; + +static const int32_t hair_default_vpt_unival_max[] = { + 1, 0, +}; + +static const int32_t hair_default_fpt_unival_max[] = { + 0, 1, +}; + +static const int32_t hair_npr1_fpt_unival_max[] = { + 0, 1, +}; + +static const int32_t cloth_default_vpt_unival_max[] = { + 1, 0, +}; + +static const int32_t cloth_default_fpt_unival_max[] = { + 0, 1, +}; + +static const int32_t cloth_aniso_fpt_unival_max[] = { + 0, 1, +}; + +static const int32_t cloth_npr1_fpt_unival_max[] = { + 0, 1, +}; + +static const int32_t tights_vpt_unival_max[] = { + 1, 0, +}; + +static const int32_t tights_fpt_unival_max[] = { + 0, 1, +}; + +static const int32_t sky_default_vpt_unival_max[] = { + 1, 0, +}; + +static const int32_t sky_default_fpt_unival_max[] = { + 0, 1, +}; + +static const int32_t glass_eye_vpt_unival_max[] = { + 1, +}; + +static const int32_t glass_eye_fpt_unival_max[] = { + 0, +}; + +static const int32_t esm_gauss_vpt_unival_max[] = { + -1, +}; + +static const int32_t esm_gauss_fpt_unival_max[] = { + -1, +}; + +static const int32_t esm_filter_min_vpt_unival_max[] = { + -1, +}; + +static const int32_t esm_filter_min_fpt_unival_max[] = { + -1, +}; + +static const int32_t esm_filter_erosion_vpt_unival_max[] = { + -1, +}; + +static const int32_t esm_filter_erosion_fpt_unival_max[] = { + -1, +}; + +static const int32_t lit_proj_vpt_unival_max[] = { + 1, 0, +}; + +static const int32_t lit_proj_fpt_unival_max[] = { + 0, 1, +}; + +static const int32_t simple_vpt_unival_max[] = { + 1, +}; + +static const int32_t simple_fpt_unival_max[] = { + 0, +}; + +static const int32_t silhouette_vpt_unival_max[] = { + 1, 1, +}; + +static const int32_t silhouette_fpt_unival_max[] = { + 0, 0, +}; + +static const int32_t lambert_vpt_unival_max[] = { + 1, 1, 0, +}; + +static const int32_t lambert_fpt_unival_max[] = { + 0, 0, 1, +}; + +static const int32_t constant_vpt_unival_max[] = { + 1, 1, 0, +}; + +static const int32_t constant_fpt_unival_max[] = { + 0, 0, 1, +}; static const int32_t tone_map_vpt_unival_max[] = { - //0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, // 0th, 7th removed + 0, 1, }; static const int32_t tone_map_fpt_unival_max[] = { - //0, 2, 2, 1, 1, 1, 0, 0, - 2, 2, 1, 1, 1, 0, // 0th, 7th removed + 2, 1, }; static const int32_t tone_map_npr1_vpt_unival_max[] = { - //0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 1, 0, 0, // 0th, 7th removed + 0, 1, }; static const int32_t tone_map_npr1_fpt_unival_max[] = { - //1, 0, 0, 1, 1, 0, 0, 1, - 0, 0, 1, 1, 0, 0, // 0th, 7th removed + 0, 1, }; -/*static const int32_t reduce_tex_vpt_unival_max[] = { - 8, 1, -}; - -static const int32_t reduce_tex_fpt_unival_max[] = { - 8, 1, -};*/ - static const int32_t reduce_tex_reduce_2_vpt_unival_max[] = { - 0, 0, + -1, }; static const int32_t reduce_tex_reduce_2_fpt_unival_max[] = { - 0, 0, + -1, }; static const int32_t reduce_tex_reduce_2_alphamask_vpt_unival_max[] = { - 0, 0, + -1, }; static const int32_t reduce_tex_reduce_2_alphamask_fpt_unival_max[] = { - 0, 0, + -1, }; static const int32_t reduce_tex_reduce_4_vpt_unival_max[] = { - 0, 0, + -1, }; static const int32_t reduce_tex_reduce_4_fpt_unival_max[] = { - 0, 0, + -1, }; static const int32_t reduce_tex_reduce_4_extract_vpt_unival_max[] = { - 0, 0, + -1, }; static const int32_t reduce_tex_reduce_4_extract_fpt_unival_max[] = { - 0, 0, + -1, }; static const int32_t ghost_vpt_unival_max[] = { - 0, 0, + -1, }; static const int32_t ghost_fpt_unival_max[] = { - 0, 0, + -1, }; static const int32_t reduce_tex_reduce_composite_2_vpt_unival_max[] = { - 0, 0, + -1, }; static const int32_t reduce_tex_reduce_composite_2_fpt_unival_max[] = { - 0, 0, + -1, }; static const int32_t reduce_tex_reduce_composite_blur_vpt_unival_max[] = { - 0, 0, + -1, }; static const int32_t reduce_tex_reduce_composite_blur_fpt_unival_max[] = { - 0, 0, + -1, }; static const int32_t reduce_tex_reduce_composite_4_vpt_unival_max[] = { - 0, 0, + -1, }; static const int32_t reduce_tex_reduce_composite_4_fpt_unival_max[] = { - 0, 0, + -1, }; -/*static const int32_t magnify_vpt_unival_max[] = { - 7, -}; - -static const int32_t magnify_fpt_unival_max[] = { - 7, -};*/ - static const int32_t magnify_linear_vpt_unival_max[] = { - 0, + -1, }; static const int32_t magnify_linear_fpt_unival_max[] = { - 0, + -1, }; static const int32_t magnify_diff_vpt_unival_max[] = { - 0, + -1, }; static const int32_t magnify_diff_fpt_unival_max[] = { - 0, + -1, }; static const int32_t magnify_diff2_vpt_unival_max[] = { - 0, + -1, }; static const int32_t magnify_diff2_fpt_unival_max[] = { - 0, + -1, }; static const int32_t magnify_cone_vpt_unival_max[] = { - 0, + -1, }; static const int32_t magnify_cone_fpt_unival_max[] = { - 0, + -1, }; static const int32_t magnify_cone2_vpt_unival_max[] = { - 0, + -1, }; static const int32_t magnify_cone2_fpt_unival_max[] = { - 0, + -1, }; -/*static const int32_t mlaa_vpt_unival_max[] = { - //0, 0, 2, 0, - 0, 2, 0, // 0th removed -}; - -static const int32_t mlaa_fpt_unival_max[] = { - //1, 1, 2, 2, - 1, 2, 2, // 0th removed -};*/ - static const int32_t mlaa_edge_vpt_unival_max[] = { - 0, 0, 0, + 0, 0, }; static const int32_t mlaa_edge_fpt_unival_max[] = { - 1, 0, 0, + 1, 0, }; static const int32_t mlaa_area_vpt_unival_max[] = { - 0, 0, 0, + 0, 0, }; static const int32_t mlaa_area_fpt_unival_max[] = { - 0, 0, 2, + 0, 2, }; static const int32_t mlaa_blend_vpt_unival_max[] = { - 0, 0, 0, + 0, 0, }; static const int32_t mlaa_blend_fpt_unival_max[] = { - 1, 0, 0, + 1, 0, }; static const int32_t contour_vpt_unival_max[] = { - //0, 1, - 1, // 0th removed + -1, }; static const int32_t contour_fpt_unival_max[] = { - //1, 1, - 1, // 0th removed + -1, }; static const int32_t contour_npr_vpt_unival_max[] = { @@ -643,60 +443,44 @@ static const int32_t contour_npr_fpt_unival_max[] = { -1, }; -/*static const int32_t exposure_vpt_unival_max[] = { - 2, -}; - -static const int32_t exposure_fpt_unival_max[] = { - 2, -};*/ - static const int32_t exposure_minify_vpt_unival_max[] = { - 0, + -1, }; static const int32_t exposure_minify_fpt_unival_max[] = { - 0, + -1, }; static const int32_t exposure_measure_vpt_unival_max[] = { - 0, + -1, }; static const int32_t exposure_measure_fpt_unival_max[] = { - 0, + -1, }; static const int32_t exposure_average_vpt_unival_max[] = { - 0, + -1, }; static const int32_t exposure_average_fpt_unival_max[] = { - 0, + -1, }; -/*static const int32_t pp_gauss_vpt_unival_max[] = { - 1, -}; - -static const int32_t pp_gauss_fpt_unival_max[] = { - 1, -};*/ - static const int32_t pp_gauss_usual_vpt_unival_max[] = { - 0, + -1, }; static const int32_t pp_gauss_usual_fpt_unival_max[] = { - 0, + -1, }; static const int32_t pp_gauss_cone_vpt_unival_max[] = { - 0, + -1, }; static const int32_t pp_gauss_cone_fpt_unival_max[] = { - 0, + -1, }; static const int32_t sun_vpt_unival_max[] = { @@ -715,38 +499,14 @@ static const int32_t sun_no_textured_fpt_unival_max[] = { -1, }; -/*static const int32_t fade_vpt_unival_max[] = { - 5, -}; - -static const int32_t fade_fpt_unival_max[] = { - 5, -};*/ - static const int32_t water01_vpt_unival_max[] = { - 1, 1, 0, 0, 0, 0, 0, 1, + 1, }; static const int32_t water01_fpt_unival_max[] = { - 0, 0, 2, 1, 1, 1, 1, 1, + 0, }; -/*static const int32_t water02_vpt_unival_max[] = { - -1, -}; - -static const int32_t water02_fpt_unival_max[] = { - -1, -};*/ - -/*static const int32_t water_ring_vpt_unival_max[] = { - 1, 0, -}; - -static const int32_t water_ring_fpt_unival_max[] = { - 1, 1, -};*/ - static const int32_t water_particle_vpt_unival_max[] = { -1, }; @@ -755,28 +515,20 @@ static const int32_t water_particle_fpt_unival_max[] = { -1, }; -/*static const int32_t snow_particle_vpt_unival_max[] = { - 1, -}; - -static const int32_t snow_particle_fpt_unival_max[] = { - 1, -};*/ - static const int32_t snow_particle_vpt_unival_max[] = { - 0, + -1, }; static const int32_t snow_particle_fpt_unival_max[] = { - 0, + -1, }; static const int32_t snow_particle_cpu_vpt_unival_max[] = { - 0, + -1, }; static const int32_t snow_particle_cpu_fpt_unival_max[] = { - 0, + -1, }; static const int32_t leaf_particle_vpt_unival_max[] = { @@ -787,94 +539,52 @@ static const int32_t leaf_particle_fpt_unival_max[] = { -1, }; -/*static const int32_t star_vpt_unival_max[] = { - 1, -}; - -static const int32_t star_fpt_unival_max[] = { - 1, -};*/ - static const int32_t star_vpt_unival_max[] = { - 0, + -1, }; static const int32_t star_fpt_unival_max[] = { - 0, + -1, }; static const int32_t star_milky_way_vpt_unival_max[] = { - 0, + -1, }; static const int32_t star_milky_way_fpt_unival_max[] = { - 0, -}; - -static const int32_t snow_ring_vpt_unival_max[] = { - 0, 0, 0, 1, 0, -}; - -static const int32_t snow_ring_fpt_unival_max[] = { - 2, 1, 1, 1, 1, -}; - -static const int32_t snow_footprint_vpt_unival_max[] = { - -1, -}; - -static const int32_t snow_footprint_fpt_unival_max[] = { - -1, -}; - -static const int32_t snow_tex_space_light_vpt_unival_max[] = { - -1, -}; - -static const int32_t snow_tex_space_light_fpt_unival_max[] = { - -1, -}; - -static const int32_t snow_calc_normal_vpt_unival_max[] = { - -1, -}; - -static const int32_t snow_calc_normal_fpt_unival_max[] = { -1, }; static const int32_t floor_vpt_unival_max[] = { - 0, 0, 1, 0, 3, 1, 1, 0, + 0, 0, }; static const int32_t floor_fpt_unival_max[] = { - 2, 1, 1, 1, 3, 0, 0, 1, // 7th added + 1, 1, }; static const int32_t puddle_vpt_unival_max[] = { - 0, 1, 0, 3, + -1, }; static const int32_t puddle_fpt_unival_max[] = { - 1, 1, 1, 3, + -1, }; static const int32_t simple_reflect_vpt_unival_max[] = { - //1, 1, 2, 1, 1, 0, 0, 0, 0, 0, - 1, 2, 1, 1, 0, 0, 0, 0, 0, // 0th removed + 1, 1, 0, }; static const int32_t simple_reflect_fpt_unival_max[] = { - //0, 0, 2, 0, 0, 1, 1, 2, 1, 1, - 0, 2, 0, 0, 1, 1, 2, 1, 1, // 0th removed + 0, 0, 1, }; static const int32_t simple_refract_vpt_unival_max[] = { - 1, 0, + 1, }; static const int32_t simple_refract_fpt_unival_max[] = { - 0, 1, + 0, }; static const int32_t ripple_emit_vpt_unival_max[] = { @@ -893,22 +603,6 @@ static const int32_t rain_fpt_unival_max[] = { -1, }; -/*static const int32_t volume_light_vpt_unival_max[] = { - -1, -}; - -static const int32_t volume_light_fpt_unival_max[] = { - -1, -};*/ - -/*static const int32_t fence_alpha_vpt_unival_max[] = { - 1, 3, -}; - -static const int32_t fence_alpha_fpt_unival_max[] = { - 0, 3, -};*/ - static const int32_t ripple_vpt_unival_max[] = { 0, }; @@ -934,31 +628,19 @@ static const int32_t particle_fpt_unival_max[] = { }; static const int32_t glitter_particle_vpt_unival_max[] = { - 2, 0, 3, 0, + -1, }; static const int32_t glitter_particle_fpt_unival_max[] = { - 2, 3, 3, 3, + -1, }; -/*static const int32_t show_vector_vpt_unival_max[] = { - //1, 1, 3, - 1, 3, // 0th removed -}; - -static const int32_t show_vector_fpt_unival_max[] = { - //0, 0, 0, - 0, 0, // 0th removed -};*/ - static const int32_t font_vpt_unival_max[] = { - //0, - -1, // 0th removed, 1st added + -1, }; static const int32_t font_fpt_unival_max[] = { - //1, - -1, // 0th removed, 1st added + -1, }; static const int32_t movie_vpt_unival_max[] = { @@ -969,37 +651,30 @@ static const int32_t movie_fpt_unival_max[] = { 1, }; -/*static const int32_t imgfilter_vpt_unival_max[] = { - 0, -}; - -static const int32_t imgfilter_fpt_unival_max[] = { - 5, -};*/ - static const int32_t box4_vpt_unival_max[] = { - 0, + -1, }; static const int32_t box4_fpt_unival_max[] = { - 0, + -1, }; static const int32_t box8_vpt_unival_max[] = { - 0, + -1, }; static const int32_t box8_fpt_unival_max[] = { - 0, + -1, }; static const int32_t copy_vpt_unival_max[] = { - 0, + -1, }; static const int32_t copy_fpt_unival_max[] = { - 0, + -1, }; + static const int32_t sprite_vpt_unival_max[] = { 0, 0, 0, }; @@ -1008,51 +683,51 @@ static const int32_t sprite_fpt_unival_max[] = { 3, 3, 2, }; -static const int32_t dof_render_tile_vpt_unival_max[] = { // Added +static const int32_t dof_render_tile_vpt_unival_max[] = { 0, }; -static const int32_t dof_render_tile_fpt_unival_max[] = { // Added +static const int32_t dof_render_tile_fpt_unival_max[] = { 1, }; -static const int32_t dof_gather_tile_vpt_unival_max[] = { // Added +static const int32_t dof_gather_tile_vpt_unival_max[] = { 0, }; -static const int32_t dof_gather_tile_fpt_unival_max[] = { // Added +static const int32_t dof_gather_tile_fpt_unival_max[] = { 0, }; -static const int32_t dof_downsample_vpt_unival_max[] = { // Added +static const int32_t dof_downsample_vpt_unival_max[] = { 0, }; -static const int32_t dof_downsample_fpt_unival_max[] = { // Added +static const int32_t dof_downsample_fpt_unival_max[] = { 1, }; -static const int32_t dof_main_filter_vpt_unival_max[] = { // Added +static const int32_t dof_main_filter_vpt_unival_max[] = { 0, }; -static const int32_t dof_main_filter_fpt_unival_max[] = { // Added +static const int32_t dof_main_filter_fpt_unival_max[] = { 1, }; -static const int32_t dof_upsample_vpt_unival_max[] = { // Added +static const int32_t dof_upsample_vpt_unival_max[] = { 0, }; -static const int32_t dof_upsample_fpt_unival_max[] = { // Added +static const int32_t dof_upsample_fpt_unival_max[] = { 1, }; -static const int32_t transparency_vpt_unival_max[] = { // Added +static const int32_t transparency_vpt_unival_max[] = { -1, }; -static const int32_t transparency_fpt_unival_max[] = { // Added +static const int32_t transparency_fpt_unival_max[] = { -1, }; @@ -1113,16 +788,6 @@ static const shader_sub_table SSS_SKIN_table[] = { }, }; -/*static const shader_sub_table SSS_FILT_table[] = { - { - SHADER_FT_SUB_SSS_FILTER, - sss_filter_vpt_unival_max, - sss_filter_fpt_unival_max, - "sss_filter", - "sss_filter", - }, -};*/ - static const shader_sub_table SSS_FILT_table[] = { { SHADER_FT_SUB_SSS_FILTER_MIN, @@ -1147,30 +812,6 @@ static const shader_sub_table SSS_FILT_table[] = { }, }; -/*static const shader_sub_table HAIR_table[] = { - { - SHADER_FT_SUB_HAIR_DEFAULT, - hair_default_vpt_unival_max, - hair_default_fpt_unival_max, - "hair_default", - "hair_default", - }, - { - SHADER_FT_SUB_HAIR_ANISO, - hair_aniso_vpt_unival_max, - hair_aniso_fpt_unival_max, - "hair_default", - "hair_aniso", - }, - { - SHADER_FT_SUB_HAIR_NPR1, - hair_npr1_vpt_unival_max, - hair_npr1_fpt_unival_max, - "hair_default", - "hair_npr1", - }, -};*/ - static const shader_sub_table HAIR_table[] = { { SHADER_FT_SUB_HAIR_DEFAULT, @@ -1181,7 +822,7 @@ static const shader_sub_table HAIR_table[] = { }, { SHADER_FT_SUB_HAIR_NPR1, - hair_npr1_vpt_unival_max, + hair_default_vpt_unival_max, hair_npr1_fpt_unival_max, "hair_default", "hair_npr1", @@ -1198,14 +839,14 @@ static const shader_sub_table CLOTH_table[] = { }, { SHADER_FT_SUB_CLOTH_ANISO, - cloth_aniso_vpt_unival_max, + cloth_default_vpt_unival_max, cloth_aniso_fpt_unival_max, "cloth_default", "cloth_aniso", }, { SHADER_FT_SUB_CLOTH_NPR1, - cloth_npr1_vpt_unival_max, + cloth_default_vpt_unival_max, cloth_npr1_fpt_unival_max, "cloth_default", "cloth_npr1", @@ -1232,26 +873,6 @@ static const shader_sub_table SKY_table[] = { }, }; -/*static const shader_sub_table EYEBALL_table[] = { - { - SHADER_FT_SUB_EYE_BALL, - eye_ball_vpt_unival_max, - eye_ball_fpt_unival_max, - "eye_ball", - "eye_ball", - }, -};*/ - -/*static const shader_sub_table EYELENS_table[] = { - { - SHADER_FT_SUB_EYE_LENS, - eye_lens_vpt_unival_max, - eye_lens_fpt_unival_max, - "eye_lens", - "eye_lens", - }, -};*/ - static const shader_sub_table GLASEYE_table[] = { { SHADER_FT_SUB_GLASS_EYE, @@ -1262,36 +883,6 @@ static const shader_sub_table GLASEYE_table[] = { }, }; -/*static const shader_sub_table MEMBRAN_table[] = { - { - SHADER_FT_SUB_MEMBRANE, - membrane_vpt_unival_max, - membrane_fpt_unival_max, - "membrane", - "membrane", - }, -};*/ - -/*static const shader_sub_table SHDMAP_table[] = { - { - SHADER_FT_SUB_SHADOWMAP, - shadowmap_vpt_unival_max, - shadowmap_fpt_unival_max, - "shadowmap", - "shadowmap", - }, -};*/ - -/*static const shader_sub_table ESM_table[] = { - { - SHADER_FT_SUB_ESM, - esm_vpt_unival_max, - esm_fpt_unival_max, - "esm", - "esm", - }, -};*/ - static const shader_sub_table ESMGAUSS_table[] = { { SHADER_FT_SUB_ESM_GAUSS, @@ -1302,16 +893,6 @@ static const shader_sub_table ESMGAUSS_table[] = { }, }; -/*static const shader_sub_table ESMFILT_table[] = { - { - SHADER_FT_SUB_ESM_FILTER, - esm_filter_vpt_unival_max, - esm_filter_fpt_unival_max, - "esm_filter", - "esm_filter", - }, -};*/ - static const shader_sub_table ESMFILT_table[] = { { SHADER_FT_SUB_ESM_FILTER_MIN, @@ -1379,16 +960,6 @@ static const shader_sub_table CONSTANT_table[] = { }, }; -/*static const shader_sub_table PEEL_table[] = { - { - SHADER_FT_SUB_PEEL, - peel_vpt_unival_max, - peel_fpt_unival_max, - "depth_peel", - "depth_peel", - }, -};*/ - static const shader_sub_table TONEMAP_table[] = { { SHADER_FT_SUB_TONEMAP, @@ -1406,16 +977,6 @@ static const shader_sub_table TONEMAP_table[] = { }, }; -/*static const shader_sub_table REDUCE_table[] = { - { - SHADER_FT_SUB_REDUCE_TEX, - reduce_tex_vpt_unival_max, - reduce_tex_fpt_unival_max, - "reduce_tex", - "reduce_tex", - }, -};*/ - static const shader_sub_table REDUCE_table[] = { { SHADER_FT_SUB_REDUCE_TEX_REDUCE_2, @@ -1475,16 +1036,6 @@ static const shader_sub_table REDUCE_table[] = { }, }; -/*static const shader_sub_table MAGNIFY_table[] = { - { - SHADER_FT_SUB_MAGNIFY, - magnify_vpt_unival_max, - magnify_fpt_unival_max, - "magnify", - "magnify", - }, -};*/ - static const shader_sub_table MAGNIFY_table[] = { { SHADER_FT_SUB_MAGNIFY_LINEAR, @@ -1523,16 +1074,6 @@ static const shader_sub_table MAGNIFY_table[] = { }, }; -/*static const shader_sub_table MLAA_table[] = { - { - SHADER_FT_SUB_MLAA, - mlaa_vpt_unival_max, - mlaa_fpt_unival_max, - "mlaa", - "mlaa", - }, -};*/ - static const shader_sub_table MLAA_table[] = { { SHADER_FT_SUB_MLAA_EDGE, @@ -1577,16 +1118,6 @@ static const shader_sub_table CONTOUR_NPR_table[] = { }, }; -/*static const shader_sub_table EXPOSURE_table[] = { - { - SHADER_FT_SUB_EXPOSURE, - exposure_vpt_unival_max, - exposure_fpt_unival_max, - "exposure", - "exposure", - }, -};*/ - static const shader_sub_table EXPOSURE_table[] = { { SHADER_FT_SUB_EXPOSURE_MINIFY, @@ -1611,16 +1142,6 @@ static const shader_sub_table EXPOSURE_table[] = { }, }; -/*static const shader_sub_table GAUSS_table[] = { - { - SHADER_FT_SUB_PP_GAUSS, - pp_gauss_vpt_unival_max, - pp_gauss_fpt_unival_max, - "pp_gauss", - "pp_gauss", - }, -};*/ - static const shader_sub_table GAUSS_table[] = { { SHADER_FT_SUB_PP_GAUSS_USUAL, @@ -1658,16 +1179,6 @@ static const shader_sub_table SUN_NO_TEXTURED_table[] = { }, }; -/*static const shader_sub_table FADE_table[] = { - { - SHADER_FT_SUB_FADE, - fade_vpt_unival_max, - fade_fpt_unival_max, - "fade", - "fade", - }, -};*/ - static const shader_sub_table WATER01_table[] = { { SHADER_FT_SUB_WATER01, @@ -1678,26 +1189,6 @@ static const shader_sub_table WATER01_table[] = { }, }; -/*static const shader_sub_table WATER02_table[] = { - { - SHADER_FT_SUB_WATER02, - water02_vpt_unival_max, - water02_fpt_unival_max, - "water02", - "water02", - }, -};*/ - -/*static const shader_sub_table WATRING_table[] = { - { - SHADER_FT_SUB_WATER_RING, - water_ring_vpt_unival_max, - water_ring_fpt_unival_max, - "water_ring", - "water_ring", - }, -};*/ - static const shader_sub_table W_PTCL_table[] = { { SHADER_FT_SUB_WATER_PARTICLE, @@ -1708,16 +1199,6 @@ static const shader_sub_table W_PTCL_table[] = { }, }; -/*static const shader_sub_table SNOW_PT_table[] = { - { - SHADER_FT_SUB_SNOW_PARTICLE, - snow_particle_vpt_unival_max, - snow_particle_fpt_unival_max, - "snow_particle", - "snow_particle", - }, -};*/ - static const shader_sub_table SNOW_PT_table[] = { { SHADER_FT_SUB_SNOW_PARTICLE, @@ -1762,46 +1243,6 @@ static const shader_sub_table STAR_table[] = { }, }; -/*static const shader_sub_table SNORING_table[] = { - { - SHADER_FT_SUB_SNOW_RING, - snow_ring_vpt_unival_max, - snow_ring_fpt_unival_max, - "snow_ring", - "snow_ring", - }, -}; - -static const shader_sub_table SN_FOOT_table[] = { - { - SHADER_FT_SUB_SNOW_FOOTPRINT, - snow_footprint_vpt_unival_max, - snow_footprint_fpt_unival_max, - "snow_footprint", - "snow_footprint", - }, -}; - -static const shader_sub_table SN_TSL_table[] = { - { - SHADER_FT_SUB_SNOW_TEX_SPACE_LIGHT, - snow_tex_space_light_vpt_unival_max, - snow_tex_space_light_fpt_unival_max, - "snow_tex_space_light", - "snow_tex_space_light", - }, -}; - -static const shader_sub_table SN_NRM_table[] = { - { - SHADER_FT_SUB_SNOW_CALC_NORMAL, - snow_calc_normal_vpt_unival_max, - snow_calc_normal_fpt_unival_max, - "snow_calc_normal", - "snow_calc_normal", - }, -};*/ - static const shader_sub_table FLOOR_table[] = { { SHADER_FT_SUB_FLOOR, @@ -1862,26 +1303,6 @@ static const shader_sub_table RAIN_table[] = { }, }; -/*static const shader_sub_table VOLLIT_table[] = { - { - SHADER_FT_SUB_VOLUME_LIGHT, - volume_light_vpt_unival_max, - volume_light_fpt_unival_max, - "volume_light", - "volume_light", - }, -};*/ - -/*static const shader_sub_table FENCE_table[] = { - { - SHADER_FT_SUB_FENCE_ALPHA, - fence_alpha_vpt_unival_max, - fence_alpha_fpt_unival_max, - "fence_alpha", - "fence_alpha", - }, -};*/ - static const shader_sub_table RIPPLE_table[] = { { SHADER_FT_SUB_RIPPLE, @@ -1922,16 +1343,6 @@ static const shader_sub_table GLITTER_PT_table[] = { }, }; -/*static const shader_sub_table SHOW_VEC_table[] = { - { - SHADER_FT_SUB_SHOW_VECTOR, - show_vector_vpt_unival_max, - show_vector_fpt_unival_max, - "show_vector", - "show_vector", - }, -};*/ - static const shader_sub_table FONT_table[] = { { SHADER_FT_SUB_FONT, @@ -1952,16 +1363,6 @@ static const shader_sub_table MOVIE_table[] = { }, }; -/*static const shader_sub_table IMGFILT_table[] = { - { - SHADER_FT_SUB_IMGFILTER, - imgfilter_vpt_unival_max, - imgfilter_fpt_unival_max, - "imgfilter", - "imgfilter", - }, -};*/ - static const shader_sub_table IMGFILT_table[] = { { SHADER_FT_SUB_BOX4, @@ -1996,7 +1397,7 @@ static const shader_sub_table SPRITE_table[] = { }, }; -static const shader_sub_table DOF_table[] = { // Added +static const shader_sub_table DOF_table[] = { { SHADER_FT_SUB_DOF_RENDER_TILE, dof_render_tile_vpt_unival_max, @@ -2034,7 +1435,7 @@ static const shader_sub_table DOF_table[] = { // Added }, }; -static const shader_sub_table TRANSPARENCY_table[] = { // Added +static const shader_sub_table TRANSPARENCY_table[] = { { SHADER_FT_SUB_TRANSPARENCY, transparency_vpt_unival_max, @@ -2044,475 +1445,226 @@ static const shader_sub_table TRANSPARENCY_table[] = { // Added }, }; -static const std::pair BLINN_uniform[] = { - //{ U16 , true }, // 0th removed - { U_SKINNING , true }, - { U_TEXTURE_COUNT, false }, - { U_LIGHT_0 , false }, - { U_NORMAL , false }, - { U_SPECULAR , false }, - { U_ENV_MAP , false }, - { U_FOG_HEIGHT , false }, - { U_MORPH , true }, - { U_MORPH_COLOR , true }, - { U_LIGHT_1 , false }, - { U_ALPHA_TEST , true }, // 11th added +static const uniform_name BLINN_uniform[] = { + U_SKINNING, + U_MORPH, + U_ALPHA_TEST, }; -static const std::pair ITEM_uniform[] = { - //{ U16 , true }, // 0th removed - { U_SKINNING , true }, - { U_MORPH , true }, - { U_SPECULAR_IBL , false }, - { U_SPECULAR , false }, - { U_NORMAL , false }, - { U_TEXTURE_COUNT, false }, - { U_ENV_MAP , false }, - { U_SELF_SHADOW , true }, - { U_FOG , false }, - { U_ALPHA_TEST , true }, - { U_SHADOW , false }, - { U_CHARA_COLOR , false }, - { U_TONE_CURVE , false }, +static const uniform_name ITEM_uniform[] = { + U_SKINNING, + U_MORPH, + U_ALPHA_TEST, }; -static const std::pair STAGE_uniform[] = { - //{ U16 , true }, // 0th removed - { U_SKINNING , true }, - { U_MORPH , true }, - { U_MORPH_COLOR , true }, - { U_TEXTURE_COUNT, false }, - { U_ENV_MAP , false }, - { U_LIGHT_0 , false }, - { U_NORMAL , false }, - { U_FOG_HEIGHT , false }, - { U_LIGHT_1 , false }, - { U_STAGE_AMBIENT, false }, - { U_ALPHA_TEST , true }, // 11th added +static const uniform_name STAGE_uniform[] = { + U_SKINNING, + U_MORPH, + U_ALPHA_TEST, }; -static const std::pair SKIN_uniform[] = { - //{ U16 , true }, // 0th removed - { U_SKINNING , true }, - { U_NORMAL , false }, - { U_SELF_SHADOW , true }, - { U_FOG , false }, - { U_ALPHA_TEST , true }, - { U_SHADOW , false }, - { U_NPR , true }, - { U_CHARA_COLOR , false }, - { U_TONE_CURVE , false }, +static const uniform_name SKIN_uniform[] = { + U_SKINNING, + U_ALPHA_TEST, }; -static const std::pair SSS_SKIN_uniform[] = { - //{ U16 , true }, // 0th removed - { U_SKINNING , true }, - { U_SSS_CHARA , true }, - { U_ALPHA_TEST , true }, - { U_SELF_SHADOW , true }, - { U_SHADOW , false }, - { U_NPR , true }, - { U_NPR_NORMAL , false }, +static const uniform_name SSS_SKIN_uniform[] = { + U_SKINNING, + U_ALPHA_TEST, }; -static const std::pair SSS_FILT_uniform[] = { - //{ U16 , true }, // 0th removed - { U_SSS_FILTER , true }, - { U_NPR , true }, +static const uniform_name SSS_FILT_uniform[] = { + U_INVALID, }; -static const std::pair HAIR_uniform[] = { - //{ U16 , true }, // 0th removed - { U_SKINNING , true }, - { U_SPECULAR_IBL , false }, - { U_SPECULAR , false }, - { U_NORMAL , false }, - { U_TRANSPARENCY , false }, - { U_TRANSLUCENCY , false }, - { U_ANISO , false }, - { U_SELF_SHADOW , true }, - { U_FOG , false }, - { U_SHADOW , false }, - { U_NPR , false }, - { U_CHARA_COLOR , false }, - { U_TONE_CURVE , false }, - { U_ALPHA_TEST , true }, // 14th added +static const uniform_name HAIR_uniform[] = { + U_SKINNING, + U_ALPHA_TEST, }; -static const std::pair CLOTH_uniform[] = { - //{ U16 , true }, // 0th removed - { U_SKINNING , true }, - { U_SPECULAR_IBL , false }, - { U_SPECULAR , false }, - { U_NORMAL , false }, - { U_TRANSPARENCY , false }, - { U_ENV_MAP , false }, - { U_SELF_SHADOW , true }, - { U_FOG , false }, - { U_ALPHA_TEST , true }, - { U_ANISO , false }, - { U_SHADOW , false }, - { U_NPR , false }, - { U_CHARA_COLOR , false }, - { U_TONE_CURVE , false }, +static const uniform_name CLOTH_uniform[] = { + U_SKINNING, + U_ALPHA_TEST, }; -static const std::pair TIGHTS_uniform[] = { - //{ U16 , true }, // 0th removed - { U_SKINNING , true }, - { U_SPECULAR , false }, - { U_ENV_MAP , false }, - { U_SELF_SHADOW , true }, - { U_FOG , false }, - { U_ALPHA_TEST , true }, - { U_SHADOW , false }, - { U_NPR , false }, - { U_CHARA_COLOR , false }, - { U_TONE_CURVE , false }, +static const uniform_name TIGHTS_uniform[] = { + U_SKINNING, + U_ALPHA_TEST, }; -static const std::pair SKY_uniform[] = { - { U_TEX_0_TYPE , false }, - { U_TEX_1_TYPE , false }, - { U_TEXTURE_COUNT, false }, - { U_MORPH , true }, - { U_MORPH_COLOR , true }, - { U_FOG_HEIGHT , false }, - { U_ALPHA_TEST , true }, // 6th added +static const uniform_name SKY_uniform[] = { + U_MORPH, + U_ALPHA_TEST, }; -/*static const std::pair EYEBALL_uniform[] = { - { U_SKINNING , true }, - { U_ENV_MAP , false }, -};*/ - -/*static const std::pair EYELENS_uniform[] = { - { U_SKINNING , true }, - { U_SPECULAR , false }, - { U_ENV_MAP , false }, -};*/ - -static const std::pair GLASEYE_uniform[] = { - //{ U16 , true }, // 0th removed - { U_SKINNING , true }, - { U_SELF_SHADOW , true }, - { U_FOG , false }, - { U_EYEBALL , false }, - { U_SHADOW , false }, - { U_CHARA_COLOR , false }, - { U_TONE_CURVE , false }, +static const uniform_name GLASEYE_uniform[] = { + U_SKINNING, }; -/*static const std::pair MEMBRAN_uniform[] = { - { U_SKINNING , true }, - { U_NORMAL , false }, - { U_MEMBRANE , false }, -};*/ - -/*static const std::pair SHDMAP_uniform[] = { - { U_SKINNING , true }, - { U_TEXTURE_COUNT, false }, - { U_TRANSPARENCY , false }, - { U_LIGHT_1 , false }, - { U2D , true }, -};*/ - -/*static const std::pair ESM_uniform[] = { - //{ U16 , true }, // 0th removed - { U_SKINNING , true }, - { U_TEXTURE_COUNT, false }, - { U_TRANSPARENCY , false }, -};*/ - -static const std::pair ESMGAUSS_uniform[] = { - { U_LIGHT_PROJ , true }, +static const uniform_name ESMGAUSS_uniform[] = { + U_INVALID, }; -static const std::pair ESMFILT_uniform[] = { - { U_ESM_FILTER , true }, +static const uniform_name ESMFILT_uniform[] = { + U_INVALID, }; -static const std::pair LITPROJ_uniform[] = { - //{ U16 , true }, // 0th removed - { U_SKINNING , true }, - { U_SPECULAR , false }, - { U_NORMAL , false }, - { U_TEXTURE_COUNT, false }, - { U_TRANSPARENCY , false }, - { U_ALPHA_TEST , true }, // 6th added +static const uniform_name LITPROJ_uniform[] = { + U_SKINNING, + U_ALPHA_TEST, }; -static const std::pair SIMPLE_uniform[] = { - //{ U16 , true }, // 0th removed - { U_SKINNING , true }, - { U_TEXTURE_COUNT, false }, - //{ U_NORMAL , false }, // 3rd removed - //{ U_INSTANCE , false }, // 4th removed - //{ U2E , false }, // 5th removed +static const uniform_name SIMPLE_uniform[] = { + U_SKINNING, }; -static const std::pair SIL_uniform[] = { - //{ U16 , true }, // 0th removed - { U_SKINNING , true }, - { U_TRANSPARENCY , false }, - { U_TEXTURE_COUNT, false }, - { U_MORPH , true }, - { U_MORPH_COLOR , true }, - { U_DEPTH , true }, - { U_ALPHA_TEST , true }, // 7th added +static const uniform_name SIL_uniform[] = { + U_SKINNING, + U_MORPH, }; -static const std::pair LAMBERT_uniform[] = { - //{ U16 , true }, // 0th removed - { U_SKINNING , true }, - { U_TEXTURE_COUNT, false }, - { U_LIGHT_0 , false }, - { U_FOG_HEIGHT , false }, - { U_MORPH , true }, - { U_MORPH_COLOR , true }, - { U_LIGHT_1 , false }, - { U_ALPHA_TEST , true }, // 8th added +static const uniform_name LAMBERT_uniform[] = { + U_SKINNING, + U_MORPH, + U_ALPHA_TEST, }; -static const std::pair CONSTANT_uniform[] = { - //{ U16 , true }, // 0th removed - { U_SKINNING , true }, - { U_TEXTURE_COUNT, false }, - { U_FOG_HEIGHT , false }, - { U_MORPH , true }, - { U_MORPH_COLOR , true }, - { U_ALPHA_TEST , true }, // 6th added +static const uniform_name CONSTANT_uniform[] = { + U_SKINNING, + U_MORPH, + U_ALPHA_TEST, }; -/*static const std::pair PEEL_uniform[] = { - { U_DEPTH_PEEL , false }, - { U_SKINNING , true }, -};*/ - -static const std::pair TONEMAP_uniform[] = { - //{ U16 , true }, // 0th removed - { U_TONE_MAP , false }, - { U_FLARE , false }, - { U_SCENE_FADE , false }, - { U_AET_BACK , false }, - { U_LIGHT_PROJ , false }, - { U_NPR , false }, - //{ U25 , false }, 7th removed +static const uniform_name TONEMAP_uniform[] = { + U_TONE_MAP, + U_AET_BACK, }; -static const std::pair REDUCE_uniform[] = { - { U_REDUCE , true }, - { U_ALPHA_MASK , true }, +static const uniform_name REDUCE_uniform[] = { + U_INVALID, }; -static const std::pair MAGNIFY_uniform[] = { - { U_MAGNIFY , true }, +static const uniform_name MAGNIFY_uniform[] = { + U_INVALID, }; -static const std::pair MLAA_uniform[] = { - //{ U16 , true }, // 0th removed - { U_ALPHA_MASK , true }, - { U_MLAA , true }, - { U_MLAA_SEARCH , true }, +static const uniform_name MLAA_uniform[] = { + U_ALPHA_MASK, + U_MLAA_SEARCH, }; -static const std::pair CONTOUR_uniform[] = { - //{ U16 , true }, // 0th removed - { U24 , false }, +static const uniform_name CONTOUR_uniform[] = { + U_INVALID, }; -static const std::pair CONTOUR_NPR_uniform[] = { - { U_INVALID , false }, +static const uniform_name CONTOUR_NPR_uniform[] = { + U_INVALID, }; -static const std::pair EXPOSURE_uniform[] = { - { U_EXPOSURE , true }, +static const uniform_name EXPOSURE_uniform[] = { + U_INVALID, }; -static const std::pair GAUSS_uniform[] = { - { U_GAUSS , true }, +static const uniform_name GAUSS_uniform[] = { + U_INVALID, }; -static const std::pair SUN_uniform[] = { - { U_INVALID , false }, +static const uniform_name SUN_uniform[] = { + U_INVALID, }; -static const std::pair SUN_NO_TEXTURED_uniform[] = { - { U_INVALID , false }, +static const uniform_name SUN_NO_TEXTURED_uniform[] = { + U_INVALID, }; -/*static const std::pair FADE_uniform[] = { - { U_FADE , false }, -};*/ - -static const std::pair WATER01_uniform[] = { - { U_MORPH , true }, - { U_MORPH_COLOR , true }, - { U_TEXTURE_COUNT, false }, - { U_NORMAL , false }, - { U_WATER_REFLECT, false }, - { U_ENV_MAP , false }, - { U_SPECULAR , false }, - { U_FOG_HEIGHT , false }, +static const uniform_name WATER01_uniform[] = { + U_MORPH, }; -/*static const std::pair WATER02_uniform[] = { - { U_INVALID , false }, -};*/ - -/*static const std::pair WATRING_uniform[] = { - { U_LIGHT_0 , false }, - { U_LIGHT_1 , false }, -};*/ - -static const std::pair W_PTCL_uniform[] = { - { U_INVALID , false }, +static const uniform_name W_PTCL_uniform[] = { + U_INVALID, }; -static const std::pair SNOW_PT_uniform[] = { - { U_SNOW_PARTICLE, false }, +static const uniform_name SNOW_PT_uniform[] = { + U_INVALID, }; -static const std::pair LEAF_PT_uniform[] = { - { U_INVALID , false }, +static const uniform_name LEAF_PT_uniform[] = { + U_INVALID, }; -static const std::pair STAR_uniform[] = { - { U_STAR , false }, +static const uniform_name STAR_uniform[] = { + U_INVALID, }; -/*static const std::pair SNORING_uniform[] = { - { U_TEXTURE_COUNT, false }, - { U_NORMAL , false }, - { U_SPECULAR , false }, - { U_LIGHT_0 , false }, - { U_LIGHT_1 , false }, +static const uniform_name FLOOR_uniform[] = { + U_MORPH, + U_ALPHA_TEST, }; -static const std::pair SN_FOOT_uniform[] = { - { U_INVALID , false }, +static const uniform_name PUDDLE_uniform[] = { + U_INVALID, }; -static const std::pair SN_TSL_uniform[] = { - { U_INVALID , false }, +static const uniform_name S_REFL_uniform[] = { + U_SKINNING, + U_MORPH, + U_ALPHA_TEST, }; -static const std::pair SN_NRM_uniform[] = { - { U_INVALID , false }, -};*/ - -static const std::pair FLOOR_uniform[] = { - { U_TEXTURE_COUNT, false }, - { U_NORMAL , false }, - { U_LIGHT_0 , false }, - { U_LIGHT_1 , false }, - { U_FOG_HEIGHT , false }, - { U_MORPH , true }, - { U_MORPH_COLOR , true }, - { U_ALPHA_TEST , true }, // 7th added +static const uniform_name S_REFR_uniform[] = { + U_SKINNING, }; -static const std::pair PUDDLE_uniform[] = { - { U_NORMAL , false }, - { U_LIGHT_0 , false }, - { U_LIGHT_1 , false }, - { U_FOG_HEIGHT , false }, +static const uniform_name RIPEMIT_uniform[] = { + U_RIPPLE, + U_RIPPLE_EMIT, }; -static const std::pair S_REFL_uniform[] = { - //{ U16 , true }, // 0th removed - { U_SKINNING , true }, - { U_REFLECT , true }, - { U_MORPH , true }, - { U_MORPH_COLOR , true }, - { U_ALPHA_TEST , true }, - { U_CLIP_PLANE , false }, - { U_TEXTURE_COUNT, false }, - { U_TONE_CURVE , false }, - { U_CHARA_COLOR , false }, +static const uniform_name RAIN_uniform[] = { + U_INVALID, }; -static const std::pair S_REFR_uniform[] = { - { U_SKINNING , true }, - { U_TRANSPARENCY , false }, +static const uniform_name RIPPLE_uniform[] = { + U_RIPPLE, }; -static const std::pair RIPEMIT_uniform[] = { - { U_RIPPLE , true }, - { U_RIPPLE_EMIT , true }, +static const uniform_name FOGPTCL_uniform[] = { + U_INVALID, }; -static const std::pair RAIN_uniform[] = { - { U_INVALID , false }, +static const uniform_name PARTICL_uniform[] = { + U_INVALID, }; -/*static const std::pair VOLLIT_uniform[] = { - { U_INVALID , false }, -};*/ - -/*static const std::pair FENCE_uniform[] = { - { U_INSTANCE , false }, - { U_FOG_HEIGHT , false }, -};*/ - -static const std::pair RIPPLE_uniform[] = { - { U_RIPPLE , true }, +static const uniform_name GLITTER_PT_uniform[] = { + U_INVALID, }; -static const std::pair FOGPTCL_uniform[] = { - { U_INVALID , false }, +static const uniform_name FONT_uniform[] = { + U_INVALID, }; -static const std::pair PARTICL_uniform[] = { - { U_INVALID , false }, +static const uniform_name MOVIE_uniform[] = { + U_MOVIE, }; -static const std::pair GLITTER_PT_uniform[] = { - { U_TEXTURE_COUNT, false }, - { U_TEXTURE_BLEND, false }, - { U_FOG_HEIGHT , false }, - { U_ALPHA_BLEND , false }, +static const uniform_name IMGFILT_uniform[] = { + U_INVALID, }; -/*static const std::pair SHOW_VEC_uniform[] = { - //{ U16 , true }, // 0th removed - { U_SKINNING , true }, - { U_SHOW_VECTOR , false }, -};*/ - -static const std::pair FONT_uniform[] = { - //{ U16 , true }, // 0th removed - { U_INVALID , false }, // 1st added +static const uniform_name SPRITE_uniform[] = { + U_TEX_0_TYPE, + U_TEX_1_TYPE, + U_COMBINER, }; -static const std::pair MOVIE_uniform[] = { - { U_MOVIE , true }, +static const uniform_name DOF_uniform[] = { + U_DOF, }; -static const std::pair IMGFILT_uniform[] = { - { U_IMAGE_FILTER , false }, -}; - -static const std::pair SPRITE_uniform[] = { - { U_TEX_0_TYPE , false }, - { U_TEX_1_TYPE , false }, - { U_COMBINER , false }, -}; - -static const std::pair DOF_uniform[] = { // Added - { U_DOF , true }, -}; - -static const std::pair TRANSPARENCY_uniform[] = { // Added - { U_INVALID , false }, -}; - -static const bool DOF_permut[] = { // Added - true, -}; - -static const bool TRANSPARENCY_permut[] = { // Added - false, +static const uniform_name TRANSPARENCY_uniform[] = { + U_INVALID, }; struct glass_eye_struct { @@ -2550,7 +1702,7 @@ struct glass_eye_struct { SHADER_FT_##n, \ sizeof(n##_table) / sizeof(shader_sub_table), \ n##_table, \ - sizeof(n##_uniform) / sizeof(std::pair), \ + n##_uniform[0] > 0 ? sizeof(n##_uniform) / sizeof(uniform_name) : 0, \ n##_uniform, \ } @@ -2573,12 +1725,7 @@ const shader_table shader_ft_table[] = { shader_table_struct(CLOTH), shader_table_struct(TIGHTS), shader_table_struct(SKY), - //shader_table_struct(EYEBALL), - //shader_table_struct(EYELENS), shader_table_struct(GLASEYE), - //shader_table_struct(MEMBRAN), - //shader_table_struct(SHDMAP), - //shader_table_struct(ESM), shader_table_struct(ESMGAUSS), shader_table_struct(ESMFILT), shader_table_struct(LITPROJ), @@ -2586,7 +1733,6 @@ const shader_table shader_ft_table[] = { shader_table_struct(SIL), shader_table_struct(LAMBERT), shader_table_struct(CONSTANT), - //shader_table_struct(PEEL), shader_table_struct(TONEMAP), shader_table_struct(REDUCE), shader_table_struct(MAGNIFY), @@ -2597,37 +1743,27 @@ const shader_table shader_ft_table[] = { shader_table_struct(GAUSS), shader_table_struct(SUN), shader_table_struct(SUN_NO_TEXTURED), - //shader_table_struct(FADE), shader_table_struct(WATER01), - //shader_table_struct(WATER02), - //shader_table_struct(WATRING), shader_table_struct(W_PTCL), shader_table_struct(SNOW_PT), shader_table_struct(LEAF_PT), shader_table_struct(STAR), - /*shader_table_struct(SNORING), - shader_table_struct(SN_FOOT), - shader_table_struct(SN_TSL), - shader_table_struct(SN_NRM),*/ shader_table_struct(FLOOR), shader_table_struct(PUDDLE), shader_table_struct(S_REFL), shader_table_struct(S_REFR), shader_table_struct(RIPEMIT), shader_table_struct(RAIN), - //shader_table_struct(VOLLIT), - //shader_table_struct(FENCE), shader_table_struct(RIPPLE), shader_table_struct(FOGPTCL), shader_table_struct(PARTICL), shader_table_struct(GLITTER_PT), - //shader_table_struct(SHOW_VEC), shader_table_struct(FONT), shader_table_struct(MOVIE), shader_table_struct(IMGFILT), shader_table_struct(SPRITE), - shader_table_struct(DOF), // Added - shader_table_struct(TRANSPARENCY), // Added + shader_table_struct(DOF), + shader_table_struct(TRANSPARENCY), }; #undef shader_table_struct @@ -2640,19 +1776,19 @@ static void glass_eye_set(glass_eye_struct* glass_eye); static void shader_bind_blinn(shader_set_data* set, shader* shad); static void shader_bind_cloth(shader_set_data* set, shader* shad); static void shader_bind_hair(shader_set_data* set, shader* shad); -static void shader_bind_eye_ball(shader_set_data* set, shader* shad); +static void shader_bind_glass_eye(shader_set_data* set, shader* shad); static void shader_bind_tone_map(shader_set_data* set, shader* shad); -static void shader_bind_sss_filter(shader_set_data* set, shader* shad); // Added -static void shader_bind_esm_filter(shader_set_data* set, shader* shad); // Added -static void shader_bind_reduce_tex(shader_set_data* set, shader* shad); // Added -static void shader_bind_magnify(shader_set_data* set, shader* shad); // Added -static void shader_bind_mlaa(shader_set_data* set, shader* shad); // Added -static void shader_bind_exposure(shader_set_data* set, shader* shad); // Added -static void shader_bind_gauss(shader_set_data* set, shader* shad); // Added -static void shader_bind_snow_particle(shader_set_data* set, shader* shad); // Added -static void shader_bind_star(shader_set_data* set, shader* shad); // Added -static void shader_bind_imgfilter(shader_set_data* set, shader* shad); // Added -static void shader_bind_dof(shader_set_data* set, shader* shad); // Added +static void shader_bind_sss_filter(shader_set_data* set, shader* shad); +static void shader_bind_esm_filter(shader_set_data* set, shader* shad); +static void shader_bind_reduce_tex(shader_set_data* set, shader* shad); +static void shader_bind_magnify(shader_set_data* set, shader* shad); +static void shader_bind_mlaa(shader_set_data* set, shader* shad); +static void shader_bind_exposure(shader_set_data* set, shader* shad); +static void shader_bind_gauss(shader_set_data* set, shader* shad); +static void shader_bind_snow_particle(shader_set_data* set, shader* shad); +static void shader_bind_star(shader_set_data* set, shader* shad); +static void shader_bind_imgfilter(shader_set_data* set, shader* shad); +static void shader_bind_dof(shader_set_data* set, shader* shad); const shader_bind_func shader_ft_bind_func_table[] = { { @@ -2668,55 +1804,54 @@ const shader_bind_func shader_ft_bind_func_table[] = { shader_bind_hair, }, { - //SHADER_FT_EYEBALL, SHADER_FT_GLASEYE, - shader_bind_eye_ball, + shader_bind_glass_eye, }, { SHADER_FT_TONEMAP, shader_bind_tone_map, }, - { // Added + { SHADER_FT_SSS_FILT, shader_bind_sss_filter, }, - { // Added + { SHADER_FT_ESMFILT, shader_bind_esm_filter, }, - { // Added + { SHADER_FT_REDUCE, shader_bind_reduce_tex, }, - { // Added + { SHADER_FT_MAGNIFY, shader_bind_magnify, }, - { // Added + { SHADER_FT_MLAA, shader_bind_mlaa, }, - { // Added + { SHADER_FT_EXPOSURE, shader_bind_exposure, }, - { // Added + { SHADER_FT_GAUSS, shader_bind_gauss, }, - { // Added + { SHADER_FT_SNOW_PT, shader_bind_snow_particle, }, - { // Added + { SHADER_FT_STAR, shader_bind_star, }, - { // Added + { SHADER_FT_IMGFILT, shader_bind_imgfilter, }, - { // Added + { SHADER_FT_DOF, shader_bind_dof, }, @@ -2854,7 +1989,7 @@ static void glass_eye_set(glass_eye_struct* glass_eye) { extern render_context* rctx_ptr; rctx_ptr->glass_eye_batch_ubo.WriteMemory(glass_eye_batch); - rctx_ptr->glass_eye_batch_ubo.Bind(4); + rctx_ptr->glass_eye_batch_ubo.Bind(5); } static void shader_bind_blinn(shader_set_data* set, shader* shad) { @@ -2871,7 +2006,7 @@ static void shader_bind_hair(shader_set_data* set, shader* shad) { shad->bind(set, uniform_value[U_NPR] ? SHADER_FT_SUB_HAIR_NPR1 : SHADER_FT_SUB_HAIR_DEFAULT); } -static void shader_bind_eye_ball(shader_set_data* set, shader* shad) { +static void shader_bind_glass_eye(shader_set_data* set, shader* shad) { uniform_value[U_EYEBALL] = 0; if (set->shaders[SHADER_FT_GLASEYE].bind(set, SHADER_FT_SUB_GLASS_EYE) >= 0) { glass_eye_calc(&glass_eye); @@ -2884,7 +2019,7 @@ static void shader_bind_tone_map(shader_set_data* set, shader* shad) { ? SHADER_FT_SUB_TONEMAP_NPR1 : SHADER_FT_SUB_TONEMAP); } -static void shader_bind_sss_filter(shader_set_data* set, shader* shad) { // Added +static void shader_bind_sss_filter(shader_set_data* set, shader* shad) { switch (uniform_value[U_SSS_FILTER]) { case 0: shad->bind(set, uniform_value[U_NPR] @@ -2896,7 +2031,7 @@ static void shader_bind_sss_filter(shader_set_data* set, shader* shad) { // Adde } } -static void shader_bind_esm_filter(shader_set_data* set, shader* shad) { // Added +static void shader_bind_esm_filter(shader_set_data* set, shader* shad) { switch (uniform_value[U_ESM_FILTER]) { case 0: shad->bind(set, SHADER_FT_SUB_ESM_FILTER_MIN); @@ -2907,7 +2042,7 @@ static void shader_bind_esm_filter(shader_set_data* set, shader* shad) { // Adde } } -static void shader_bind_reduce_tex(shader_set_data* set, shader* shad) { // Added +static void shader_bind_reduce_tex(shader_set_data* set, shader* shad) { switch (uniform_value[U_REDUCE]) { case 0: switch (uniform_value[U_ALPHA_MASK]) { @@ -2964,7 +2099,7 @@ static void shader_bind_reduce_tex(shader_set_data* set, shader* shad) { // Adde } } -static void shader_bind_magnify(shader_set_data* set, shader* shad) { // Added +static void shader_bind_magnify(shader_set_data* set, shader* shad) { switch (uniform_value[U_MAGNIFY]) { case 0: shad->bind(set, SHADER_FT_SUB_MAGNIFY_LINEAR); @@ -2984,7 +2119,7 @@ static void shader_bind_magnify(shader_set_data* set, shader* shad) { // Added } } -static void shader_bind_mlaa(shader_set_data* set, shader* shad) { // Added +static void shader_bind_mlaa(shader_set_data* set, shader* shad) { switch (uniform_value[U_MLAA]) { case 0: shad->bind(set, SHADER_FT_SUB_MLAA_EDGE); @@ -2998,7 +2133,7 @@ static void shader_bind_mlaa(shader_set_data* set, shader* shad) { // Added } } -static void shader_bind_exposure(shader_set_data* set, shader* shad) { // Added +static void shader_bind_exposure(shader_set_data* set, shader* shad) { switch (uniform_value[U_EXPOSURE]) { case 0: shad->bind(set, SHADER_FT_SUB_EXPOSURE_MINIFY); @@ -3012,7 +2147,7 @@ static void shader_bind_exposure(shader_set_data* set, shader* shad) { // Added } } -static void shader_bind_gauss(shader_set_data* set, shader* shad) { // Added +static void shader_bind_gauss(shader_set_data* set, shader* shad) { switch (uniform_value[U_GAUSS]) { case 0: shad->bind(set, SHADER_FT_SUB_PP_GAUSS_USUAL); @@ -3023,7 +2158,7 @@ static void shader_bind_gauss(shader_set_data* set, shader* shad) { // Added } } -static void shader_bind_snow_particle(shader_set_data* set, shader* shad) { // Added +static void shader_bind_snow_particle(shader_set_data* set, shader* shad) { switch (uniform_value[U_SNOW_PARTICLE]) { case 0: shad->bind(set, SHADER_FT_SUB_SNOW_PARTICLE_CPU); @@ -3034,7 +2169,7 @@ static void shader_bind_snow_particle(shader_set_data* set, shader* shad) { // A } } -static void shader_bind_star(shader_set_data* set, shader* shad) { // Added +static void shader_bind_star(shader_set_data* set, shader* shad) { switch (uniform_value[U_STAR]) { case 0: shad->bind(set, SHADER_FT_SUB_STAR); @@ -3059,7 +2194,7 @@ static void shader_bind_imgfilter(shader_set_data* set, shader* shad) { } } -static void shader_bind_dof(shader_set_data* set, shader* shad) { // Added +static void shader_bind_dof(shader_set_data* set, shader* shad) { switch (uniform_value[U_DOF_STAGE]) { case 0: shad->bind(set, SHADER_FT_SUB_DOF_RENDER_TILE); diff --git a/src/CRE/shader_ft.hpp b/src/CRE/shader_ft.hpp index fa70aa39..c1f8e790 100644 --- a/src/CRE/shader_ft.hpp +++ b/src/CRE/shader_ft.hpp @@ -20,12 +20,7 @@ enum shader_ft_enum { SHADER_FT_CLOTH, SHADER_FT_TIGHTS, SHADER_FT_SKY, - //SHADER_FT_EYEBALL, - //SHADER_FT_EYELENS, SHADER_FT_GLASEYE, - //SHADER_FT_MEMBRAN, - //SHADER_FT_SHDMAP, - //SHADER_FT_ESM, SHADER_FT_ESMGAUSS, SHADER_FT_ESMFILT, SHADER_FT_LITPROJ, @@ -33,7 +28,6 @@ enum shader_ft_enum { SHADER_FT_SIL, SHADER_FT_LAMBERT, SHADER_FT_CONSTANT, - //SHADER_FT_PEEL, SHADER_FT_TONEMAP, SHADER_FT_REDUCE, SHADER_FT_MAGNIFY, @@ -44,37 +38,27 @@ enum shader_ft_enum { SHADER_FT_GAUSS, SHADER_FT_SUN, SHADER_FT_SUN_NO_TEXTURED, - //SHADER_FT_FADE, SHADER_FT_WATER01, - //SHADER_FT_WATER02, - //SHADER_FT_WATRING, SHADER_FT_W_PTCL, SHADER_FT_SNOW_PT, SHADER_FT_LEAF_PT, SHADER_FT_STAR, - //SHADER_FT_SNORING, - //SHADER_FT_SN_FOOT, - //SHADER_FT_SN_TSL, - //SHADER_FT_SN_NRM, SHADER_FT_FLOOR, SHADER_FT_PUDDLE, SHADER_FT_S_REFL, SHADER_FT_S_REFR, SHADER_FT_RIPEMIT, SHADER_FT_RAIN, - //SHADER_FT_VOLLIT, - //SHADER_FT_FENCE, SHADER_FT_RIPPLE, SHADER_FT_FOGPTCL, SHADER_FT_PARTICL, SHADER_FT_GLITTER_PT, - //SHADER_FT_SHOW_VEC, SHADER_FT_FONT, SHADER_FT_MOVIE, SHADER_FT_IMGFILT, SHADER_FT_SPRITE, - SHADER_FT_DOF, // Added - SHADER_FT_TRANSPARENCY, // Added + SHADER_FT_DOF, + SHADER_FT_TRANSPARENCY, SHADER_FT_END, SHADER_FT_MAX, }; diff --git a/src/CRE/shadow.cpp b/src/CRE/shadow.cpp index 83dbdb7c..f917c404 100644 --- a/src/CRE/shadow.cpp +++ b/src/CRE/shadow.cpp @@ -13,7 +13,7 @@ extern render_context* rctx_ptr; Shadow::Shadow() : curr_render_textures(), shadow_range(), shadow_range_factor(), field_1C0(), field_1C8(), field_200(), field_208(), near_blur(), blur_filter(), far_blur(), field_2BC(), distance(), field_2C4(), z_near(), z_far(), field_2D0(), field_2D4(), field_2D8(), field_2DC(), field_2E0(), shadow_ambient(), -show_texture(), num_light(), light_enable(), self_shadow(), blur_filter_enable(), separate() { +show_texture(), num_shadow(), shadow_enable(), self_shadow(), blur_filter_enable(), separate() { reset(); } @@ -23,7 +23,7 @@ Shadow::~Shadow() { void Shadow::ctrl() { for (int32_t i = 0; i < 2; i++) - light_enable[i] = false; + shadow_enable[i] = false; if (rctx_ptr->render_manager->shadow) { view_mat[0] = rctx_ptr->camera->view; @@ -41,24 +41,24 @@ void Shadow::ctrl() { for (int32_t i = 0; i < 2; i++) if (rctx_ptr->disp_manager->get_obj_count((mdl::ObjType)((int32_t)mdl::OBJ_TYPE_SHADOW_CHARA + i))) - light_enable[i] = true; + shadow_enable[i] = true; } int32_t count = 0; - num_light = 0; + num_shadow = 0; for (int32_t i = 0; i < 2; i++) - if (light_enable[i] && field_1D0[i].size() > 0) { - num_light++; + if (shadow_enable[i] && field_1D0[i].size() > 0) { + num_shadow++; count += (int32_t)field_1D0[i].size(); } else - light_enable[i] = false; + shadow_enable[i] = false; if (count < 3) { for (int32_t i = 0; i < 2; i++) { field_1A8[i] = 0.0f; field_1C8[i] = 0.0f; - if (!light_enable[i] || field_1D0[i].size() < 1) + if (!shadow_enable[i] || field_1D0[i].size() < 1) continue; vec3 v7 = 0.0f; @@ -85,11 +85,11 @@ void Shadow::ctrl() { field_1C8[i] = v15; } - if (num_light > 0) { + if (num_shadow > 0) { vec3 view_point = 0.0f; vec3 interest = 0.0f; for (int32_t i = 0; i < 2; i++) { - if (!light_enable[i]) + if (!shadow_enable[i]) continue; vec3 v11 = field_1A8[i] - direction * field_208; @@ -104,8 +104,8 @@ void Shadow::ctrl() { interest += this->interest[i]; } - view_point_shared = view_point * (1.0f / (float_t)num_light); - interest_shared = interest * (1.0f / (float_t)num_light); + view_point_shared = view_point * (1.0f / (float_t)num_shadow); + interest_shared = interest * (1.0f / (float_t)num_shadow); } float_t v2 = max_def(field_1C8[0], field_1C8[1]); @@ -113,7 +113,7 @@ void Shadow::ctrl() { shadow_range = v2 + 1.2f; field_200[0] = 0; field_200[1] = 1; - if (num_light >= 2) { + if (num_shadow >= 2) { vec3 v12 = field_1A8[0] - interest_shared; vec3 v14 = field_1A8[1] - interest_shared; @@ -152,7 +152,7 @@ void Shadow::ctrl() { for (int32_t i = 0; i < 2; i++) { field_1A8[i] = 0.0f; field_1C8[i] = 0.0; - if (!light_enable[i] || field_1D0[i].size() < 1) + if (!shadow_enable[i] || field_1D0[i].size() < 1) continue; vec3 v22 = 0.0f; @@ -179,9 +179,9 @@ void Shadow::ctrl() { field_1C8[i] = v30; } - if (num_light > 0) { + if (num_shadow > 0) { for (int32_t i = 0; i < 2; i++) { - if (!light_enable[i]) + if (!shadow_enable[i]) continue; vec3 v53 = field_1A8[i] - direction * field_208; @@ -213,12 +213,12 @@ void Shadow::ctrl() { shadow_range = v67 + 1.2f; field_200[0] = 0; field_200[1] = 1; - if (num_light >= 2) { + if (num_shadow >= 2) { float_t v68 = 0.0f; float_t v69 = 0.0f; float_t v70 = 0.0f; for (int32_t i = 0; i < 2; i++) { - if (!light_enable[i]) + if (!shadow_enable[i]) continue; for (vec3& j : field_1D0[i]) { @@ -341,7 +341,7 @@ void Shadow::reset() { field_2DC = 2.0f; field_2E0 = 0.05f; shadow_ambient = 0.4f; - num_light = 0; + num_shadow = 0; direction = vec3(0.0f, -1.0f, -1.0f) * (1.0f / sqrtf(2.0f)); show_texture = false; self_shadow = true; diff --git a/src/CRE/shadow.hpp b/src/CRE/shadow.hpp index a6b33d89..02911b19 100644 --- a/src/CRE/shadow.hpp +++ b/src/CRE/shadow.hpp @@ -50,8 +50,8 @@ struct Shadow { float_t field_2E0; float_t shadow_ambient; bool show_texture; - int32_t num_light; - bool light_enable[2]; + int32_t num_shadow; + bool shadow_enable[2]; bool self_shadow; bool blur_filter_enable[2]; bool separate; diff --git a/src/CRE/static_var.cpp b/src/CRE/static_var.cpp index fdd384b3..42dbadf4 100644 --- a/src/CRE/static_var.cpp +++ b/src/CRE/static_var.cpp @@ -79,8 +79,8 @@ void uniform_value_reset() { uniform_value[U_ANISO] = 0; uniform_value[U0B] = 0; uniform_value[U_TEXTURE_BLEND] = 0; - uniform_value[U_FOG_HEIGHT] = 0; - uniform_value[U_FOG] = 0; + uniform_value[U_FOG_STAGE] = 0; + uniform_value[U_FOG_CHARA] = 0; uniform_value[U_SPECULAR_IBL] = 0; uniform_value[U_TEX_0_TYPE] = 0; uniform_value[U_TEX_1_TYPE] = 0; @@ -89,7 +89,7 @@ void uniform_value_reset() { uniform_value[U_TRANSLUCENCY] = 0; uniform_value[U_NORMAL] = 0; uniform_value[U_TRANSPARENCY] = 0; - uniform_value[U_LIGHT_0] = 0; + uniform_value[U_STAGE_SHADOW] = 0; uniform_value[U_SPECULAR] = 0; uniform_value[U45] = 0; } diff --git a/src/CRE/static_var.hpp b/src/CRE/static_var.hpp index aab96206..f6ee6107 100644 --- a/src/CRE/static_var.hpp +++ b/src/CRE/static_var.hpp @@ -48,8 +48,8 @@ enum uniform_name { U_FADE, U_STAGE_AMBIENT, U_FLARE, - U_FOG_HEIGHT, - U_FOG, + U_FOG_STAGE, + U_FOG_CHARA, U16, U_GAUSS, U_EYEBALL, @@ -68,11 +68,11 @@ enum uniform_name { U25, U_NPR_NORMAL, U_NPR, - U_LIGHT_1, + U_STAGE_SHADOW2, U_REFLECT, U_REDUCE, - U_SELF_SHADOW, - U_SHADOW, + U_CHARA_SHADOW, + U_CHARA_SHADOW2, U2D, U2E, U_SHOW_VECTOR, @@ -94,7 +94,7 @@ enum uniform_name { U_WATER_REFLECT, U40, U41, - U_LIGHT_0, + U_STAGE_SHADOW, U_SPECULAR, U_TONE_MAP, U45, diff --git a/src/ReDIVA/main.cpp b/src/ReDIVA/main.cpp index 0bb464ea..c6e5a8d0 100644 --- a/src/ReDIVA/main.cpp +++ b/src/ReDIVA/main.cpp @@ -331,7 +331,7 @@ void compile_shaders(farc* f, farc* of, const shader_table* shaders_table, const vec_frag.resize(shader_table->num_uniform); int32_t* vec_vert_data = vec_vert.data(); int32_t* vec_frag_data = vec_frag.data(); - for (size_t j = 0; j < num_sub; j++, sub_table++) { + for (int32_t j = 0; j < num_sub; j++, sub_table++) { strcpy_s(vert_file_buf, sizeof(vert_file_buf), sub_table->vp); strcat_s(vert_file_buf, sizeof(vert_file_buf), ".vert"); farc_file* vert_ff = f->read_file(vert_file_buf); @@ -366,13 +366,12 @@ void compile_shaders(farc* f, farc* of, const shader_table* shaders_table, const uint32_t uniform_vert_flags = 0; uint32_t uniform_frag_flags = 0; - for (int32_t k = 0; k < shader_table->num_uniform; k++) - if (shader_table->use_uniform[k].second) { - if (sub_table->vp_unival_max[k] > 0) - uniform_vert_flags |= 1 << k; - if (sub_table->fp_unival_max[k] > 0) - uniform_frag_flags |= 1 << k; - } + for (int32_t k = 0; k < shader_table->num_uniform; k++) { + if (sub_table->vp_unival_max[k] > 0) + uniform_vert_flags |= 1 << k; + if (sub_table->fp_unival_max[k] > 0) + uniform_frag_flags |= 1 << k; + } char uniform_vert_flags_buf[9]; char uniform_frag_flags_buf[9]; @@ -417,15 +416,15 @@ void compile_shaders(farc* f, farc* of, const shader_table* shaders_table, const if ((!has_vert_bin || !has_frag_bin) && shader_table->num_uniform > 0 && (sub_table->vp_unival_max[0] != -1 || sub_table->fp_unival_max[0] != -1)) { int32_t num_uniform = shader_table->num_uniform; - size_t unival_vp_curr = 1; - size_t unival_vp_count = 1; - size_t unival_fp_curr = 1; - size_t unival_fp_count = 1; + int32_t unival_vp_curr = 1; + int32_t unival_vp_count = 1; + int32_t unival_fp_curr = 1; + int32_t unival_fp_count = 1; const int32_t* vp_unival_max = sub_table->vp_unival_max; const int32_t* fp_unival_max = sub_table->fp_unival_max; - for (size_t k = 0; k < num_uniform; k++) { - const size_t unival_vp_max = shader_table->use_uniform[k].second ? vp_unival_max[k] : 0; - const size_t unival_fp_max = shader_table->use_uniform[k].second ? fp_unival_max[k] : 0; + for (int32_t k = 0; k < num_uniform; k++) { + const int32_t unival_vp_max = vp_unival_max[k]; + const int32_t unival_fp_max = fp_unival_max[k]; unival_vp_count += unival_vp_curr * unival_vp_max; unival_fp_count += unival_fp_curr * unival_fp_max; unival_vp_curr *= unival_vp_max + 1; @@ -444,10 +443,10 @@ void compile_shaders(farc* f, farc* of, const shader_table* shaders_table, const strcat_s(vert_buf, sizeof(vert_buf), ".vert.spv"); int32_t vert_buf_len = (int32_t)utf8_length(vert_buf); - for (size_t k = 0; k < unival_vp_count; k++) { - for (size_t l = 0, m = k; l < num_uniform; l++) { - size_t unival_max = (size_t)(shader_table->use_uniform[l].second ? vp_unival_max[l] : 0) + 1; - vec_vert_data[l] = (uint32_t)(min_def(m % unival_max, vp_unival_max[l])); + for (int32_t k = 0; k < unival_vp_count; k++) { + for (int32_t l = 0, m = k; l < num_uniform; l++) { + int32_t unival_max = vp_unival_max[l] + 1; + vec_vert_data[l] = min_def(m % unival_max, vp_unival_max[l]); m /= unival_max; vert_buf[vert_buf_pos + l] = (char)('0' + vec_vert_data[l]); } @@ -514,9 +513,9 @@ void compile_shaders(farc* f, farc* of, const shader_table* shaders_table, const strcat_s(frag_buf, sizeof(frag_buf), ".frag.spv"); int32_t frag_buf_len = (int32_t)utf8_length(frag_buf); - for (size_t k = 0; k < unival_fp_count; k++) { - for (size_t l = 0, m = k; l < num_uniform; l++) { - size_t unival_max = (size_t)(shader_table->use_uniform[l].second ? fp_unival_max[l] : 0) + 1; + for (int32_t k = 0; k < unival_fp_count; k++) { + for (int32_t l = 0, m = k; l < num_uniform; l++) { + int32_t unival_max = fp_unival_max[l] + 1; vec_frag_data[l] = (uint32_t)(min_def(m % unival_max, fp_unival_max[l])); m /= unival_max; frag_buf[frag_buf_pos + l] = (char)('0' + vec_frag_data[l]);