Hi all, I'd like to override the terrain shader from script.. Any idea how this can be done ? I've seen some terrain projects but they seem to hack unity instead of setting the shader properly Also I don't want to use the terrain "as a terrain", it's more about using the LOD tesselation feature of the terrain and use it for "something else" Let me know if I'm totally wrong Cheers oX
you can't override it from script. you can decide if you want to replace it or not, and that will happen globally. There is no material on terrains where you can access a shader or alike. you do this overriding by creaing a new shader that does what the old does and give it the same identification name. there is a thread on the showcase board with an enhanced terrain shader with normal mapping to show that.
It is also possible to use custom shaders for the terrain using Replacement Shaders with a sensible camera culling mask.
Hi , I'm struggling with the same problem of how to override and modify the shader of a terrain. How can we know what is the identification name of the terrain . I'll also appreciate if you can give me a link on the thread you mentioned . thanks very much
Get the source of built-in shaders for unity . And then find the Terrain shader and modify it , put it in your project.