- Home /
Unable to find shaders used for the terrain engine.
This is the full error:
Unable to find shaders used for the terrain engine. Please include Nature/Terrain/Diffuse shader in Graphics settings.
This error is only in the build. This error has only occured to me in Unity 5.0, I also have tried doing as it says: Without no results in the build. How can I fix this?
Are you creating a terrain at runtime via script? It's unusual for the shaders used by any objects placed in the scene to not be included...
I am creating the terrain using Terrain.CreateTerrainGameObject(TerrainData);
Answer by mkturkeri · Mar 29, 2015 at 06:37 PM
Unity 5's terrain shaders are a bit changed. Before Unity 5, it was named as "Diffuse" but now it is "Standard". I believe you automatically created a terrain object and did not alter the materials. If so, the shader will be "Standard". Just in case importing all three shaders in Graphics Settings from the tab called Always Included Shaders for terrain will solve the problem.
Add these to the list;
Nature/Terrain/Standard (Only adding this solved the same problem for me)
Nature/Terrain/Diffuse
Nature/Terrain/Specular
That's it. It should work in build also now.
The problem here I believe, is the Debug Log generated by the build itself. It says "Diffuse", but if you look to the automatically created terrain material in the Editor, it is "Standard". That was true for 4.6, but not 5.0.
I don't know what was happening then... Today after I saw your answer I thought of checking that again and i don't know how it's working properly
Thank you very much for this @mkturkeri. This solved my problem as well.
This is actually the answer to a lot of "Terrain assetBundle missing textures/materials" questions too, I think.
Your answer
Follow this Question
Related Questions
Terrain billboard trees not dropping shadows. 2 Answers
Unlit terrain shader 0 Answers
unity 5 showing meshes through terrain 0 Answers
why cant i paint trees 1 Answer