Geeks3D Forums

GeeXLab => GeeXLab - english forum => Topic started by: Alex on September 30, 2017, 11:55:55 AM

Title: simple Lua framework over GeeXLab Lua API
Post by: Alex on September 30, 2017, 11:55:55 AM
Hi JeGX,

Can you share plans for high-level Lua framework over GeeXLab Lua API?

I am hoping to use new GeeXLab in similar way old GeeXLab was envisioned.

Kind regards,
Alex
Title: Re: simple Lua framework over GeeXLab Lua API
Post by: JeGX on September 30, 2017, 06:28:00 PM
Yes I will try to code a skeleton of a high level framework as soon as possible....  :P   
Title: Re: simple Lua framework over GeeXLab Lua API
Post by: Alex on October 19, 2017, 08:44:13 PM
Hi JeGX,

Any news about high level framework ?

Thanks,
Alex
Title: Re: simple Lua framework over GeeXLab Lua API
Post by: JeGX on November 23, 2017, 11:20:17 AM
I started to code a tiny framework for Lua... I let you know asap  :P
Title: Re: simple Lua framework over GeeXLab Lua API
Post by: Alex on November 23, 2017, 11:24:18 AM
Awesome :D
Title: Re: simple Lua framework over GeeXLab Lua API
Post by: Alex on January 04, 2018, 01:26:27 PM
Hi JeGX,

Happy new year !

Looking forward to upcoming Lua framework :)

Title: Re: simple Lua framework over GeeXLab Lua API
Post by: JeGX on January 06, 2018, 07:33:26 PM
Sorry for the delay, I've worked on the new version of GeeXLab and as usual it took lot of time. I will add the small framework in the code sample...
And happy new year too!
Title: Re: simple Lua framework over GeeXLab Lua API
Post by: Alex on March 22, 2018, 08:24:21 AM
Hey JeGX,

Any way to sponsor the effort of Lua framework and GeeXLab SDK ?
Title: Re: simple Lua framework over GeeXLab Lua API
Post by: JeGX on March 22, 2018, 10:34:35 AM
I will upload asap the current version of the micro Lua framework on GeeXLab download page.
Title: Re: simple Lua framework over GeeXLab Lua API
Post by: Alex on March 22, 2018, 10:35:39 AM
Awesome :D
Title: Simple Lua framework over GeeXLab Lua API released
Post by: JeGX on March 26, 2018, 02:23:03 PM
Here is a first version of the simple Lua framework: Download (http://www.geeks3d.com/r/50017)

GeeXLab can be downloaded from this page (http://www.geeks3d.com/geexlab/downloads/)

The simple Lua framework demo renders the following scene:

(http://www.geeks3d.com/public/jegx/2018q1/geexlab-simple-lua-framework-demo.jpg)

The framework is rather minimal and does only simple things. But it can be used as a base for a more advanced framework.

The principle of this framework is the following: you create objects in the INIT scripts and you render the scene in the FRAME script by calling hlf_render_frame(). It's a kind of retained mode. All 3d code (binding textures + gpu programs and objects rendering) is hidden in hlf_render_frame().


INIT script:
Code: [Select]
local demo_dir = gh_utils.get_demo_dir()
dofile(demo_dir .. "hlf.lua")


hlf_init()

local phong_prog = hlf_get_gpu_program_phong()
local phong_tex_prog = hlf_get_gpu_program_phong_texture()

torus = hlf_add_mesh_torus(10, 2, 20)
hlf_item_set_gpu_program(torus, phong_prog)
hlf_item_set_auto_spin(torus, 1, 11.0, 13.0, 17.0)


torus2 = hlf_add_mesh_torus(15, 2, 20)
hlf_item_set_gpu_program(torus2, phong_tex_prog)
hlf_item_set_auto_spin(torus2, 1, -11.0, -13.0, -17.0)


local t = hlf_load_texture(demo_dir .. "data/10857.jpg", "rgba_u8")
local texture_unit = hlf_item_add_texture(torus2, t)
hlf_item_set_uv_tiling(torus2, 8.0, 2.0, texture_unit)


hlf_stext_rgba(20, 20, 1.0, 1.0, 0.0, 1.0, "Simple Lua Framework")

frames = 0 -- frame counter



FRAME script:
Code: [Select]
hlf_set_background_color(0.2, 0.2, 0.2, 1.0)


hlf_dtext(20, 40, "- frames: " .. frames)
frames = frames + 1


hlf_render_frame()



SIZE script:
Code: [Select]
hlf_resize()


TERMINATE script:
Code: [Select]
hlf_terminate()

Title: Re: simple Lua framework over GeeXLab Lua API
Post by: Alex on March 26, 2018, 03:35:04 PM
Hi JeGX,

Awesome news.

Thank you very much.
Title: Re: simple Lua framework over GeeXLab Lua API
Post by: leon on November 15, 2018, 09:42:22 AM
Hey Thanks for this, this makes application-code soooo small and readable ♥♥♥
Great startingpoint!