Search Unity

"Shader wants vertex colors" log message

Discussion in 'Shaders' started by NCarter, Mar 6, 2006.

  1. NCarter

    NCarter

    Joined:
    Sep 3, 2005
    Posts:
    686
    I'm getting this error message in the console.log hundreds of times per run of the game in the editor:

    Code (csharp):
    1. Shader wants vertex colors, but the mesh doesn't have them (Filename: MeshRenderer.cpp Line: 430)
    This makes the console.log quite big quite quickly - several megabytes over the course of a day!

    I presume it's something to do with my recent shader experiments. I'm applying the shader to TextMeshes, and I suppose the problem is that TextMeshes don't have vertex colours, as the message says.

    Unfortunately, swapping the shader for something else (like Diffuse) doesn't make the message go away, even if I quit and restart Unity, so I seem to be stuck with it. Is there anything I can do to stop it from doing that?
     
  2. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Maybe you still have the shader attached to another renderer?

    Btw. if you select the log message in Unity's Console, it will draw a connection line to the renderer in the hierarchy view. This way you can easily see which object still uses the shader.
     
  3. NCarter

    NCarter

    Joined:
    Sep 3, 2005
    Posts:
    686
    It's indicating two of the objects with the shader listed in the other thread, but not the other four objects with the same shader. Strangely, sometimes it doesn't complain about it at all, and sometimes it complains a lot.

    Is there something specific about using the shader with TextMeshes that doesn't work? Anything I can do to fix it?
     
  4. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Thats because the warning is emitted when rendering. Thus if the object is not rendered one frame you will not get the message.

    I tried your shader and attaching it to a text mesh doesn't seem to cause any problems.

    Possibly you have attached another shader that requires vertex colors to some renderer in your scene?
     
  5. NCarter

    NCarter

    Joined:
    Sep 3, 2005
    Posts:
    686
    I've figured it out, I think. It looks like the selection wireframe for the TextMesh is emitting the error message, not the shader for the TextMesh itself. If the TextMesh is selected and visible in the editor, the error message appears; if it's either not selected or not visible, it doesn't do it.
     
  6. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Interesting. What shader do you have applied to it? Having the diffuse shader or the shader you put into the wiki on it and then selecting it doesn't give warnings on my machine.
     
  7. NCarter

    NCarter

    Joined:
    Sep 3, 2005
    Posts:
    686
    It's the one that I put on the wiki. This is on a machine with a Radeon 9600 XT.

    Unfortunately, while trying to switch from this project to my scrap testing-things project to try to isolate the problem, my Mac kernel panicked, and now I can't launch Unity. I'll see if I can fix Unity first, then I'll have another look at this problem.