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 Snorky · Jun 08, 2011 at 05:17 AM · texturecolortilingedge

Ugly edges with multiple image parts in one texture

Hi, I am new to Unity and 3d itself and just playing around with some basics. But now I have a question about of a strange color problem and how to use textures properly. In my scene are only brown cubes, but looking from a special distance and angle the cubes get a green discoloration and I don't know why or how to fix this. I uploaded a picture to show what I mean (and the unity test project):
discolorated cube
This big cube consists of many small cubes which are instantiated prefabs via a script. The prefab cube has a "dirt" material assigned with a standard diffuse shader and a texture imported with aniso level 1, bilinear filter mode and repeat wrap mode. The material's tiling and offset properties are set because the texture image has not only a dirt part, but also a green grass part for an other cube for the future. So in the image there are 4x4 quad slots for different terrain types and to my dirt cube there should only be the dirt quad assigned to wich is on position 1x2. That's why tiling x is 0.25, tiling y 0.25, offset x 0.25 and offset y 0.75. In the preview window everything looks fine for a single dirt cube, no parts of green grass or other colors are visible. If I instantiate the prefab dirt cube, it looks okay. There are no green parts visible, but some edges seems to be white. I figured out that's because of my white background in the texture image, so I switched it to black and the single cube in unity's game mode looks fine. So I instantiated a lot of these cubes forming the huge cube shown in the picture above and there are no white edges, only black edges which are not so obviously and the green tint which in turn is. It seems to me, the green is belonging to the grass quad next to the dirt quad in the texture image which is also drawn in the scene, like the white/black background. I tried to fix this with tweaking the material's tiling and offset properties, but I can't get rid of this green, nor of the black/white edges. Changing the aniso level of the texture importer from 1 to 2 or the filter mode to trilinear softens the problem, but does not fix it. The only solution is to use one texture for each terrain quad, so there are no other terrain types and colors in the image and no tiling is necessary. But the documentation mentions this should be avoided, so using multiple terrain types for different cubes in one texture image should be the right way. I could try to place all green quads on one side of the texture image and the brown quads on the other surrounded by almost equal looking quad pictures, but there will always be some quads aligned which have different colors, maybe not in this example but later for sure. What can I do to fix this strange discoloration of edges? Is there something I did wrong or misunderstood? Any advise is welcome and thanks for it in advance.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Ampler Games · Jun 08, 2011 at 07:30 AM

If you want to get a good result with your cube problem you need to do this

Game object> create other> cube

then the should be a folder in the inspector view (when you have clicked on the cube in the hierarchy view) that is called mesh renderer.

then there should be a materials folder then you will see some thing called "element 0" Now click on Element 0 A box should appear with different matterials all listed. then just select the material you want.

If you are still having problems, just try scaling the box and then when it is the right size just drag it onto an empty prefab

to get an empty prefab just go assets>create>prefab then rescale the prefab.

sorry, i know it alot of information. hope this helps

technor.

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

Answer by Snorky · Jun 08, 2011 at 08:06 AM

Hi Technor,

thank you for your answer, but that is exactly what I did. There is a standard 1x1x1 cube with the dirt material assigned to it in the element 0 slot and saved as a prefab. I instantiate this prefab multiple times via script to create this big cube on start. Unfortunatly this results in such a strange edge color which tints the big cube.

I just tried to scale the prefab as you mentioned, but this didn't help either. I think it is the same as trying to tweak the tiling of the texture and even with a smaller tiling and a higher offset the green tint stays, same with smaller prefab cubes as advised.

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

2 People are following this question.

avatar image avatar image

Related Questions

Same material, different meshes, different tiling 2 Answers

How do I fill a texture with one color? 2 Answers

Can't find a way to simplify this code... any help appreciated... 0 Answers

is it possible to make 2d real time coloring with masks (paint app) 1 Answer

Shader Texture Change 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