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
2
Question by No_Username_Found · Apr 19, 2015 at 04:04 PM · texturespritetilequad

Texture UVs Shift with Camera Movement (ortho)

I'm trying to make a top-down sprite-based game, sort of like classic Zelda or Pokemon. Right now I am working on the tool that paints terrains so I can make area maps. I have a different file for each terrain, but each file contains tiles for about 120 different angles.

When the Quad for the terrain is created, it has the whole texture file as a texture. It then looks at neighbors that have the same texture and decides which UV coordinates to use. The code for this is super long (thousands of lines), so I don't think I'll be posting it.

I've got all this working fine. My problem comes in when I move the camera. As you can see in these two screen-shots, a weird line in the texture appears at one angle but disappears at another. All I have to do is move the camera. This also happens when I change zoom levels (by adjusting the orthogonal width).

Glitch Picture: Notice the brown lines in the grass, and the green lines on the right side of the grass? alt text

Glitch Picture: Notice how the lines are now gone? alt text

I have tried introducing blank lines to the Texture file between the Tiles and updated the UV coordinates. The problem persisted but with clear/see-through lines instead of solid colored lines as shown. The camera is in orthographic mode, so it isn't a perspective issue. It changes with angle, so it isn't a UV coordinate issue.

I would like to avoid having to make each UV coordinate it's own texture file if at all possible.

Thanks in advance.

screenshot0.png (139.4 kB)
screenshot1.png (123.0 kB)
Comment
Add comment · Show 1
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 No_Username_Found · Apr 19, 2015 at 06:02 PM 0
Share

An additional detail I've discovered:

If the Orthographic Width is 6, 8, or 12 AND the camera position does not have decimals that are not a factor of 2 then the error does not occur.

I'm managed to implement a work-around where the orthographic size snaps to either 6, 8, or 12 and the camera position movement uses [Vector3.direction] x .03125f x cameraSpeed (rather than Time.deltaTime)

This makes me think that the issue is not with the texture/renderer/UV/etc. but with some other aspect of Unity 5.

0 Replies

· Add your reply
  • Sort: 

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

19 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

Related Questions

Tilemap: Resizing Tiles? 1 Answer

Issue mapping texture to imported quad 1 Answer

Best way to do tiling in 2D 1 Answer

Black lines between tile sprites 7 Answers

Sprites and textures appears black on Samsung Galaxy Grand I9082 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