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 /
  • Help Room /
avatar image
6
Question by Jopan · Dec 03, 2014 at 03:42 AM · c#shadermaterialunity5

What are the property names in the new Unity 5 standard shader

Hello, I am trying to assign textures and such via C# code to the new standard shaders using the functions found in the Material class (setTexture, setFloat, etc). The problem is, I don't know what the properties are called or how to find that out (google is no help so far). To be clear, something like this. go.GetComponent().material.setTexture("Diffuse", someTexture);

I have tried "Diffuse", "_Diffuse", "Albedo", "_Albedo". I would like all the names of the properties available in the shader. As a bonus, pointing me as to how to find the information myself in the future is a plus.

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 duck ♦♦ · Jul 10, 2015 at 04:23 PM 0
Share

Also read this if you're setting values on a material using the Standard Shader:

http://docs.unity3d.com/$$anonymous$$anual/$$anonymous$$aterialsAccessingViaScript.html

Important info.

3 Replies

· Add your reply
  • Sort: 
avatar image
18
Best Answer

Answer by Jopan · Dec 03, 2014 at 04:42 AM

Answer to my own question.

Diffuse - "_MainTex"

Specular/Roughness - "_SpecGlossMap"

Normal - "_BumpMap"

AO - "_Occlusion"

etc...

You can find these by switching the inspector to debug mode. Then inspecting the standard material.

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
19

Answer by aormsby · Jul 02, 2015 at 09:05 AM

Hi @Jopan! I know I'm a bit late to this thread, but you can also select a Game Object, right-click on its material, and select 'Edit Shader' to see a list of its properties in the Inspector. Pretty handy.

alt text

And if by chance you're still working on updating your Materials to use the Standard shaders, I actually just released a tool on the Asset Store called Legacy 2 PBR that might help you if you're still having any trouble. I invite you to check it out. :)


editshader.png (15.1 kB)
Comment
Add comment · Show 2 · 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 TBruce · Sep 09, 2016 at 01:25 AM 0
Share

I modified your link to point to the asset page not the publisher page.

avatar image ben_page · Jul 28, 2017 at 02:04 AM 1
Share

You just saved me a full night of sleep. Thank you. https://media.giphy.com/media/1Z02vuppxP1Pa/200.gif

avatar image
3

Answer by kbr0n · Sep 09, 2016 at 01:19 AM

thank you so much

i've been looking for the correct property name for days!!!

it was _GlossMapScale -> the property that control Smoothness

thank you man, thank you lord!

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

32 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

Related Questions

Highlighting Multiple Objects with an Outline Shader 0 Answers

Check if emission is enabled in URP Lit Shader from C# script 0 Answers

Accessing shader colors 1 Answer

NavMeshAgent dont find the right way on runtime build NavMesh 0 Answers

How to know whether material's emission is enabled or not by C# script? 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