Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/overlay/overlay_shader.cc
| Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | typedef struct OVERLAY_Shaders { | ||||
| GPUShader *paint_weight[2]; | GPUShader *paint_weight[2]; | ||||
| GPUShader *paint_wire; | GPUShader *paint_wire; | ||||
| GPUShader *particle_dot; | GPUShader *particle_dot; | ||||
| GPUShader *particle_shape; | GPUShader *particle_shape; | ||||
| GPUShader *pointcloud_dot; | GPUShader *pointcloud_dot; | ||||
| GPUShader *sculpt_mask; | GPUShader *sculpt_mask; | ||||
| GPUShader *sculpt_curves_selection; | GPUShader *sculpt_curves_selection; | ||||
| GPUShader *uniform_color; | GPUShader *uniform_color; | ||||
| GPUShader *uniform_color_pointcloud; | |||||
| GPUShader *viewer_attribute_mesh; | |||||
| GPUShader *viewer_attribute_pointcloud; | |||||
| GPUShader *viewer_attribute_curve; | |||||
| GPUShader *viewer_attribute_curves; | |||||
| GPUShader *volume_velocity_needle_sh; | GPUShader *volume_velocity_needle_sh; | ||||
| GPUShader *volume_velocity_mac_sh; | GPUShader *volume_velocity_mac_sh; | ||||
| GPUShader *volume_velocity_sh; | GPUShader *volume_velocity_sh; | ||||
| GPUShader *volume_gridlines_sh; | GPUShader *volume_gridlines_sh; | ||||
| GPUShader *volume_gridlines_flags_sh; | GPUShader *volume_gridlines_flags_sh; | ||||
| GPUShader *volume_gridlines_range_sh; | GPUShader *volume_gridlines_range_sh; | ||||
| GPUShader *wireframe_select; | GPUShader *wireframe_select; | ||||
| GPUShader *wireframe[2]; | GPUShader *wireframe[2]; | ||||
| ▲ Show 20 Lines • Show All 709 Lines • ▼ Show 20 Lines | GPUShader *OVERLAY_shader_sculpt_curves_selection(void) | ||||
| if (!sh_data->sculpt_curves_selection) { | if (!sh_data->sculpt_curves_selection) { | ||||
| sh_data->sculpt_curves_selection = GPU_shader_create_from_info_name( | sh_data->sculpt_curves_selection = GPU_shader_create_from_info_name( | ||||
| draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED ? "overlay_sculpt_curves_selection_clipped" : | draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED ? "overlay_sculpt_curves_selection_clipped" : | ||||
| "overlay_sculpt_curves_selection"); | "overlay_sculpt_curves_selection"); | ||||
| } | } | ||||
| return sh_data->sculpt_curves_selection; | return sh_data->sculpt_curves_selection; | ||||
| } | } | ||||
| GPUShader *OVERLAY_shader_viewer_attribute_mesh(void) | |||||
| { | |||||
| const DRWContextState *draw_ctx = DRW_context_state_get(); | |||||
| OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg]; | |||||
| if (!sh_data->viewer_attribute_mesh) { | |||||
| sh_data->viewer_attribute_mesh = GPU_shader_create_from_info_name( | |||||
| draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED ? "overlay_viewer_attribute_mesh_clipped" : | |||||
| "overlay_viewer_attribute_mesh"); | |||||
| } | |||||
| return sh_data->viewer_attribute_mesh; | |||||
| } | |||||
| GPUShader *OVERLAY_shader_viewer_attribute_pointcloud(void) | |||||
| { | |||||
| const DRWContextState *draw_ctx = DRW_context_state_get(); | |||||
| OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg]; | |||||
| if (!sh_data->viewer_attribute_pointcloud) { | |||||
| sh_data->viewer_attribute_pointcloud = GPU_shader_create_from_info_name( | |||||
| draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED ? | |||||
| "overlay_viewer_attribute_pointcloud_clipped" : | |||||
| "overlay_viewer_attribute_pointcloud"); | |||||
| } | |||||
| return sh_data->viewer_attribute_pointcloud; | |||||
| } | |||||
| GPUShader *OVERLAY_shader_viewer_attribute_curve(void) | |||||
| { | |||||
| const DRWContextState *draw_ctx = DRW_context_state_get(); | |||||
| OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg]; | |||||
| if (!sh_data->viewer_attribute_curve) { | |||||
| sh_data->viewer_attribute_curve = GPU_shader_create_from_info_name( | |||||
| draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED ? "overlay_viewer_attribute_curve_clipped" : | |||||
| "overlay_viewer_attribute_curve"); | |||||
| } | |||||
| return sh_data->viewer_attribute_curve; | |||||
| } | |||||
| GPUShader *OVERLAY_shader_viewer_attribute_curves(void) | |||||
| { | |||||
| const DRWContextState *draw_ctx = DRW_context_state_get(); | |||||
| OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg]; | |||||
| if (!sh_data->viewer_attribute_curves) { | |||||
| sh_data->viewer_attribute_curves = GPU_shader_create_from_info_name( | |||||
| draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED ? "overlay_viewer_attribute_curves_clipped" : | |||||
| "overlay_viewer_attribute_curves"); | |||||
| } | |||||
| return sh_data->viewer_attribute_curves; | |||||
| } | |||||
| struct GPUShader *OVERLAY_shader_uniform_color(void) | struct GPUShader *OVERLAY_shader_uniform_color(void) | ||||
| { | { | ||||
| const DRWContextState *draw_ctx = DRW_context_state_get(); | const DRWContextState *draw_ctx = DRW_context_state_get(); | ||||
| OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg]; | OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg]; | ||||
| if (!sh_data->uniform_color) { | if (!sh_data->uniform_color) { | ||||
| sh_data->uniform_color = GPU_shader_create_from_info_name( | sh_data->uniform_color = GPU_shader_create_from_info_name( | ||||
| draw_ctx->sh_cfg ? "overlay_uniform_color_clipped" : "overlay_uniform_color"); | draw_ctx->sh_cfg ? "overlay_uniform_color_clipped" : "overlay_uniform_color"); | ||||
| } | } | ||||
| return sh_data->uniform_color; | return sh_data->uniform_color; | ||||
| } | } | ||||
| struct GPUShader *OVERLAY_shader_uniform_color_pointcloud() | |||||
| { | |||||
| const DRWContextState *draw_ctx = DRW_context_state_get(); | |||||
| OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg]; | |||||
| if (!sh_data->uniform_color_pointcloud) { | |||||
| sh_data->uniform_color_pointcloud = GPU_shader_create_from_info_name( | |||||
| draw_ctx->sh_cfg ? "overlay_uniform_color_pointcloud_clipped" : | |||||
| "overlay_uniform_color_pointcloud"); | |||||
| } | |||||
| return sh_data->uniform_color_pointcloud; | |||||
| } | |||||
| struct GPUShader *OVERLAY_shader_volume_velocity(bool use_needle, bool use_mac) | struct GPUShader *OVERLAY_shader_volume_velocity(bool use_needle, bool use_mac) | ||||
| { | { | ||||
| OVERLAY_Shaders *sh_data = &e_data.sh_data[0]; | OVERLAY_Shaders *sh_data = &e_data.sh_data[0]; | ||||
| if (use_needle && !sh_data->volume_velocity_needle_sh) { | if (use_needle && !sh_data->volume_velocity_needle_sh) { | ||||
| sh_data->volume_velocity_needle_sh = GPU_shader_create_from_info_name( | sh_data->volume_velocity_needle_sh = GPU_shader_create_from_info_name( | ||||
| "overlay_volume_velocity_needle"); | "overlay_volume_velocity_needle"); | ||||
| } | } | ||||
| else if (use_mac && !sh_data->volume_velocity_mac_sh) { | else if (use_mac && !sh_data->volume_velocity_mac_sh) { | ||||
| ▲ Show 20 Lines • Show All 243 Lines • Show Last 20 Lines | |||||