Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InstancedMesh challenges #6

Open
zebranine opened this issue Nov 29, 2024 · 0 comments
Open

InstancedMesh challenges #6

zebranine opened this issue Nov 29, 2024 · 0 comments

Comments

@zebranine
Copy link

Thanks for this very nice library.

In my experimentation I have been unable to make InstancedMesh work. I could not find an example. I am using LÖVE 11.5 on Windows.

Working with the code in instanced_mesh.lua I ran into issues with love.graphics.newMesh() vertexformat/attributes (perhaps related to LÖVE versioning?).

For example, I have modified:

local default_format = {
      {name = "instance_position", format = "floatvec3"},
}

to:

local default_format = {
	{ "instance_position", "float", 3},
}

..and for testing, modified attribute management with hard coded values accordingly, such as:

self.lg_mesh:attachAttribute("instance_position", self.instanced_mesh_buffer, "perinstance")
...
self.lg_mesh:detachAttribute("instance_position")

There may be remaining steps I omitted with shader value updates for the instanced draw, I haven't got there. I am applying the shader:

menori.ShaderUtils.shaders['instanced_mesh']

A usage example would be much appreciated.

Thanks again for the work put into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant