diff options
Diffstat (limited to 'source/blender/draw/engines/overlay/shaders/infos')
6 files changed, 106 insertions, 11 deletions
diff --git a/source/blender/draw/engines/overlay/shaders/infos/overlay_armature_info.hh b/source/blender/draw/engines/overlay/shaders/infos/overlay_armature_info.hh index 9f2acceed97..0ab653ba29f 100644 --- a/source/blender/draw/engines/overlay/shaders/infos/overlay_armature_info.hh +++ b/source/blender/draw/engines/overlay/shaders/infos/overlay_armature_info.hh @@ -69,6 +69,11 @@ GPU_SHADER_INTERFACE_INFO(overlay_armature_shape_outline_iface, "geom_in") .smooth(Type::VEC4, "vColSize") .flat(Type::INT, "inverted"); +GPU_SHADER_INTERFACE_INFO(overlay_armature_shape_outline_no_geom_iface, "") + .flat(Type::VEC4, "finalColor") + .flat(Type::VEC2, "edgeStart") + .no_perspective(Type::VEC2, "edgePos"); + GPU_SHADER_CREATE_INFO(overlay_armature_shape_outline) .do_static_compilation(true) .vertex_in(0, Type::VEC3, "pos") @@ -84,10 +89,26 @@ GPU_SHADER_CREATE_INFO(overlay_armature_shape_outline) .fragment_source("overlay_armature_wire_frag.glsl") .additional_info("overlay_frag_output", "overlay_armature_common", "draw_globals"); +GPU_SHADER_CREATE_INFO(overlay_armature_shape_outline_no_geom) + .do_static_compilation(true) + .vertex_in(0, Type::VEC3, "pos") + .vertex_in(1, Type::VEC3, "snor") + /* Per instance. */ + .vertex_in(2, Type::VEC4, "color") + .vertex_in(3, Type::MAT4, "inst_obmat") + .vertex_out(overlay_armature_shape_outline_no_geom_iface) + .vertex_source("overlay_armature_shape_outline_vert_no_geom.glsl") + .fragment_source("overlay_armature_wire_frag.glsl") + .additional_info("overlay_frag_output", "overlay_armature_common", "draw_globals"); + GPU_SHADER_CREATE_INFO(overlay_armature_shape_outline_clipped) .do_static_compilation(true) .additional_info("overlay_armature_shape_outline", "drw_clipped"); +GPU_SHADER_CREATE_INFO(overlay_armature_shape_outline_clipped_no_geom) + .do_static_compilation(true) + .additional_info("overlay_armature_shape_outline_no_geom", "drw_clipped"); + GPU_SHADER_INTERFACE_INFO(overlay_armature_shape_solid_iface, "") .smooth(Type::VEC4, "finalColor") .flat(Type::INT, "inverted"); diff --git a/source/blender/draw/engines/overlay/shaders/infos/overlay_background_info.hh b/source/blender/draw/engines/overlay/shaders/infos/overlay_background_info.hh index 88a012c35c9..8bc15400248 100644 --- a/source/blender/draw/engines/overlay/shaders/infos/overlay_background_info.hh +++ b/source/blender/draw/engines/overlay/shaders/infos/overlay_background_info.hh @@ -15,7 +15,7 @@ GPU_SHADER_CREATE_INFO(overlay_background) GPU_SHADER_CREATE_INFO(overlay_clipbound) .do_static_compilation(true) - .push_constant(Type::VEC4, "color") + .push_constant(Type::VEC4, "ucolor") .push_constant(Type::VEC3, "boundbox", 8) .vertex_source("overlay_clipbound_vert.glsl") .fragment_out(0, Type::VEC4, "fragColor") diff --git a/source/blender/draw/engines/overlay/shaders/infos/overlay_edit_mode_info.hh b/source/blender/draw/engines/overlay/shaders/infos/overlay_edit_mode_info.hh index 58f96110887..e2cc0a54153 100644 --- a/source/blender/draw/engines/overlay/shaders/infos/overlay_edit_mode_info.hh +++ b/source/blender/draw/engines/overlay/shaders/infos/overlay_edit_mode_info.hh @@ -22,6 +22,17 @@ GPU_SHADER_CREATE_INFO(overlay_edit_mesh_common) .vertex_source("overlay_edit_mesh_vert.glsl") .additional_info("draw_modelmat", "draw_globals"); +GPU_SHADER_CREATE_INFO(overlay_edit_mesh_common_no_geom) + .define("blender_srgb_to_framebuffer_space(a)", "a") + .sampler(0, ImageType::DEPTH_2D, "depthTex") + .fragment_out(0, Type::VEC4, "fragColor") + .push_constant(Type::BOOL, "selectFaces") + .push_constant(Type::BOOL, "selectEdges") + .push_constant(Type::FLOAT, "alpha") + .push_constant(Type::IVEC4, "dataMask") + .vertex_source("overlay_edit_mesh_vert_no_geom.glsl") + .additional_info("draw_modelmat", "draw_globals"); + GPU_SHADER_INTERFACE_INFO(overlay_edit_mesh_vert_iface, "") .smooth(Type::VEC4, "finalColor") .smooth(Type::FLOAT, "vertexCrease"); @@ -61,11 +72,28 @@ GPU_SHADER_CREATE_INFO(overlay_edit_mesh_edge) .fragment_source("overlay_edit_mesh_frag.glsl") .additional_info("overlay_edit_mesh_common"); +/* The Non-Geometry shader variant passes directly to fragment. */ +GPU_SHADER_CREATE_INFO(overlay_edit_mesh_edge_no_geom) + .do_static_compilation(true) + .define("EDGE") + .vertex_in(0, Type::VEC3, "pos") + .vertex_in(1, Type::UCHAR4, "data") + .vertex_in(2, Type::VEC3_101010I2, "vnor") + .push_constant(Type::BOOL, "do_smooth_wire") + .vertex_out(overlay_edit_mesh_edge_geom_iface) + .fragment_source("overlay_edit_mesh_frag.glsl") + .additional_info("overlay_edit_mesh_common_no_geom"); + GPU_SHADER_CREATE_INFO(overlay_edit_mesh_edge_flat) .do_static_compilation(true) .define("FLAT") .additional_info("overlay_edit_mesh_edge"); +GPU_SHADER_CREATE_INFO(overlay_edit_mesh_edge_flat_no_geom) + .do_static_compilation(true) + .define("FLAT") + .additional_info("overlay_edit_mesh_edge_no_geom"); + GPU_SHADER_CREATE_INFO(overlay_edit_mesh_face) .do_static_compilation(true) .define("FACE") @@ -136,10 +164,18 @@ GPU_SHADER_CREATE_INFO(overlay_edit_mesh_edge_clipped) .do_static_compilation(true) .additional_info("overlay_edit_mesh_edge", "drw_clipped"); +GPU_SHADER_CREATE_INFO(overlay_edit_mesh_edge_clipped_no_geom) + .do_static_compilation(true) + .additional_info("overlay_edit_mesh_edge_no_geom", "drw_clipped"); + GPU_SHADER_CREATE_INFO(overlay_edit_mesh_edge_flat_clipped) .do_static_compilation(true) .additional_info("overlay_edit_mesh_edge_flat", "drw_clipped"); +GPU_SHADER_CREATE_INFO(overlay_edit_mesh_edge_flat_clipped_no_geom) + .do_static_compilation(true) + .additional_info("overlay_edit_mesh_edge_flat_no_geom", "drw_clipped"); + GPU_SHADER_CREATE_INFO(overlay_edit_mesh_face_clipped) .do_static_compilation(true) .additional_info("overlay_edit_mesh_face", "drw_clipped"); @@ -242,7 +278,7 @@ GPU_SHADER_CREATE_INFO(overlay_edit_uv_verts) GPU_SHADER_CREATE_INFO(overlay_edit_uv_tiled_image_borders) .do_static_compilation(true) .vertex_in(0, Type::VEC3, "pos") - .push_constant(Type::VEC4, "color") + .push_constant(Type::VEC4, "ucolor") .fragment_out(0, Type::VEC4, "fragColor") .vertex_source("overlay_edit_uv_tiled_image_borders_vert.glsl") .fragment_source("overlay_uniform_color_frag.glsl") @@ -258,7 +294,7 @@ GPU_SHADER_CREATE_INFO(overlay_edit_uv_stencil_image) .sampler(0, ImageType::FLOAT_2D, "imgTexture") .push_constant(Type::BOOL, "imgPremultiplied") .push_constant(Type::BOOL, "imgAlphaBlend") - .push_constant(Type::VEC4, "color") + .push_constant(Type::VEC4, "ucolor") .fragment_out(0, Type::VEC4, "fragColor") .fragment_source("overlay_image_frag.glsl") .additional_info("draw_mesh"); @@ -293,7 +329,6 @@ GPU_SHADER_CREATE_INFO(overlay_edit_uv_stretching_area) .do_static_compilation(true) .vertex_in(1, Type::FLOAT, "ratio") .push_constant(Type::FLOAT, "totalAreaRatio") - .push_constant(Type::FLOAT, "totalAreaRatioInv") .additional_info("overlay_edit_uv_stretching"); GPU_SHADER_CREATE_INFO(overlay_edit_uv_stretching_angle) @@ -327,10 +362,29 @@ GPU_SHADER_CREATE_INFO(overlay_edit_curve_handle) .fragment_source("overlay_varying_color.glsl") .additional_info("draw_mesh", "draw_globals"); +GPU_SHADER_CREATE_INFO(overlay_edit_curve_handle_no_geom) + .do_static_compilation(true) + .typedef_source("overlay_shader_shared.h") + /* NOTE: Color already in Linear space. Which is what we want. */ + .define("srgbTarget", "false") + .vertex_in(0, Type::VEC3, "pos") + .vertex_in(1, Type::INT, "data") + .vertex_out(overlay_edit_curve_handle_iface) + .push_constant(Type::BOOL, "showCurveHandles") + .push_constant(Type::INT, "curveHandleDisplay") + .fragment_out(0, Type::VEC4, "fragColor") + .vertex_source("overlay_edit_curve_handle_vert_no_geom.glsl") + .fragment_source("overlay_varying_color.glsl") + .additional_info("draw_mesh", "draw_globals"); + GPU_SHADER_CREATE_INFO(overlay_edit_curve_handle_clipped) .do_static_compilation(true) .additional_info("overlay_edit_curve_handle", "drw_clipped"); +GPU_SHADER_CREATE_INFO(overlay_edit_curve_handle_clipped_no_geom) + .do_static_compilation(true) + .additional_info("overlay_edit_curve_handle_no_geom", "drw_clipped"); + GPU_SHADER_CREATE_INFO(overlay_edit_curve_point) .do_static_compilation(true) .typedef_source("overlay_shader_shared.h") @@ -527,7 +581,7 @@ GPU_SHADER_CREATE_INFO(overlay_depth_only_clipped) GPU_SHADER_CREATE_INFO(overlay_uniform_color) .do_static_compilation(true) .vertex_in(0, Type::VEC3, "pos") - .push_constant(Type::VEC4, "color") + .push_constant(Type::VEC4, "ucolor") .fragment_out(0, Type::VEC4, "fragColor") .vertex_source("overlay_depth_only_vert.glsl") .fragment_source("overlay_uniform_color_frag.glsl") diff --git a/source/blender/draw/engines/overlay/shaders/infos/overlay_extra_info.hh b/source/blender/draw/engines/overlay/shaders/infos/overlay_extra_info.hh index 5b50bbcaa55..65084361f14 100644 --- a/source/blender/draw/engines/overlay/shaders/infos/overlay_extra_info.hh +++ b/source/blender/draw/engines/overlay/shaders/infos/overlay_extra_info.hh @@ -145,7 +145,7 @@ GPU_SHADER_CREATE_INFO(overlay_extra_point) /* TODO(fclem): Move the vertex shader to Overlay engine and remove this bypass. */ .define("blender_srgb_to_framebuffer_space(a)", "a") .vertex_in(0, Type::VEC3, "pos") - .push_constant(Type::VEC4, "color") + .push_constant(Type::VEC4, "ucolor") .vertex_out(overlay_extra_point_iface) .fragment_out(0, Type::VEC4, "fragColor") .vertex_source("overlay_extra_point_vert.glsl") @@ -161,7 +161,7 @@ GPU_SHADER_INTERFACE_INFO(overlay_extra_loose_point_iface, "").smooth(Type::VEC4 GPU_SHADER_CREATE_INFO(overlay_extra_loose_point) .do_static_compilation(true) .vertex_in(0, Type::VEC3, "pos") - .push_constant(Type::VEC4, "color") + .push_constant(Type::VEC4, "ucolor") .vertex_out(overlay_extra_loose_point_iface) .fragment_out(0, Type::VEC4, "fragColor") .fragment_out(1, Type::VEC4, "lineOutput") @@ -183,6 +183,9 @@ GPU_SHADER_INTERFACE_INFO(overlay_motion_path_line_iface, "interp") .flat(Type::VEC2, "ss_pos") .smooth(Type::VEC4, "color"); +GPU_SHADER_INTERFACE_INFO(overlay_motion_path_line_no_geom_iface, "interp") + .smooth(Type::VEC4, "color"); + GPU_SHADER_CREATE_INFO(overlay_motion_path_line) .do_static_compilation(true) .vertex_in(0, Type::VEC3, "pos") @@ -199,10 +202,27 @@ GPU_SHADER_CREATE_INFO(overlay_motion_path_line) .fragment_source("overlay_motion_path_line_frag.glsl") .additional_info("draw_view", "draw_globals"); +GPU_SHADER_CREATE_INFO(overlay_motion_path_line_no_geom) + .do_static_compilation(true) + .vertex_in(0, Type::VEC3, "pos") + .push_constant(Type::IVEC4, "mpathLineSettings") + .push_constant(Type::BOOL, "selected") + .push_constant(Type::VEC3, "customColor") + .push_constant(Type::INT, "lineThickness") /* In pixels. */ + .vertex_out(overlay_motion_path_line_no_geom_iface) + .fragment_out(0, Type::VEC4, "fragColor") + .vertex_source("overlay_motion_path_line_vert_no_geom.glsl") + .fragment_source("overlay_motion_path_line_frag.glsl") + .additional_info("draw_view", "draw_globals"); + GPU_SHADER_CREATE_INFO(overlay_motion_path_line_clipped) .do_static_compilation(true) .additional_info("overlay_motion_path_line", "drw_clipped"); +GPU_SHADER_CREATE_INFO(overlay_motion_path_line_clipped_no_geom) + .do_static_compilation(true) + .additional_info("overlay_motion_path_line_no_geom", "drw_clipped"); + GPU_SHADER_INTERFACE_INFO(overlay_motion_path_point_iface, "").flat(Type::VEC4, "finalColor"); GPU_SHADER_CREATE_INFO(overlay_motion_path_point) @@ -237,7 +257,7 @@ GPU_SHADER_CREATE_INFO(overlay_image) .push_constant(Type::BOOL, "isCameraBackground") .push_constant(Type::BOOL, "imgPremultiplied") .push_constant(Type::BOOL, "imgAlphaBlend") - .push_constant(Type::VEC4, "color") + .push_constant(Type::VEC4, "ucolor") .vertex_in(0, Type::VEC3, "pos") .vertex_out(overlay_image_iface) .sampler(0, ImageType::FLOAT_2D, "imgTexture") @@ -284,7 +304,7 @@ GPU_SHADER_INTERFACE_INFO(overlay_particle_iface, "").flat(Type::VEC4, "finalCol GPU_SHADER_CREATE_INFO(overlay_particle) .sampler(0, ImageType::FLOAT_1D, "weightTex") - .push_constant(Type::VEC4, "color") /* Draw-size packed in alpha. */ + .push_constant(Type::VEC4, "ucolor") /* Draw-size packed in alpha. */ .vertex_in(0, Type::VEC3, "part_pos") .vertex_in(1, Type::VEC4, "part_rot") .vertex_in(2, Type::FLOAT, "part_val") diff --git a/source/blender/draw/engines/overlay/shaders/infos/overlay_grid_info.hh b/source/blender/draw/engines/overlay/shaders/infos/overlay_grid_info.hh index a8f1281d53a..70175b7072f 100644 --- a/source/blender/draw/engines/overlay/shaders/infos/overlay_grid_info.hh +++ b/source/blender/draw/engines/overlay/shaders/infos/overlay_grid_info.hh @@ -32,7 +32,7 @@ GPU_SHADER_CREATE_INFO(overlay_grid_background) GPU_SHADER_CREATE_INFO(overlay_grid_image) .do_static_compilation(true) .vertex_in(0, Type::VEC3, "pos") - .push_constant(Type::VEC4, "color") + .push_constant(Type::VEC4, "ucolor") .fragment_out(0, Type::VEC4, "fragColor") .vertex_source("overlay_edit_uv_tiled_image_borders_vert.glsl") .fragment_source("overlay_uniform_color_frag.glsl") diff --git a/source/blender/draw/engines/overlay/shaders/infos/overlay_paint_info.hh b/source/blender/draw/engines/overlay/shaders/infos/overlay_paint_info.hh index 3083d5a463b..08b421de3e6 100644 --- a/source/blender/draw/engines/overlay/shaders/infos/overlay_paint_info.hh +++ b/source/blender/draw/engines/overlay/shaders/infos/overlay_paint_info.hh @@ -12,7 +12,7 @@ GPU_SHADER_CREATE_INFO(overlay_paint_face) .do_static_compilation(true) .vertex_in(0, Type::VEC3, "pos") .vertex_in(1, Type::VEC4, "nor") /* Select flag on the 4th component. */ - .push_constant(Type::VEC4, "color") + .push_constant(Type::VEC4, "ucolor") .fragment_out(0, Type::VEC4, "fragColor") .vertex_source("overlay_paint_face_vert.glsl") .fragment_source("overlay_uniform_color_frag.glsl") |