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 Dot45 · Aug 31, 2011 at 06:32 AM · texturesharedmaterial

How to i share material and texture

I have a scene that consist of many types of obstacle; mountain, flat floor, box(not move) and etc.

I use plane made by 3dsmax and import into Unity, this plane is used for every obstacle in the scene. I have made transparent texture with Photoshop , 1 material for 1 texture

For example, in the scene i have 5 kinds of obstacle so i have 5 material and 5 texture. i drag material into a game objects so my plane didn't has texture UV since i didn't textured in 3dsmax

now i want to combine all these texture into one texture atlas with 1 material in order to reduce draw call.

How do i share or scripting 1 material with 1 atlas since if we make that for 1 object, another obstacle's texture will effected as well??

How do i shared or scripting material and texture by still keeping texture for each obstacle object.

ps. i have looked other questions that similar to mine but still not get an idea or understanding how to implement it.

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 Dot45 · Aug 31, 2011 at 08:41 AM 0
Share

I have try testing using 1 texure atlas with 2 sub texture, but fail "Orz.........

i created 2 box and take one material to both so both of them shared the same material, now we have 1 draw call, 2 batched now i write script /////////////////// public float textureScaleX; private $$anonymous$$aterial test$$anonymous$$at1;

void Start () { renderer.material.SetTextureScale ("_$$anonymous$$ainTex", new Vector2(textureScaleX,1));
} ///////////////////

i have set textureScaleX for each both objects , the result is both of them can show different texture that come from shared material but it becomes 2 draw call and 0 batch intend of 1 draw call and 2 batch and each of them has word "(Instance)" follow the name of material.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by 3D-Magic-VR · Sep 01, 2011 at 11:48 PM

Hi there, the problem here it's the material, you can´t use two objects with the same material and try to set different parameters on each one, because if you set just to say the offset x to 0.5 in object 1 it will be reflected in object 2 and vice verse, the better way it's to use separated materials (one per object) but you can use the same texture on all of them and then set different parameters on each one.

Hopes this helps.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Can't figure out why 5 objects with the same material/texture are not batching.. 2 Answers

Assigning UV Map to model at runtime 0 Answers

Changing shared texture at runtime without affecting project settings? 1 Answer

Spout: shared texture breaks model UVs 0 Answers

Terrain Splatting 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