mirror of
https://github.com/3b1b/manim.git
synced 2025-07-28 12:32:36 +08:00
Batch render groups by Mobject type
This commit is contained in:
@ -383,20 +383,11 @@ class Scene(object):
|
|||||||
|
|
||||||
def assemble_render_groups(self):
|
def assemble_render_groups(self):
|
||||||
"""
|
"""
|
||||||
Rendering is more efficient when VMobjects are grouped
|
Rendering can be more efficient when mobjects of the
|
||||||
together, so this function creates VGroups of all
|
same type are grouped together, so this function creates
|
||||||
clusters of adjacent VMobjects in the scene's mobject
|
Groups of all clusters of adjacent Mobjects in the scene
|
||||||
list.
|
|
||||||
"""
|
"""
|
||||||
batches = batch_by_property(
|
batches = batch_by_property(self.mobjects, lambda m: str(type(m)))
|
||||||
self.mobjects,
|
|
||||||
lambda m: "|".join([
|
|
||||||
str(m.shader_dtype.names),
|
|
||||||
str(m.is_fixed_in_frame()),
|
|
||||||
str(m.depth_test),
|
|
||||||
str(m.is_changing()),
|
|
||||||
])
|
|
||||||
)
|
|
||||||
|
|
||||||
for group in self.render_groups:
|
for group in self.render_groups:
|
||||||
group.clear()
|
group.clear()
|
||||||
|
Reference in New Issue
Block a user