Quantcast
Channel: Answers for "Material doesn't have a texture property '_MainTex'"
Viewing all 23 articles
Browse latest View live

Answer by Andy Korth

$
0
0

It's probably named something else in your shader.. or your shader doesn't have a _MainTex

Check your shader for a line like this:

Properties {
    _MainTex ("Base (RGB)", 2D) = "white" {}
}

Answer by pepefirst

$
0
0
After a crash in Unity I got exactly the same message. Anyone found a fix for this?

Answer by messyfresh

$
0
0
Its all dependent on the shader you are using. I started with OpenGL ES1.1, then changed to OpenGL2.0. After i switched i noticed i was still getting the error. I had to change the graphics emulation properties under the edit menu to OpenGL ES2.0 and now the problem is gone. Im not sure if its a complete fix or not, but i dont get the error anymore. Hope this helps.

Answer by TopTor

$
0
0
check the appropriate include in shader file for example #include "UnityCG.cginc" #include "AngryInclude.cginc" etc

Answer by kurifu

$
0
0
Rebooting my computer usually fixes this error, not sure what causes it but this looks to be a Unity bug (of course this is assuming that you do infact have the _MainTex property defined in your shader as I did). If your computer crashed, you might want to manually delete the Temp folder from your project to make sure nothing is surviving the restart, maybe forcibly reimporting all assets in your project will be enough to fix this too, I have not tried though.

Answer by DuckOfDoom

$
0
0
I know this question is really old but I found a way to diagnose this error. You have to find your shader in project tab, select it and in inspector you will see an error. Then you can click "Open compiled shader" and it can give you clues about where the error is. I often mistype things and this helps me find errors.

Answer by Andy Korth

$
0
0

It's probably named something else in your shader.. or your shader doesn't have a _MainTex

Check your shader for a line like this:

Properties {
    _MainTex ("Base (RGB)", 2D) = "white" {}
}

Answer by pepefirst

$
0
0
After a crash in Unity I got exactly the same message. Anyone found a fix for this?

Answer by messyfresh

$
0
0
Its all dependent on the shader you are using. I started with OpenGL ES1.1, then changed to OpenGL2.0. After i switched i noticed i was still getting the error. I had to change the graphics emulation properties under the edit menu to OpenGL ES2.0 and now the problem is gone. Im not sure if its a complete fix or not, but i dont get the error anymore. Hope this helps.

Answer by TopTor

$
0
0
check the appropriate include in shader file for example #include "UnityCG.cginc" #include "AngryInclude.cginc" etc

Answer by kurifu

$
0
0
Rebooting my computer usually fixes this error, not sure what causes it but this looks to be a Unity bug (of course this is assuming that you do infact have the _MainTex property defined in your shader as I did). If your computer crashed, you might want to manually delete the Temp folder from your project to make sure nothing is surviving the restart, maybe forcibly reimporting all assets in your project will be enough to fix this too, I have not tried though.

Answer by DuckOfDoom

$
0
0
I know this question is really old but I found a way to diagnose this error. You have to find your shader in project tab, select it and in inspector you will see an error. Then you can click "Open compiled shader" and it can give you clues about where the error is. I often mistype things and this helps me find errors.

Answer by hutchison-kim

$
0
0
See this post: https://forum.unity.com/threads/material-doesnt-have-a-texture-property-_maintex.100652/#post-3352921

Answer by Andy Korth

$
0
0

It's probably named something else in your shader.. or your shader doesn't have a _MainTex

Check your shader for a line like this:

Properties {
    _MainTex ("Base (RGB)", 2D) = "white" {}
}

Answer by pepefirst

$
0
0
After a crash in Unity I got exactly the same message. Anyone found a fix for this?

Answer by messyfresh

$
0
0
Its all dependent on the shader you are using. I started with OpenGL ES1.1, then changed to OpenGL2.0. After i switched i noticed i was still getting the error. I had to change the graphics emulation properties under the edit menu to OpenGL ES2.0 and now the problem is gone. Im not sure if its a complete fix or not, but i dont get the error anymore. Hope this helps.

Answer by TopTor

$
0
0
check the appropriate include in shader file for example #include "UnityCG.cginc" #include "AngryInclude.cginc" etc

Answer by kurifu

$
0
0
Rebooting my computer usually fixes this error, not sure what causes it but this looks to be a Unity bug (of course this is assuming that you do infact have the _MainTex property defined in your shader as I did). If your computer crashed, you might want to manually delete the Temp folder from your project to make sure nothing is surviving the restart, maybe forcibly reimporting all assets in your project will be enough to fix this too, I have not tried though.

Answer by DuckOfDoom

$
0
0
I know this question is really old but I found a way to diagnose this error. You have to find your shader in project tab, select it and in inspector you will see an error. Then you can click "Open compiled shader" and it can give you clues about where the error is. I often mistype things and this helps me find errors.

Answer by hutchison-kim

$
0
0
See this post: https://forum.unity.com/threads/material-doesnt-have-a-texture-property-_maintex.100652/#post-3352921
Viewing all 23 articles
Browse latest View live