@@ -220,6 +220,14 @@ def draw(self, shader: Shader, line_shader: Shader, rendermode: str, is_instance
220220 # Also include transparent elements when rendering instance map
221221 shader .draw_triangles (elements = self .buffer_ids [face_type ]["elements_transparent" ], n = len (self .elements [face_type + "_transparent" ]))
222222
223+ # Draw points
224+ shader .uniform1i ("element_type" , 0 )
225+ if self .buffer_ids ["_points_data" ]:
226+ shader .bind_attribute ("position" , self .buffer_ids ["_points_data" ]["positions" ])
227+ shader .bind_attribute ("color" , self .buffer_ids ["_points_data" ]["colors" ], step = 4 )
228+ shader .bind_attribute ("object_index" , self .buffer_ids ["_points_data" ]["object_indices" ], step = 1 )
229+ shader .draw_points (elements = self .buffer_ids ["_points_data" ]["elements" ], n = len (self .elements ["_points_data" ]), size = 10.0 )
230+
223231 # Draw lines
224232 GL .glDisable (GL .GL_CULL_FACE )
225233 line_shader .bind ()
@@ -233,23 +241,12 @@ def draw(self, shader: Shader, line_shader: Shader, rendermode: str, is_instance
233241 line_shader .bind_attribute ("color" , self .buffer_ids ["_lines_data" ]["colors" ], step = 4 )
234242 line_shader .bind_attribute ("object_index" , self .buffer_ids ["_lines_data" ]["object_indices" ], step = 1 )
235243 line_shader .draw_lines (elements = self .buffer_ids ["_lines_data" ]["elements" ], n = len (self .elements ["_lines_data" ]))
236- line_shader .disable_attribute ("object_index" )
237- line_shader .disable_attribute ("position" )
238- line_shader .disable_attribute ("color" )
239244 line_shader .release ()
240245 GL .glEnable (GL .GL_CULL_FACE )
241246
242- # Draw points
243- shader .bind ()
244- shader .uniform1i ("element_type" , 0 )
245- if self .buffer_ids ["_points_data" ]:
246- shader .bind_attribute ("position" , self .buffer_ids ["_points_data" ]["positions" ])
247- shader .bind_attribute ("color" , self .buffer_ids ["_points_data" ]["colors" ], step = 4 )
248- shader .bind_attribute ("object_index" , self .buffer_ids ["_points_data" ]["object_indices" ], step = 1 )
249- shader .draw_points (elements = self .buffer_ids ["_points_data" ]["elements" ], n = len (self .elements ["_points_data" ]), size = 10.0 )
250-
251247 if not is_instance and not is_wireframe :
252248 # Then Draw all the transparent elements
249+ shader .bind ()
253250 shader .uniform1i ("is_lighted" , is_lighted )
254251 shader .uniform1i ("element_type" , 2 )
255252 GL .glDepthMask (GL .GL_FALSE ) # Disable depth writing for transparent objects
0 commit comments