Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Oct 23, 2013 at 02:55 AM by meat5000 for the following reason:

The question is answered, right answer was accepted

avatar image
3
Question by Bart 2 · May 12, 2011 at 08:30 PM · shadermaterialedit

Can't edit materials anymore

I did something and now none of the materials in my project can be edited anymore. All I can change in the material inspector is the shader, below that there's just an empty grey area. I have the problem both if I view the material itself in the inspector and if I view a gameobject with that material attached (which brings up a small popup at the bottom of the inspector).

The problem persists for every shader and every material, even the ones in the Standard Assets package. Materials created before the problem do keep the settings I gave them (textures, colors etc.), I just can't edit them anymore. The problem isn't restricted to one scene but to the project: if I switch scenes it persists, but if I switch to a different (older or newer, doesn't matter) project I can suddenly edit materials. This doesn't provide me with a workaround though, as when I import a material from a different project (after first importing the texture assets) it sets its texture settings to the default texture (other settings, like shader, color and shininess, remain though).

I didn't immediately notice the problem, but this is some stuff I did that might have caused it:

I create a material at runtime using this code:

Custom.playerColors[i] = new Material("Shader \"Player Color " + i + "\" {SubShader{Pass{Color(" + playerColors[i].r + " , " + playerColors[i].g + " , " + playerColors[i].b + " , " + playerColors[i].a + ")}}}");

I imported some (projector) shaders from a different project (where materials do work) and I wrote a new one, which also uses the projector matrix and has a fragment program embedded in it (incidentally, it doesn't work yet). Here's the code:

 <blockquote>
   <p>Shader "Projector/Fog of War" {  
 
   Properties {   _Transparency
   ("Transparency", Float) = 0.5  
 
        _FogTex ("Cookie", 2D) = "" { TexGen ObjectLinear }
        _FalloffTex ("FallOff", 2D) = "" { TexGen ObjectLinear }   }  
 
   Subshader {
        Pass {
           ZWrite off
           Fog { Color (1, 1, 1) }       Color (1 , 1 , 1 , [_Transparency])
           ColorMask RGB         Offset -1, -1
         Blend DstColor OneMinusSrcAlpha</p>
 
 </p><pre><code>    CGPROGRAM // Upgrade NOTE: excluded shader from OpenGL ES 2.0
 </code></pre>
   
   <p>because it does not contain a surface
   program or both vertex and fragment
   programs.</p>
   
   <h1>pragma exclude_renderers gles</h1>
 
 <pre><code>    #pragma fragment DrawTexture
 
     sampler2D _FogTex;
     float4x4 _Projector;      float _Transparency;
 
     struct outputWithVariable         {
     float4 color : COLOR;
     float partOfTransp;       };
 
     outputWithVariable DrawTexture (float4 color : COLOR, float4
 </code></pre>
   
   <p>textureCoord : TEXCOORD0)
           {
           float3 projectedTextureCoord = mul (_Projector, textureCoord).xyz;
           projectedTextureCoord.z = - projectedTextureCoord.z;
             float4 fogCoordinate = tex2Dproj (_FogTex,
   projectedTextureCoord);
           fogCoordinate[3] = 1 - fogCoordinate[3];
           outputWithVariable output;
             output.color = 2.0 * fogCoordinate * _Transparency *
   color;  
 
           return output;
           }</p>
 
 </p><pre><code>    ENDCG
 </code></pre>
   
   <p>}   } }</p>
 </blockquote>

I deleted the line of code that creates a new material and all the materials that were created after the problem, plus all the shaders I imported or created. After that I restarted my project, but the problem is still there.

Does anyone know or have an idea about what's going on? And more importantly, how I can fix this? Any help would be greatly appreciated. Thanks in advance!

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Moohasha · Jul 13, 2012 at 12:32 PM 0
Share

So I just noticed this problem too, and I'm guessing it's a new "feature" in the latest version of Unity. I'm curious why they thought that hiding the material properties should be the default without making it obvious how to view them. Very frustrating. Glad there was an easy solution.

avatar image Owen-Reynolds · Apr 11, 2013 at 02:11 AM 0
Share

This normally happens because you were previously Inspecting an object that had a material. Then you clicked shut that bonus copy of the shared $$anonymous$$aterial down below (which is a perfectly normal thing you might want to do.)

Just like when you click BoxCollider shut, it shuts it for all gameObjects; collapsing sets $$anonymous$$aterial shut for all materials. Also perfectly reasonable, for browsing through other gameObjects. But, a side-effect is all $$anonymous$$aterials are now also collapsed when viewed as Assets.

1 Reply

  • Sort: 
avatar image
14
Best Answer

Answer by yoyo · May 12, 2011 at 08:43 PM

Click on the little circular rendering of the material, just to the left of the shader selection drop-down, and it will toggle the display of the material properties.

Comment
Add comment · Show 14 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bart 2 · May 12, 2011 at 08:58 PM 0
Share

Lol, that was simple! Thanks a million!

avatar image yoyo · May 13, 2011 at 12:15 AM 0
Share

don't feel bad ... I spent 20 $$anonymous$$utes of frustrated googling over that one too, just a few weeks ago in fact!

avatar image maikkel · Aug 07, 2011 at 04:27 PM 0
Share

thanks! This saved me from total frustration

avatar image Poemind · Oct 22, 2013 at 10:11 PM 1
Share

Thanks as well. Just happened to me. Frustrating as crap. Why would they do that? I can't really see a good reason. They need to fix that. Or make it more obvious.

avatar image ssatguru · Dec 25, 2013 at 03:46 PM 1
Share

agreed. happened with me too. bad ui

Show more comments

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Material doesn't have a color property '_Color' 4 Answers

How can i get mixed texture from one shader and set it for another object with another shader? 0 Answers

Laser Shader/Material? 0 Answers

How to find and assign Default-Particle material to a renderer 2 Answers

How do i make particles be under the Player? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges