44 call_buffers_.ground_line_buf.clear();
45 call_buffers_.icon_inner_buf.clear();
46 call_buffers_.icon_outer_buf.clear();
47 call_buffers_.icon_sun_rays_buf.clear();
48 call_buffers_.point_buf.clear();
49 call_buffers_.sun_buf.clear();
50 call_buffers_.spot_buf.clear();
51 call_buffers_.spot_cone_back_buf.clear();
52 call_buffers_.spot_cone_front_buf.clear();
53 call_buffers_.area_disk_buf.clear();
54 call_buffers_.area_square_buf.clear();
62 float4 &theme_color = data.color_;
65 float4x4 &matrix = data.object_to_world_;
66 float &area_size_x = matrix[0].w;
67 float &area_size_y = matrix[1].w;
68 float &spot_cosine = matrix[0].w;
69 float &spot_blend = matrix[1].w;
70 float &clip_start = matrix[2].w;
71 float &clip_end = matrix[3].w;
80 clip_end = la.att_dist;
81 clip_start = la.clipsta;
83 call_buffers_.ground_line_buf.append(
float4(matrix.location()), select_id);
85 const float4 light_color = {la.r, la.g, la.b, 1.0f};
89 call_buffers_.icon_outer_buf.append(data, select_id);
90 call_buffers_.icon_inner_buf.append(show_light_colors ? data.with_color(light_color) :
data,
95 area_size_x = area_size_y = la.radius;
96 call_buffers_.point_buf.append(data, select_id);
99 call_buffers_.sun_buf.append(data, select_id);
100 call_buffers_.icon_sun_rays_buf.append(
101 show_light_colors ? data.with_color(light_color) :
data, select_id);
113 const float a =
cosf(la.spotsize * 0.5f);
114 const float b = la.spotblend;
115 const float c = a *
b - a -
b;
116 const float a2 = a * a;
117 const float c2 = c * c;
119 spot_blend =
sqrtf((a2 - a2 * c2) / (c2 - a2 * c2));
122 theme_color[3] = -
max_ff(la.radius, FLT_MIN);
123 call_buffers_.spot_buf.append(data, select_id);
124 if ((la.mode &
LA_SHOW_CONE) && selection_type_ == SelectionType::DISABLED) {
125 const float4 color_inside{0.0f, 0.0f, 0.0f, 0.5f};
126 const float4 color_outside{1.0f, 1.0f, 1.0f, 0.3f};
127 call_buffers_.spot_cone_front_buf.append(data.with_color(color_inside), select_id);
128 call_buffers_.spot_cone_back_buf.append(data.with_color(color_outside), select_id);
135 call_buffers_.area_square_buf :
136 call_buffers_.area_disk_buf;
137 area_size_x = la.area_size;
138 area_size_y = uniform_scale ? la.area_size : la.area_sizey;
139 area_buf.
append(data, select_id);
154 state.clipping_plane_count);
157 call_buffers_.spot_cone_front_buf.end_sync(sub_pass, shapes.
light_spot_volume.get());
163 state.clipping_plane_count);
166 call_buffers_.spot_cone_back_buf.end_sync(sub_pass, shapes.
light_spot_volume.get());
177 call_buffers_.sun_buf.end_sync(sub_pass, shapes.
light_sun_lines.get());
187 call_buffers_.ground_line_buf.end_sync(sub_pass, shapes.
ground_line.get());