question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Export Particle System to EXT_mesh_gpu_instancing

See original GitHub issue

I’m considering an experimental implementation of KHR_instancing (DRAFT), using Blender’s Particle Systems as the source. The glTF extension is not certainly not meant to reproduce the full functionality of a particle system in any particular software (that would be … challenging 😅) but it does provide a very efficient way to have large quantities of the same mesh in a scene, with per-instance transforms and other custom data attached.

Proposal:

  • Export a Particle System emitting a Mesh as a static KHR_instancing batch.
  • Include Custom Data Layers to write custom attributes on the batch (_INDEX, _VALUE) so that shaders in the viewing application can add variance to materials, identify instances, etc.

I have no plan to include animation at this time; baking and efficiently storing the various animation types and simulations that can be applied to Particle Systems is well beyond what I want to attempt right now.

Example (viewer) implementation in three.js:

68440494-19e37480-0180-11ea-8a5e-11a2d71001c5

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:7
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
PirateJCcommented, Jan 22, 2020

Another option, not implemented — Blender has a separate “instancing” mechanism for objects scattered around a scene to reuse mesh or other data. We export those without duplicating the geometry already (great!) although it could be even more efficient with KHR_instancing. However, KHR_instancing would lose these objects’ positions in the scene graph. I think that type of opinionated optimization might be more appropriate for a post-export optimization tool, like gltfpack or glTF-Pipeline.

I’d love to add my vote for this. Blender’s Object Scatter add-on allows for a very artist friendly workflow for instancing objects while being able to easily “paint” the instances where you’d like them to go. It would be amazing if the gltf exporter could read that scatter data (duplicators) and do the necessary conversions to gltf.

Thanks for all the work on this!

0reactions
takahiroxcommented, Nov 7, 2022

FYI: I wrote an addon that allows to export instanced geometries created with Geometry Nodes, not particle systems, as glTF with EXT_mesh_gpu_instancing extension.

https://github.com/takahirox/glTF-Blender-IO-EXT-mesh-gpu-instancing

It’s still an early prototype and I’m not sure if this is the best approach, and I’m not sure how the extension should be imported yet tho.

https://github.com/takahirox/glTF-Blender-IO-EXT-mesh-gpu-instancing/issues/2

Read more comments on GitHub >

github_iconTop Results From Across the Web

Particle System GPU Instancing - Unity - Manual
GPU instancing offers a large performance boost compared with CPU rendering. You can use it if you want your particle systemA component that...
Read more >
Clarifying how Particle systems use Instancing and Dynamic ...
My first experiment was to just have one mesh-based particle system in my scene, with instancing for it disabled and dynamic batching ...
Read more >
Renderer module - Unity User Manual 2021.3 (LTS)
Enable GPU Instancing, Control whether the Particle System will be rendered using GPU Instancing. Requires using the Mesh Render Mode, ...
Read more >
Manual: GPU instancing - Unity
Use GPU Instancing to draw (or render) multiple copies of the same Mesh at once, using a small number of draw calls. It...
Read more >
Create a Mesh Particle Effect in Niagara
Next, you will edit the modules in the Particle Spawn group. These are behaviors that apply to particles when they first spawn. In...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found