Author Topic: simple Lua framework over GeeXLab Lua API  (Read 6461 times)

0 Members and 1 Guest are viewing this topic.

Alex

  • Jr. Member
  • **
  • Posts: 26
    • View Profile
simple Lua framework over GeeXLab Lua API
« 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


JeGX

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1624
    • View Profile
    • Geeks3D.com
Re: simple Lua framework over GeeXLab Lua API
« Reply #1 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   

Alex

  • Jr. Member
  • **
  • Posts: 26
    • View Profile
Re: simple Lua framework over GeeXLab Lua API
« Reply #2 on: October 19, 2017, 08:44:13 PM »
Hi JeGX,

Any news about high level framework ?

Thanks,
Alex

JeGX

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1624
    • View Profile
    • Geeks3D.com
Re: simple Lua framework over GeeXLab Lua API
« Reply #3 on: November 23, 2017, 11:20:17 AM »
I started to code a tiny framework for Lua... I let you know asap  :P

Alex

  • Jr. Member
  • **
  • Posts: 26
    • View Profile
Re: simple Lua framework over GeeXLab Lua API
« Reply #4 on: November 23, 2017, 11:24:18 AM »
Awesome :D

Alex

  • Jr. Member
  • **
  • Posts: 26
    • View Profile
Re: simple Lua framework over GeeXLab Lua API
« Reply #5 on: January 04, 2018, 01:26:27 PM »
Hi JeGX,

Happy new year !

Looking forward to upcoming Lua framework :)


JeGX

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1624
    • View Profile
    • Geeks3D.com
Re: simple Lua framework over GeeXLab Lua API
« Reply #6 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!

Alex

  • Jr. Member
  • **
  • Posts: 26
    • View Profile
Re: simple Lua framework over GeeXLab Lua API
« Reply #7 on: March 22, 2018, 08:24:21 AM »
Hey JeGX,

Any way to sponsor the effort of Lua framework and GeeXLab SDK ?

JeGX

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1624
    • View Profile
    • Geeks3D.com
Re: simple Lua framework over GeeXLab Lua API
« Reply #8 on: March 22, 2018, 10:34:35 AM »
I will upload asap the current version of the micro Lua framework on GeeXLab download page.

Alex

  • Jr. Member
  • **
  • Posts: 26
    • View Profile
Re: simple Lua framework over GeeXLab Lua API
« Reply #9 on: March 22, 2018, 10:35:39 AM »
Awesome :D

JeGX

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1624
    • View Profile
    • Geeks3D.com
Simple Lua framework over GeeXLab Lua API released
« Reply #10 on: March 26, 2018, 02:23:03 PM »
Here is a first version of the simple Lua framework: Download

GeeXLab can be downloaded from this page

The simple Lua framework demo renders the following scene:



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()


Alex

  • Jr. Member
  • **
  • Posts: 26
    • View Profile
Re: simple Lua framework over GeeXLab Lua API
« Reply #11 on: March 26, 2018, 03:35:04 PM »
Hi JeGX,

Awesome news.

Thank you very much.