From time to time when writing shaders with CG language in it I get normal errors like syntax errors or some others that everyone makes during normal coding, but sometimes Unity stops recompiling my shaders and keeps a older version compiled ("Open Compiled Shader" option) and does not recompile it until I erase completely the shader and the material assigned and create it from zero with the same shader code.
Is there a way to force a recompilation of the shader? Maybe erasing something in the Assets folder or any other place?
Answer by Aras
Jun 30, 2010 at 06:08 AM
Does right clicking on the shader and doing "Reimport" help?
Answer by Kelvin 2
Jul 10, 2010 at 06:00 PM
Right click the file and Select "Reimport", this is the solution provided by the Unity team.
Answer by andeeee
Feb 09, 2010 at 05:00 PM
Does this happen when you open the file from the text editor's recent items menu, or when you open the file from the desktop? Unity doesn't always track files if they weren't opened from within Unity. Try closing open shader files and reopening them from Unity.
I did opened them from Unity, the only thing that does the trick according to the Unity team themselves is to right click the shader file in Unity and "Reimport" them.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
No one has followed this question yet.
shader cg blending two textures
How can I make my own shader include file (.cginc or .glslinc)?
Surface Shader - Light Probes
Shader - Object Depth
Cg and "for" statements, what's the deal?