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
0
Question by Virtlink · Jan 09, 2013 at 02:07 PM · meshmaterialuvpacktextures

PackTextures: many materials or many meshes?

I have a game world consisting of tiles, and there are many kinds of tiles (and therefore many textures). A tile is just a two triangle square. I have packed the textures together using PackTexures and now I have a bunch of `Rects`.

To apply the packed texture correctly on each tile, I can do one of two things:

  • Create a new material for each kind of tile, with the offset set to the Rect's position and the tiling set to the Rect's size. This would result in dozens of materials.

  • Adjust the UV coordinates of the tile's mesh for each kind of tile, scaling them by the Rect's size and offsetting them by the Rect's position. This would (I think) result in dozens of copied meshes that just have different UV coordinates.

This answer suggests that I should use the multiple materials approach. However, here on the forum it is suggested to change all the UV coordinates. Or, as Aras states it:

The packing idea is that you'll end up with a single material (otherwise, if meshes will still use different materials, there's not much point in packing).

It seems to me that materials are more lightweight and put less strain on the GPU than multiple meshes do, and therefore I'd be inclined to use multiple materials. What would be the best approach? Or are there any other smart things I could do with a Rect and a simple square mesh?

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Wiki

Answer by dorpeleg · Jan 09, 2013 at 02:27 PM

If you are generating the tiles in the scene via code then you can actually use this: Material-mainTextureOffset

or something similar, to have only one mesh and one material and only change the offset via code.

If you are not generating the tiles via code then chose the material solution just for the sake of the final file size.

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

9 People are following this question.

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

Related Questions

3D Procedural Hex UV Map 0 Answers

can't put texture materials on imported mesh. 1 Answer

UV Mapping for 2D Meshes with 3 Vertices Only 1 Answer

Manual UV-Mapping of a Primitive Cube 1 Answer

How to merge per triangle UVs 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