- Home /
Is it possible to use a shader to create duplicates of meshes without creating new GameObjects?
I have a complicated mesh geometry that I animate by updating the mesh vertices in C#. I would like to create many duplicates of this mesh in the 3D environment, but generating and animating many meshes in C# takes too much computer resources. I am wondering if it is possible to duplicate a mesh using a vertex shader? Is it possible to duplicate vertices in a shader?
I would like to apply this to two things. One is to create kaleidoscopic 3D worlds (which contain many symmetries), and rendering schools of 3D fish.
Thank you in advance.
Best regards, Ben
Hi, there are new features in Unity 5.6 for Instancing many meshes, as well as generate mesh data by the GPU itself with compute shaders, check the Unity blog post:https://blogs.unity3d.com/2016/12/13/unity-5-6-beta-is-now-available/
Geometry shader might be enough. But if you really just want to render something without having gameObjects/renderers, check the UnityEngine.Graphics class