From f946b541dfc56032aa90b3fe146b955668b80ad3 Mon Sep 17 00:00:00 2001 From: Angaros Date: Tue, 19 Nov 2024 09:33:13 +0100 Subject: [PATCH] Translated scene_capture_texture.lua to a python file --- scene_capture_texture.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scene_capture_texture.py b/scene_capture_texture.py index 1d5f084..58425c7 100644 --- a/scene_capture_texture.py +++ b/scene_capture_texture.py @@ -47,19 +47,20 @@ while not hg.ReadKeyboard().Key(hg.K_Escape) and hg.IsWindowOpen(win): dt = hg.TickClock() + #Update Scene and render to the frameBuffer scene.Update(dt) trs = scene.GetNode("engine_master").GetTransform() trs.SetRot(trs.GetRot() + hg.Vec3(0, hg.Deg(15) * hg.time_to_sec_f(dt), 0)) view_id = 0 - view_id = hg.SubmitSceneToPipeline(view_id, scene, hg.IntRect(0, 0, res_x, res_y), True, pipeline, res, frame_buffer.handle) + view_id, pass_id = hg.SubmitSceneToPipeline(view_id, scene, hg.IntRect(0, 0, res_x, res_y), True, pipeline, res, frame_buffer.handle) #Draw a plabe using the texture the scene was rendered to - hg.SetViewPerspective(view_id , 0, 0, res_x, res_y, hg.TranslationMat4(hg.Vec3(0, 0, -1.8))) + hg.SetViewPerspective(view_id, 0, 0, res_x, res_y, hg.TranslationMat4(hg.Vec3(0, 0, -1.8))) - val_uniforms = {hg.MakeUniformSetValue('color', hg.Vec4(1, 1, 1, 1))} - tex_uniforms = {hg.MakeUniformSetTexture('s_tex', tex_color, 0)} + val_uniforms = [hg.MakeUniformSetValue('color', hg.Vec4(1, 1, 1, 1))] + tex_uniforms = [hg.MakeUniformSetTexture('s_tex', tex_color, 0)] hg.DrawModel(view_id, plane_mdl, plane_prg, val_uniforms, tex_uniforms, hg.TransformationMat4(hg.Vec3(0, 0, 0), hg.Vec3(math.pi / 2, 0, math.pi)))