EvergineTeam / Feedback

Feedback, feature requests, and bug reports for Evergine.
https://evergine.com
14 stars 1 forks source link

GPU Instancing work-around #61

Open JohnMasen opened 3 years ago

JohnMasen commented 3 years ago

GPU instancing is key to my project. however current version does not support it. By dissembling the engine code, I found GPU instancing is already there, but has some bugs. I managed to fix it , but seems WaveEngine 3.1 is not open source , any place I can put my solution?

jcant0n commented 3 years ago

Hello John,

We are going to open source more engine parts this year. But for now, you can create a new github repo and share with us the link in this thread to see your proposal.

Thanks

JohnMasen commented 3 years ago

I uploaded my test project to https://github.com/JohnMasen/WE31_GPUInstancing this project also contains 2 other test cases(compute shader test and item generator test), you can simply ignore them

key points:

  1. clone default shader and modify to support GPU instancing
  2. create corresponding material
  3. create MyInstancingBatchRenderUnit and MyInstancingMeshProcessor which contains bug fix for related class
  4. register MyInstancingMeshProcessor at scene load suggestion: use Span and MemoryMarshal instead of unsafe memory access/copy.