Skip to content

InstancedMesh challenges #6

@zebranine

Description

@zebranine

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions