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
3
Question by wehrwolf · Mar 08, 2013 at 02:11 AM · shadershaderstransparencyreflection

Reflection shader with alpha channel

Hello, I'm new to Unity and need to ask a simple question.

I have a 3D mesh with a texture applied to it. Small parts of the texture should be reflective, while the rest should stay non-reflective.

When I however setup a Reflective Bumped Diffuse shader, the entire texture becomes reflective.

Is there any humane way to apply an alpha matte to the reflection in order to specify what parts of the texture it should be applied to? Alternatively, do you know of any custom made shader that could do this?

Any help would be much appreciated.

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 wehrwolf · Mar 09, 2013 at 01:51 AM 0
Share

Hey, great idea! Never thought about using multiple materials. Works nice. Thanks a lot!

avatar image Professor Snake · Mar 09, 2013 at 06:44 AM 0
Share

I converted my comment into an answer. If it solved your issue, you can accepting by clicking on the tick button.

2 Replies

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

Answer by Professor Snake · Mar 08, 2013 at 04:55 AM

You are able to use multiple materials in one mesh, but that would require some extra work with getting their textures right. A shader based solution however would indeed be lovely.

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 remistorms · Oct 19, 2013 at 10:57 PM

Hi there,

I hope this works for you. The reflective shaders inside unity have the option to be masked with and alpha. The only trick is to embed this alpha mask into the diffuse.

I tried to get the effect a couple of times but I only made it work when I saved my textures as TGA with 32 bit. Check the images below with the same cube and material but the masked and unmasked texture.

Let me know if if works, if you are still confused I could send you a more detailed description or a quick video of what I did.

Cheers.

alt text


maskedcube.png (312.6 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 Professor Snake · Oct 19, 2013 at 11:27 PM 0
Share

Which built-in shader did you use? For everyone's convenience i can try editing it to support a reflection map of sorts.

avatar image remistorms · Oct 20, 2013 at 03:16 AM 0
Share

For that example I used the default Reflective/Diffuse shader that comes with unity.

alt text

screen shot 2013-10-19 at 10.12.32 pm.png (177.8 kB)

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

12 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

Related Questions

How to prevent shader overlap in LWRP Shadergraph. 0 Answers

See backside of a transparent emissive shader? 0 Answers

How to make my shader have a variable transparency 1 Answer

Silhouette overlay shader 0 Answers

how to do color separation in specular reflections 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