forked from blender/blender
GPU: Shader Create Info GLSL-C++ stubs #3
@ -5,21 +5,23 @@
|
|||||||
#include "gpu_shader_create_info.hh"
|
#include "gpu_shader_create_info.hh"
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_antialiasing)
|
GPU_SHADER_CREATE_INFO(overlay_antialiasing)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.sampler(0, ImageType::DEPTH_2D, "depthTex")
|
SAMPLER(0, DEPTH_2D, depthTex)
|
||||||
.sampler(1, ImageType::FLOAT_2D, "colorTex")
|
SAMPLER(1, FLOAT_2D, colorTex)
|
||||||
.sampler(2, ImageType::FLOAT_2D, "lineTex")
|
SAMPLER(2, FLOAT_2D, lineTex)
|
||||||
.push_constant(Type::BOOL, "doSmoothLines")
|
PUSH_CONSTANT(BOOL, doSmoothLines)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.fragment_source("overlay_antialiasing_frag.glsl")
|
FRAGMENT_SOURCE("overlay_antialiasing_frag.glsl")
|
||||||
.additional_info("draw_fullscreen")
|
ADDITIONAL_INFO(draw_fullscreen)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_xray_fade)
|
GPU_SHADER_CREATE_INFO(overlay_xray_fade)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.sampler(0, ImageType::DEPTH_2D, "depthTex")
|
SAMPLER(0, DEPTH_2D, depthTex)
|
||||||
.sampler(1, ImageType::DEPTH_2D, "xrayDepthTex")
|
SAMPLER(1, DEPTH_2D, xrayDepthTex)
|
||||||
.push_constant(Type::FLOAT, "opacity")
|
PUSH_CONSTANT(FLOAT, opacity)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.fragment_source("overlay_xray_fade_frag.glsl")
|
FRAGMENT_SOURCE("overlay_xray_fade_frag.glsl")
|
||||||
.additional_info("draw_fullscreen");
|
ADDITIONAL_INFO(draw_fullscreen)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
@ -5,64 +5,72 @@
|
|||||||
#include "gpu_shader_create_info.hh"
|
#include "gpu_shader_create_info.hh"
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_frag_output)
|
GPU_SHADER_CREATE_INFO(overlay_frag_output)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.fragment_out(1, Type::VEC4, "lineOutput");
|
FRAGMENT_OUT(1, VEC4, lineOutput)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_armature_wire_iface)
|
GPU_SHADER_INTERFACE_INFO(overlay_armature_wire_iface)
|
||||||
.flat(Type::VEC4, "finalColor")
|
FLAT(VEC4, finalColor)
|
||||||
.flat(Type::VEC2, "edgeStart")
|
FLAT(VEC2, edgeStart)
|
||||||
.no_perspective(Type::VEC2, "edgePos");
|
NO_PERSPECTIVE(VEC2, edgePos)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_common)
|
GPU_SHADER_CREATE_INFO(overlay_armature_common)
|
||||||
.push_constant(Type::FLOAT, "alpha")
|
PUSH_CONSTANT(FLOAT, alpha)
|
||||||
.additional_info("draw_view");
|
ADDITIONAL_INFO(draw_view)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/* -------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------- */
|
||||||
/** \name Armature Sphere
|
/** \name Armature Sphere
|
||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_sphere_outline)
|
GPU_SHADER_CREATE_INFO(overlay_armature_sphere_outline)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_in(0, Type::VEC2, "pos")
|
VERTEX_IN(0, VEC2, pos)
|
||||||
/* Per instance. */
|
/* Per instance. */
|
||||||
.vertex_in(1, Type::MAT4, "inst_obmat")
|
VERTEX_IN(1, MAT4, inst_obmat)
|
||||||
.vertex_out(overlay_armature_wire_iface)
|
VERTEX_OUT(overlay_armature_wire_iface)
|
||||||
.vertex_source("overlay_armature_sphere_outline_vert.glsl")
|
VERTEX_SOURCE("overlay_armature_sphere_outline_vert.glsl")
|
||||||
.fragment_source("overlay_armature_wire_frag.glsl")
|
FRAGMENT_SOURCE("overlay_armature_wire_frag.glsl")
|
||||||
.additional_info("overlay_frag_output")
|
ADDITIONAL_INFO(overlay_frag_output)
|
||||||
.additional_info("overlay_armature_common")
|
ADDITIONAL_INFO(overlay_armature_common)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_sphere_outline_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_armature_sphere_outline_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_armature_sphere_outline")
|
ADDITIONAL_INFO(overlay_armature_sphere_outline)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_armature_sphere_solid_iface)
|
GPU_SHADER_INTERFACE_INFO(overlay_armature_sphere_solid_iface)
|
||||||
.flat(Type::VEC3, "finalStateColor")
|
FLAT(VEC3, finalStateColor)
|
||||||
.flat(Type::VEC3, "finalBoneColor")
|
FLAT(VEC3, finalBoneColor)
|
||||||
.flat(Type::MAT4, "sphereMatrix")
|
FLAT(MAT4, sphereMatrix)
|
||||||
.smooth(Type::VEC3, "viewPosition");
|
SMOOTH(VEC3, viewPosition)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_sphere_solid)
|
GPU_SHADER_CREATE_INFO(overlay_armature_sphere_solid)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_in(0, Type::VEC2, "pos")
|
VERTEX_IN(0, VEC2, pos)
|
||||||
/* Per instance. */
|
/* Per instance. */
|
||||||
.vertex_in(1, Type::VEC4, "color")
|
VERTEX_IN(1, VEC4, color)
|
||||||
.vertex_in(2, Type::MAT4, "inst_obmat")
|
VERTEX_IN(2, MAT4, inst_obmat)
|
||||||
.depth_write(DepthWrite::GREATER)
|
DEPTH_WRITE(DepthWrite::GREATER)
|
||||||
.vertex_out(overlay_armature_sphere_solid_iface)
|
VERTEX_OUT(overlay_armature_sphere_solid_iface)
|
||||||
.vertex_source("overlay_armature_sphere_solid_vert.glsl")
|
VERTEX_SOURCE("overlay_armature_sphere_solid_vert.glsl")
|
||||||
.fragment_source("overlay_armature_sphere_solid_frag.glsl")
|
FRAGMENT_SOURCE("overlay_armature_sphere_solid_frag.glsl")
|
||||||
.additional_info("overlay_frag_output")
|
ADDITIONAL_INFO(overlay_frag_output)
|
||||||
.additional_info("overlay_armature_common")
|
ADDITIONAL_INFO(overlay_armature_common)
|
||||||
.additional_info("draw_globals")
|
ADDITIONAL_INFO(draw_globals)
|
||||||
.depth_write(DepthWrite::ANY);
|
DEPTH_WRITE(DepthWrite::ANY)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_sphere_solid_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_armature_sphere_solid_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_armature_sphere_solid")
|
ADDITIONAL_INFO(overlay_armature_sphere_solid)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
@ -71,166 +79,185 @@ GPU_SHADER_CREATE_INFO(overlay_armature_sphere_solid_clipped)
|
|||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_NAMED_INTERFACE_INFO(overlay_armature_shape_outline_iface, geom_in)
|
GPU_SHADER_NAMED_INTERFACE_INFO(overlay_armature_shape_outline_iface, geom_in)
|
||||||
.smooth(Type::VEC4, "pPos")
|
SMOOTH(VEC4, pPos)
|
||||||
.smooth(Type::VEC3, "vPos")
|
SMOOTH(VEC3, vPos)
|
||||||
.smooth(Type::VEC2, "ssPos")
|
SMOOTH(VEC2, ssPos)
|
||||||
.smooth(Type::VEC4, "vColSize");
|
SMOOTH(VEC4, vColSize)
|
||||||
|
GPU_SHADER_NAMED_INTERFACE_END(geom_in)
|
||||||
GPU_SHADER_NAMED_INTERFACE_INFO(overlay_armature_shape_outline_flat_iface, geom_flat_in)
|
GPU_SHADER_NAMED_INTERFACE_INFO(overlay_armature_shape_outline_flat_iface, geom_flat_in)
|
||||||
.flat(Type::INT, "inverted");
|
FLAT(INT, inverted)
|
||||||
|
GPU_SHADER_NAMED_INTERFACE_END(geom_flat_in)
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_armature_shape_outline_no_geom_iface)
|
GPU_SHADER_INTERFACE_INFO(overlay_armature_shape_outline_no_geom_iface)
|
||||||
.flat(Type::VEC4, "finalColor")
|
FLAT(VEC4, finalColor)
|
||||||
.flat(Type::VEC2, "edgeStart")
|
FLAT(VEC2, edgeStart)
|
||||||
.no_perspective(Type::VEC2, "edgePos");
|
NO_PERSPECTIVE(VEC2, edgePos)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_shape_outline)
|
GPU_SHADER_CREATE_INFO(overlay_armature_shape_outline)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
/* Per instance. */
|
/* Per instance. */
|
||||||
.vertex_in(3, Type::MAT4, "inst_obmat")
|
VERTEX_IN(3, MAT4, inst_obmat)
|
||||||
.vertex_out(overlay_armature_shape_outline_iface)
|
VERTEX_OUT(overlay_armature_shape_outline_iface)
|
||||||
.vertex_out(overlay_armature_shape_outline_flat_iface)
|
VERTEX_OUT(overlay_armature_shape_outline_flat_iface)
|
||||||
.geometry_layout(PrimitiveIn::LINES_ADJACENCY, PrimitiveOut::LINE_STRIP, 2)
|
GEOMETRY_LAYOUT(PrimitiveIn::LINES_ADJACENCY, PrimitiveOut::LINE_STRIP, 2)
|
||||||
.geometry_out(overlay_armature_wire_iface)
|
GEOMETRY_OUT(overlay_armature_wire_iface)
|
||||||
.vertex_source("overlay_armature_shape_outline_vert.glsl")
|
VERTEX_SOURCE("overlay_armature_shape_outline_vert.glsl")
|
||||||
.geometry_source("overlay_armature_shape_outline_geom.glsl")
|
GEOMETRY_SOURCE("overlay_armature_shape_outline_geom.glsl")
|
||||||
.fragment_source("overlay_armature_wire_frag.glsl")
|
FRAGMENT_SOURCE("overlay_armature_wire_frag.glsl")
|
||||||
.additional_info("overlay_frag_output")
|
ADDITIONAL_INFO(overlay_frag_output)
|
||||||
.additional_info("overlay_armature_common")
|
ADDITIONAL_INFO(overlay_armature_common)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_shape_outline_no_geom)
|
GPU_SHADER_CREATE_INFO(overlay_armature_shape_outline_no_geom)
|
||||||
.metal_backend_only(true)
|
METAL_BACKEND_ONLY()
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
/* Per instance. */
|
/* Per instance. */
|
||||||
.vertex_in(3, Type::MAT4, "inst_obmat")
|
VERTEX_IN(3, MAT4, inst_obmat)
|
||||||
.vertex_out(overlay_armature_shape_outline_no_geom_iface)
|
VERTEX_OUT(overlay_armature_shape_outline_no_geom_iface)
|
||||||
.vertex_source("overlay_armature_shape_outline_vert_no_geom.glsl")
|
VERTEX_SOURCE("overlay_armature_shape_outline_vert_no_geom.glsl")
|
||||||
.fragment_source("overlay_armature_wire_frag.glsl")
|
FRAGMENT_SOURCE("overlay_armature_wire_frag.glsl")
|
||||||
.additional_info("overlay_frag_output")
|
ADDITIONAL_INFO(overlay_frag_output)
|
||||||
.additional_info("overlay_armature_common")
|
ADDITIONAL_INFO(overlay_armature_common)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_shape_outline_next)
|
GPU_SHADER_CREATE_INFO(overlay_armature_shape_outline_next)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.storage_buf(0, Qualifier::READ, "float", "pos[]", Frequency::GEOMETRY)
|
STORAGE_BUF_FREQ(0, READ, float, pos[], GEOMETRY)
|
||||||
.storage_buf(1, Qualifier::READ, "mat4", "data_buf[]")
|
STORAGE_BUF(1, READ, mat4, data_buf[])
|
||||||
.push_constant(Type::IVEC2, "gpu_attr_0")
|
PUSH_CONSTANT(IVEC2, gpu_attr_0)
|
||||||
.vertex_out(overlay_armature_shape_outline_no_geom_iface)
|
VERTEX_OUT(overlay_armature_shape_outline_no_geom_iface)
|
||||||
.vertex_source("overlay_armature_shape_outline_next_vert.glsl")
|
VERTEX_SOURCE("overlay_armature_shape_outline_next_vert.glsl")
|
||||||
.fragment_source("overlay_armature_wire_frag.glsl")
|
FRAGMENT_SOURCE("overlay_armature_wire_frag.glsl")
|
||||||
.additional_info("overlay_frag_output")
|
ADDITIONAL_INFO(overlay_frag_output)
|
||||||
.additional_info("overlay_armature_common")
|
ADDITIONAL_INFO(overlay_armature_common)
|
||||||
.additional_info("gpu_index_load")
|
ADDITIONAL_INFO(gpu_index_load)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_shape_outline_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_armature_shape_outline_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_armature_shape_outline")
|
ADDITIONAL_INFO(overlay_armature_shape_outline)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_shape_outline_clipped_no_geom)
|
GPU_SHADER_CREATE_INFO(overlay_armature_shape_outline_clipped_no_geom)
|
||||||
.metal_backend_only(true)
|
METAL_BACKEND_ONLY()
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_armature_shape_outline_no_geom")
|
ADDITIONAL_INFO(overlay_armature_shape_outline_no_geom)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_armature_shape_solid_iface)
|
GPU_SHADER_INTERFACE_INFO(overlay_armature_shape_solid_iface)
|
||||||
.smooth(Type::VEC4, "finalColor")
|
SMOOTH(VEC4, finalColor)
|
||||||
.flat(Type::INT, "inverted");
|
FLAT(INT, inverted)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_shape_solid)
|
GPU_SHADER_CREATE_INFO(overlay_armature_shape_solid)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_in(1, Type::VEC3, "nor")
|
VERTEX_IN(1, VEC3, nor)
|
||||||
/* Per instance. */
|
/* Per instance. */
|
||||||
.vertex_in(2, Type::MAT4, "inst_obmat")
|
VERTEX_IN(2, MAT4, inst_obmat)
|
||||||
.depth_write(DepthWrite::GREATER)
|
DEPTH_WRITE(DepthWrite::GREATER)
|
||||||
.vertex_out(overlay_armature_shape_solid_iface)
|
VERTEX_OUT(overlay_armature_shape_solid_iface)
|
||||||
.vertex_source("overlay_armature_shape_solid_vert.glsl")
|
VERTEX_SOURCE("overlay_armature_shape_solid_vert.glsl")
|
||||||
.fragment_source("overlay_armature_shape_solid_frag.glsl")
|
FRAGMENT_SOURCE("overlay_armature_shape_solid_frag.glsl")
|
||||||
.additional_info("overlay_frag_output")
|
ADDITIONAL_INFO(overlay_frag_output)
|
||||||
.additional_info("overlay_armature_common")
|
ADDITIONAL_INFO(overlay_armature_common)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_shape_solid_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_armature_shape_solid_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_armature_shape_solid")
|
ADDITIONAL_INFO(overlay_armature_shape_solid)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_armature_shape_wire_next_iface)
|
GPU_SHADER_INTERFACE_INFO(overlay_armature_shape_wire_next_iface)
|
||||||
.flat(Type::VEC4, "finalColor")
|
FLAT(VEC4, finalColor)
|
||||||
.flat(Type::FLOAT, "wire_width")
|
FLAT(FLOAT, wire_width)
|
||||||
.no_perspective(Type::FLOAT, "edgeCoord");
|
NO_PERSPECTIVE(FLOAT, edgeCoord)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_NAMED_INTERFACE_INFO(overlay_armature_shape_wire_iface, geometry_in)
|
GPU_SHADER_NAMED_INTERFACE_INFO(overlay_armature_shape_wire_iface, geometry_in)
|
||||||
.flat(Type::VEC4, "finalColor")
|
FLAT(VEC4, finalColor)
|
||||||
.flat(Type::FLOAT, "wire_width");
|
FLAT(FLOAT, wire_width)
|
||||||
|
GPU_SHADER_NAMED_INTERFACE_END(geometry_in)
|
||||||
|
|
||||||
GPU_SHADER_NAMED_INTERFACE_INFO(overlay_armature_shape_wire_geom_iface, geometry_out)
|
GPU_SHADER_NAMED_INTERFACE_INFO(overlay_armature_shape_wire_geom_iface, geometry_out)
|
||||||
.flat(Type::VEC4, "finalColor")
|
FLAT(VEC4, finalColor)
|
||||||
.flat(Type::FLOAT, "wire_width");
|
FLAT(FLOAT, wire_width)
|
||||||
|
GPU_SHADER_NAMED_INTERFACE_END(geometry_out)
|
||||||
|
|
||||||
GPU_SHADER_NAMED_INTERFACE_INFO(overlay_armature_shape_wire_geom_noperspective_iface,
|
GPU_SHADER_NAMED_INTERFACE_INFO(overlay_armature_shape_wire_geom_noperspective_iface,
|
||||||
geometry_noperspective_out)
|
geometry_noperspective_out)
|
||||||
.no_perspective(Type::FLOAT, "edgeCoord");
|
NO_PERSPECTIVE(FLOAT, edgeCoord)
|
||||||
|
GPU_SHADER_NAMED_INTERFACE_END(geometry_noperspective_out)
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_shape_wire)
|
GPU_SHADER_CREATE_INFO(overlay_armature_shape_wire)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.push_constant(Type::BOOL, "do_smooth_wire")
|
PUSH_CONSTANT(BOOL, do_smooth_wire)
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
/* Per instance. */
|
/* Per instance. */
|
||||||
.vertex_in(2, Type::MAT4, "inst_obmat")
|
VERTEX_IN(2, MAT4, inst_obmat)
|
||||||
.vertex_out(overlay_armature_shape_wire_iface)
|
VERTEX_OUT(overlay_armature_shape_wire_iface)
|
||||||
.vertex_source("overlay_armature_shape_wire_vert.glsl")
|
VERTEX_SOURCE("overlay_armature_shape_wire_vert.glsl")
|
||||||
.geometry_out(overlay_armature_shape_wire_geom_iface)
|
GEOMETRY_OUT(overlay_armature_shape_wire_geom_iface)
|
||||||
.geometry_out(overlay_armature_shape_wire_geom_noperspective_iface)
|
GEOMETRY_OUT(overlay_armature_shape_wire_geom_noperspective_iface)
|
||||||
.geometry_layout(PrimitiveIn::LINES, PrimitiveOut::TRIANGLE_STRIP, 4)
|
GEOMETRY_LAYOUT(PrimitiveIn::LINES, PrimitiveOut::TRIANGLE_STRIP, 4)
|
||||||
.geometry_source("overlay_armature_shape_wire_geom.glsl")
|
GEOMETRY_SOURCE("overlay_armature_shape_wire_geom.glsl")
|
||||||
.fragment_source("overlay_armature_shape_wire_frag.glsl")
|
FRAGMENT_SOURCE("overlay_armature_shape_wire_frag.glsl")
|
||||||
.typedef_source("overlay_shader_shared.h")
|
TYPEDEF_SOURCE("overlay_shader_shared.h")
|
||||||
.additional_info("overlay_frag_output")
|
ADDITIONAL_INFO(overlay_frag_output)
|
||||||
.additional_info("overlay_armature_common")
|
ADDITIONAL_INFO(overlay_armature_common)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_shape_wire_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_armature_shape_wire_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_armature_shape_wire")
|
ADDITIONAL_INFO(overlay_armature_shape_wire)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
#ifdef WITH_METAL_BACKEND
|
#ifdef WITH_METAL_BACKEND
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_shape_wire_no_geom)
|
GPU_SHADER_CREATE_INFO(overlay_armature_shape_wire_no_geom)
|
||||||
.metal_backend_only(true)
|
METAL_BACKEND_ONLY()
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.push_constant(Type::BOOL, "do_smooth_wire")
|
PUSH_CONSTANT(BOOL, do_smooth_wire)
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_in(2, Type::MAT4, "inst_obmat")
|
VERTEX_IN(2, MAT4, inst_obmat)
|
||||||
.vertex_out(overlay_armature_wire_iface)
|
VERTEX_OUT(overlay_armature_wire_iface)
|
||||||
.vertex_source("overlay_armature_shape_wire_vert_no_geom.glsl")
|
VERTEX_SOURCE("overlay_armature_shape_wire_vert_no_geom.glsl")
|
||||||
.fragment_source("overlay_armature_wire_frag.glsl")
|
FRAGMENT_SOURCE("overlay_armature_wire_frag.glsl")
|
||||||
.typedef_source("overlay_shader_shared.h")
|
TYPEDEF_SOURCE("overlay_shader_shared.h")
|
||||||
.additional_info("overlay_frag_output")
|
ADDITIONAL_INFO(overlay_frag_output)
|
||||||
.additional_info("overlay_armature_common")
|
ADDITIONAL_INFO(overlay_armature_common)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_shape_wire_next)
|
GPU_SHADER_CREATE_INFO(overlay_armature_shape_wire_next)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.define("NO_GEOM")
|
DEFINE("NO_GEOM")
|
||||||
.push_constant(Type::BOOL, "do_smooth_wire")
|
PUSH_CONSTANT(BOOL, do_smooth_wire)
|
||||||
.storage_buf(0, Qualifier::READ, "float", "pos[]", Frequency::GEOMETRY)
|
STORAGE_BUF_FREQ(0, READ, float, pos[], GEOMETRY)
|
||||||
.storage_buf(1, Qualifier::READ, "mat4", "data_buf[]")
|
STORAGE_BUF(1, READ, mat4, data_buf[])
|
||||||
.push_constant(Type::IVEC2, "gpu_attr_0")
|
PUSH_CONSTANT(IVEC2, gpu_attr_0)
|
||||||
.define("inst_obmat", "data_buf[gl_InstanceID]")
|
DEFINE_VALUE("inst_obmat", "data_buf[gl_InstanceID]")
|
||||||
.vertex_out(overlay_armature_shape_wire_next_iface)
|
VERTEX_OUT(overlay_armature_shape_wire_next_iface)
|
||||||
.vertex_source("overlay_armature_shape_wire_next_vert.glsl")
|
VERTEX_SOURCE("overlay_armature_shape_wire_next_vert.glsl")
|
||||||
.fragment_source("overlay_armature_shape_wire_frag.glsl")
|
FRAGMENT_SOURCE("overlay_armature_shape_wire_frag.glsl")
|
||||||
.typedef_source("overlay_shader_shared.h")
|
TYPEDEF_SOURCE("overlay_shader_shared.h")
|
||||||
.additional_info("overlay_frag_output")
|
ADDITIONAL_INFO(overlay_frag_output)
|
||||||
.additional_info("overlay_armature_common")
|
ADDITIONAL_INFO(overlay_armature_common)
|
||||||
.additional_info("gpu_index_load")
|
ADDITIONAL_INFO(gpu_index_load)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
@ -239,54 +266,59 @@ GPU_SHADER_CREATE_INFO(overlay_armature_shape_wire_next)
|
|||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_envelope_outline)
|
GPU_SHADER_CREATE_INFO(overlay_armature_envelope_outline)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.typedef_source("overlay_shader_shared.h")
|
TYPEDEF_SOURCE("overlay_shader_shared.h")
|
||||||
.vertex_in(0, Type::VEC2, "pos0")
|
VERTEX_IN(0, VEC2, pos0)
|
||||||
.vertex_in(1, Type::VEC2, "pos1")
|
VERTEX_IN(1, VEC2, pos1)
|
||||||
.vertex_in(2, Type::VEC2, "pos2")
|
VERTEX_IN(2, VEC2, pos2)
|
||||||
/* Per instance. */
|
/* Per instance. */
|
||||||
.vertex_in(3, Type::VEC4, "headSphere")
|
VERTEX_IN(3, VEC4, headSphere)
|
||||||
.vertex_in(4, Type::VEC4, "tailSphere")
|
VERTEX_IN(4, VEC4, tailSphere)
|
||||||
.vertex_in(5, Type::VEC4, "outlineColorSize")
|
VERTEX_IN(5, VEC4, outlineColorSize)
|
||||||
.vertex_in(6, Type::VEC3, "xAxis")
|
VERTEX_IN(6, VEC3, xAxis)
|
||||||
.vertex_out(overlay_armature_wire_iface)
|
VERTEX_OUT(overlay_armature_wire_iface)
|
||||||
.vertex_source("overlay_armature_envelope_outline_vert.glsl")
|
VERTEX_SOURCE("overlay_armature_envelope_outline_vert.glsl")
|
||||||
.fragment_source("overlay_armature_wire_frag.glsl")
|
FRAGMENT_SOURCE("overlay_armature_wire_frag.glsl")
|
||||||
.additional_info("overlay_frag_output")
|
ADDITIONAL_INFO(overlay_frag_output)
|
||||||
.additional_info("overlay_armature_common")
|
ADDITIONAL_INFO(overlay_armature_common)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_envelope_outline_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_armature_envelope_outline_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_armature_envelope_outline")
|
ADDITIONAL_INFO(overlay_armature_envelope_outline)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_armature_envelope_solid_iface)
|
GPU_SHADER_INTERFACE_INFO(overlay_armature_envelope_solid_iface)
|
||||||
.flat(Type::VEC3, "finalStateColor")
|
FLAT(VEC3, finalStateColor)
|
||||||
.flat(Type::VEC3, "finalBoneColor")
|
FLAT(VEC3, finalBoneColor)
|
||||||
.smooth(Type::VEC3, "normalView");
|
SMOOTH(VEC3, normalView)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_envelope_solid)
|
GPU_SHADER_CREATE_INFO(overlay_armature_envelope_solid)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.typedef_source("overlay_shader_shared.h")
|
TYPEDEF_SOURCE("overlay_shader_shared.h")
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
/* Per instance. Assumed to be in world coordinate already. */
|
/* Per instance. Assumed to be in world coordinate already. */
|
||||||
.vertex_in(1, Type::VEC4, "headSphere")
|
VERTEX_IN(1, VEC4, headSphere)
|
||||||
.vertex_in(2, Type::VEC4, "tailSphere")
|
VERTEX_IN(2, VEC4, tailSphere)
|
||||||
.vertex_in(3, Type::VEC3, "xAxis")
|
VERTEX_IN(3, VEC3, xAxis)
|
||||||
.vertex_in(4, Type::VEC3, "stateColor")
|
VERTEX_IN(4, VEC3, stateColor)
|
||||||
.vertex_in(5, Type::VEC3, "boneColor")
|
VERTEX_IN(5, VEC3, boneColor)
|
||||||
.vertex_out(overlay_armature_envelope_solid_iface)
|
VERTEX_OUT(overlay_armature_envelope_solid_iface)
|
||||||
.push_constant(Type::BOOL, "isDistance")
|
PUSH_CONSTANT(BOOL, isDistance)
|
||||||
.vertex_source("overlay_armature_envelope_solid_vert.glsl")
|
VERTEX_SOURCE("overlay_armature_envelope_solid_vert.glsl")
|
||||||
.fragment_source("overlay_armature_envelope_solid_frag.glsl")
|
FRAGMENT_SOURCE("overlay_armature_envelope_solid_frag.glsl")
|
||||||
.additional_info("overlay_frag_output")
|
ADDITIONAL_INFO(overlay_frag_output)
|
||||||
.additional_info("overlay_armature_common");
|
ADDITIONAL_INFO(overlay_armature_common)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_envelope_solid_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_armature_envelope_solid_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_armature_envelope_solid")
|
ADDITIONAL_INFO(overlay_armature_envelope_solid)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
@ -295,36 +327,39 @@ GPU_SHADER_CREATE_INFO(overlay_armature_envelope_solid_clipped)
|
|||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_armature_stick_iface)
|
GPU_SHADER_INTERFACE_INFO(overlay_armature_stick_iface)
|
||||||
.no_perspective(Type::FLOAT, "colorFac")
|
NO_PERSPECTIVE(FLOAT, colorFac)
|
||||||
.flat(Type::VEC4, "finalWireColor")
|
FLAT(VEC4, finalWireColor)
|
||||||
.flat(Type::VEC4, "finalInnerColor");
|
FLAT(VEC4, finalInnerColor)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_stick)
|
GPU_SHADER_CREATE_INFO(overlay_armature_stick)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.typedef_source("overlay_shader_shared.h")
|
TYPEDEF_SOURCE("overlay_shader_shared.h")
|
||||||
/* Bone aligned screen space. */
|
/* Bone aligned screen space. */
|
||||||
.vertex_in(0, Type::VEC2, "pos")
|
VERTEX_IN(0, VEC2, pos)
|
||||||
.vertex_in(1, Type::UINT, "flag")
|
VERTEX_IN(1, UINT, flag)
|
||||||
/* Per instance. Assumed to be in world coordinate already. */
|
/* Per instance. Assumed to be in world coordinate already. */
|
||||||
.vertex_in(2, Type::VEC3, "boneStart")
|
VERTEX_IN(2, VEC3, boneStart)
|
||||||
.vertex_in(3, Type::VEC3, "boneEnd")
|
VERTEX_IN(3, VEC3, boneEnd)
|
||||||
/* alpha encode if we do wire. If 0.0 we don't. */
|
/* alpha encode if we do wire. If 0.0 we don't. */
|
||||||
.vertex_in(4, Type::VEC4, "wireColor")
|
VERTEX_IN(4, VEC4, wireColor)
|
||||||
.vertex_in(5, Type::VEC4, "boneColor")
|
VERTEX_IN(5, VEC4, boneColor)
|
||||||
.vertex_in(6, Type::VEC4, "headColor")
|
VERTEX_IN(6, VEC4, headColor)
|
||||||
.vertex_in(7, Type::VEC4, "tailColor")
|
VERTEX_IN(7, VEC4, tailColor)
|
||||||
.define("do_wire", "(wireColor.a > 0.0)")
|
DEFINE_VALUE("do_wire", "(wireColor.a > 0.0)")
|
||||||
.vertex_out(overlay_armature_stick_iface)
|
VERTEX_OUT(overlay_armature_stick_iface)
|
||||||
.vertex_source("overlay_armature_stick_vert.glsl")
|
VERTEX_SOURCE("overlay_armature_stick_vert.glsl")
|
||||||
.fragment_source("overlay_armature_stick_frag.glsl")
|
FRAGMENT_SOURCE("overlay_armature_stick_frag.glsl")
|
||||||
.additional_info("overlay_frag_output")
|
ADDITIONAL_INFO(overlay_frag_output)
|
||||||
.additional_info("overlay_armature_common")
|
ADDITIONAL_INFO(overlay_armature_common)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_stick_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_armature_stick_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_armature_stick")
|
ADDITIONAL_INFO(overlay_armature_stick)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
@ -333,23 +368,25 @@ GPU_SHADER_CREATE_INFO(overlay_armature_stick_clipped)
|
|||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_dof)
|
GPU_SHADER_CREATE_INFO(overlay_armature_dof)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.typedef_source("overlay_shader_shared.h")
|
TYPEDEF_SOURCE("overlay_shader_shared.h")
|
||||||
.vertex_in(0, Type::VEC2, "pos")
|
VERTEX_IN(0, VEC2, pos)
|
||||||
/* Per instance. Assumed to be in world coordinate already. */
|
/* Per instance. Assumed to be in world coordinate already. */
|
||||||
.vertex_in(1, Type::VEC4, "color")
|
VERTEX_IN(1, VEC4, color)
|
||||||
.vertex_in(2, Type::MAT4, "inst_obmat")
|
VERTEX_IN(2, MAT4, inst_obmat)
|
||||||
.vertex_out(overlay_armature_wire_iface)
|
VERTEX_OUT(overlay_armature_wire_iface)
|
||||||
.vertex_source("overlay_armature_dof_vert.glsl")
|
VERTEX_SOURCE("overlay_armature_dof_vert.glsl")
|
||||||
.fragment_source("overlay_armature_dof_solid_frag.glsl")
|
FRAGMENT_SOURCE("overlay_armature_dof_solid_frag.glsl")
|
||||||
.additional_info("overlay_frag_output")
|
ADDITIONAL_INFO(overlay_frag_output)
|
||||||
.additional_info("overlay_armature_common")
|
ADDITIONAL_INFO(overlay_armature_common)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_dof_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_armature_dof_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_armature_dof")
|
ADDITIONAL_INFO(overlay_armature_dof)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
@ -358,21 +395,23 @@ GPU_SHADER_CREATE_INFO(overlay_armature_dof_clipped)
|
|||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_wire)
|
GPU_SHADER_CREATE_INFO(overlay_armature_wire)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.typedef_source("overlay_shader_shared.h")
|
TYPEDEF_SOURCE("overlay_shader_shared.h")
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_in(1, Type::VEC4, "color")
|
VERTEX_IN(1, VEC4, color)
|
||||||
.push_constant(Type::FLOAT, "alpha")
|
PUSH_CONSTANT(FLOAT, alpha)
|
||||||
.vertex_out(overlay_armature_wire_iface)
|
VERTEX_OUT(overlay_armature_wire_iface)
|
||||||
.vertex_source("overlay_armature_wire_vert.glsl")
|
VERTEX_SOURCE("overlay_armature_wire_vert.glsl")
|
||||||
.fragment_source("overlay_armature_wire_frag.glsl")
|
FRAGMENT_SOURCE("overlay_armature_wire_frag.glsl")
|
||||||
.additional_info("overlay_frag_output")
|
ADDITIONAL_INFO(overlay_frag_output)
|
||||||
.additional_info("draw_mesh")
|
ADDITIONAL_INFO(draw_mesh)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_armature_wire_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_armature_wire_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_armature_wire")
|
ADDITIONAL_INFO(overlay_armature_wire)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
@ -5,22 +5,24 @@
|
|||||||
#include "gpu_shader_create_info.hh"
|
#include "gpu_shader_create_info.hh"
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_background)
|
GPU_SHADER_CREATE_INFO(overlay_background)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.typedef_source("overlay_shader_shared.h")
|
TYPEDEF_SOURCE("overlay_shader_shared.h")
|
||||||
.sampler(0, ImageType::FLOAT_2D, "colorBuffer")
|
SAMPLER(0, FLOAT_2D, colorBuffer)
|
||||||
.sampler(1, ImageType::DEPTH_2D, "depthBuffer")
|
SAMPLER(1, DEPTH_2D, depthBuffer)
|
||||||
.push_constant(Type::INT, "bgType")
|
PUSH_CONSTANT(INT, bgType)
|
||||||
.push_constant(Type::VEC4, "colorOverride")
|
PUSH_CONSTANT(VEC4, colorOverride)
|
||||||
.fragment_source("overlay_background_frag.glsl")
|
FRAGMENT_SOURCE("overlay_background_frag.glsl")
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.additional_info("draw_fullscreen")
|
ADDITIONAL_INFO(draw_fullscreen)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_clipbound)
|
GPU_SHADER_CREATE_INFO(overlay_clipbound)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.push_constant(Type::VEC4, "ucolor")
|
PUSH_CONSTANT(VEC4, ucolor)
|
||||||
.push_constant(Type::VEC3, "boundbox", 8)
|
PUSH_CONSTANT_ARRAY(VEC3, boundbox, 8)
|
||||||
.vertex_source("overlay_clipbound_vert.glsl")
|
VERTEX_SOURCE("overlay_clipbound_vert.glsl")
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.fragment_source("overlay_uniform_color_frag.glsl")
|
FRAGMENT_SOURCE("overlay_uniform_color_frag.glsl")
|
||||||
.additional_info("draw_view");
|
ADDITIONAL_INFO(draw_view)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -9,40 +9,45 @@
|
|||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_extra_iface)
|
GPU_SHADER_INTERFACE_INFO(overlay_extra_iface)
|
||||||
.no_perspective(Type::VEC2, "edgePos")
|
NO_PERSPECTIVE(VEC2, edgePos)
|
||||||
.flat(Type::VEC2, "edgeStart")
|
FLAT(VEC2, edgeStart)
|
||||||
.flat(Type::VEC4, "finalColor");
|
FLAT(VEC4, finalColor)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_extra)
|
GPU_SHADER_CREATE_INFO(overlay_extra)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.typedef_source("overlay_shader_shared.h")
|
TYPEDEF_SOURCE("overlay_shader_shared.h")
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_in(1, Type::INT, "vclass")
|
VERTEX_IN(1, INT, vclass)
|
||||||
/* Instance attributes. */
|
/* Instance attributes. */
|
||||||
.vertex_in(2, Type::VEC4, "color")
|
VERTEX_IN(2, VEC4, color)
|
||||||
.vertex_in(3, Type::MAT4, "inst_obmat")
|
VERTEX_IN(3, MAT4, inst_obmat)
|
||||||
.vertex_out(overlay_extra_iface)
|
VERTEX_OUT(overlay_extra_iface)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.fragment_out(1, Type::VEC4, "lineOutput")
|
FRAGMENT_OUT(1, VEC4, lineOutput)
|
||||||
.vertex_source("overlay_extra_vert.glsl")
|
VERTEX_SOURCE("overlay_extra_vert.glsl")
|
||||||
.fragment_source("overlay_extra_frag.glsl")
|
FRAGMENT_SOURCE("overlay_extra_frag.glsl")
|
||||||
.additional_info("draw_view")
|
ADDITIONAL_INFO(draw_view)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_extra_select)
|
GPU_SHADER_CREATE_INFO(overlay_extra_select)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.define("SELECT_EDGES")
|
DEFINE("SELECT_EDGES")
|
||||||
.additional_info("overlay_extra");
|
ADDITIONAL_INFO(overlay_extra)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_extra_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_extra_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_extra")
|
ADDITIONAL_INFO(overlay_extra)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_extra_select_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_extra_select_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_extra_select")
|
ADDITIONAL_INFO(overlay_extra_select)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
@ -50,24 +55,28 @@ GPU_SHADER_CREATE_INFO(overlay_extra_select_clipped)
|
|||||||
/** \name Irradiance Grid
|
/** \name Irradiance Grid
|
||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_extra_grid_iface).flat(Type::VEC4, "finalColor");
|
GPU_SHADER_INTERFACE_INFO(overlay_extra_grid_iface)
|
||||||
|
FLAT(VEC4, finalColor)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_extra_grid)
|
GPU_SHADER_CREATE_INFO(overlay_extra_grid)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.sampler(0, ImageType::DEPTH_2D, "depthBuffer")
|
SAMPLER(0, DEPTH_2D, depthBuffer)
|
||||||
.push_constant(Type::MAT4, "gridModelMatrix")
|
PUSH_CONSTANT(MAT4, gridModelMatrix)
|
||||||
.push_constant(Type::BOOL, "isTransform")
|
PUSH_CONSTANT(BOOL, isTransform)
|
||||||
.vertex_out(overlay_extra_grid_iface)
|
VERTEX_OUT(overlay_extra_grid_iface)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.vertex_source("overlay_extra_lightprobe_grid_vert.glsl")
|
VERTEX_SOURCE("overlay_extra_lightprobe_grid_vert.glsl")
|
||||||
.fragment_source("overlay_point_varying_color_frag.glsl")
|
FRAGMENT_SOURCE("overlay_point_varying_color_frag.glsl")
|
||||||
.additional_info("draw_view")
|
ADDITIONAL_INFO(draw_view)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_extra_grid_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_extra_grid_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_extra_grid")
|
ADDITIONAL_INFO(overlay_extra_grid)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
@ -76,22 +85,24 @@ GPU_SHADER_CREATE_INFO(overlay_extra_grid_clipped)
|
|||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_extra_groundline)
|
GPU_SHADER_CREATE_INFO(overlay_extra_groundline)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
/* Instance attributes. */
|
/* Instance attributes. */
|
||||||
.vertex_in(1, Type::VEC3, "inst_pos")
|
VERTEX_IN(1, VEC3, inst_pos)
|
||||||
.vertex_out(overlay_extra_iface)
|
VERTEX_OUT(overlay_extra_iface)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.fragment_out(1, Type::VEC4, "lineOutput")
|
FRAGMENT_OUT(1, VEC4, lineOutput)
|
||||||
.vertex_source("overlay_extra_groundline_vert.glsl")
|
VERTEX_SOURCE("overlay_extra_groundline_vert.glsl")
|
||||||
.fragment_source("overlay_extra_frag.glsl")
|
FRAGMENT_SOURCE("overlay_extra_frag.glsl")
|
||||||
.additional_info("draw_view")
|
ADDITIONAL_INFO(draw_view)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_extra_groundline_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_extra_groundline_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_extra_groundline")
|
ADDITIONAL_INFO(overlay_extra_groundline)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
@ -100,48 +111,55 @@ GPU_SHADER_CREATE_INFO(overlay_extra_groundline_clipped)
|
|||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_extra_wire_iface)
|
GPU_SHADER_INTERFACE_INFO(overlay_extra_wire_iface)
|
||||||
.no_perspective(Type::VEC2, "stipple_coord")
|
NO_PERSPECTIVE(VEC2, stipple_coord)
|
||||||
.flat(Type::VEC2, "stipple_start")
|
FLAT(VEC2, stipple_start)
|
||||||
.flat(Type::VEC4, "finalColor");
|
FLAT(VEC4, finalColor)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_extra_wire)
|
GPU_SHADER_CREATE_INFO(overlay_extra_wire)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_in(1, Type::VEC4, "color")
|
VERTEX_IN(1, VEC4, color)
|
||||||
/* If colorid is equal to 0 (i.e: Not specified) use color attribute and stippling. */
|
/* If colorid is equal to 0 (i.e: Not specified) use color attribute and stippling. */
|
||||||
.vertex_in(2, Type::INT, "colorid")
|
VERTEX_IN(2, INT, colorid)
|
||||||
.vertex_out(overlay_extra_wire_iface)
|
VERTEX_OUT(overlay_extra_wire_iface)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.fragment_out(1, Type::VEC4, "lineOutput")
|
FRAGMENT_OUT(1, VEC4, lineOutput)
|
||||||
.vertex_source("overlay_extra_wire_vert.glsl")
|
VERTEX_SOURCE("overlay_extra_wire_vert.glsl")
|
||||||
.fragment_source("overlay_extra_wire_frag.glsl")
|
FRAGMENT_SOURCE("overlay_extra_wire_frag.glsl")
|
||||||
.additional_info("draw_modelmat")
|
ADDITIONAL_INFO(draw_modelmat)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_extra_wire_select)
|
GPU_SHADER_CREATE_INFO(overlay_extra_wire_select)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.define("SELECT_EDGES")
|
DEFINE("SELECT_EDGES")
|
||||||
.additional_info("overlay_extra_wire");
|
ADDITIONAL_INFO(overlay_extra_wire)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_extra_wire_object)
|
GPU_SHADER_CREATE_INFO(overlay_extra_wire_object)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.define("OBJECT_WIRE")
|
DEFINE("OBJECT_WIRE")
|
||||||
.additional_info("overlay_extra_wire");
|
ADDITIONAL_INFO(overlay_extra_wire)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_extra_wire_select_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_extra_wire_select_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_extra_wire_select")
|
ADDITIONAL_INFO(overlay_extra_wire_select)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_extra_wire_object_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_extra_wire_object_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_extra_wire_object")
|
ADDITIONAL_INFO(overlay_extra_wire_object)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_extra_wire_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_extra_wire_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_extra_wire")
|
ADDITIONAL_INFO(overlay_extra_wire)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
@ -150,46 +168,53 @@ GPU_SHADER_CREATE_INFO(overlay_extra_wire_clipped)
|
|||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_extra_point_iface)
|
GPU_SHADER_INTERFACE_INFO(overlay_extra_point_iface)
|
||||||
.flat(Type::VEC4, "radii")
|
FLAT(VEC4, radii)
|
||||||
.flat(Type::VEC4, "fillColor")
|
FLAT(VEC4, fillColor)
|
||||||
.flat(Type::VEC4, "outlineColor");
|
FLAT(VEC4, outlineColor)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_extra_point)
|
GPU_SHADER_CREATE_INFO(overlay_extra_point)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
/* TODO(fclem): Move the vertex shader to Overlay engine and remove this bypass. */
|
/* TODO(fclem): Move the vertex shader to Overlay engine and remove this bypass. */
|
||||||
.define("blender_srgb_to_framebuffer_space(a)", "a")
|
DEFINE_VALUE("blender_srgb_to_framebuffer_space(a)", "a")
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.push_constant(Type::VEC4, "ucolor")
|
PUSH_CONSTANT(VEC4, ucolor)
|
||||||
.vertex_out(overlay_extra_point_iface)
|
VERTEX_OUT(overlay_extra_point_iface)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.vertex_source("overlay_extra_point_vert.glsl")
|
VERTEX_SOURCE("overlay_extra_point_vert.glsl")
|
||||||
.fragment_source("overlay_point_varying_color_varying_outline_aa_frag.glsl")
|
FRAGMENT_SOURCE("overlay_point_varying_color_varying_outline_aa_frag.glsl")
|
||||||
.additional_info("draw_modelmat")
|
ADDITIONAL_INFO(draw_modelmat)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_extra_point_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_extra_point_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_extra_point")
|
ADDITIONAL_INFO(overlay_extra_point)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_extra_loose_point_iface).smooth(Type::VEC4, "finalColor");
|
GPU_SHADER_INTERFACE_INFO(overlay_extra_loose_point_iface)
|
||||||
|
SMOOTH(VEC4, finalColor)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_extra_loose_point)
|
GPU_SHADER_CREATE_INFO(overlay_extra_loose_point)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_in(1, Type::VEC4, "vertex_color")
|
VERTEX_IN(1, VEC4, vertex_color)
|
||||||
.vertex_out(overlay_extra_loose_point_iface)
|
VERTEX_OUT(overlay_extra_loose_point_iface)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.fragment_out(1, Type::VEC4, "lineOutput")
|
FRAGMENT_OUT(1, VEC4, lineOutput)
|
||||||
.vertex_source("overlay_extra_loose_point_vert.glsl")
|
VERTEX_SOURCE("overlay_extra_loose_point_vert.glsl")
|
||||||
.fragment_source("overlay_extra_loose_point_frag.glsl")
|
FRAGMENT_SOURCE("overlay_extra_loose_point_frag.glsl")
|
||||||
.additional_info("draw_modelmat")
|
ADDITIONAL_INFO(draw_modelmat)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_extra_loose_point_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_extra_loose_point_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_extra_loose_point")
|
ADDITIONAL_INFO(overlay_extra_loose_point)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
@ -198,98 +223,109 @@ GPU_SHADER_CREATE_INFO(overlay_extra_loose_point_clipped)
|
|||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_NAMED_INTERFACE_INFO(overlay_motion_path_line_iface, interp)
|
GPU_SHADER_NAMED_INTERFACE_INFO(overlay_motion_path_line_iface, interp)
|
||||||
.smooth(Type::VEC4, "color");
|
SMOOTH(VEC4, color)
|
||||||
|
GPU_SHADER_NAMED_INTERFACE_END(interp)
|
||||||
GPU_SHADER_NAMED_INTERFACE_INFO(overlay_motion_path_line_flat_iface, interp_flat)
|
GPU_SHADER_NAMED_INTERFACE_INFO(overlay_motion_path_line_flat_iface, interp_flat)
|
||||||
.flat(Type::VEC2, "ss_pos");
|
FLAT(VEC2, ss_pos)
|
||||||
|
GPU_SHADER_NAMED_INTERFACE_END(interp_flat)
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_motion_path_line)
|
GPU_SHADER_CREATE_INFO(overlay_motion_path_line)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.push_constant(Type::IVEC4, "mpathLineSettings")
|
PUSH_CONSTANT(IVEC4, mpathLineSettings)
|
||||||
.push_constant(Type::BOOL, "selected")
|
PUSH_CONSTANT(BOOL, selected)
|
||||||
.push_constant(Type::VEC3, "customColorPre")
|
PUSH_CONSTANT(VEC3, customColorPre)
|
||||||
.push_constant(Type::VEC3, "customColorPost")
|
PUSH_CONSTANT(VEC3, customColorPost)
|
||||||
.push_constant(Type::INT, "lineThickness") /* In pixels. */
|
PUSH_CONSTANT(INT, lineThickness) /* In pixels. */
|
||||||
.push_constant(Type::MAT4, "camera_space_matrix")
|
PUSH_CONSTANT(MAT4, camera_space_matrix)
|
||||||
.vertex_out(overlay_motion_path_line_iface)
|
VERTEX_OUT(overlay_motion_path_line_iface)
|
||||||
.vertex_out(overlay_motion_path_line_flat_iface)
|
VERTEX_OUT(overlay_motion_path_line_flat_iface)
|
||||||
.geometry_out(overlay_motion_path_line_iface)
|
GEOMETRY_OUT(overlay_motion_path_line_iface)
|
||||||
.geometry_layout(PrimitiveIn::LINES, PrimitiveOut::TRIANGLE_STRIP, 4)
|
GEOMETRY_LAYOUT(PrimitiveIn::LINES, PrimitiveOut::TRIANGLE_STRIP, 4)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.vertex_source("overlay_motion_path_line_vert.glsl")
|
VERTEX_SOURCE("overlay_motion_path_line_vert.glsl")
|
||||||
.geometry_source("overlay_motion_path_line_geom.glsl")
|
GEOMETRY_SOURCE("overlay_motion_path_line_geom.glsl")
|
||||||
.fragment_source("overlay_motion_path_line_frag.glsl")
|
FRAGMENT_SOURCE("overlay_motion_path_line_frag.glsl")
|
||||||
.additional_info("draw_view")
|
ADDITIONAL_INFO(draw_view)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_motion_path_line_no_geom)
|
GPU_SHADER_CREATE_INFO(overlay_motion_path_line_no_geom)
|
||||||
.metal_backend_only(true)
|
METAL_BACKEND_ONLY()
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.push_constant(Type::IVEC4, "mpathLineSettings")
|
PUSH_CONSTANT(IVEC4, mpathLineSettings)
|
||||||
.push_constant(Type::BOOL, "selected")
|
PUSH_CONSTANT(BOOL, selected)
|
||||||
.push_constant(Type::VEC3, "customColorPre")
|
PUSH_CONSTANT(VEC3, customColorPre)
|
||||||
.push_constant(Type::VEC3, "customColorPost")
|
PUSH_CONSTANT(VEC3, customColorPost)
|
||||||
.push_constant(Type::INT, "lineThickness") /* In pixels. */
|
PUSH_CONSTANT(INT, lineThickness) /* In pixels. */
|
||||||
.vertex_out(overlay_motion_path_line_iface)
|
VERTEX_OUT(overlay_motion_path_line_iface)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.vertex_source("overlay_motion_path_line_vert_no_geom.glsl")
|
VERTEX_SOURCE("overlay_motion_path_line_vert_no_geom.glsl")
|
||||||
.fragment_source("overlay_motion_path_line_frag.glsl")
|
FRAGMENT_SOURCE("overlay_motion_path_line_frag.glsl")
|
||||||
.additional_info("draw_view")
|
ADDITIONAL_INFO(draw_view)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_motion_path_line_next)
|
GPU_SHADER_CREATE_INFO(overlay_motion_path_line_next)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.storage_buf(0, Qualifier::READ, "float", "pos[]", Frequency::GEOMETRY)
|
STORAGE_BUF_FREQ(0, READ, float, pos[], GEOMETRY)
|
||||||
.push_constant(Type::IVEC2, "gpu_attr_0")
|
PUSH_CONSTANT(IVEC2, gpu_attr_0)
|
||||||
.push_constant(Type::IVEC4, "mpathLineSettings")
|
PUSH_CONSTANT(IVEC4, mpathLineSettings)
|
||||||
.push_constant(Type::BOOL, "selected")
|
PUSH_CONSTANT(BOOL, selected)
|
||||||
.push_constant(Type::VEC3, "customColorPre")
|
PUSH_CONSTANT(VEC3, customColorPre)
|
||||||
.push_constant(Type::VEC3, "customColorPost")
|
PUSH_CONSTANT(VEC3, customColorPost)
|
||||||
.push_constant(Type::INT, "lineThickness") /* In pixels. */
|
PUSH_CONSTANT(INT, lineThickness) /* In pixels. */
|
||||||
.push_constant(Type::MAT4, "camera_space_matrix")
|
PUSH_CONSTANT(MAT4, camera_space_matrix)
|
||||||
.vertex_out(overlay_motion_path_line_iface)
|
VERTEX_OUT(overlay_motion_path_line_iface)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.vertex_source("overlay_motion_path_line_next_vert.glsl")
|
VERTEX_SOURCE("overlay_motion_path_line_next_vert.glsl")
|
||||||
.fragment_source("overlay_motion_path_line_frag.glsl")
|
FRAGMENT_SOURCE("overlay_motion_path_line_frag.glsl")
|
||||||
.additional_info("draw_view")
|
ADDITIONAL_INFO(draw_view)
|
||||||
.additional_info("gpu_index_load")
|
ADDITIONAL_INFO(gpu_index_load)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_motion_path_line_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_motion_path_line_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_motion_path_line")
|
ADDITIONAL_INFO(overlay_motion_path_line)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_motion_path_line_clipped_no_geom)
|
GPU_SHADER_CREATE_INFO(overlay_motion_path_line_clipped_no_geom)
|
||||||
.metal_backend_only(true)
|
METAL_BACKEND_ONLY()
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_motion_path_line_no_geom")
|
ADDITIONAL_INFO(overlay_motion_path_line_no_geom)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_motion_path_point_iface).flat(Type::VEC4, "finalColor");
|
GPU_SHADER_INTERFACE_INFO(overlay_motion_path_point_iface)
|
||||||
|
FLAT(VEC4, finalColor)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_motion_path_point)
|
GPU_SHADER_CREATE_INFO(overlay_motion_path_point)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.typedef_source("overlay_shader_shared.h")
|
TYPEDEF_SOURCE("overlay_shader_shared.h")
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_in(1, Type::INT, "flag")
|
VERTEX_IN(1, INT, flag)
|
||||||
.push_constant(Type::IVEC4, "mpathPointSettings")
|
PUSH_CONSTANT(IVEC4, mpathPointSettings)
|
||||||
.push_constant(Type::BOOL, "showKeyFrames")
|
PUSH_CONSTANT(BOOL, showKeyFrames)
|
||||||
.push_constant(Type::VEC3, "customColorPre")
|
PUSH_CONSTANT(VEC3, customColorPre)
|
||||||
.push_constant(Type::VEC3, "customColorPost")
|
PUSH_CONSTANT(VEC3, customColorPost)
|
||||||
.push_constant(Type::MAT4, "camera_space_matrix")
|
PUSH_CONSTANT(MAT4, camera_space_matrix)
|
||||||
.vertex_out(overlay_motion_path_point_iface)
|
VERTEX_OUT(overlay_motion_path_point_iface)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.vertex_source("overlay_motion_path_point_vert.glsl")
|
VERTEX_SOURCE("overlay_motion_path_point_vert.glsl")
|
||||||
.fragment_source("overlay_point_varying_color_frag.glsl")
|
FRAGMENT_SOURCE("overlay_point_varying_color_frag.glsl")
|
||||||
.additional_info("draw_view")
|
ADDITIONAL_INFO(draw_view)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_motion_path_point_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_motion_path_point_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_motion_path_point")
|
ADDITIONAL_INFO(overlay_motion_path_point)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
@ -297,27 +333,31 @@ GPU_SHADER_CREATE_INFO(overlay_motion_path_point_clipped)
|
|||||||
/** \name Image Empty
|
/** \name Image Empty
|
||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_image_iface).smooth(Type::VEC2, "uvs");
|
GPU_SHADER_INTERFACE_INFO(overlay_image_iface)
|
||||||
|
SMOOTH(VEC2, uvs)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_image)
|
GPU_SHADER_CREATE_INFO(overlay_image)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.push_constant(Type::BOOL, "depthSet")
|
PUSH_CONSTANT(BOOL, depthSet)
|
||||||
.push_constant(Type::BOOL, "isCameraBackground")
|
PUSH_CONSTANT(BOOL, isCameraBackground)
|
||||||
.push_constant(Type::BOOL, "imgPremultiplied")
|
PUSH_CONSTANT(BOOL, imgPremultiplied)
|
||||||
.push_constant(Type::BOOL, "imgAlphaBlend")
|
PUSH_CONSTANT(BOOL, imgAlphaBlend)
|
||||||
.push_constant(Type::VEC4, "ucolor")
|
PUSH_CONSTANT(VEC4, ucolor)
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_out(overlay_image_iface)
|
VERTEX_OUT(overlay_image_iface)
|
||||||
.sampler(0, ImageType::FLOAT_2D, "imgTexture")
|
SAMPLER(0, FLOAT_2D, imgTexture)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.vertex_source("overlay_image_vert.glsl")
|
VERTEX_SOURCE("overlay_image_vert.glsl")
|
||||||
.fragment_source("overlay_image_frag.glsl")
|
FRAGMENT_SOURCE("overlay_image_frag.glsl")
|
||||||
.additional_info("draw_mesh");
|
ADDITIONAL_INFO(draw_mesh)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_image_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_image_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_image")
|
ADDITIONAL_INFO(overlay_image)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
@ -326,24 +366,26 @@ GPU_SHADER_CREATE_INFO(overlay_image_clipped)
|
|||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_gpencil_canvas)
|
GPU_SHADER_CREATE_INFO(overlay_gpencil_canvas)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_out(overlay_extra_iface)
|
VERTEX_OUT(overlay_extra_iface)
|
||||||
.push_constant(Type::VEC4, "color")
|
PUSH_CONSTANT(VEC4, color)
|
||||||
.push_constant(Type::VEC3, "xAxis")
|
PUSH_CONSTANT(VEC3, xAxis)
|
||||||
.push_constant(Type::VEC3, "yAxis")
|
PUSH_CONSTANT(VEC3, yAxis)
|
||||||
.push_constant(Type::VEC3, "origin")
|
PUSH_CONSTANT(VEC3, origin)
|
||||||
.push_constant(Type::INT, "halfLineCount")
|
PUSH_CONSTANT(INT, halfLineCount)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.fragment_out(1, Type::VEC4, "lineOutput")
|
FRAGMENT_OUT(1, VEC4, lineOutput)
|
||||||
.vertex_source("overlay_edit_gpencil_canvas_vert.glsl")
|
VERTEX_SOURCE("overlay_edit_gpencil_canvas_vert.glsl")
|
||||||
.fragment_source("overlay_extra_frag.glsl")
|
FRAGMENT_SOURCE("overlay_extra_frag.glsl")
|
||||||
.additional_info("draw_mesh")
|
ADDITIONAL_INFO(draw_mesh)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_gpencil_canvas_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_gpencil_canvas_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_gpencil_canvas")
|
ADDITIONAL_INFO(overlay_gpencil_canvas)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
@ -351,85 +393,94 @@ GPU_SHADER_CREATE_INFO(overlay_gpencil_canvas_clipped)
|
|||||||
/** \name Particle
|
/** \name Particle
|
||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_particle_iface).flat(Type::VEC4, "finalColor");
|
GPU_SHADER_INTERFACE_INFO(overlay_particle_iface)
|
||||||
|
FLAT(VEC4, finalColor)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_particle)
|
GPU_SHADER_CREATE_INFO(overlay_particle)
|
||||||
.sampler(0, ImageType::FLOAT_1D, "weightTex")
|
SAMPLER(0, FLOAT_1D, weightTex)
|
||||||
.push_constant(Type::VEC4, "ucolor") /* Draw-size packed in alpha. */
|
PUSH_CONSTANT(VEC4, ucolor) /* Draw-size packed in alpha. */
|
||||||
.vertex_in(0, Type::VEC3, "part_pos")
|
VERTEX_IN(0, VEC3, part_pos)
|
||||||
.vertex_in(1, Type::VEC4, "part_rot")
|
VERTEX_IN(1, VEC4, part_rot)
|
||||||
.vertex_in(2, Type::FLOAT, "part_val")
|
VERTEX_IN(2, FLOAT, part_val)
|
||||||
.vertex_out(overlay_particle_iface)
|
VERTEX_OUT(overlay_particle_iface)
|
||||||
.vertex_source("overlay_particle_vert.glsl")
|
VERTEX_SOURCE("overlay_particle_vert.glsl")
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_particle_dot)
|
GPU_SHADER_CREATE_INFO(overlay_particle_dot)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.define("USE_DOTS")
|
DEFINE("USE_DOTS")
|
||||||
.define("vclass", "0")
|
DEFINE_VALUE("vclass", "0")
|
||||||
.define("pos", "vec3(0.0)")
|
DEFINE_VALUE("pos", "vec3(0.0)")
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.fragment_out(1, Type::VEC4, "lineOutput")
|
FRAGMENT_OUT(1, VEC4, lineOutput)
|
||||||
.fragment_source("overlay_particle_frag.glsl")
|
FRAGMENT_SOURCE("overlay_particle_frag.glsl")
|
||||||
.additional_info("overlay_particle")
|
ADDITIONAL_INFO(overlay_particle)
|
||||||
.additional_info("draw_mesh");
|
ADDITIONAL_INFO(draw_mesh)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_particle_dot_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_particle_dot_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_particle_dot")
|
ADDITIONAL_INFO(overlay_particle_dot)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_particle_shape)
|
GPU_SHADER_CREATE_INFO(overlay_particle_shape)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
/* Instantiated Attrs. */
|
/* Instantiated Attrs. */
|
||||||
.vertex_in(3, Type::VEC3, "pos")
|
VERTEX_IN(3, VEC3, pos)
|
||||||
.vertex_in(4, Type::INT, "vclass")
|
VERTEX_IN(4, INT, vclass)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.fragment_source("overlay_varying_color.glsl")
|
FRAGMENT_SOURCE("overlay_varying_color.glsl")
|
||||||
.additional_info("overlay_particle")
|
ADDITIONAL_INFO(overlay_particle)
|
||||||
.additional_info("draw_modelmat")
|
ADDITIONAL_INFO(draw_modelmat)
|
||||||
.additional_info("draw_resource_id_uniform");
|
ADDITIONAL_INFO(draw_resource_id_uniform)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_particle_shape_next)
|
GPU_SHADER_CREATE_INFO(overlay_particle_shape_next)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.typedef_source("overlay_shader_shared.h")
|
TYPEDEF_SOURCE("overlay_shader_shared.h")
|
||||||
.sampler(0, ImageType::FLOAT_1D, "weightTex")
|
SAMPLER(0, FLOAT_1D, weightTex)
|
||||||
.push_constant(Type::VEC4, "ucolor") /* Draw-size packed in alpha. */
|
PUSH_CONSTANT(VEC4, ucolor) /* Draw-size packed in alpha. */
|
||||||
.push_constant(Type::INT, "shape_type")
|
PUSH_CONSTANT(INT, shape_type)
|
||||||
/* Use first attribute to only bind one buffer. */
|
/* Use first attribute to only bind one buffer. */
|
||||||
.storage_buf(0, Qualifier::READ, "ParticlePointData", "part_pos[]", Frequency::GEOMETRY)
|
STORAGE_BUF_FREQ(0, READ, ParticlePointData, part_pos[], GEOMETRY)
|
||||||
.vertex_out(overlay_extra_iface)
|
VERTEX_OUT(overlay_extra_iface)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.fragment_out(1, Type::VEC4, "lineOutput")
|
FRAGMENT_OUT(1, VEC4, lineOutput)
|
||||||
.vertex_source("overlay_particle_shape_vert.glsl")
|
VERTEX_SOURCE("overlay_particle_shape_vert.glsl")
|
||||||
.fragment_source("overlay_particle_shape_frag.glsl")
|
FRAGMENT_SOURCE("overlay_particle_shape_frag.glsl")
|
||||||
.additional_info("draw_view")
|
ADDITIONAL_INFO(draw_view)
|
||||||
.additional_info("draw_modelmat_new")
|
ADDITIONAL_INFO(draw_modelmat_new)
|
||||||
.additional_info("draw_resource_handle_new")
|
ADDITIONAL_INFO(draw_resource_handle_new)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_particle_hair_next)
|
GPU_SHADER_CREATE_INFO(overlay_particle_hair_next)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.typedef_source("overlay_shader_shared.h")
|
TYPEDEF_SOURCE("overlay_shader_shared.h")
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_in(1, Type::VEC3, "nor")
|
VERTEX_IN(1, VEC3, nor)
|
||||||
.push_constant(Type::INT, "colorType")
|
PUSH_CONSTANT(INT, colorType)
|
||||||
.push_constant(Type::BOOL, "isTransform")
|
PUSH_CONSTANT(BOOL, isTransform)
|
||||||
.push_constant(Type::BOOL, "useColoring")
|
PUSH_CONSTANT(BOOL, useColoring)
|
||||||
.vertex_out(overlay_extra_iface)
|
VERTEX_OUT(overlay_extra_iface)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.fragment_out(1, Type::VEC4, "lineOutput")
|
FRAGMENT_OUT(1, VEC4, lineOutput)
|
||||||
.vertex_source("overlay_particle_hair_vert.glsl")
|
VERTEX_SOURCE("overlay_particle_hair_vert.glsl")
|
||||||
.fragment_source("overlay_particle_shape_frag.glsl")
|
FRAGMENT_SOURCE("overlay_particle_shape_frag.glsl")
|
||||||
.additional_info("draw_view")
|
ADDITIONAL_INFO(draw_view)
|
||||||
.additional_info("draw_modelmat_new")
|
ADDITIONAL_INFO(draw_modelmat_new)
|
||||||
.additional_info("draw_object_infos_new")
|
ADDITIONAL_INFO(draw_object_infos_new)
|
||||||
.additional_info("draw_resource_handle_new")
|
ADDITIONAL_INFO(draw_resource_handle_new)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_particle_shape_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_particle_shape_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_particle_shape")
|
ADDITIONAL_INFO(overlay_particle_shape)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
@ -5,15 +5,17 @@
|
|||||||
#include "gpu_shader_create_info.hh"
|
#include "gpu_shader_create_info.hh"
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_facing)
|
GPU_SHADER_CREATE_INFO(overlay_facing)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_source("overlay_facing_vert.glsl")
|
VERTEX_SOURCE("overlay_facing_vert.glsl")
|
||||||
.fragment_source("overlay_facing_frag.glsl")
|
FRAGMENT_SOURCE("overlay_facing_frag.glsl")
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.additional_info("draw_mesh")
|
ADDITIONAL_INFO(draw_mesh)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_facing_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_facing_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_facing")
|
ADDITIONAL_INFO(overlay_facing)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
@ -5,38 +5,43 @@
|
|||||||
#include "gpu_shader_create_info.hh"
|
#include "gpu_shader_create_info.hh"
|
||||||
|
|
||||||
/* We use the normalized local position to avoid precision loss during interpolation. */
|
/* We use the normalized local position to avoid precision loss during interpolation. */
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_grid_iface).smooth(Type::VEC3, "local_pos");
|
GPU_SHADER_INTERFACE_INFO(overlay_grid_iface)
|
||||||
|
SMOOTH(VEC3, local_pos)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_grid)
|
GPU_SHADER_CREATE_INFO(overlay_grid)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.typedef_source("overlay_shader_shared.h")
|
TYPEDEF_SOURCE("overlay_shader_shared.h")
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_out(overlay_grid_iface)
|
VERTEX_OUT(overlay_grid_iface)
|
||||||
.fragment_out(0, Type::VEC4, "out_color")
|
FRAGMENT_OUT(0, VEC4, out_color)
|
||||||
.sampler(0, ImageType::DEPTH_2D, "depth_tx")
|
SAMPLER(0, DEPTH_2D, depth_tx)
|
||||||
.uniform_buf(3, "OVERLAY_GridData", "grid_buf")
|
UNIFORM_BUF(3, OVERLAY_GridData, grid_buf)
|
||||||
.push_constant(Type::VEC3, "plane_axes")
|
PUSH_CONSTANT(VEC3, plane_axes)
|
||||||
.push_constant(Type::INT, "grid_flag")
|
PUSH_CONSTANT(INT, grid_flag)
|
||||||
.vertex_source("overlay_grid_vert.glsl")
|
VERTEX_SOURCE("overlay_grid_vert.glsl")
|
||||||
.fragment_source("overlay_grid_frag.glsl")
|
FRAGMENT_SOURCE("overlay_grid_frag.glsl")
|
||||||
.additional_info("draw_view")
|
ADDITIONAL_INFO(draw_view)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_grid_background)
|
GPU_SHADER_CREATE_INFO(overlay_grid_background)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.sampler(0, ImageType::DEPTH_2D, "depthBuffer")
|
SAMPLER(0, DEPTH_2D, depthBuffer)
|
||||||
.push_constant(Type::VEC4, "ucolor")
|
PUSH_CONSTANT(VEC4, ucolor)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.vertex_source("overlay_edit_uv_tiled_image_borders_vert.glsl")
|
VERTEX_SOURCE("overlay_edit_uv_tiled_image_borders_vert.glsl")
|
||||||
.fragment_source("overlay_grid_background_frag.glsl")
|
FRAGMENT_SOURCE("overlay_grid_background_frag.glsl")
|
||||||
.additional_info("draw_modelmat");
|
ADDITIONAL_INFO(draw_modelmat)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_grid_image)
|
GPU_SHADER_CREATE_INFO(overlay_grid_image)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.push_constant(Type::VEC4, "ucolor")
|
PUSH_CONSTANT(VEC4, ucolor)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.vertex_source("overlay_edit_uv_tiled_image_borders_vert.glsl")
|
VERTEX_SOURCE("overlay_edit_uv_tiled_image_borders_vert.glsl")
|
||||||
.fragment_source("overlay_uniform_color_frag.glsl")
|
FRAGMENT_SOURCE("overlay_uniform_color_frag.glsl")
|
||||||
.additional_info("draw_modelmat");
|
ADDITIONAL_INFO(draw_modelmat)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
@ -8,128 +8,147 @@
|
|||||||
/** \name Outline Pre-pass
|
/** \name Outline Pre-pass
|
||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_NAMED_INTERFACE_INFO(overlay_outline_prepass_iface, interp).flat(Type::UINT, "ob_id");
|
GPU_SHADER_NAMED_INTERFACE_INFO(overlay_outline_prepass_iface, interp)
|
||||||
|
FLAT(UINT, ob_id)
|
||||||
|
GPU_SHADER_NAMED_INTERFACE_END(interp)
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_outline_prepass)
|
GPU_SHADER_CREATE_INFO(overlay_outline_prepass)
|
||||||
.push_constant(Type::BOOL, "isTransform")
|
PUSH_CONSTANT(BOOL, isTransform)
|
||||||
.vertex_out(overlay_outline_prepass_iface)
|
VERTEX_OUT(overlay_outline_prepass_iface)
|
||||||
/* Using uint because 16bit uint can contain more ids than int. */
|
/* Using uint because 16bit uint can contain more ids than int. */
|
||||||
.fragment_out(0, Type::UINT, "out_object_id")
|
FRAGMENT_OUT(0, UINT, out_object_id)
|
||||||
.fragment_source("overlay_outline_prepass_frag.glsl")
|
FRAGMENT_SOURCE("overlay_outline_prepass_frag.glsl")
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_mesh)
|
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_mesh)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_source("overlay_outline_prepass_vert.glsl")
|
VERTEX_SOURCE("overlay_outline_prepass_vert.glsl")
|
||||||
.additional_info("draw_mesh")
|
ADDITIONAL_INFO(draw_mesh)
|
||||||
.additional_info("draw_resource_handle")
|
ADDITIONAL_INFO(draw_resource_handle)
|
||||||
.additional_info("overlay_outline_prepass")
|
ADDITIONAL_INFO(overlay_outline_prepass)
|
||||||
.additional_info("draw_object_infos");
|
ADDITIONAL_INFO(draw_object_infos)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_mesh_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_mesh_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_outline_prepass_mesh")
|
ADDITIONAL_INFO(overlay_outline_prepass_mesh)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_NAMED_INTERFACE_INFO(overlay_outline_prepass_wire_iface, vert).flat(Type::VEC3, "pos");
|
GPU_SHADER_NAMED_INTERFACE_INFO(overlay_outline_prepass_wire_iface, vert)
|
||||||
|
FLAT(VEC3, pos)
|
||||||
|
GPU_SHADER_NAMED_INTERFACE_END(vert)
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_curves)
|
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_curves)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_source("overlay_outline_prepass_curves_vert.glsl")
|
VERTEX_SOURCE("overlay_outline_prepass_curves_vert.glsl")
|
||||||
.additional_info("draw_hair")
|
ADDITIONAL_INFO(draw_hair)
|
||||||
.additional_info("draw_resource_handle")
|
ADDITIONAL_INFO(draw_resource_handle)
|
||||||
.additional_info("overlay_outline_prepass")
|
ADDITIONAL_INFO(overlay_outline_prepass)
|
||||||
.additional_info("draw_object_infos");
|
ADDITIONAL_INFO(draw_object_infos)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_curves_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_curves_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_outline_prepass_curves")
|
ADDITIONAL_INFO(overlay_outline_prepass_curves)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_wire)
|
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_wire)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_outline_prepass")
|
ADDITIONAL_INFO(overlay_outline_prepass)
|
||||||
.additional_info("draw_object_infos")
|
ADDITIONAL_INFO(draw_object_infos)
|
||||||
.additional_info("draw_mesh")
|
ADDITIONAL_INFO(draw_mesh)
|
||||||
.additional_info("draw_resource_handle")
|
ADDITIONAL_INFO(draw_resource_handle)
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.define("USE_GEOM")
|
DEFINE("USE_GEOM")
|
||||||
.vertex_out(overlay_outline_prepass_wire_iface)
|
VERTEX_OUT(overlay_outline_prepass_wire_iface)
|
||||||
.geometry_layout(PrimitiveIn::LINES_ADJACENCY, PrimitiveOut::LINE_STRIP, 2)
|
GEOMETRY_LAYOUT(PrimitiveIn::LINES_ADJACENCY, PrimitiveOut::LINE_STRIP, 2)
|
||||||
.geometry_out(overlay_outline_prepass_iface)
|
GEOMETRY_OUT(overlay_outline_prepass_iface)
|
||||||
.vertex_source("overlay_outline_prepass_vert.glsl")
|
VERTEX_SOURCE("overlay_outline_prepass_vert.glsl")
|
||||||
.geometry_source("overlay_outline_prepass_geom.glsl");
|
GEOMETRY_SOURCE("overlay_outline_prepass_geom.glsl")
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_wire_next)
|
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_wire_next)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_outline_prepass")
|
ADDITIONAL_INFO(overlay_outline_prepass)
|
||||||
.additional_info("draw_view")
|
ADDITIONAL_INFO(draw_view)
|
||||||
.additional_info("draw_mesh_new")
|
ADDITIONAL_INFO(draw_mesh_new)
|
||||||
.additional_info("draw_object_infos_new")
|
ADDITIONAL_INFO(draw_object_infos_new)
|
||||||
.additional_info("draw_resource_handle_new")
|
ADDITIONAL_INFO(draw_resource_handle_new)
|
||||||
.additional_info("gpu_index_load")
|
ADDITIONAL_INFO(gpu_index_load)
|
||||||
.storage_buf(0, Qualifier::READ, "float", "pos[]", Frequency::GEOMETRY)
|
STORAGE_BUF_FREQ(0, READ, float, pos[], GEOMETRY)
|
||||||
.push_constant(Type::IVEC2, "gpu_attr_0")
|
PUSH_CONSTANT(IVEC2, gpu_attr_0)
|
||||||
.vertex_source("overlay_outline_prepass_wire_vert.glsl");
|
VERTEX_SOURCE("overlay_outline_prepass_wire_vert.glsl")
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_wire_no_geom)
|
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_wire_no_geom)
|
||||||
.metal_backend_only(true)
|
METAL_BACKEND_ONLY()
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.additional_info("overlay_outline_prepass")
|
ADDITIONAL_INFO(overlay_outline_prepass)
|
||||||
.additional_info("draw_object_infos")
|
ADDITIONAL_INFO(draw_object_infos)
|
||||||
.additional_info("draw_mesh")
|
ADDITIONAL_INFO(draw_mesh)
|
||||||
.additional_info("draw_resource_handle")
|
ADDITIONAL_INFO(draw_resource_handle)
|
||||||
.vertex_source("overlay_outline_prepass_vert_no_geom.glsl");
|
VERTEX_SOURCE("overlay_outline_prepass_vert_no_geom.glsl")
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_wire_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_wire_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_outline_prepass_wire")
|
ADDITIONAL_INFO(overlay_outline_prepass_wire)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_NAMED_INTERFACE_INFO(overlay_outline_prepass_gpencil_flat_iface, gp_interp_flat)
|
GPU_SHADER_NAMED_INTERFACE_INFO(overlay_outline_prepass_gpencil_flat_iface, gp_interp_flat)
|
||||||
.flat(Type::VEC2, "aspect")
|
FLAT(VEC2, aspect)
|
||||||
.flat(Type::VEC4, "sspos");
|
FLAT(VEC4, sspos)
|
||||||
|
GPU_SHADER_NAMED_INTERFACE_END(gp_interp_flat)
|
||||||
GPU_SHADER_NAMED_INTERFACE_INFO(overlay_outline_prepass_gpencil_noperspective_iface,
|
GPU_SHADER_NAMED_INTERFACE_INFO(overlay_outline_prepass_gpencil_noperspective_iface,
|
||||||
gp_interp_noperspective)
|
gp_interp_noperspective)
|
||||||
.no_perspective(Type::VEC2, "thickness")
|
NO_PERSPECTIVE(VEC2, thickness)
|
||||||
.no_perspective(Type::FLOAT, "hardness");
|
NO_PERSPECTIVE(FLOAT, hardness)
|
||||||
|
GPU_SHADER_NAMED_INTERFACE_END(gp_interp_noperspective)
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_gpencil)
|
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_gpencil)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.push_constant(Type::BOOL, "isTransform")
|
PUSH_CONSTANT(BOOL, isTransform)
|
||||||
.vertex_out(overlay_outline_prepass_iface)
|
VERTEX_OUT(overlay_outline_prepass_iface)
|
||||||
.vertex_out(overlay_outline_prepass_gpencil_flat_iface)
|
VERTEX_OUT(overlay_outline_prepass_gpencil_flat_iface)
|
||||||
.vertex_out(overlay_outline_prepass_gpencil_noperspective_iface)
|
VERTEX_OUT(overlay_outline_prepass_gpencil_noperspective_iface)
|
||||||
.vertex_source("overlay_outline_prepass_gpencil_vert.glsl")
|
VERTEX_SOURCE("overlay_outline_prepass_gpencil_vert.glsl")
|
||||||
.push_constant(Type::BOOL, "gpStrokeOrder3d") /* TODO(fclem): Move to a GPencil object UBO. */
|
PUSH_CONSTANT(BOOL, gpStrokeOrder3d) /* TODO(fclem): Move to a GPencil object UBO. */
|
||||||
.push_constant(Type::VEC4, "gpDepthPlane") /* TODO(fclem): Move to a GPencil object UBO. */
|
PUSH_CONSTANT(VEC4, gpDepthPlane) /* TODO(fclem): Move to a GPencil object UBO. */
|
||||||
/* Using uint because 16bit uint can contain more ids than int. */
|
/* Using uint because 16bit uint can contain more ids than int. */
|
||||||
.fragment_out(0, Type::UINT, "out_object_id")
|
FRAGMENT_OUT(0, UINT, out_object_id)
|
||||||
.fragment_source("overlay_outline_prepass_gpencil_frag.glsl")
|
FRAGMENT_SOURCE("overlay_outline_prepass_gpencil_frag.glsl")
|
||||||
.depth_write(DepthWrite::ANY)
|
DEPTH_WRITE(DepthWrite::ANY)
|
||||||
.additional_info("draw_gpencil")
|
ADDITIONAL_INFO(draw_gpencil)
|
||||||
.additional_info("draw_resource_handle")
|
ADDITIONAL_INFO(draw_resource_handle)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_gpencil_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_gpencil_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_outline_prepass_gpencil")
|
ADDITIONAL_INFO(overlay_outline_prepass_gpencil)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_pointcloud)
|
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_pointcloud)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_source("overlay_outline_prepass_pointcloud_vert.glsl")
|
VERTEX_SOURCE("overlay_outline_prepass_pointcloud_vert.glsl")
|
||||||
.additional_info("draw_pointcloud")
|
ADDITIONAL_INFO(draw_pointcloud)
|
||||||
.additional_info("draw_resource_handle")
|
ADDITIONAL_INFO(draw_resource_handle)
|
||||||
.additional_info("overlay_outline_prepass")
|
ADDITIONAL_INFO(overlay_outline_prepass)
|
||||||
.additional_info("draw_object_infos");
|
ADDITIONAL_INFO(draw_object_infos)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_pointcloud_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_pointcloud_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_outline_prepass_pointcloud")
|
ADDITIONAL_INFO(overlay_outline_prepass_pointcloud)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
@ -138,19 +157,20 @@ GPU_SHADER_CREATE_INFO(overlay_outline_prepass_pointcloud_clipped)
|
|||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_outline_detect)
|
GPU_SHADER_CREATE_INFO(overlay_outline_detect)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.push_constant(Type::FLOAT, "alphaOcclu")
|
PUSH_CONSTANT(FLOAT, alphaOcclu)
|
||||||
.push_constant(Type::BOOL, "isXrayWires")
|
PUSH_CONSTANT(BOOL, isXrayWires)
|
||||||
.push_constant(Type::BOOL, "doAntiAliasing")
|
PUSH_CONSTANT(BOOL, doAntiAliasing)
|
||||||
.push_constant(Type::BOOL, "doThickOutlines")
|
PUSH_CONSTANT(BOOL, doThickOutlines)
|
||||||
.sampler(0, ImageType::UINT_2D, "outlineId")
|
SAMPLER(0, UINT_2D, outlineId)
|
||||||
.sampler(1, ImageType::DEPTH_2D, "outlineDepth")
|
SAMPLER(1, DEPTH_2D, outlineDepth)
|
||||||
.sampler(2, ImageType::DEPTH_2D, "sceneDepth")
|
SAMPLER(2, DEPTH_2D, sceneDepth)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.fragment_out(1, Type::VEC4, "lineOutput")
|
FRAGMENT_OUT(1, VEC4, lineOutput)
|
||||||
.fragment_source("overlay_outline_detect_frag.glsl")
|
FRAGMENT_SOURCE("overlay_outline_detect_frag.glsl")
|
||||||
.additional_info("draw_fullscreen")
|
ADDITIONAL_INFO(draw_fullscreen)
|
||||||
.additional_info("draw_view")
|
ADDITIONAL_INFO(draw_view)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
@ -11,19 +11,21 @@
|
|||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_paint_face)
|
GPU_SHADER_CREATE_INFO(overlay_paint_face)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_in(1, Type::VEC4, "nor") /* Select flag on the 4th component. */
|
VERTEX_IN(1, VEC4, nor) /* Select flag on the 4th component. */
|
||||||
.push_constant(Type::VEC4, "ucolor")
|
PUSH_CONSTANT(VEC4, ucolor)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.vertex_source("overlay_paint_face_vert.glsl")
|
VERTEX_SOURCE("overlay_paint_face_vert.glsl")
|
||||||
.fragment_source("overlay_uniform_color_frag.glsl")
|
FRAGMENT_SOURCE("overlay_uniform_color_frag.glsl")
|
||||||
.additional_info("draw_modelmat");
|
ADDITIONAL_INFO(draw_modelmat)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_paint_face_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_paint_face_clipped)
|
||||||
.additional_info("overlay_paint_face")
|
ADDITIONAL_INFO(overlay_paint_face)
|
||||||
.additional_info("drw_clipped")
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
.do_static_compilation(true);
|
DO_STATIC_COMPILATION()
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
@ -33,23 +35,27 @@ GPU_SHADER_CREATE_INFO(overlay_paint_face_clipped)
|
|||||||
* Used for vertex selection mode in Weight and Vertex Paint.
|
* Used for vertex selection mode in Weight and Vertex Paint.
|
||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_overlay_paint_point_iface).smooth(Type::VEC4, "finalColor");
|
GPU_SHADER_INTERFACE_INFO(overlay_overlay_paint_point_iface)
|
||||||
|
SMOOTH(VEC4, finalColor)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_paint_point)
|
GPU_SHADER_CREATE_INFO(overlay_paint_point)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_in(1, Type::VEC4, "nor") /* Select flag on the 4th component. */
|
VERTEX_IN(1, VEC4, nor) /* Select flag on the 4th component. */
|
||||||
.vertex_out(overlay_overlay_paint_point_iface)
|
VERTEX_OUT(overlay_overlay_paint_point_iface)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.vertex_source("overlay_paint_point_vert.glsl")
|
VERTEX_SOURCE("overlay_paint_point_vert.glsl")
|
||||||
.fragment_source("overlay_point_varying_color_frag.glsl")
|
FRAGMENT_SOURCE("overlay_point_varying_color_frag.glsl")
|
||||||
.additional_info("draw_modelmat")
|
ADDITIONAL_INFO(draw_modelmat)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_paint_point_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_paint_point_clipped)
|
||||||
.additional_info("overlay_paint_point")
|
ADDITIONAL_INFO(overlay_paint_point)
|
||||||
.additional_info("drw_clipped")
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
.do_static_compilation(true);
|
DO_STATIC_COMPILATION()
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
@ -59,27 +65,31 @@ GPU_SHADER_CREATE_INFO(overlay_paint_point_clipped)
|
|||||||
* Used in Texture Paint mode for the Stencil Image Masking.
|
* Used in Texture Paint mode for the Stencil Image Masking.
|
||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_paint_texture_iface).smooth(Type::VEC2, "uv_interp");
|
GPU_SHADER_INTERFACE_INFO(overlay_paint_texture_iface)
|
||||||
|
SMOOTH(VEC2, uv_interp)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_paint_texture)
|
GPU_SHADER_CREATE_INFO(overlay_paint_texture)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_in(1, Type::VEC2, "mu") /* Masking uv map. */
|
VERTEX_IN(1, VEC2, mu) /* Masking uv map. */
|
||||||
.vertex_out(overlay_paint_texture_iface)
|
VERTEX_OUT(overlay_paint_texture_iface)
|
||||||
.sampler(0, ImageType::FLOAT_2D, "maskImage")
|
SAMPLER(0, FLOAT_2D, maskImage)
|
||||||
.push_constant(Type::VEC3, "maskColor")
|
PUSH_CONSTANT(VEC3, maskColor)
|
||||||
.push_constant(Type::FLOAT, "opacity") /* `1.0` by default. */
|
PUSH_CONSTANT(FLOAT, opacity) /* `1.0` by default. */
|
||||||
.push_constant(Type::BOOL, "maskInvertStencil")
|
PUSH_CONSTANT(BOOL, maskInvertStencil)
|
||||||
.push_constant(Type::BOOL, "maskImagePremultiplied")
|
PUSH_CONSTANT(BOOL, maskImagePremultiplied)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.vertex_source("overlay_paint_texture_vert.glsl")
|
VERTEX_SOURCE("overlay_paint_texture_vert.glsl")
|
||||||
.fragment_source("overlay_paint_texture_frag.glsl")
|
FRAGMENT_SOURCE("overlay_paint_texture_frag.glsl")
|
||||||
.additional_info("draw_modelmat");
|
ADDITIONAL_INFO(draw_modelmat)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_paint_texture_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_paint_texture_clipped)
|
||||||
.additional_info("overlay_paint_texture")
|
ADDITIONAL_INFO(overlay_paint_texture)
|
||||||
.additional_info("drw_clipped")
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
.do_static_compilation(true);
|
DO_STATIC_COMPILATION()
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
@ -89,24 +99,28 @@ GPU_SHADER_CREATE_INFO(overlay_paint_texture_clipped)
|
|||||||
* It should be used to draw a Vertex Paint overlay. But it is currently unreachable.
|
* It should be used to draw a Vertex Paint overlay. But it is currently unreachable.
|
||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_paint_vertcol_iface).smooth(Type::VEC3, "finalColor");
|
GPU_SHADER_INTERFACE_INFO(overlay_paint_vertcol_iface)
|
||||||
|
SMOOTH(VEC3, finalColor)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_paint_vertcol)
|
GPU_SHADER_CREATE_INFO(overlay_paint_vertcol)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_in(1, Type::VEC3, "ac") /* Active color. */
|
VERTEX_IN(1, VEC3, ac) /* Active color. */
|
||||||
.vertex_out(overlay_paint_vertcol_iface)
|
VERTEX_OUT(overlay_paint_vertcol_iface)
|
||||||
.push_constant(Type::FLOAT, "opacity") /* `1.0` by default. */
|
PUSH_CONSTANT(FLOAT, opacity) /* `1.0` by default. */
|
||||||
.push_constant(Type::BOOL, "useAlphaBlend") /* `false` by default. */
|
PUSH_CONSTANT(BOOL, useAlphaBlend) /* `false` by default. */
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.vertex_source("overlay_paint_vertcol_vert.glsl")
|
VERTEX_SOURCE("overlay_paint_vertcol_vert.glsl")
|
||||||
.fragment_source("overlay_paint_vertcol_frag.glsl")
|
FRAGMENT_SOURCE("overlay_paint_vertcol_frag.glsl")
|
||||||
.additional_info("draw_modelmat");
|
ADDITIONAL_INFO(draw_modelmat)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_paint_vertcol_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_paint_vertcol_clipped)
|
||||||
.additional_info("overlay_paint_vertcol")
|
ADDITIONAL_INFO(overlay_paint_vertcol)
|
||||||
.additional_info("drw_clipped")
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
.do_static_compilation(true);
|
DO_STATIC_COMPILATION()
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
@ -118,39 +132,44 @@ GPU_SHADER_CREATE_INFO(overlay_paint_vertcol_clipped)
|
|||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_paint_weight_iface)
|
GPU_SHADER_INTERFACE_INFO(overlay_paint_weight_iface)
|
||||||
.smooth(Type::VEC2, "weight_interp") /* (weight, alert) */
|
SMOOTH(VEC2, weight_interp) /* (weight, alert) */
|
||||||
.smooth(Type::FLOAT, "color_fac");
|
SMOOTH(FLOAT, color_fac)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_paint_weight)
|
GPU_SHADER_CREATE_INFO(overlay_paint_weight)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_in(0, Type::FLOAT, "weight")
|
VERTEX_IN(0, FLOAT, weight)
|
||||||
.vertex_in(1, Type::VEC3, "pos")
|
VERTEX_IN(1, VEC3, pos)
|
||||||
.vertex_in(2, Type::VEC3, "nor")
|
VERTEX_IN(2, VEC3, nor)
|
||||||
.vertex_out(overlay_paint_weight_iface)
|
VERTEX_OUT(overlay_paint_weight_iface)
|
||||||
.sampler(0, ImageType::FLOAT_1D, "colorramp")
|
SAMPLER(0, FLOAT_1D, colorramp)
|
||||||
.push_constant(Type::FLOAT, "opacity") /* `1.0` by default. */
|
PUSH_CONSTANT(FLOAT, opacity) /* `1.0` by default. */
|
||||||
.push_constant(Type::BOOL, "drawContours") /* `false` by default. */
|
PUSH_CONSTANT(BOOL, drawContours) /* `false` by default. */
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.vertex_source("overlay_paint_weight_vert.glsl")
|
VERTEX_SOURCE("overlay_paint_weight_vert.glsl")
|
||||||
.fragment_source("overlay_paint_weight_frag.glsl")
|
FRAGMENT_SOURCE("overlay_paint_weight_frag.glsl")
|
||||||
.additional_info("draw_modelmat")
|
ADDITIONAL_INFO(draw_modelmat)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_paint_weight_fake_shading)
|
GPU_SHADER_CREATE_INFO(overlay_paint_weight_fake_shading)
|
||||||
.additional_info("overlay_paint_weight")
|
ADDITIONAL_INFO(overlay_paint_weight)
|
||||||
.define("FAKE_SHADING")
|
DEFINE("FAKE_SHADING")
|
||||||
.push_constant(Type::VEC3, "light_dir")
|
PUSH_CONSTANT(VEC3, light_dir)
|
||||||
.do_static_compilation(true);
|
DO_STATIC_COMPILATION()
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_paint_weight_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_paint_weight_clipped)
|
||||||
.additional_info("overlay_paint_weight")
|
ADDITIONAL_INFO(overlay_paint_weight)
|
||||||
.additional_info("drw_clipped")
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
.do_static_compilation(true);
|
DO_STATIC_COMPILATION()
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_paint_weight_fake_shading_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_paint_weight_fake_shading_clipped)
|
||||||
.additional_info("overlay_paint_weight_fake_shading")
|
ADDITIONAL_INFO(overlay_paint_weight_fake_shading)
|
||||||
.additional_info("drw_clipped")
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
.do_static_compilation(true);
|
DO_STATIC_COMPILATION()
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
@ -161,23 +180,27 @@ GPU_SHADER_CREATE_INFO(overlay_paint_weight_fake_shading_clipped)
|
|||||||
* paint modes.
|
* paint modes.
|
||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_paint_wire_iface).flat(Type::VEC4, "finalColor");
|
GPU_SHADER_INTERFACE_INFO(overlay_paint_wire_iface)
|
||||||
|
FLAT(VEC4, finalColor)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_paint_wire)
|
GPU_SHADER_CREATE_INFO(overlay_paint_wire)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_in(1, Type::VEC4, "nor") /* flag stored in w */
|
VERTEX_IN(1, VEC4, nor) /* flag stored in w */
|
||||||
.vertex_out(overlay_paint_wire_iface)
|
VERTEX_OUT(overlay_paint_wire_iface)
|
||||||
.push_constant(Type::BOOL, "useSelect")
|
PUSH_CONSTANT(BOOL, useSelect)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.vertex_source("overlay_paint_wire_vert.glsl")
|
VERTEX_SOURCE("overlay_paint_wire_vert.glsl")
|
||||||
.fragment_source("overlay_varying_color.glsl")
|
FRAGMENT_SOURCE("overlay_varying_color.glsl")
|
||||||
.additional_info("draw_modelmat")
|
ADDITIONAL_INFO(draw_modelmat)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_paint_wire_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_paint_wire_clipped)
|
||||||
.additional_info("overlay_paint_vertcol")
|
ADDITIONAL_INFO(overlay_paint_vertcol)
|
||||||
.additional_info("drw_clipped")
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
.do_static_compilation(true);
|
DO_STATIC_COMPILATION()
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
@ -5,45 +5,51 @@
|
|||||||
#include "gpu_shader_create_info.hh"
|
#include "gpu_shader_create_info.hh"
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_sculpt_curves_selection_iface)
|
GPU_SHADER_INTERFACE_INFO(overlay_sculpt_curves_selection_iface)
|
||||||
.smooth(Type::FLOAT, "mask_weight");
|
SMOOTH(FLOAT, mask_weight)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_sculpt_curves_selection)
|
GPU_SHADER_CREATE_INFO(overlay_sculpt_curves_selection)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.push_constant(Type::BOOL, "is_point_domain")
|
PUSH_CONSTANT(BOOL, is_point_domain)
|
||||||
.push_constant(Type::FLOAT, "selection_opacity")
|
PUSH_CONSTANT(FLOAT, selection_opacity)
|
||||||
.sampler(1, ImageType::FLOAT_BUFFER, "selection_tx")
|
SAMPLER(1, FLOAT_BUFFER, selection_tx)
|
||||||
.vertex_out(overlay_sculpt_curves_selection_iface)
|
VERTEX_OUT(overlay_sculpt_curves_selection_iface)
|
||||||
.vertex_source("overlay_sculpt_curves_selection_vert.glsl")
|
VERTEX_SOURCE("overlay_sculpt_curves_selection_vert.glsl")
|
||||||
.fragment_source("overlay_sculpt_curves_selection_frag.glsl")
|
FRAGMENT_SOURCE("overlay_sculpt_curves_selection_frag.glsl")
|
||||||
.fragment_out(0, Type::VEC4, "out_color")
|
FRAGMENT_OUT(0, VEC4, out_color)
|
||||||
.additional_info("draw_hair")
|
ADDITIONAL_INFO(draw_hair)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_sculpt_curves_selection_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_sculpt_curves_selection_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_sculpt_curves_selection")
|
ADDITIONAL_INFO(overlay_sculpt_curves_selection)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_sculpt_curves_cage_iface)
|
GPU_SHADER_INTERFACE_INFO(overlay_sculpt_curves_cage_iface)
|
||||||
.no_perspective(Type::VEC2, "edgePos")
|
NO_PERSPECTIVE(VEC2, edgePos)
|
||||||
.flat(Type::VEC2, "edgeStart")
|
FLAT(VEC2, edgeStart)
|
||||||
.smooth(Type::VEC4, "finalColor");
|
SMOOTH(VEC4, finalColor)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_sculpt_curves_cage)
|
GPU_SHADER_CREATE_INFO(overlay_sculpt_curves_cage)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_in(1, Type::FLOAT, "selection")
|
VERTEX_IN(1, FLOAT, selection)
|
||||||
.vertex_out(overlay_sculpt_curves_cage_iface)
|
VERTEX_OUT(overlay_sculpt_curves_cage_iface)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.fragment_out(1, Type::VEC4, "lineOutput")
|
FRAGMENT_OUT(1, VEC4, lineOutput)
|
||||||
.push_constant(Type::FLOAT, "opacity")
|
PUSH_CONSTANT(FLOAT, opacity)
|
||||||
.vertex_source("overlay_sculpt_curves_cage_vert.glsl")
|
VERTEX_SOURCE("overlay_sculpt_curves_cage_vert.glsl")
|
||||||
.fragment_source("overlay_extra_frag.glsl")
|
FRAGMENT_SOURCE("overlay_extra_frag.glsl")
|
||||||
.additional_info("draw_modelmat")
|
ADDITIONAL_INFO(draw_modelmat)
|
||||||
.additional_info("draw_view")
|
ADDITIONAL_INFO(draw_view)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_sculpt_curves_cage_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_sculpt_curves_cage_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_sculpt_curves_cage")
|
ADDITIONAL_INFO(overlay_sculpt_curves_cage)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
@ -5,26 +5,29 @@
|
|||||||
#include "gpu_shader_create_info.hh"
|
#include "gpu_shader_create_info.hh"
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_sculpt_mask_iface)
|
GPU_SHADER_INTERFACE_INFO(overlay_sculpt_mask_iface)
|
||||||
.flat(Type::VEC3, "faceset_color")
|
FLAT(VEC3, faceset_color)
|
||||||
.smooth(Type::FLOAT, "mask_color")
|
SMOOTH(FLOAT, mask_color)
|
||||||
.smooth(Type::VEC4, "finalColor");
|
SMOOTH(VEC4, finalColor)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_sculpt_mask)
|
GPU_SHADER_CREATE_INFO(overlay_sculpt_mask)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.push_constant(Type::FLOAT, "maskOpacity")
|
PUSH_CONSTANT(FLOAT, maskOpacity)
|
||||||
.push_constant(Type::FLOAT, "faceSetsOpacity")
|
PUSH_CONSTANT(FLOAT, faceSetsOpacity)
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_in(1, Type::VEC3, "fset")
|
VERTEX_IN(1, VEC3, fset)
|
||||||
.vertex_in(2, Type::FLOAT, "msk")
|
VERTEX_IN(2, FLOAT, msk)
|
||||||
.vertex_out(overlay_sculpt_mask_iface)
|
VERTEX_OUT(overlay_sculpt_mask_iface)
|
||||||
.vertex_source("overlay_sculpt_mask_vert.glsl")
|
VERTEX_SOURCE("overlay_sculpt_mask_vert.glsl")
|
||||||
.fragment_source("overlay_sculpt_mask_frag.glsl")
|
FRAGMENT_SOURCE("overlay_sculpt_mask_frag.glsl")
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.additional_info("draw_mesh")
|
ADDITIONAL_INFO(draw_mesh)
|
||||||
.additional_info("draw_object_infos")
|
ADDITIONAL_INFO(draw_object_infos)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_sculpt_mask_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_sculpt_mask_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_sculpt_mask")
|
ADDITIONAL_INFO(overlay_sculpt_mask)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
@ -4,74 +4,86 @@
|
|||||||
|
|
||||||
#include "gpu_shader_create_info.hh"
|
#include "gpu_shader_create_info.hh"
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_viewer_attribute_iface).smooth(Type::VEC4, "finalColor");
|
GPU_SHADER_INTERFACE_INFO(overlay_viewer_attribute_iface)
|
||||||
|
SMOOTH(VEC4, finalColor)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_viewer_attribute_common).push_constant(Type::FLOAT, "opacity");
|
GPU_SHADER_CREATE_INFO(overlay_viewer_attribute_common)
|
||||||
|
PUSH_CONSTANT(FLOAT, opacity)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_viewer_attribute_mesh)
|
GPU_SHADER_CREATE_INFO(overlay_viewer_attribute_mesh)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_source("overlay_viewer_attribute_mesh_vert.glsl")
|
VERTEX_SOURCE("overlay_viewer_attribute_mesh_vert.glsl")
|
||||||
.fragment_source("overlay_viewer_attribute_frag.glsl")
|
FRAGMENT_SOURCE("overlay_viewer_attribute_frag.glsl")
|
||||||
.fragment_out(0, Type::VEC4, "out_color")
|
FRAGMENT_OUT(0, VEC4, out_color)
|
||||||
.fragment_out(1, Type::VEC4, "lineOutput")
|
FRAGMENT_OUT(1, VEC4, lineOutput)
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_in(1, Type::VEC4, "attribute_value")
|
VERTEX_IN(1, VEC4, attribute_value)
|
||||||
.vertex_out(overlay_viewer_attribute_iface)
|
VERTEX_OUT(overlay_viewer_attribute_iface)
|
||||||
.additional_info("overlay_viewer_attribute_common")
|
ADDITIONAL_INFO(overlay_viewer_attribute_common)
|
||||||
.additional_info("draw_mesh");
|
ADDITIONAL_INFO(draw_mesh)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_viewer_attribute_mesh_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_viewer_attribute_mesh_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_viewer_attribute_mesh")
|
ADDITIONAL_INFO(overlay_viewer_attribute_mesh)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_viewer_attribute_pointcloud)
|
GPU_SHADER_CREATE_INFO(overlay_viewer_attribute_pointcloud)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_source("overlay_viewer_attribute_pointcloud_vert.glsl")
|
VERTEX_SOURCE("overlay_viewer_attribute_pointcloud_vert.glsl")
|
||||||
.fragment_source("overlay_viewer_attribute_frag.glsl")
|
FRAGMENT_SOURCE("overlay_viewer_attribute_frag.glsl")
|
||||||
.fragment_out(0, Type::VEC4, "out_color")
|
FRAGMENT_OUT(0, VEC4, out_color)
|
||||||
.fragment_out(1, Type::VEC4, "lineOutput")
|
FRAGMENT_OUT(1, VEC4, lineOutput)
|
||||||
.sampler(3, ImageType::FLOAT_BUFFER, "attribute_tx")
|
SAMPLER(3, FLOAT_BUFFER, attribute_tx)
|
||||||
.vertex_out(overlay_viewer_attribute_iface)
|
VERTEX_OUT(overlay_viewer_attribute_iface)
|
||||||
.additional_info("overlay_viewer_attribute_common")
|
ADDITIONAL_INFO(overlay_viewer_attribute_common)
|
||||||
.additional_info("draw_pointcloud");
|
ADDITIONAL_INFO(draw_pointcloud)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_viewer_attribute_pointcloud_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_viewer_attribute_pointcloud_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_viewer_attribute_pointcloud")
|
ADDITIONAL_INFO(overlay_viewer_attribute_pointcloud)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_viewer_attribute_curve)
|
GPU_SHADER_CREATE_INFO(overlay_viewer_attribute_curve)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_source("overlay_viewer_attribute_curve_vert.glsl")
|
VERTEX_SOURCE("overlay_viewer_attribute_curve_vert.glsl")
|
||||||
.fragment_source("overlay_viewer_attribute_frag.glsl")
|
FRAGMENT_SOURCE("overlay_viewer_attribute_frag.glsl")
|
||||||
.fragment_out(0, Type::VEC4, "out_color")
|
FRAGMENT_OUT(0, VEC4, out_color)
|
||||||
.fragment_out(1, Type::VEC4, "lineOutput")
|
FRAGMENT_OUT(1, VEC4, lineOutput)
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_in(1, Type::VEC4, "attribute_value")
|
VERTEX_IN(1, VEC4, attribute_value)
|
||||||
.vertex_out(overlay_viewer_attribute_iface)
|
VERTEX_OUT(overlay_viewer_attribute_iface)
|
||||||
.additional_info("overlay_viewer_attribute_common")
|
ADDITIONAL_INFO(overlay_viewer_attribute_common)
|
||||||
.additional_info("draw_modelmat")
|
ADDITIONAL_INFO(draw_modelmat)
|
||||||
.additional_info("draw_resource_id");
|
ADDITIONAL_INFO(draw_resource_id)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_viewer_attribute_curve_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_viewer_attribute_curve_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_viewer_attribute_curve")
|
ADDITIONAL_INFO(overlay_viewer_attribute_curve)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_viewer_attribute_curves)
|
GPU_SHADER_CREATE_INFO(overlay_viewer_attribute_curves)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.vertex_source("overlay_viewer_attribute_curves_vert.glsl")
|
VERTEX_SOURCE("overlay_viewer_attribute_curves_vert.glsl")
|
||||||
.fragment_source("overlay_viewer_attribute_frag.glsl")
|
FRAGMENT_SOURCE("overlay_viewer_attribute_frag.glsl")
|
||||||
.fragment_out(0, Type::VEC4, "out_color")
|
FRAGMENT_OUT(0, VEC4, out_color)
|
||||||
.fragment_out(1, Type::VEC4, "lineOutput")
|
FRAGMENT_OUT(1, VEC4, lineOutput)
|
||||||
.sampler(0, ImageType::FLOAT_BUFFER, "color_tx")
|
SAMPLER(0, FLOAT_BUFFER, color_tx)
|
||||||
.push_constant(Type::BOOL, "is_point_domain")
|
PUSH_CONSTANT(BOOL, is_point_domain)
|
||||||
.vertex_out(overlay_viewer_attribute_iface)
|
VERTEX_OUT(overlay_viewer_attribute_iface)
|
||||||
.additional_info("overlay_viewer_attribute_common")
|
ADDITIONAL_INFO(overlay_viewer_attribute_common)
|
||||||
.additional_info("draw_hair");
|
ADDITIONAL_INFO(draw_hair)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_viewer_attribute_curves_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_viewer_attribute_curves_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_viewer_attribute_curves")
|
ADDITIONAL_INFO(overlay_viewer_attribute_curves)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
@ -8,48 +8,54 @@
|
|||||||
/** \name Volume Velocity
|
/** \name Volume Velocity
|
||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_volume_velocity_iface).smooth(Type::VEC4, "finalColor");
|
GPU_SHADER_INTERFACE_INFO(overlay_volume_velocity_iface)
|
||||||
|
SMOOTH(VEC4, finalColor)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_volume_velocity)
|
GPU_SHADER_CREATE_INFO(overlay_volume_velocity)
|
||||||
.sampler(0, ImageType::FLOAT_3D, "velocityX")
|
SAMPLER(0, FLOAT_3D, velocityX)
|
||||||
.sampler(1, ImageType::FLOAT_3D, "velocityY")
|
SAMPLER(1, FLOAT_3D, velocityY)
|
||||||
.sampler(2, ImageType::FLOAT_3D, "velocityZ")
|
SAMPLER(2, FLOAT_3D, velocityZ)
|
||||||
.push_constant(Type::FLOAT, "displaySize")
|
PUSH_CONSTANT(FLOAT, displaySize)
|
||||||
.push_constant(Type::FLOAT, "slicePosition")
|
PUSH_CONSTANT(FLOAT, slicePosition)
|
||||||
.push_constant(Type::INT, "sliceAxis")
|
PUSH_CONSTANT(INT, sliceAxis)
|
||||||
.push_constant(Type::BOOL, "scaleWithMagnitude")
|
PUSH_CONSTANT(BOOL, scaleWithMagnitude)
|
||||||
.push_constant(Type::BOOL, "isCellCentered")
|
PUSH_CONSTANT(BOOL, isCellCentered)
|
||||||
/* FluidDomainSettings.cell_size */
|
/* FluidDomainSettings.cell_size */
|
||||||
.push_constant(Type::VEC3, "cellSize")
|
PUSH_CONSTANT(VEC3, cellSize)
|
||||||
/* FluidDomainSettings.p0 */
|
/* FluidDomainSettings.p0 */
|
||||||
.push_constant(Type::VEC3, "domainOriginOffset")
|
PUSH_CONSTANT(VEC3, domainOriginOffset)
|
||||||
/* FluidDomainSettings.res_min */
|
/* FluidDomainSettings.res_min */
|
||||||
.push_constant(Type::IVEC3, "adaptiveCellOffset")
|
PUSH_CONSTANT(IVEC3, adaptiveCellOffset)
|
||||||
.push_constant(Type::INT, "in_select_id")
|
PUSH_CONSTANT(INT, in_select_id)
|
||||||
.vertex_out(overlay_volume_velocity_iface)
|
VERTEX_OUT(overlay_volume_velocity_iface)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.vertex_source("overlay_volume_velocity_vert.glsl")
|
VERTEX_SOURCE("overlay_volume_velocity_vert.glsl")
|
||||||
.fragment_source("overlay_varying_color.glsl");
|
FRAGMENT_SOURCE("overlay_varying_color.glsl")
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_volume_velocity_streamline)
|
GPU_SHADER_CREATE_INFO(overlay_volume_velocity_streamline)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("draw_volume")
|
ADDITIONAL_INFO(draw_volume)
|
||||||
.additional_info("overlay_volume_velocity");
|
ADDITIONAL_INFO(overlay_volume_velocity)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_volume_velocity_mac)
|
GPU_SHADER_CREATE_INFO(overlay_volume_velocity_mac)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.define("USE_MAC")
|
DEFINE("USE_MAC")
|
||||||
.push_constant(Type::BOOL, "drawMACX")
|
PUSH_CONSTANT(BOOL, drawMACX)
|
||||||
.push_constant(Type::BOOL, "drawMACY")
|
PUSH_CONSTANT(BOOL, drawMACY)
|
||||||
.push_constant(Type::BOOL, "drawMACZ")
|
PUSH_CONSTANT(BOOL, drawMACZ)
|
||||||
.additional_info("draw_volume")
|
ADDITIONAL_INFO(draw_volume)
|
||||||
.additional_info("overlay_volume_velocity");
|
ADDITIONAL_INFO(overlay_volume_velocity)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_volume_velocity_needle)
|
GPU_SHADER_CREATE_INFO(overlay_volume_velocity_needle)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.define("USE_NEEDLE")
|
DEFINE("USE_NEEDLE")
|
||||||
.additional_info("draw_volume")
|
ADDITIONAL_INFO(draw_volume)
|
||||||
.additional_info("overlay_volume_velocity");
|
ADDITIONAL_INFO(overlay_volume_velocity)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
@ -57,47 +63,53 @@ GPU_SHADER_CREATE_INFO(overlay_volume_velocity_needle)
|
|||||||
/** \name Volume Grid-Lines
|
/** \name Volume Grid-Lines
|
||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_volume_gridlines_iface).flat(Type::VEC4, "finalColor");
|
GPU_SHADER_INTERFACE_INFO(overlay_volume_gridlines_iface)
|
||||||
|
FLAT(VEC4, finalColor)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_volume_gridlines)
|
GPU_SHADER_CREATE_INFO(overlay_volume_gridlines)
|
||||||
.push_constant(Type::FLOAT, "slicePosition")
|
PUSH_CONSTANT(FLOAT, slicePosition)
|
||||||
.push_constant(Type::INT, "sliceAxis")
|
PUSH_CONSTANT(INT, sliceAxis)
|
||||||
/* FluidDomainSettings.res */
|
/* FluidDomainSettings.res */
|
||||||
.push_constant(Type::IVEC3, "volumeSize")
|
PUSH_CONSTANT(IVEC3, volumeSize)
|
||||||
/* FluidDomainSettings.cell_size */
|
/* FluidDomainSettings.cell_size */
|
||||||
.push_constant(Type::VEC3, "cellSize")
|
PUSH_CONSTANT(VEC3, cellSize)
|
||||||
/* FluidDomainSettings.p0 */
|
/* FluidDomainSettings.p0 */
|
||||||
.push_constant(Type::VEC3, "domainOriginOffset")
|
PUSH_CONSTANT(VEC3, domainOriginOffset)
|
||||||
/* FluidDomainSettings.res_min */
|
/* FluidDomainSettings.res_min */
|
||||||
.push_constant(Type::IVEC3, "adaptiveCellOffset")
|
PUSH_CONSTANT(IVEC3, adaptiveCellOffset)
|
||||||
.push_constant(Type::INT, "in_select_id")
|
PUSH_CONSTANT(INT, in_select_id)
|
||||||
.vertex_out(overlay_volume_gridlines_iface)
|
VERTEX_OUT(overlay_volume_gridlines_iface)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.vertex_source("overlay_volume_gridlines_vert.glsl")
|
VERTEX_SOURCE("overlay_volume_gridlines_vert.glsl")
|
||||||
.fragment_source("overlay_varying_color.glsl");
|
FRAGMENT_SOURCE("overlay_varying_color.glsl")
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_volume_gridlines_flat)
|
GPU_SHADER_CREATE_INFO(overlay_volume_gridlines_flat)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("draw_volume")
|
ADDITIONAL_INFO(draw_volume)
|
||||||
.additional_info("overlay_volume_gridlines");
|
ADDITIONAL_INFO(overlay_volume_gridlines)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_volume_gridlines_flags)
|
GPU_SHADER_CREATE_INFO(overlay_volume_gridlines_flags)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.define("SHOW_FLAGS")
|
DEFINE("SHOW_FLAGS")
|
||||||
.sampler(0, ImageType::UINT_3D, "flagTexture")
|
SAMPLER(0, UINT_3D, flagTexture)
|
||||||
.additional_info("draw_volume")
|
ADDITIONAL_INFO(draw_volume)
|
||||||
.additional_info("overlay_volume_gridlines");
|
ADDITIONAL_INFO(overlay_volume_gridlines)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_volume_gridlines_range)
|
GPU_SHADER_CREATE_INFO(overlay_volume_gridlines_range)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.define("SHOW_RANGE")
|
DEFINE("SHOW_RANGE")
|
||||||
.push_constant(Type::FLOAT, "lowerBound")
|
PUSH_CONSTANT(FLOAT, lowerBound)
|
||||||
.push_constant(Type::FLOAT, "upperBound")
|
PUSH_CONSTANT(FLOAT, upperBound)
|
||||||
.push_constant(Type::VEC4, "rangeColor")
|
PUSH_CONSTANT(VEC4, rangeColor)
|
||||||
.push_constant(Type::INT, "cellFilter")
|
PUSH_CONSTANT(INT, cellFilter)
|
||||||
.sampler(0, ImageType::UINT_3D, "flagTexture")
|
SAMPLER(0, UINT_3D, flagTexture)
|
||||||
.sampler(1, ImageType::FLOAT_3D, "fieldTexture")
|
SAMPLER(1, FLOAT_3D, fieldTexture)
|
||||||
.additional_info("draw_volume")
|
ADDITIONAL_INFO(draw_volume)
|
||||||
.additional_info("overlay_volume_gridlines");
|
ADDITIONAL_INFO(overlay_volume_gridlines)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
@ -5,117 +5,128 @@
|
|||||||
#include "gpu_shader_create_info.hh"
|
#include "gpu_shader_create_info.hh"
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_wireframe_iface)
|
GPU_SHADER_INTERFACE_INFO(overlay_wireframe_iface)
|
||||||
.smooth(Type::VEC4, "finalColor")
|
SMOOTH(VEC4, finalColor)
|
||||||
.flat(Type::VEC2, "edgeStart")
|
FLAT(VEC2, edgeStart)
|
||||||
.no_perspective(Type::VEC2, "edgePos");
|
NO_PERSPECTIVE(VEC2, edgePos)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_wireframe)
|
GPU_SHADER_CREATE_INFO(overlay_wireframe)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.push_constant(Type::FLOAT, "wireStepParam")
|
PUSH_CONSTANT(FLOAT, wireStepParam)
|
||||||
.push_constant(Type::FLOAT, "wireOpacity")
|
PUSH_CONSTANT(FLOAT, wireOpacity)
|
||||||
.push_constant(Type::BOOL, "useColoring")
|
PUSH_CONSTANT(BOOL, useColoring)
|
||||||
.push_constant(Type::BOOL, "isTransform")
|
PUSH_CONSTANT(BOOL, isTransform)
|
||||||
.push_constant(Type::INT, "colorType")
|
PUSH_CONSTANT(INT, colorType)
|
||||||
.push_constant(Type::BOOL, "isHair")
|
PUSH_CONSTANT(BOOL, isHair)
|
||||||
.push_constant(Type::MAT4, "hairDupliMatrix")
|
PUSH_CONSTANT(MAT4, hairDupliMatrix)
|
||||||
/* Scene Depth texture copy for manual depth test. */
|
/* Scene Depth texture copy for manual depth test. */
|
||||||
.sampler(0, ImageType::DEPTH_2D, "depthTex")
|
SAMPLER(0, DEPTH_2D, depthTex)
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_in(1, Type::VEC3, "nor")
|
VERTEX_IN(1, VEC3, nor)
|
||||||
.vertex_in(2, Type::FLOAT, "wd") /* wire-data. */
|
VERTEX_IN(2, FLOAT, wd) /* wire-data. */
|
||||||
.vertex_out(overlay_wireframe_iface)
|
VERTEX_OUT(overlay_wireframe_iface)
|
||||||
.vertex_source("overlay_wireframe_vert.glsl")
|
VERTEX_SOURCE("overlay_wireframe_vert.glsl")
|
||||||
.fragment_source("overlay_wireframe_frag.glsl")
|
FRAGMENT_SOURCE("overlay_wireframe_frag.glsl")
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.fragment_out(1, Type::VEC4, "lineOutput")
|
FRAGMENT_OUT(1, VEC4, lineOutput)
|
||||||
.depth_write(DepthWrite::ANY)
|
DEPTH_WRITE(DepthWrite::ANY)
|
||||||
.additional_info("draw_mesh")
|
ADDITIONAL_INFO(draw_mesh)
|
||||||
.additional_info("draw_object_infos")
|
ADDITIONAL_INFO(draw_object_infos)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_wireframe_curve)
|
GPU_SHADER_CREATE_INFO(overlay_wireframe_curve)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.define("CURVES")
|
DEFINE("CURVES")
|
||||||
.push_constant(Type::FLOAT, "wireOpacity")
|
PUSH_CONSTANT(FLOAT, wireOpacity)
|
||||||
.push_constant(Type::BOOL, "useColoring")
|
PUSH_CONSTANT(BOOL, useColoring)
|
||||||
.push_constant(Type::BOOL, "isTransform")
|
PUSH_CONSTANT(BOOL, isTransform)
|
||||||
.push_constant(Type::INT, "colorType")
|
PUSH_CONSTANT(INT, colorType)
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_out(overlay_wireframe_iface)
|
VERTEX_OUT(overlay_wireframe_iface)
|
||||||
.vertex_source("overlay_wireframe_vert.glsl")
|
VERTEX_SOURCE("overlay_wireframe_vert.glsl")
|
||||||
.fragment_source("overlay_wireframe_frag.glsl")
|
FRAGMENT_SOURCE("overlay_wireframe_frag.glsl")
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.fragment_out(1, Type::VEC4, "lineOutput")
|
FRAGMENT_OUT(1, VEC4, lineOutput)
|
||||||
.additional_info("draw_view")
|
ADDITIONAL_INFO(draw_view)
|
||||||
.additional_info("draw_modelmat_new")
|
ADDITIONAL_INFO(draw_modelmat_new)
|
||||||
.additional_info("draw_resource_handle_new")
|
ADDITIONAL_INFO(draw_resource_handle_new)
|
||||||
.additional_info("draw_object_infos_new")
|
ADDITIONAL_INFO(draw_object_infos_new)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_INTERFACE_INFO(overlay_wireframe_points_iface)
|
GPU_SHADER_INTERFACE_INFO(overlay_wireframe_points_iface)
|
||||||
.flat(Type::VEC4, "finalColor")
|
FLAT(VEC4, finalColor)
|
||||||
.flat(Type::VEC4, "finalColorInner");
|
FLAT(VEC4, finalColorInner)
|
||||||
|
GPU_SHADER_INTERFACE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_wireframe_points)
|
GPU_SHADER_CREATE_INFO(overlay_wireframe_points)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.define("POINTS")
|
DEFINE("POINTS")
|
||||||
.push_constant(Type::BOOL, "useColoring")
|
PUSH_CONSTANT(BOOL, useColoring)
|
||||||
.push_constant(Type::BOOL, "isTransform")
|
PUSH_CONSTANT(BOOL, isTransform)
|
||||||
.push_constant(Type::INT, "colorType")
|
PUSH_CONSTANT(INT, colorType)
|
||||||
.vertex_in(0, Type::VEC3, "pos")
|
VERTEX_IN(0, VEC3, pos)
|
||||||
.vertex_out(overlay_wireframe_points_iface)
|
VERTEX_OUT(overlay_wireframe_points_iface)
|
||||||
.vertex_source("overlay_wireframe_vert.glsl")
|
VERTEX_SOURCE("overlay_wireframe_vert.glsl")
|
||||||
.fragment_source("overlay_wireframe_frag.glsl")
|
FRAGMENT_SOURCE("overlay_wireframe_frag.glsl")
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
.fragment_out(1, Type::VEC4, "lineOutput")
|
FRAGMENT_OUT(1, VEC4, lineOutput)
|
||||||
.additional_info("draw_view")
|
ADDITIONAL_INFO(draw_view)
|
||||||
.additional_info("draw_modelmat_new")
|
ADDITIONAL_INFO(draw_modelmat_new)
|
||||||
.additional_info("draw_resource_handle_new")
|
ADDITIONAL_INFO(draw_resource_handle_new)
|
||||||
.additional_info("draw_object_infos_new")
|
ADDITIONAL_INFO(draw_object_infos_new)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_wireframe_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_wireframe_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_wireframe")
|
ADDITIONAL_INFO(overlay_wireframe)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_wireframe_custom_depth)
|
GPU_SHADER_CREATE_INFO(overlay_wireframe_custom_depth)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.define("CUSTOM_DEPTH_BIAS")
|
DEFINE("CUSTOM_DEPTH_BIAS")
|
||||||
.additional_info("overlay_wireframe");
|
ADDITIONAL_INFO(overlay_wireframe)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_wireframe_custom_depth_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_wireframe_custom_depth_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_wireframe_custom_depth")
|
ADDITIONAL_INFO(overlay_wireframe_custom_depth)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_wireframe_select)
|
GPU_SHADER_CREATE_INFO(overlay_wireframe_select)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.define("SELECT_EDGES")
|
DEFINE("SELECT_EDGES")
|
||||||
.additional_info("overlay_wireframe");
|
ADDITIONAL_INFO(overlay_wireframe)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_wireframe_select_clipped)
|
GPU_SHADER_CREATE_INFO(overlay_wireframe_select_clipped)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.additional_info("overlay_wireframe_select")
|
ADDITIONAL_INFO(overlay_wireframe_select)
|
||||||
.additional_info("drw_clipped");
|
ADDITIONAL_INFO(drw_clipped)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
|
||||||
GPU_SHADER_CREATE_INFO(overlay_wireframe_uv)
|
GPU_SHADER_CREATE_INFO(overlay_wireframe_uv)
|
||||||
.do_static_compilation(true)
|
DO_STATIC_COMPILATION()
|
||||||
.define("WIREFRAME")
|
DEFINE("WIREFRAME")
|
||||||
.storage_buf(0, Qualifier::READ, "float", "au[]", Frequency::GEOMETRY)
|
STORAGE_BUF_FREQ(0, READ, float, au[], GEOMETRY)
|
||||||
.push_constant(Type::IVEC2, "gpu_attr_0")
|
PUSH_CONSTANT(IVEC2, gpu_attr_0)
|
||||||
.define("lineStyle", "4" /* OVERLAY_UV_LINE_STYLE_SHADOW */)
|
DEFINE_VALUE("lineStyle", "4" /* OVERLAY_UV_LINE_STYLE_SHADOW */)
|
||||||
.define("dashLength", "1" /* Not used by this line style */)
|
DEFINE_VALUE("dashLength", "1" /* Not used by this line style */)
|
||||||
.define("use_edge_select", "false")
|
DEFINE_VALUE("use_edge_select", "false")
|
||||||
.push_constant(Type::BOOL, "doSmoothWire")
|
PUSH_CONSTANT(BOOL, doSmoothWire)
|
||||||
.push_constant(Type::FLOAT, "alpha")
|
PUSH_CONSTANT(FLOAT, alpha)
|
||||||
.vertex_out(overlay_edit_uv_next_iface)
|
VERTEX_OUT(overlay_edit_uv_next_iface)
|
||||||
.fragment_out(0, Type::VEC4, "fragColor")
|
FRAGMENT_OUT(0, VEC4, fragColor)
|
||||||
/* Note: Reuse edit mode shader as it is mostly the same. */
|
/* Note: Reuse edit mode shader as it is mostly the same. */
|
||||||
.vertex_source("overlay_edit_uv_edges_next_vert.glsl")
|
VERTEX_SOURCE("overlay_edit_uv_edges_next_vert.glsl")
|
||||||
.fragment_source("overlay_edit_uv_edges_next_frag.glsl")
|
FRAGMENT_SOURCE("overlay_edit_uv_edges_next_frag.glsl")
|
||||||
.additional_info("draw_view")
|
ADDITIONAL_INFO(draw_view)
|
||||||
.additional_info("draw_modelmat_new")
|
ADDITIONAL_INFO(draw_modelmat_new)
|
||||||
.additional_info("draw_resource_handle_new")
|
ADDITIONAL_INFO(draw_resource_handle_new)
|
||||||
.additional_info("gpu_index_load")
|
ADDITIONAL_INFO(gpu_index_load)
|
||||||
.additional_info("draw_globals");
|
ADDITIONAL_INFO(draw_globals)
|
||||||
|
GPU_SHADER_CREATE_END()
|
||||||
|
Loading…
Reference in New Issue
Block a user