Jump to content

Instanced Animation


photo

Recommended Posts

Hello everybody,

If you're fine with programming then I suppose MeshDynamic is currentlty a way to go as a low level rendering abstraction. It is flexible enough to allow instanced rendering with all the custom buffers you want to bind. Also ObjectExtern can help with binding to the engine material system.

I've attached a small sample. Here 10 cubes are rendered with one instanced draw call via custom material. Colors are passed through the structured buffer, transforms are passed through the constant buffer. I hope you'll find it useful.

image.png

Probably you will want to copy-paste and modify mesh_base rather than to create a material from scratch to have all the goodies. Also properties may be useful to collect per instance data because the material system currently can't provide such functionality.
 

instancing.zip

  • Like 5
Link to comment

Thanks, this is exactly what we needed!

 

15 hours ago, andrey-kozlov said:

If you're fine with programming then I suppose MeshDynamic is currentlty a way to go as a low level rendering abstraction.

Is there overhead for MeshDynamic in compare to MeshStatic?

 

15 hours ago, andrey-kozlov said:

Probably you will want to copy-paste and modify mesh_base rather than to create a material from scratch to have all the goodies

I guess, for now, this is true almost for any custom material ...

 

15 hours ago, andrey-kozlov said:

Also properties may be useful to collect per instance data because the material system currently can't provide such functionality.

What "properties" are?

Edited by tower120
Link to comment

 

Quote

Is there overhead for MeshDynamic in compare to MeshStatic?

No overhead. Dynamic refers here to flexible vertex layout in comparison to predifened one of MeshStatic. But use immutable flag whenever it's possible

Quote

What "properties" are?

https://developer.unigine.com/en/docs/2.13/principles/properties/?rlang=cpp

If you want to do some editor integration then properties can be useful as they have auto generated UI

Link to comment
  • 1 year later...
×
×
  • Create New...