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

Performance improvement: GPU Instancing #282

Open
christianclavet opened this issue Mar 16, 2019 · 5 comments
Open

Performance improvement: GPU Instancing #282

christianclavet opened this issue Mar 16, 2019 · 5 comments
Labels
type: enhancement [MAJOR] Feature that takes a few weeks up to few months to implement
Milestone

Comments

@christianclavet
Copy link

christianclavet commented Mar 16, 2019

It's called GPU Instancing or Hardware instancing.

Here is a video showing how it can improve performance of rendering more meshes (Unity Example)
https://www.youtube.com/watch?v=fryX28vvHMc

From the video, you can have 100 000 entities on screen with almost no performance degradation, since the mesh buffer reside in the GPU memory and is instanced from there to build the scene.

Here is render stress test using the same technique on UnrealEngine:
https://www.youtube.com/watch?v=GmFYPotzLhc

In almost any scene that need to be realistic there a need to have multiple instance of a model (building structure, props, vegetation), this technique will improve performance a lot and will help creating incredible realistic scenes using the engine.

I asked and it's integrated in some form as low level code in the engine, would be great to have access to this as a high level function and also in the Banshee Editor (copy paste and checkmark?).

@BearishSun BearishSun added the type: enhancement [MAJOR] Feature that takes a few weeks up to few months to implement label Mar 17, 2019
@BearishSun BearishSun added this to the Longterm milestone Mar 17, 2019
@pgruenbacher
Copy link
Contributor

I was thinking of trying to implement it in the ECS renderer module fork I have. have you seen any already-existing implementations out there for a high-level renderer? What i was thinking was just if an entity has a tag on it, then the renderer would find all visible instances with the same mesh and material and perform instancing.

@pgruenbacher
Copy link
Contributor

the real benefit would be to start integrating indirect command buffers too likely... https://bazhenovc.github.io/blog/post/gpu-driven-occlusion-culling-slides-lif/

@BearishSun
Copy link
Member

It's an approach I've been thinking about, doing the rendering almost completely on the GPU. Although dealing with mesh and texture data would be problematic, likely requiring them to be grouped in a large buffer/texture array. Ultimately if using normal instancing, along with low-overhead Vulkan with multiple command buffers, it might be fast enough to do it just on the CPU even for extreme cases, which would be a significantly cleaner approach I believe.

@pgruenbacher
Copy link
Contributor

yea cpu occlusion and instancing is going to be better for most use-cases. Once terrain is done then it would benefit from the indirect command for static trees and landscape assets cause that's really the only use-case where it becomes necessary if you want the massive landscape.

@pgruenbacher
Copy link
Contributor

#364 referencing this issue as it's tied to the instanced skel anim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement [MAJOR] Feature that takes a few weeks up to few months to implement
Projects
None yet
Development

No branches or pull requests

3 participants