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
-2
Question by user-526 (google) · Dec 11, 2009 at 10:17 AM · shader

how to do A reflective shader of the marble

how to do A reflective shader of the marble

Comment
Add comment
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

1 Reply

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

Answer by noradninja · Dec 13, 2009 at 12:45 AM

It would help a lot if you were more descriptive about what you are trying to do, I am sure that is why your post got modded down.

Aside from that, I am assuming you are asking how you would make a shader that is reflective and also looks like marble.

There are a couple of ways you can do this.

First, you can use the Reflective Diffuse shader (Click here). You will need a cubemap for the reflection, and a texture of a marble surface for the base color. The alpha channel of the base color texture determines how strong the reflection strength is; if you want the floor to be 100% reflective, make the alpha channel black. If you don't want it to reflect, make it white; if you want say 50% reflection, make it a medium grey.

Another thing you can do is use the Transparent Diffuse shader (Click here). You will need a marble texture, and again, the alpha channel will in this case control the transparency: white is 100% solid and black is 100% transparent, with shades of grey being in between. Once you set this up and put it on your reflective marble surface (I assume it is a floor or a ceiling), you can then duplicate your level geometry and flip it 180 degrees so that it mirrors the level in the floor like so:

Reflection example Reflection example 2

You might ask, 'if the first way is so easy, why would you do it the second way?' and that is a good question. A good reason would be if you had two reflective surfaces facing each other (a marble floor and a mirrored ceiling, for example). The reflective shaders are good, but they have a hard time working out this sort of thing. Another reason is that unless you do some code work, the cubemap used by the reflective shader is static; it wont reflect dynamic objects like your player character as he walks around the floor. And, finally, not everyone has hardware that can do cube maps, a good example of this is the iPhone. You can use a custom shader and a spherical map to get a similar effect, but thats a topic for a different discussion.

I hope that this explanation helps you understand what you were trying to do, and please, in the future, don't be afraid to ask questions, but the more detail you give us about what you are trying to do, the better the answers will be and the community will benefit as a whole from that.

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

No one has followed this question yet.

Related Questions

How to force the compilation of a shader in Unity? 5 Answers

Generating a texture through Graphics.Blit with shadergraph 0 Answers

Standard assets Skybox and cubemap are mirrored along X towards each other? 1 Answer

Multiply Mode uses strange Alpha 1 Answer

What is the best way I could recolor all the pixels of a certain country on a texture of a political map(for achieving a map mode system such as in a grand strategy game)? 2 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