Should I use a shader or conventional code for displacement?

I need to be able to move vertices up and down on a mesh using a brush (the terrain features without using terrain) and I’m not sure if i should do this in a shader or in c#. To create it, i would get the uv co ordinate of the vertex and find the colour of that on the displacement texture (b/w) and then use the value of it to set the height. That sounds like something you could do in a shader, but i have almost no knowledge of how shaders work and so id prefer to make it in c# :slight_smile:
So would a shader be more efficient to implement this, or should i stick with what i know? can shaders even move vertices?? haha sorry for my ignorance :wink:

Well, I’d go with mesh displacement either way.

Height maps only give an illusion on how something is rendered, so interaction with physics will still be the same as with the ‘flat’ mesh. You could however, give a little extra depth with a displacement shader, for the sake of graphical looks.

Creating such shaders from scratch is indeed not that easy with no knowledge, while replacing vertices and triangles is much much easier.

Take a look here. It’s requires some trial and error to get it to work in the beginning, but IMO, it’s super fun to mess around with.