Author Topic: Missing tangents/normals for shaders?  (Read 15235 times)

kwelts

  • Guest
Missing tangents/normals for shaders?
« on: July 24, 2012, 10:37:12 AM »
Hey there,

So I recently made 3 atlases with custom textures (1 reference one and 2 other regular ones), but when i run my code that gets the reference to change references between the other 2 i get the following error:

"Shader wants tangents, but the mesh Mesh0 for Refractive Atlas doesn't have them"
"Shader wants normals, but the mesh Mesh0 for Refractive Atlas doesn't have them"
"Shader wants tangents, but the mesh Mesh1 for Refractive Atlas doesn't have them"
"Shader wants normals, but the mesh Mesh1 for Refractive Atlas doesn't have them"

I didnt make anything called Mesh0 or Mesh1 and in the Atlases I made, i dont see where I'm using the refractive Atlases.

Any help would be much appreciated.

Malzbier

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 93
    • View Profile
Re: Missing tangents/normals for shaders?
« Reply #1 on: July 24, 2012, 11:10:38 AM »
At your UIBase Panel there is an option for generating normals. (Maybe called "UI Root (2D)")

JRoch

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 140
    • View Profile
Re: Missing tangents/normals for shaders?
« Reply #2 on: July 24, 2012, 11:16:14 AM »
Is the Shader of your atlas "Unlit/Transparent Colored"?

It sounds like your atlas is using a shader that is bump or parallax mapping, which would throw that kind of warning if you don't have a corresponding texture assigned for the bump map or height field texture.

kwelts

  • Guest
Re: Missing tangents/normals for shaders?
« Reply #3 on: July 24, 2012, 01:16:49 PM »
the shader of my atlas is "unlit/transparent colored"

my main panel has the generating normals field unchecked. I checked it to try it out and nothing changed.

the error had a bit more to it, i did not notice this. after the error it says "UnityEditor.DockArea:OnGUI()" if that means anything.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Missing tangents/normals for shaders?
« Reply #4 on: July 24, 2012, 05:10:31 PM »
To make NGUI generate normals, select the UIPanel and check the appropriate checkbox. However if you're getting this warning it means you're not using Unlit/Transparent Colored somewhere, but a different, lit shader. You mentioned refractive earlier -- refractive shader requires normals.

Lypheus

  • Guest
Re: Missing tangents/normals for shaders?
« Reply #5 on: September 11, 2012, 12:32:20 AM »
Same problem here, I found the checkbox, but am unable to check it off: http://screencast.com/t/HBlRBvYr  - am I in the right place here or why would this be unselectable?  If it matters, none of the checkboxes allow for a change of value except "Panel Tool".

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Missing tangents/normals for shaders?
« Reply #6 on: September 11, 2012, 03:35:07 AM »
Are you using Unity 4 beta? There is a bug in it that prevents you from clicking checkboxes.

Lypheus

  • Guest
Re: Missing tangents/normals for shaders?
« Reply #7 on: September 13, 2012, 04:04:21 PM »
That'd be the problem then :). WOW - that's some regression lol!

RogueRocket

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: Missing tangents/normals for shaders?
« Reply #8 on: February 20, 2014, 03:37:14 PM »
Reviving this ancient thread.
So i started coming across this today in unity 4.3.4...
except ONLY after pausing the game.  i have no idea why this makes a difference.
Fine before... not fine after...

looking at the materials, it appears to still be pointing at the unlit shader, though I can't examine the instanced materials created internally by NGUI. 
note i'm still on the older version of NGUI not the major overhaul version.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Missing tangents/normals for shaders?
« Reply #9 on: February 21, 2014, 04:15:25 PM »
There isn't much I can do about older versions of NGUI.

cmataga

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: Missing tangents/normals for shaders?
« Reply #10 on: April 07, 2016, 12:05:18 PM »
Happened to me also and google brought me here.  Turned out to be the inspector.    Oops.