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
1
Question by i_am_qix · Oct 04, 2015 at 08:38 AM · shadercomponentcopycopy-paste

Why can't you copy a Material component?

Is there something special I have to do to be able to copy a material component? Changing tons and tons of shader values all at once is becoming tedious...

Comment
Add comment · Show 4
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 cjdev · Oct 05, 2015 at 08:41 AM 0
Share

Do you mean in the editor? You can press Ctrl+D to duplicate a material there. Otherwise in script you'd have to make a deep copy.

avatar image fffMalzbier · Oct 05, 2015 at 03:03 PM 0
Share

Like cjdev said yo just can duplicate the $$anonymous$$aterial with Ctrl+D / strg+D. A material is a asset and not a component. It's more like a texture(asset) that lives in your project then then a script(component) that runs on your gameobject. The render component is just referencing it.

avatar image i_am_qix · Oct 05, 2015 at 08:23 PM 0
Share

So a material is nothing more than a pre-configured shader, right?

avatar image cjdev · Oct 05, 2015 at 09:14 PM 0
Share

A material is just a Unity component that points to the compiled shader code, any textures it relies on, and any external variables the shader defines. Basically the shader is the compiled code that gets run by the GPU and the material is what manages the rendering component on the CPU side.

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by paraself · Oct 06, 2015 at 03:58 AM

A Material is not a component, it's an asset. cjdev explained quite clearly. If you want to render objects with a single material and all of the object varies a bit in its shader values , consider using MaterialPropertyBlock to apply these values. By using MPB, you can render all of the objects with only one material assets and possibly benefiting from unity's batching optimization. http://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html

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

Answer by Wanzyee · Mar 04, 2016 at 09:29 AM

To duplicate, Ctrl+D works for you.

To copy properties from a material to existing others, you can try Component Clipboard.

To copy by script, this API might be right.

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

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

Related Questions

Copying gameObject doesn't work as intended 1 Answer

How to fill polygon collider with a texture? 0 Answers

Unity Login Server Address 0 Answers

How to make a Tovel like cube (edge smooth?) 2 Answers

Can you Help ME? 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