From b6553db09e0b425e1fcbac76bcae82996c4d3fda Mon Sep 17 00:00:00 2001 From: Roz K Date: Fri, 30 Dec 2022 14:58:40 +0100 Subject: [PATCH] Bump engine submodule and update timings. --- engine | 2 +- game/batch.py | 4 ++-- game/game.py | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/engine b/engine index 628f8bc..3b21e16 160000 --- a/engine +++ b/engine @@ -1 +1 @@ -Subproject commit 628f8bcaa4eb3c4da5a534b55d58218b894b9822 +Subproject commit 3b21e1610a687edcd91d5fe1c05823c2834928db diff --git a/game/batch.py b/game/batch.py index 10afa3d..9912c55 100644 --- a/game/batch.py +++ b/game/batch.py @@ -21,12 +21,12 @@ from engine import (vec3, mat3, buffer, class Batch: __slots__ = '_batch', 'size', 'max_size', 'flags', 'meshes', 'params', '_params', '__dict__' - def __init__(self, vertices, max_size, **params_decls): + def __init__(self, vertices, max_size, max_meshes, **params_decls): assert max_size <= BATCH_MAX_SIZE nparams = len(params_decls) names = params_decls.keys() formats = params_decls.values() - self._batch = create_batch(vertices, max_size, params_format(*formats)) + self._batch = create_batch(vertices, max_size, max_meshes, params_format(*formats)) self.size = 0 self.max_size = max_size self.flags = buffer(c_ubyte, max_size) diff --git a/game/game.py b/game/game.py index 540174e..ad2e99b 100644 --- a/game/game.py +++ b/game/game.py @@ -84,7 +84,7 @@ def main(): rock_model = archive.get_model('rock') mud_model = archive.get_model('mud') lava_model = archive.get_model('lava') - terrain_batch = Batch(tiles_vertices, generated.size ** 2, translation = PARAM_FORMAT_VEC3_SHORT) + terrain_batch = Batch(tiles_vertices, generated.size ** 2, 8, translation = PARAM_FORMAT_VEC3_SHORT) #TODO: generator & for real vc = generated.volcano_c @@ -123,7 +123,7 @@ def main(): blob_model = archive.get_model('blob') cube_model = archive.get_model('cube') clouds_model = archive.get_model('clouds') - tests_batch = Batch(tests_vertices, 3, + tests_batch = Batch(tests_vertices, 3, 3, translation = PARAM_FORMAT_VEC3_FLOAT, orientation = PARAM_FORMAT_MAT3_INT10 | PARAM_FORMAT_NORMALIZE) blob_spawn_translation = vec3(-100.0, -500.0, 0.0) @@ -269,13 +269,13 @@ def main(): # for _ in range(10000): # current_time = 0 # time.monotonic() - start_time - # Draw * 9999 : min = 0.14 , max = 0.86 , avg = 0.2 ms - # Draw * 9999 : min = 0.14 , max = 0.93 , avg = 0.2 ms - # Draw * 9999 : min = 0.14 , max = 0.77 , avg = 0.2 ms + # Draw * 9999 : min = 0.13 , max = 0.86 , avg = 0.2 ms + # Draw * 9999 : min = 0.14 , max = 0.75 , avg = 0.2 ms + # Draw * 9999 : min = 0.14 , max = 0.84 , avg = 0.2 ms - # Frame * 9999 : min = 0.20 , max = 0.95 , avg = 0.34 ms - # Frame * 9999 : min = 0.21 , max = 1.03 , avg = 0.34 ms - # Frame * 9999 : min = 0.21 , max = 1.09 , avg = 0.34 ms + # Frame * 9999 : min = 0.19 , max = 0.98 , avg = 0.34 ms + # Frame * 9999 : min = 0.21 , max = 0.94 , avg = 0.34 ms + # Frame * 9999 : min = 0.21 , max = 1.0 , avg = 0.34 ms print("Quitting...") del tests_batch