So instead of using uv_AmbientTex try using uv2_AmbientTex to actually get the secondary uv set of your object. I’d be interested to hear if that worked since I am doing some shader stuff myself at the moment.
I allready tried, but i got errors.
I readed at unity answers that i could be a bug in unity.
If some one knoes something about that i liked to hear from it.
I just tried this myself and it seems to work. Given a model which actually has a second uv set that differs from its first set this shader should produce different results when you swap UVs inside the import settings of the model (fbx/obj asset):
I think v4.0.0f7 it was - in editor mode. No build made.
Perhaps you should post a sample project including your model to for instance verify it actually has secondary uvs?
The shader in there does not use the syntax for accessing secondary UVs. Please change lines 22 and 29.
22: float2 uv2_AmbientTex;
29: o.Albedo *= tex2D (_AmbientTex, IN.uv2_AmbientTex) * _BlendAmbient;
The mesh in there is provided in OBJ format. To my knowledge there is no standardized support for secondary UV channels in OBJ files. Solution: use another format like FBX or Collada. Both support multiple UV sets/channels. If you use Blender you may directly use your BLEND file (http://docs.unity3d.com/Documentation/Manual/HOWTO-ImportObjectBlender.html) and see what happens.
You can tell if a given model has kept its second UV set after import to Unity by looking at its mesh. That’s a child object (the one with the grid icon) of the model asset. Clicking on it reveals the information it got (like uv, uv2, verte colors, tri count etc.).
Let me give you another tip: Next time you upload something for use in a forum discussion you may try and reduce the overall filesize somewhat by removing files not needed or by shrinking textures. Also try adding the files directly as an attachment to the discussion. Others might not go the difficult route of registering to a file sharing service. I did with the help of a one-time-email address. Again, others might not want to do this.
Happy new year and ask questions if something’s not clear to you.
thanks for this tip, but the problem was that the standard file includer don’t get this big of a file.
so wanted it to share through mediafire, but i would work. so i did it through 4share.
sorry for that.