Only form render groups from Mobjects of the same type

I.e. bias against forming such groups
This commit is contained in:
Grant Sanderson 2024-08-23 14:45:27 -05:00
parent 513de19657
commit a823901b98

View file

@ -388,13 +388,13 @@ class Scene(object):
""" """
batches = batch_by_property( batches = batch_by_property(
self.mobjects, self.mobjects,
lambda m: m.get_shader_wrapper(self.camera.ctx).get_id() lambda m: str(type(m)) + str(m.get_shader_wrapper(self.camera.ctx).get_id())
) )
for group in self.render_groups: for group in self.render_groups:
group.clear() group.clear()
self.render_groups = [ self.render_groups = [
batch[0].get_group_class()(*batch) batch[0].get_group_class()(*batch) if len(batch) > 1 else batch[0]
for batch, key in batches for batch, key in batches
] ]