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 /
avatar image
0
Question by Girish-sruthkia · May 19, 2015 at 10:17 AM · modeluv coordinates

How to use 2nd uv set for base texture

Hi friends, I have a racing track which i'm using for one different lighting condition, and now i want to use the same scene for another lighting condition, so i can assign different material which uses second uv set for diffuse channel. If i make swap uvs option enabled in fbx then the uvs will be change for the first track also. So is there any other way to use 2n uvset for a model without changing in fbx settings??

Comment
Add comment · Show 4
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 jamesflowerdew · May 19, 2015 at 10:48 AM 0
Share

you probably need to use a new mesh or shader/material. a new shader could be very sticky, as hidden unity effects are applied etc and you may need to rebuild these, so easier to copy your mesh and swap uv1 to uv2 there. mesh building is surprisingly fast so you could do this runtime if filesize is an issue.

avatar image Girish-sruthkia · May 19, 2015 at 01:10 PM 0
Share

Hi thnx for ur reply, I can save the scene as another one, but i want to use only one fbx. I read that there is some possibility with shader which uses only the second UV set for diffuse channel. Is it possible to get that with shader?? The reason why i am asking without changing the fbx is, i wanted my level design not to be changed.

avatar image jamesflowerdew · May 21, 2015 at 11:22 AM 0
Share

Hi Girish, here is a shader that uses the other uv set.

I hope it helps.

     Properties {
         _Color ("Color", Color) = (1,1,1,1)
         _$$anonymous$$ainTex ("Albedo (RGB)", 2D) = "white" {}
         _Glossiness ("Smoothness", Range(0,1)) = 0.5
         _$$anonymous$$etallic ("$$anonymous$$etallic", Range(0,1)) = 0.0
     }
     SubShader {
         Tags { "RenderType"="Opaque" }
         LOD 200
         Cull Back
         CGPROGRA$$anonymous$$
         // Physically based Standard lighting model, and enable shadows on all light types
         #pragma surface surf Standard fullforwardshadows
         // Use shader model 3.0 target, to get nicer looking lighting
         #pragma target 3.0
 
         sampler2D _$$anonymous$$ainTex;
         //float4 _$$anonymous$$ainTex_ST;
         half _Glossiness;
         half _$$anonymous$$etallic;
         fixed4 _Color;
         struct Input {
               float2 uv_$$anonymous$$ainTex;
               float2 uv2_$$anonymous$$ainTex;
         };
     
         
         
 
         void surf (Input IN, inout SurfaceOutputStandard o) {
             // Albedo comes from a texture tinted by color
             fixed4 c = tex2D (_$$anonymous$$ainTex, IN.uv2_$$anonymous$$ainTex) * _Color;
             o.Albedo = c.rgb;
             // $$anonymous$$etallic and smoothness come from slider variables
             o.$$anonymous$$etallic = _$$anonymous$$etallic;
             o.Smoothness = _Glossiness;
             clip(c.a);
             o.Alpha = c.a;
         }
         ENDCG
     } 
 }


I don't know whether I reccomend this, particularly if you're new to shaders, but good luck.

avatar image Girish-sruthkia · May 30, 2015 at 09:06 AM 0
Share

Thnx james, will try that....

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

MMD How to export model and animations to Unity as 3rd person controller? 2 Answers

My toon shader seems to make a black hole. 0 Answers

Difference between Legacy, Humanoid and Generic model 2 Answers

Vectorworks model FBX export issue 0 Answers

Using models from installed games 3 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