19 float2 edge = edge_start - edge_pos;
32 float dist =
dot(perp, frag_co - edge_start);
38 return float4(0.0f, 0.5f, 0.0f, 1.0f);
63 int line_id = (vert_id / 2);
64 bool is_provoking_vertex = (vert_id & 1) == 0;
69 uint3(vert.pos1_x, vert.pos1_y, vert.pos1_z) :
70 uint3(vert.pos2_x, vert.pos2_y, vert.pos2_z));
74 if (is_provoking_vertex && vert.lifetime > 1) {
76 uint vertid =
atomicAdd(srt.out_debug_lines_buf[0].pos1_x, 2u);
78 uint out_line_id = vertid / 2u;
84 v_out.final_color = col;
85 out_pos = srt.persmat *
float4(pos, 1.0f);
87 v_out.edge_start = v_out.edge_pos = (0.5f * (out_pos.xy / out_pos.w) + 0.5f) * srt.size_viewport;
100 frag_out.color = v_out.final_color;
101 frag_out.line_data =
pack_line_data(frag_co.xy, v_out.edge_start, v_out.edge_pos);
ccl_device_inline float sin_theta(const float3 w)
float4 pack_line_data(float2 frag_co, float2 edge_start, float2 edge_pos)
#define DRW_DEBUG_DRAW_VERT_MAX
#define drw_debug_draw_offset
#define DRW_DEBUG_DRAW_SLOT
#define DRW_DEBUG_DRAW_FEEDBACK_SLOT
#define storage(slot, qualifiers)
float dot(VecOp< float, D >, VecOp< float, D >) RET
int atomicAdd(int &, int) RET
VecBase< float, D > uintBitsToFloat(VecOp< uint, D >) RET
float length(VecOp< float, D >) RET
ccl_device_inline dual1 len(const ccl_private dual< T > &a)
MatBase< float, 4, 4 > float4x4
void vert_main(DebugDrawDisplay &srt, VertOut &v_out, float4 &out_pos, const int vert_id)
PipelineGraphic draw_display(vert_main, frag_main)
void frag_main(const VertOut &v_out, FragOut &frag_out, const float4 frag_co)
const float2 size_viewport
DRWDebugVertPair(& in_debug_lines_buf)[]
DRWDebugVertPair(& out_debug_lines_buf)[]