Unable to convert mobile diffuse to vertex / fragment shader.

Has someone achieved to replicate the exact same behaviour of the mobile diffuse in a vertex / fragment shader?

  • Diffuse lighting
  • Lightmapping
  • Shadow casting
  • Shadow recieving
  • Shadowmasking

The reason i want the vertex fragment shader version is cause i want to use the “nointerpolation” keyword wich seems to not be possible in a surface shader.

Make your surface shader, select it in project view, click on Show generated code, add nointerpolation to the values you want it on, copy that generated vertex fragment shader over your surface shader.

1 Like

Woah, i would have never though about that.

Thanks Sir!

Generated shaders are quite ugly, but it’s an easy way to get to implementing more specialized shaders if you’re not familiar with Unity’s internals.