I tried to add my first shader to my game. Its a top down 2D game, and I added a shader that moves my foliage to simulate wind. Its a fairly simple vertex shader, but my world generates a lot of chunks/foliage, and so when i converted my spritebundles to my mesh2d material bundles with the shader when spawning foliage entities, my game is unplayably slow. I imagine its because its running the shader on some 5-10k+ trees that have generated around my world.
What is the appropriate work around for things like this, im very new to shaders. Is there a way to only run shaders for whats on the screen?