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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by drak8888 · Nov 21, 2013 at 12:01 AM · shadersdeformation

UV Deformation

I remember a way of deforming the UV of a texture in UDK using a normal map and I was wondering, can we do the same in Unity?

I've been trying to mess around with the shaders but everytime i try to add a multiply or an additive to a texture UV it just tells me to off, saying "*" is not valid there.

In the end, the effect that I'm looking for is distortion of the texture using a normal map and since it was pretty straight forward in UDK, I suppose one of you guys must have done this before!

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 Sparrowfc · Nov 21, 2013 at 02:25 AM 0
Share

Do you mean you want to apply distortion on the normal map or distort the origin texture based on a normal map?

avatar image drak8888 · Nov 21, 2013 at 04:41 PM 0
Share

Distort the origin texture based on a normal map, but I got it working in the end. I'd be curious to see other ways to do it though because my way was pretty much wierd and ungraceful.

1 Reply

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

Answer by drak8888 · Nov 22, 2013 at 05:18 PM

Well I got it working this way :

 IN.uv_MainTex = IN.uv_MainTex + IN.uv_MainTex * (UnpackNormal(tex2D(_BumpMap , IN.uv_BumpMap)/2 + tex2D(_BumpMap2 , IN.uv_BumpMap2)/2)/50);
 fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);

The /50 in the end simply reducing the distortion because it was way too strong.

Maybe its not the best way to do it but it works like a charm, mixing 2 bumps and distorting the texture. All I had to do after was slide both bumps with Javascript and I could make myself some pretty water even in Unity Free.

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

18 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

Related Questions

Buoyancy using shaders 2 Answers

Shaders do not work in build. 0 Answers

How to iterate a Shader Pass? 0 Answers

Best Workflow/Setup for Swapping Shaders based on Build Target 0 Answers

SetMaterial don't works with canvasRenderer 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