will love extend mesh api

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
abyssol
Prole
Posts: 25
Joined: Wed Nov 03, 2021 6:20 am

will love extend mesh api

Post by abyssol »

I am writing a lot of 3D stuff in Love, rely on the little mesh api. I try to keep it lightweight and dirty, to fullfill most 3D workarounds, just like Love itself. It may now be close-source.

I had read some 3d projects based on love, I think I have confidence to implement it well, especially in reducing number of api.

Now what I am doing is writing a .pmx importer, a format is transmitting in MikuMikuDance. I met a difficulty, pmx file only store whole vertices and vertex indices next to vertices. I can use both to create a mesh. But It does not specify which texture to combine with vertices but faces, since Love is a texture per mesh, so I have got to separate vertices according to faces that texture affects, this sounds easy at first, but this part in pmx file is chaos. Maybe I can separate them correct later.

I am noob in programing what i am programing, I will go further in love 3d module and make it complete one day ^^
abyssol
Prole
Posts: 25
Joined: Wed Nov 03, 2021 6:20 am

Re: will love extend mesh api

Post by abyssol »

wow, maybe i can use setTexture and setDrawRange to handle pmx file, instead of separating vertices but I am not sure how is its performance and whether it works. :)

ADD: a simple and crude way as a solution is to copy vertices according to vertex indices (faces) directly to form each mesh, each formed mesh will suit for rendering with desired texture, but this will triple the number of vertices and duplicate the vertex. Looks like just made vertex indices become vertices and then deprecate vertex map. EDIT: And one more thing I think of is, lua table is only reference, So the number of vertices did not grow treble truely, this may be the best solution. :rofl:
Last edited by abyssol on Sun Feb 04, 2024 9:54 pm, edited 2 times in total.
abyssol
Prole
Posts: 25
Joined: Wed Nov 03, 2021 6:20 am

Re: will love extend mesh api

Post by abyssol »

progress report:
An asset system: support load .zip mod
A scene system: each scene can be a file, and it has a main coroutine to run, main coroutine will be reused instead of being garbage when it is done. it is very easy to write something like loading screen, cause we can stop that scene function and skip to next frame everywhere
A loadinfo.txt parser: this is a very powerful file, which can be carried by asset, it tells program how to load the asset, when we got a new asset, just creating a loadinfo.txt in that asset folder, therefore we don't need to change any source code. its syntax can be extended, for example, creating variants of an obj model using different textures instead of modifying and copying the obj file, this syntax is supported.
Model loader: obj, gltf, pmx
About 3D: now only used one world, we can create cameras and views to look at the world.

doing: 3d skeleton for game usage. :)

2/5 Edit: only 3d skeleton is pointless, why not implement Motion Matching in the meantime
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 3 guests