## Live2D model rendering in LOVE

Show off your games, demos and other (playable) creations.
AuahDark
Prole
Posts: 5
Joined: Mon Oct 23, 2017 2:34 pm
Contact:

### Live2D model rendering in LOVE

It's good to know that I'm the first one who attempt to create this thing.

Click the image to open the video.

I have some reasons why I create this:
• So I can see BanG Dream! character models (now I can see my best girl models ).
• Because no one ever attempt to use Live2D in LOVE.
• For learning purpose on how to write OOP Lua C module (yeah the library is C module).
• Other creations which may come handy in the future.
The source code of the C module is in here: https://github.com/MikuAuahDark/Live2LOVE

Most things is already supported in the module, like proper blending, draw ordering, animation, physics (handled by Live2D and not by love.physics), motion, and face expression.

The principle is basically, let the Live2D Cubism SDK update the models, but don't let Live2D do the rendering. Instead, retrieve the transformed points and supply it to Mesh object. The model texture is also assigned by using Image object then calling Mesh:setTexture. When drawing the model, for each Mesh, it's just simple call to love.graphics.draw supplying the Mesh object and additional parameters for transformation. This gives some advantages:
• You can apply Shader to it.
• You can render it to Canvas as needed.
• The model drawing is affected by love.graphics transformation (which is what most people want).
There are some limitations, like clipping system is not yet implemented (requires stencil, but I want to make this library simple) and some minor graphical glitches. I think it's pretty stable and suits my needs at the moment.

Let me know what do you guys think about this.
Put "AuahDark" as credits, not "Tae Hanazono"

Davidobot
Party member
Posts: 1145
Joined: Sat Mar 31, 2012 5:18 am
Location: Game-Dev. Land
Contact:

### Re: Live2D model rendering in LOVE

Great work! Really neat to see someone add support for this - I was wondering if it was possible to do at all. I've been planning a VN title for some time now and resolved myself to Unity because of the native integration with Live2D.

I'll definitely be making use of this over the summer! Thank you very much for your work.

Quick question - does it support the lip-sync feature?
My library:
LovelyMoon

Check out my current project:
Raycaster

Oh hey, I have a website now!

AuahDark
Prole
Posts: 5
Joined: Mon Oct 23, 2017 2:34 pm
Contact:

### Re: Live2D model rendering in LOVE

For lip sync, I'm sure you just need to modify "PARAM_MOUTH_OPEN_Y" parameter, and this library allows you to do that.

Code: Select all

local Live2LOVEModel = Live2LOVE.loadModel("model_definition.json")
Live2LOVEModel:setParamValue("PARAM_MOUTH_OPEN_Y", lipsyncValue, 0.8)

Put "AuahDark" as credits, not "Tae Hanazono"

zorg
Party member
Posts: 2554
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

### Re: Live2D model rendering in LOVE

basically, someone writes a lightweight wrapper around everything, and it'll be just as usable as any other live2d interface.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

### Who is online

Users browsing this forum: KayleMaster and 40 guests