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
0
Question by divyansh87 · Sep 03, 2015 at 05:41 PM · texturematerialoptimizationdrawcalls

script to assign different texture from a single material having all the textures

so i am trying to optimize my game by reducing the draw calls as it lags very badly on android devices ! all the objects in my game are cubes of same size ( 1 x 1 x 1 ). i have a single material for all the objects ! the material have all the textures that are needed in my game . how can i assign different textures to my blocks from that material ? please provide me a script or any better way to do this : )

Comment
Add comment · Show 2
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 hexagonius · Sep 03, 2015 at 08:55 PM 0
Share

I hope you mean the texture of the one material holds all textures at once like an atlas. If so, your cubes needs to index their particular past in that texture by UV coordinate. they go from 0 to 1 on x and y. so you either configure the UVs for each cube to match their respective patch in the atlas, our you recreate the UV array of the mesh in Unity and assign UVs there. As a tip: if all sides of a cube were to show the same patch in the lower left corner and the dimensions are 64*64 and the atlas is 1024*1024, coordinates would be 0,0 and 0.0625,0.0625

avatar image divyansh87 · Sep 04, 2015 at 04:31 AM 0
Share

@hexagonius yes ! thats exactly what i was talking about ! i want to make an atlas ? but how will i assign those atlas textures to individual cubes ? for example i have two cubes , cube1 & cube2 and a texture atlas of 200 x 100 resolution having two diffferent textures of 100x100 ! now what scripts should i add to those cubes ? i want all the sides of a cube to have same texture ! please help me anytime when you are free

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

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

Related Questions

Best way of combining textures 0 Answers

same material for different texture ? to increase performance 1 Answer

Unity seems to be in 2D, but I want it in 3D 1 Answer

Can I do this in Unity without importing textures? 1 Answer

Ever seen blurry textures like this? 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