About optimisation for better performance

Can i make a atlas texture for bushes, grass with a shader and use them as detail mesh on the terrain

OR

use multipe textures and use them as grass texture

i would say the first option would likely be better as it would reduce the number of drawcalls, but that’s only in cases where you can batch the meshes together or use gpu instancing. if you have a lot of lights, it would be less performant as different lights increase draw calls and can’t be batched with other meshes that aren’t affected by the exact same lights. now i assume since this is grass/foliage, so most of it will be lit only by the directional light in the scene and this will be a non-issue. note that batching is more likely to occur and is less finicky on the srps.

i advise you to try out both and see how they perform with your case. if there are a lot of different lights, the atlas can actually be worse in some areas as the shader would have to load in a bigger texture, which would be an unnecessary raise in resolution if it can’t be batched.

2 Likes

Thank you so much for the reply
Actually i am making a mobile forest game (no lights , just directional)
One thing that am worried about is the shader for those bushes/grass !
I will use a simple bending shader

1 Like

luckily, moving vertices in vertex shader is pretty cheap so with atlas you should have fairly cheap foliage.

1 Like

Its never a good idea to use multiple textures vs an atlas…

2 Likes