骑砍战团MOD开发(27)-module_tableau_materials.py材质

发布时间:2023年12月29日

一.配置材质资源

? ??OpenBrf寻找对应材质资源.

? ? tableau配置材质资源

  ("round_shield_1", 0, "sample_shield_round_1", 512, 256, 0, 0, 0, 0,[
       (store_script_param, ":banner_mesh", 1),

       (set_fixed_point_multiplier, 100),

       (init_position, pos1),
       (position_set_x, pos1, -50),
       (position_set_y, pos1, 125),
       (cur_tableau_add_mesh, ":banner_mesh", pos1, 120, 0),
       (init_position, pos1),
       (position_set_z, pos1, 10),
       (cur_tableau_add_mesh, "mesh_tableau_mesh_shield_round_1", pos1, 0, 0),
       (cur_tableau_set_camera_parameters, 0, 200, 100, 0, 100000),
  ]),

二.使用材质资源

? ? ?骑砍引擎支持少量的动态切换材质的场景,例如不同势力的盔甲颜色,军旗.不同势力衣服的纹章.

cur_item_set_tableau_material                    = 1981  # (cur_item_set_tableu_material, <tableau_material_id>, <instance_code>),
                                                         # Can only be used inside ti_on_init_item trigger in module_items.py. Assigns tableau to the item instance. Value of <instance_code> will be passed to tableau code. Commonly used for heraldic armors and shields.
cur_scene_prop_set_tableau_material              = 1982  # (cur_scene_prop_set_tableau_material, <tableau_material_id>, <instance_code>),
                                                         # Can only be used inside ti_on_init_scene_prop trigger in module_scene_props.py. Assigns tableau to the scene prop instance. Value of <instance_code> will be passed to tableau code. Commonly used for static banners.
cur_map_icon_set_tableau_material                = 1983  # (cur_map_icon_set_tableau_material, <tableau_material_id>, <instance_code>),
                                                         # Can only be used inside ti_on_init_map_icon trigger in module_map_icons.py. Assigns tableau to the icon prop instance. Value of <instance_code> will be passed to tableau code. Commonly used for player/lord party banners.
cur_agent_set_banner_tableau_material            = 1986  # (cur_agent_set_banner_tableau_material, <tableau_material_id>),
                                                         # Can only be used inside ti_on_agent_spawn trigger in module_mission_templates. Assigns heraldry.

三.动态更新着色器算法

? ? ?可通过提供函数调整高光alpha,环境等相关着色器参数.

# Operations used in module_tableau_materials.py module

cur_tableau_add_tableau_mesh  = 1980  # (cur_tableau_add_tableau_mesh,<tableau_material_id>, <value>, <position_register_no>),
                                                        
cur_tableau_render_as_alpha_mask  = 1984  # (cur_tableau_render_as_alpha_mask)
                                                   
cur_tableau_set_background_color  = 1985  # (cur_tableau_set_background_color, <value>),

cur_tableau_set_ambient_light  = 1987  # (cur_tableau_set_ambient_light, <red_fixed_point>, <green_fixed_point>, <blue_fixed_point>),

cur_tableau_set_camera_position  = 1988  # (cur_tableau_set_camera_position, <position>),

cur_tableau_set_camera_parameters = 1989  # (cur_tableau_set_camera_parameters, <is_perspective>, <camera_width_times_1000>, <camera_height_times_1000>, <camera_near_times_1000>, <camera_far_times_1000>),

cur_tableau_add_point_light  = 1990  # (cur_tableau_add_point_light, <position>, <red_fixed_point>, <green_fixed_point>, <blue_fixed_point>),

cur_tableau_add_sun_light = 1991  # (cur_tableau_add_sun_light, <position>, <red_fixed_point>, <green_fixed_point>, <blue_fixed_point>),

cur_tableau_add_mesh   = 1992  # (cur_tableau_add_mesh, <mesh_id>, <position>, <value_fixed_point>, <value_fixed_point>),

cur_tableau_add_mesh_with_vertex_color  = 1993  # (cur_tableau_add_mesh_with_vertex_color, <mesh_id>, <position>, <value_fixed_point>, <value_fixed_point>, <value>),

cur_tableau_add_mesh_with_scale_and_vertex_color = 2000  # (cur_tableau_add_mesh_with_scale_and_vertex_color, <mesh_id>, <position>, <scale_position>, <value_fixed_point>, <value>),
                                                         
cur_tableau_add_map_icon  = 1994  # (cur_tableau_add_map_icon, <map_icon_id>, <position>, <value_fixed_point>),

cur_tableau_add_troop  = 1995  # (cur_tableau_add_troop, <troop_id>, <position>, <animation_id>, <instance_no>),

cur_tableau_add_horse = 1996  # (cur_tableau_add_horse, <item_id>, <position>, <animation_id>),

cur_tableau_set_override_flags  = 1997  # (cur_tableau_set_override_flags, <value>),

cur_tableau_clear_override_items  = 1998  # (cur_tableau_clear_override_items),

cur_tableau_add_override_item  = 1999  # (cur_tableau_add_override_item, <item_kind_id>),

四.系统内置材质

#游戏窗口
tab_game_profile_window
#军旗
tab_game_troop_label_banner
#部队详情页
tab_game_party_window
#个人仓库页
tab_game_inventory_window
#角色详情页
tab_game_character_sheet    
文章来源:https://blog.csdn.net/qq_35829452/article/details/135282735
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。