Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 gibber10 · Jun 08, 2017 at 03:50 PM · shadersuvsuv coordinates

Unknown input semantics TEXCOORD/4

I've set

 #pragma target 3.0

in the shader, but I cant get TEXCOORD4 to work. I get the following error when I add it to my shader. Its commented out in the code below, with or without doesn't work. Is TEXCOORD4 allowed as an input? Its happy with it in just the v2f struct.

 Shader error in 'Custom/TileRenderer': Vertex program 'vert': unknown input semantics TEXCOORD/4

What am I doing wrong?

 Shader "Custom/TileRenderer" {
 Properties {
     _MainTex ("Base (RGB)", 2D) = "white" {}
     _AlphaTex("Trans (A)", 2D) = "white" {}
     _OverlayTex("Trans (A)", 2D) = "white" {}
 }
 
 SubShader {
     Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
     LOD 100
     
     ZWrite Off
     Blend SrcAlpha OneMinusSrcAlpha 
     
     Pass {  
         CGPROGRAM
             #pragma vertex vert
             #pragma fragment frag
             //#pragma target 3.0
             //#pragma multi_compile_fog
             #pragma debug
             
             #include "UnityCG.cginc"
 
             struct appdata_t {
                 float4 vertex : POSITION;
                 float2 texcoord : TEXCOORD0;
                 float2 texcoord1 : TEXCOORD1;
                 float2 texcoord2 : TEXCOORD2;
                 float2 texcoord3 : TEXCOORD3;
 
                 //as soon as I add TEXCOORD4 in the appdata_t struct
                 //I get the shader compile error
                 float2 texcoord4 : TEXCOORD4;
 
                 //UNITY_VERTEX_INPUT_INSTANCE_ID
             };
             
             struct v2f {
                 float4 vertex : SV_POSITION;
                 float2 texcoord : TEXCOORD0;
                 float2 texcoord1 : TEXCOORD1;
                 float2 texcoord2 : TEXCOORD2;
                 float2 texcoord3 : TEXCOORD3;
                 float2 texcoord4 : TEXCOORD4;
             };



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 wwcolter · Feb 21, 2018 at 10:57 PM 0
Share

@gibber10 Were you able to figure this out? We’re seeing something similar.

avatar image gibber10 wwcolter · Feb 22, 2018 at 10:33 AM 0
Share

No I didn't. I didn't even figure out if this its supposed to work. I know that unity meshes only have up to 4 sets of UVs so I figured it might just not support passing more than 4 to the shader.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by VLukianenko · Mar 20, 2018 at 07:57 AM

As this is a top result when googling this issue, I'm answering this old question.

You can output more than 4 texcoords from your vertex function, but input can have not more than 4. I suspect (haven't tested this) that it may also depend on if the model provides information for more than 4 texture coordinates, as IIRC you can export up to 9 uv sets, but that's an assumption.

If you need different modified versions of your UV coordinates, you can input them as a single uv set (TEXCOORD) and output to different variables the modified versions, and pass them to fragment shader. This probably will cease the need for so many input TEXCOORDs.

Hope this will help someone!

Comment
Add comment · 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

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

71 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

A Shader to Duplicate and Flip a texture 0 Answers

UV Coordinates 1 Answer

uv's different in editor from on device 0 Answers

Unity Materials and UV coordinate help 3 Answers

Rotating "layer" on a logo 1 Answer


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