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 cod · Aug 16, 2012 at 08:29 AM · shadershaderlabcguvs

How can I access Texcoords x and y?

So, If I write this it's all right

 IN.uv_Splat0

but if I write

 float2(IN.uv_Splat0.x, IN.uv_Splat0.y)

it doesn't work properly

Is there a way to access and modify uv's x and y in a shader?

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 ScroodgeM · Aug 16, 2012 at 08:30 AM 0
Share

in which case doesn't it work properly? in which context do you use it?

avatar image cod · Aug 16, 2012 at 08:46 AM 0
Share

when I set up a texture using tex2D(_Splat, float2(IN.uv_Splat0.x, IN.uv_Splat0.y))

because I need to modify x and y value of the uv_Splat0

avatar image ScroodgeM · Aug 16, 2012 at 09:13 AM 0
Share

just to be sure:

tex2D(_Splat, IN.uv_Splat0);

works O$$anonymous$$, but

tex2D(_Splat, float2(IN.uv_Splat0.x, IN.uv_Splat0.y));

doesn't work in the same place? what happened then? and is it correct to use _Splat texture with _Splat0 mapping?

avatar image cod · Aug 16, 2012 at 10:03 AM 0
Share

well, the point is that I have a texture atlas for my terrain textures and I unpack them this way

float2((frac(IN.uv_Splat0.x)*-0.5), (frac(IN.uv_Splat0.y)*0.5))

but if I need to tile them 7 times less in the normal shader I would write

IN.uv_Splat0/7

but if I write so

float2((frac(IN.uv_Splat0.x)*-0.5), (frac(IN.uv_Splat0.y)*0.5))/7

it just shows me 1/7 of the texture

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by ScroodgeM · Aug 16, 2012 at 11:40 AM

float2((frac(IN.uv_Splat0.x/7)*-0.5), (frac(IN.uv_Splat0.y/7)*0.5))
Comment
Add comment · Show 1 · 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
avatar image cod · Aug 16, 2012 at 12:34 PM 0
Share

already solved, it's a multiplication between matrix

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

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Pass ShaderLab properties to Standard cginc 2 Answers

Shader compiler: internal error compiling shader snippet type=0 platform=0: 1 Answer

Linearising the inversion of camera depth effect 1 Answer

SurfaceOutput.viewDir not the same in deferred 1 Answer

Shardelab/CG shaders not working on iOS 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