Simple Advice Please

Hi. I’m posting this with the hope that some of you shader - God - like guys would give me a simple advice. I’ve been working on a shader that clips pixels above a clipping plane, pseudo - capping the gaps, etc. Currently it’s done in a surface shader which I find easy to use. Now I have to improve on in, project textures on the gaps( +5% insanity for me), mulltiple slicing, and God knows what else. My question is : Should I carry on with the surface shader or should I break it into vertex and fragment programs and continue in there? I like the surface shader thing, but I feel like you don’t have enough access to stuff. Thanks. PS : I hate the start of a new year so much…

There are two questions important for you:

  • Do you need your shader to work with Unity lights? If yes: you’ll probably have no choice but doing surface shaders.

  • What is it you feel you don’t have access to? In the end you can do almost the same thing as vertex/fragment shaders, since you can use your own lighting and vertex manipulation functions (see Unity - Manual: Writing Surface Shaders). So perhaps the things you want are possible but simply difficult to figure out given the rather brief documentation on surface shaders. If you can layout what it is you’re missing exactly, someone on this forum may be able to help you out.

Thing is I might need to alter some vertex positions.

Check the page I linked before and specifically this line:
vertex:VertexFunction - Custom vertex modification function. See Tree Bark shader for example.

It allows you to write a function that manipulates the vertices. The only problem is if somehow need to manipulate the vertices after projection (or if you need a custom projection that is not matrix based) this is not really possible without massive hacks (which I’ve managed to pull off, but it wasn’t pretty). In that case it’s probably easier to go for the vert/frag solution.

Thanks tomvds:). I’ll stick to surface shader