Don't use index buffer

It's strangely longer
This commit is contained in:
Grant Sanderson
2023-01-11 15:59:46 -08:00
parent 7847ff1a9d
commit d9dc956137

View File

@@ -403,26 +403,20 @@ class Camera(object):
single_use: bool = True
) -> dict[str, Any]:
# Data buffers
vbo = self.ctx.buffer(shader_wrapper.vert_data.tobytes())
if shader_wrapper.vert_indices is None:
ibo = None
else:
vert_index_data = shader_wrapper.vert_indices.astype('i4').tobytes()
if vert_index_data:
ibo = self.ctx.buffer(vert_index_data)
else:
ibo = None
vert_data = shader_wrapper.vert_data
if shader_wrapper.vert_indices is not None:
vert_data = vert_data[shader_wrapper.vert_indices]
vbo = self.ctx.buffer(vert_data.tobytes())
# Program and vertex array
shader_program, vert_format = self.get_shader_program(shader_wrapper)
vao = self.ctx.vertex_array(
program=shader_program,
content=[(vbo, vert_format, *shader_wrapper.vert_attributes)],
index_buffer=ibo,
)
return {
"vbo": vbo,
"ibo": ibo,
"vao": vao,
"prog": shader_program,
"shader_wrapper": shader_wrapper,
@@ -430,7 +424,7 @@ class Camera(object):
}
def release_render_group(self, render_group: dict[str, Any]) -> None:
for key in ["vbo", "ibo", "vao"]:
for key in ["vbo", "vao"]:
if render_group[key] is not None:
render_group[key].release()