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
1
Question by pauldstewart · Oct 29, 2010 at 07:28 PM · shadermaterialtransparencyreflectionglass

Creating realistic glass

I know this has been asked many times before, but I can't actually get a simple answer that works for me.

How do I create glass for windows. I've had a go at cube maps which don't really produce good enough results, so I'd like real reflections if possible.

I'm also having trouble controlling transpareny of the reflective material.

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

4 Replies

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

Answer by BerggreenDK · Nov 29, 2010 at 03:53 AM

You didnt state if you are using the free or pro version of Unity. But as I've been told (currently using the free version only), certain features with shader and shadows has been removed from the free version - so you might have to "fake" some features.

One of the important features regarding your problem might be "real reflections" as thats something "raytracing" programs does, eg. real 3D rendering programs. Unity3D is a GAME-ENGINE, not a RAYTRACER.

You can get realtime shadows, because these can be calculated from vector-coords. If I was to produce eg. a mirror, I would use the PRO version, then map a "rendered texture" where the texture is comming from a secondary camera facing in the direction of the mirror. This is the closest possible way I think so far, unless I've misunderstod Unity3D engine.

With transparency, its a matter of "alpha transparency", but alpha does not "index" your view-rays, for this you also need the shaders to do the trick. So look at the water-materials and see if any of these does the trick. Again, I think you will need PRO license to use the shaders for something "really beautiful" but I might be wrong.

Hope you can use these advices.

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 pauldstewart · Dec 02, 2010 at 09:48 AM 1
Share

Thank you. This makes things slightly clearer. I think the water-material are the way to start.

avatar image Benproductions1 · Mar 14, 2013 at 10:22 PM 0
Share

RAYTRACING is just a way of rendering a scene, I made one for Unity a while ago! a GA$$anonymous$$E-ENGINE is completely different from a RAYTRACER, but a GA$$anonymous$$E-ENGINE can contain a RAYTRACER. I'm sorry, but my OCD kicks in when people say "unity isn't a raytracer" ins$$anonymous$$d of "unity doesn't have a raytracer". :P

avatar image
2

Answer by Monkey.du · Feb 12, 2011 at 07:55 PM

I don't understand why there is such a reluctance to writing such a shader that handles real-time reflections and transparency. What's the big deal?
Looks like many users here are asking for such a shader. What does it take? Days, weeks of work?

Looks like I'm going to pay someone to write this shader and then I'm going to share it for free.

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 almo · May 16, 2011 at 02:24 PM 0
Share

Because the amount of CPU power needed to calculate real reflections is prohibitive in a realtime game. Reflections you see in games are almost always done through some trick.

avatar image Venryx · Mar 19, 2013 at 06:29 AM 0
Share

I've also been searching for a glass shader with dynamic reflections. I eventually managed to make one, by modifying the $$anonymous$$irrorReflective shader/script to include transparency, a base texture, and tinting.

I made a page for it on the Wiki: http://wiki.unity3d.com/index.php/SurfaceReflection

It requires Unity Pro, though.

avatar image
1

Answer by fherbst · Oct 29, 2010 at 07:42 PM

"True" reflections are possible - at least for planar objects like windows and water - but not easy, thus you can't get a "simple answer". You should prepare to learn how the rendering pipeline works, how render textures work (Unity Pro only)...

You could also take a look at http://www.unifycommunity.com/wiki/index.php?title=MirrorReflection2, there is a mirror shader which can quite sure be adapted for a "true reflection and transparency window shader". I do not know whether this shader works for Unity 3 (seems some have to be ported first). Another shader to look at is the water shader which ships with Unity Pro (especially for the setup script and stuff).

You see - another not-so-simple answer, because true reflections are quite a complex topic in real-time computer graphics (because real-time raytracing isn't possible - right now).

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 pauldstewart · Oct 29, 2010 at 08:17 PM 0
Share

I see your point - that it's not simple. I can appreciate that. But surely someone must have cracked this. I'm really looking for someone that has solved this to give me specific advise - please!

avatar image fherbst · Oct 29, 2010 at 08:55 PM 0
Share

I think it adds too less to the realism of a standard game scene to have true reflecting glass. $$anonymous$$irrors and water are another thing - maybe you have luck and find something for glass as well. You could also take a look at some of the refractive shaders in the unifycommunity.

avatar image
0

Answer by Venryx · Mar 19, 2013 at 07:26 AM

I've also been searching for a glass shader with dynamic reflections. I eventually managed to make one, by modifying the MirrorReflective shader/script to include transparency, a base texture, and tinting.

I made a page for it on the Wiki: http://wiki.unity3d.com/index.php/SurfaceReflection

It requires Unity Pro, though.

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

2 People are following this question.

avatar image avatar image

Related Questions

Can I make a glass cube on iOS w/ Pro? 0 Answers

Semi Transparent Material on a plane. 2 Answers

Transparent material on iPhone Android 3 Answers

Iphone Shader Reflection Map 0 Answers

GameObject generated during runtime is not transparent on mobile device 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