groverburger / g3d

Simple and easy 3D engine for LÖVE.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Portability question

gingerbeardman opened this issue · comments

Hi,

I'm wondering about whether I can port this to Lua for Playdate SDK.

Before I begin i thought I'd ask for your opinion.

  • How much is this tied to LOVE?
  • How much is this tied to specific Lua features (I see ffi from LuaJIT)?
  • without Shader capability, I'll have to draw the models in software?

Any other thoughts you have would be appreciated.

Thanks!

commented

Hey! Thanks for your interest in porting g3d, that means a lot.

To answer your questions:

  • g3d isn't tied to LOVE too much, but does use LOVE to interface with the GPU by creating meshes and shaders. As meshes and shaders are common graphics concepts, g3d could be relatively easily ported to other APIs.
  • Not much is tied to specific Lua features! The compression method for model objects is the only use of LuaJIT in g3d, and is not necessary. It's mainly just useful for reducing memory usage, but could be completely removed from the codebase easily.
  • Unless you have access to an old-school Fixed-Function Graphics Pipeline, your options are (to my knowledge) using shaders or software. To implement g3d's functionality in software, you would have to deal with multiplying the projection, view, and model matrices together with each vertex in your model, implement polygon clipping, and z-sorting. Clipping is a little tricky, but it's all definitely doable, you just won't be pushing as many polygons in a frame as you would using the GPU of course. The thing to google here is "software rendering".

Hope that helps!

Thanks, it helps. I think that means no go for me at this point (no Shaders). But thanks for your detailed answers!