andrey-kozlov Posted January 11, 2021 Share Posted January 11, 2021 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. 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 5 Link to comment
tower120 Posted January 12, 2021 Author Share Posted January 12, 2021 (edited) 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 January 12, 2021 by tower120 Link to comment
andrey-kozlov Posted January 12, 2021 Share Posted January 12, 2021 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
nitrooo Posted January 6, 2023 Share Posted January 6, 2023 Can such custom MeshDynamic be used inside editor or only generated from code during run time? Link to comment
silent Posted January 9, 2023 Share Posted January 9, 2023 Quote Can such custom MeshDynamic be used inside editor or only generated from code during run time? Only if you write a plugin (C++) that will execute this custom logic inside Editor while it's being running. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts