53 call_buffers_.ground_line_buf.clear();
54 call_buffers_.icon_inner_buf.clear();
55 call_buffers_.icon_outer_buf.clear();
56 call_buffers_.icon_sun_rays_buf.clear();
57 call_buffers_.point_buf.clear();
58 call_buffers_.sun_buf.clear();
59 call_buffers_.spot_buf.clear();
60 call_buffers_.spot_cone_back_buf.clear();
61 call_buffers_.spot_cone_front_buf.clear();
62 call_buffers_.area_disk_buf.clear();
63 call_buffers_.area_square_buf.clear();
76 float4(res.object_wire_color(ob_ref,
state).xyz(), 1.0f),
82 float &area_size_x = matrix[0].w;
83 float &area_size_y = matrix[1].w;
84 float &spot_cosine = matrix[0].w;
85 float &spot_blend = matrix[1].w;
86 float &clip_start = matrix[2].w;
87 float &clip_end = matrix[3].w;
90 const select::ID select_id = res.select_id(ob_ref);
96 clip_end = la.att_dist;
97 clip_start = la.clipsta;
99 call_buffers_.ground_line_buf.append(
float4(matrix.
location(), 0.0f), select_id);
101 const float4 light_color = {la.r, la.g, la.b, 1.0f};
102 const bool show_light_colors =
state.show_light_colors();
105 call_buffers_.icon_outer_buf.append(
data, select_id);
106 call_buffers_.icon_inner_buf.append(show_light_colors ?
data.with_color(light_color) :
data,
111 area_size_x = area_size_y = la.radius;
112 call_buffers_.point_buf.append(
data, select_id);
115 call_buffers_.sun_buf.append(
data, select_id);
116 call_buffers_.icon_sun_rays_buf.append(
117 show_light_colors ?
data.with_color(light_color) :
data, select_id);
129 const float a =
cosf(la.spotsize * 0.5f);
130 const float b = la.spotblend;
131 const float c = a *
b - a -
b;
132 const float a2 = a * a;
133 const float c2 = c * c;
135 spot_blend =
sqrtf((a2 - a2 * c2) / (c2 - a2 * c2));
138 theme_color[3] = -
max_ff(la.radius, FLT_MIN);
139 call_buffers_.spot_buf.append(
data, select_id);
141 const float4 color_inside{0.0f, 0.0f, 0.0f, 0.5f};
142 const float4 color_outside{1.0f, 1.0f, 1.0f, 0.3f};
143 call_buffers_.spot_cone_front_buf.append(
data.with_color(color_inside), select_id);
144 call_buffers_.spot_cone_back_buf.append(
data.with_color(color_outside), select_id);
151 call_buffers_.area_square_buf :
152 call_buffers_.area_disk_buf;
153 area_size_x = la.area_size;
154 area_size_y = uniform_scale ? la.area_size : la.area_sizey;
171 res.select_bind(ps_);
177 state.clipping_plane_count);
178 sub_pass.
shader_set(res.shaders->light_spot_cone.get());
179 call_buffers_.spot_cone_front_buf.end_sync(sub_pass, res.shapes.light_spot_volume.get());
185 state.clipping_plane_count);
186 sub_pass.
shader_set(res.shaders->light_spot_cone.get());
187 call_buffers_.spot_cone_back_buf.end_sync(sub_pass, res.shapes.light_spot_volume.get());
192 sub_pass.
shader_set(res.shaders->extra_shape.get());
193 call_buffers_.icon_inner_buf.end_sync(sub_pass, res.shapes.light_icon_outer_lines.get());
194 call_buffers_.icon_outer_buf.end_sync(sub_pass, res.shapes.light_icon_inner_lines.get());
195 call_buffers_.icon_sun_rays_buf.end_sync(sub_pass, res.shapes.light_icon_sun_rays.get());
196 call_buffers_.point_buf.end_sync(sub_pass, res.shapes.light_point_lines.get());
197 call_buffers_.sun_buf.end_sync(sub_pass, res.shapes.light_sun_lines.get());
198 call_buffers_.spot_buf.end_sync(sub_pass, res.shapes.light_spot_lines.get());
199 call_buffers_.area_disk_buf.end_sync(sub_pass, res.shapes.light_area_disk_lines.get());
200 call_buffers_.area_square_buf.end_sync(sub_pass, res.shapes.light_area_square_lines.get());
205 sub_pass.
shader_set(res.shaders->extra_ground_line.get());
206 call_buffers_.ground_line_buf.end_sync(sub_pass, res.shapes.ground_line.get());