By performing the lighting calculations in the vertex or fragment shader.
The question is about a rather large topic, so I decided to limit my answer to the core question: “What is the difference between Surface shaders and regular Vertex and Fragment shaders?”
Answer: Surface Shaders handle lighting for you.
and to take this advice further, by looking through all the CGIncludes from the built-in shader source, tracking how it integrates into the shader source you’ve posted and by adding ‘pragma debug’ to the shader then looking at the compiled shader source (in Unity select the shader, then click ‘open compiled source’ in the inspector.
I’m having some difficulty understanding your post and what you want. If you get the impression I misunderstood you, you could try to ask someone to help you translate the post from your native language to English.
If you want to apply the changes suggested by shiva.js, you can do that without converting from surface to vertex+fragment shader. You can indicate that a function should be called at the start of the vertex shader (called vertex modification function in the documentation), by adding “vertex: functionName” to the #pragma that mentions the surface shader
For example:
There’s an example in the Built-in Tree Bark shader.
If this is confusing, I recommend taking time to learn Cg and shader programming in Unity. If you want someone else to do the work for you, you can wait and hope someone is kind enough to put the time and effort in, or hire someone.
Sorry for my bad english I understand the reading of English, but I’m not good at applying…
I’ll try to be more specific with my situation:
I downloaded the “Unity Built-in Shaders” to take a look, and applied the code sent by @shiva.js.
I attached the code to each object on the scene, but the terrain uses “Nature/Terrain/Diffuse” shader and I need adapt code for this shader…
I made some changes in the code, and now I have this: