• 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 Humam3D · Oct 11, 2016 at 07:59 PM · textureing

tiling portion of texture

Can we tile only portion of texture. right now i have 512*128 texture and i want to tile the ground (at the beginning) 2*20 times

alt text

BR

1.jpg (99.4 kB)
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 jrocamora · Oct 11, 2016 at 08:37 PM

3D objects read a kind of map embedded into them that tells them what area of the texture file that is assigned to look at, in some cases for different parts of the object. These are called UV's, and I don't think it's possible to edit UV mappings within unity, correct me if I'm wrong. If you want to use part of your texture for an entire object, the easiest solution would be to split the texture into the pieces you want and then use that piece!

Comment
Add comment · Show 3 · 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 Bonfire-Boy · Oct 11, 2016 at 09:04 PM 0
Share

You can edit UVs. But they're only defined at the vertices so I'm not sure it'd help much in this case.

Seems to me the way to do this would be with a custom shader. Essentially, you'd be implementing your own tiling system.

avatar image Humam3D · Oct 15, 2016 at 12:23 PM 0
Share

The point is i will only want to have one atlas 1024*1024 to have a better performance part of it is sprites some is texture some is tileable

avatar image Bonfire-Boy Humam3D · Oct 15, 2016 at 06:06 PM 0
Share

The more I think about it the more convinced I am that a custom shader is the way to do it. If you haven't written a shader before this is actually a good one to start with, would be relatively straightforward, especially if you start with a normal tiling shader.

avatar image
0

Answer by Lilius · Oct 12, 2016 at 06:15 AM

Quick and bad solution: Create an empty game object. Add a quad as a child of that game object. Add texture to material and tile it to have the ground part in the quad. Duplicate quad 39 times and position quads in 2 x 20 grid.

You could write your own shader, that is quite much work and reading if you haven't done that before.

Both of these kind of ruin the idea of texture atlasing, if you use atlas to reduce draw calls because you would have to have different materials or shaders with different tiling for different objects (correct me if I'm wrong, I'm quite beginner with shaders).

You can do it with script, setting the UV coordinates to vertices but your model would need to have at least 3*21 vertices (which you could also add via script). You could do the same thing in 3D modelling software, which is much faster and easier (at least when you have something more complicated than simple plane) but you anyway need 3*21 vertices instead of 2*2 to produce that one piece of ground.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

6 People are following this question.

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

Related Questions

Why does applying a material to a object break batching? 2 Answers

Blend between 3 Textures by depth value 0 Answers

How to get realistic textures 1 Answer

resize gui texture, scrollbar 0 Answers

Align tiled texture on different models 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges