Creating full models using the buffer component

I’d wanna know if i can create a full model with just buffers and data. Is it possible to take data about mesh like vertex color and position, texture coordinates and alike and put that into a buffer to create mesh? If so, how exactly? The docs about the buffer api only shows collors being used in the buffer. The reason why im asking is a bit long, i discussed that in the discord server and is a bit off of what i ve been asking in the forums, but i want to create a level editor just for fun, and id need to have a way to take data generated by the level editor and put it into the game, either by the buffer way or writing to a gltf/glb file. I couldnt find a glb writer in lua, rests to know if the buffer way is possible. I also thought of exposing the api that defold uses to load models, but i aint fooling no one, im not that good of a programmer neither id have the time or effort to do it, since it is a thing just for fun.

Yes, you would use buffers and the mesh component. I know we have examples of it, but I’m not able to dig them up now. Perhaps someone else can share an example?

The buffer works just like a vertex buffer.
Add the stream names and data types that you want in your vertex program, and use them the way you like in your shader.

A small example is found here:

2 Likes