Add multiple surface functionality for meshes in Footstep System #70
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pinging @ac-arcana here for a look, as well as @Bezoika
This is my attempt at implementing handling multiple surfaces. I don't currently have a way implemented to handle multiple MeshInstance3D children, so just go for the first one.
However, with a MeshInstance3D that has an ArrayMesh or multiple surfaces, it should work. I've tested this with as many cases I can think of, but I'm doubtless missing some.
This will try very hard to validate that there's more than one surface material needing to be thought about, and if so:
This is far from perfect in implementation, but it's surprisingly performant on my machine, curious to know how it works for others. I did a similar stress test to that video Bezoika posted of a heavily subdivided plane with two surfaces, and got an occasional stutter but really didn't feel much other than that.
There's a whole bunch of ways I could imagine optimizing it, but again, want to know how it works for others before spending the time optimizing.
This would fix #65