mirror of
https://github.com/3b1b/manim.git
synced 2025-09-01 00:48:45 +00:00
Use ibo for single use render groups
This commit is contained in:
parent
702bb2776c
commit
5b8fb1828f
1 changed files with 12 additions and 4 deletions
|
@ -412,12 +412,20 @@ class Camera(object):
|
||||||
# Data buffer
|
# Data buffer
|
||||||
vert_data = shader_wrapper.vert_data
|
vert_data = shader_wrapper.vert_data
|
||||||
indices = shader_wrapper.vert_indices
|
indices = shader_wrapper.vert_indices
|
||||||
if indices is not None:
|
if indices is None:
|
||||||
|
ibo = None
|
||||||
|
elif single_use:
|
||||||
|
ibo = self.ctx.buffer(indices)
|
||||||
|
else:
|
||||||
|
# The vao.render call is strangely longer
|
||||||
|
# when an index buffer is used, so if the
|
||||||
|
# mobject is not changing, meaning only its
|
||||||
|
# uniforms are being updated, just create
|
||||||
|
# a larger data array based on the indices
|
||||||
|
# and don't bother with the ibo
|
||||||
vert_data = vert_data[indices]
|
vert_data = vert_data[indices]
|
||||||
|
ibo = None
|
||||||
vbo = self.ctx.buffer(vert_data)
|
vbo = self.ctx.buffer(vert_data)
|
||||||
# For the moment, the index buffer is actually not used,
|
|
||||||
# since it seems to make the actual render calls meaninfully slower
|
|
||||||
ibo = None
|
|
||||||
|
|
||||||
# Program and vertex array
|
# Program and vertex array
|
||||||
shader_program, vert_format = self.get_shader_program(shader_wrapper)
|
shader_program, vert_format = self.get_shader_program(shader_wrapper)
|
||||||
|
|
Loading…
Add table
Reference in a new issue