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 /
  • Help Room /
avatar image
1
Question by Nosmo · Aug 27, 2015 at 04:15 PM · materialobjectassetmaterial color

How can i stop the stretch effect of a material when i add it to an object and then resize it

When i add a material to an object and then resize the object, the material stretches and goes all fuzzy. How can i stop this?

Is there a way to tile it?

Comment
Add comment · Show 3
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 Owen-Reynolds · Aug 27, 2015 at 04:48 PM 1
Share

$$anonymous$$oved this to the Help Room (since it's a common Q, been asked and answered a lot. But maybe you don't know the technical terms to search for how $$anonymous$$aterials work, or where to find them.)

avatar image Nosmo · Aug 27, 2015 at 11:14 PM 0
Share

i just did a search for materials and nothing came up

avatar image Chom1czek · Oct 09, 2015 at 10:55 PM 0
Share

I would also like to know how to do it. On terrains material behaves normally but when I put it on the plane for example and then resize it (scaling) then it's stretching but I want it to get "repeated".

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Owen-Reynolds · Oct 09, 2015 at 11:37 PM

Unity borrows the idea of Materials and UVs, tiling ... all of it from standard 3D modeling. Unity borrows a lot of things from a a lot of places, which is a good thing.

The best way to understand why textures stretch, an so on, is to learn about the normal, non-Unity, way that Textures are applied, what tiling means, how UV mapping works ... . Do searches without the word Unity in them. Things that are about 3dsMax or blender (3D modeling programs) might be good, but look for an explanation, not exact settings.

Then all of this will make sense, including why the rule is for textures to stretch. Sure, you can find a line or two that will solve one exact particular problem. But if you plan to do this for real, it's better to do the reading. Then you'll also have a skill that applies to any sort of 3D computer stuff, and be able to solve all sorts of Unity texture problems.

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 Chom1czek · Oct 09, 2015 at 11:55 PM 0
Share

I understand that I should understand it on a lower level to be prepared for unco$$anonymous$$g obstacles but to be honest, I'm beginner, I've just started my journey with Unity and I'm trying to learn as much as possible and there is a lot of stuff to go through. I'm trying to do a lot of research if I don't understand something enough but sometimes I cannot do it with everything and I think that's one of the things right now, but I'm going to back to it probably soon if I need it again. I'm just glad that I sorted this thing up with just 2 lines of code and I can get back to work :) Cheers!

avatar image
0

Answer by Statement · Oct 09, 2015 at 11:08 PM

When you scale a model, UV mapping stays the same. In the case of simple models such as quads, planes and boxes, sometimes it could be useful to use procedural UV generation, such as planar texture mapping which uses world coordinates to generate UV coordinates. The answer then would be to use a shader (i.e. find, buy or write it) which supports planar texture mapping.

Triplanar texture mapping can also be used to automatically texture an object on all three axis and is often used with voxel terrain. These shaders can be used on all kinds of geometry while planar mapping will look fine if it's flat but will look stretched if vertices start pointing along the axis it's projecting from.

It can also be called texture projection or uv projection.

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 Chom1czek · Oct 09, 2015 at 11:15 PM 1
Share

Hi, thank you for your effort but I don't understand what you just said to be honest. However I went deeper to check what I wanted and I found solution which works as I wanted which is:

         Renderer render = GetComponent<Renderer>();
         render.material.mainTextureScale = new Vector2(x, x);

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Ever seen blurry textures like this? 0 Answers

Can I use MaterialPropertyBlock to set properties per material instead of per renderer? 0 Answers

Transperancy gives a reverse normal effect? 0 Answers

Change partial material color based on overlap (collision) 0 Answers

Changing color on specific tile in texture at runtime 0 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