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
0
Question by AxisRob · Dec 12, 2013 at 04:40 AM · transparencywindowglass

Looking through glass windows

I looked at quite a few threads, but I'm still not sure how to do what I want to do. I would like to have a glass window. I've experimented with the transparency shaders and alpha adjustment, but it doesn't give me quite the effect that I'm looking for.

I would like to have it so that you can look through a window and see what's on the other side, but still tell that there is glass there. Is there some creative way I can do this (Using a "Glass texture" with a transparency shader, perhaps)? I tried render to texture, but it gave the same effect as transparency (and also seems like a bad idea in a hall of windows).

I don't need any form of reflection at all, simply realistic transparency.

Thank you.

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 yogee · Dec 12, 2013 at 05:23 AM 0
Share

try this link1 link1

avatar image Kiloblargh · Dec 13, 2013 at 05:00 AM 0
Share

You have to be more specific and maybe post pics. It sounds like you don't know exactly what you want the glass to look like. Your problem could be as simple as using the wrong material color- (white or grey) the RGB components of glass should be nearly black with some blue-green. A cubemap (fake reflection) would go a long way toward making the glass look more real too

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Moor · Dec 12, 2013 at 05:28 AM

Simple glass shader by unity wiki:

 Shader "Glass" {
     Properties {
         _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1)
         _Shininess ("Shininess", Range (0.01, 1)) = 0.078125
     }
     SubShader {
         Tags {
             "Queue"="Transparent"
             "IgnoreProjector"="True"
             "RenderType"="Transparent"
         }
         LOD 300
         
         CGPROGRAM
             #pragma surface surf BlinnPhong decal:add nolightmap
             
             half _Shininess;
             
             struct Input {
                 float dummy;
             };
             
             void surf (Input IN, inout SurfaceOutput o) {
                 o.Albedo = 0;
                 o.Gloss = 1;
                 o.Specular = _Shininess;
                 o.Alpha = 0;
             }
         ENDCG
     }
     FallBack "Transparent/VertexLit"
 }
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 AxisRob · Dec 12, 2013 at 12:02 PM 0
Share

I appreciate the comment, but the issue is: I don't know how to add a texture to the material that uses this shader that will actually make it look like proper glass.

I read about that shader in This link from a forum post, but I couldn't see how it would solve the "$$anonymous$$ake the glass visible" issue. Is it just picking a better texture or?

avatar image Moor · Dec 13, 2013 at 04:47 AM 0
Share
 Shader "Simple Glass11" {
     Properties {
         _Color ("$$anonymous$$ain Color", Color) = (1,1,1,0)
         _SpecColor ("Spec Color", Color) = (1,1,1,1)
         _Shininess ("Shininess", Range (0.01, 1)) = 0.7
         _$$anonymous$$ainTex ("Base (RGB)", 2D) = "white" { }
     }
 
     SubShader {
         // We use the material in many passes by defining them in the subshader.
         // Anything defined here becomes default values for all contained passes.
         $$anonymous$$aterial {
             Diffuse [_Color]
             Ambient [_Color]
             Shininess [_Shininess]
             Specular [_SpecColor]
         }
         Lighting On
         SeparateSpecular On
 
         // Set up alpha blending
         Blend SrcAlpha One$$anonymous$$inusSrcAlpha
 
         // Render the back facing parts of the object.
         // If the object is convex, these will always be further away
         // than the front-faces.
         Pass {
             Cull Front
             SetTexture [_$$anonymous$$ainTex] {
                 Combine Primary 
             }
         }
         // Render the parts of the object facing us.
         // If the object is convex, these will be closer than the
         // back-faces.
         Pass {
             Cull Back
             SetTexture [_$$anonymous$$ainTex] {
                 Combine Primary 
             }
         }
     }
 } 

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

19 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

Related Questions

Making a glass/window shader with cubemap reflection and transparency options 2 Answers

Creating realistic glass 4 Answers

How to Make a Window? 2 Answers

Windows (glass) 4 Answers

How do I stop seeing through models by glass windows? 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