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 Willium_Bob_Cole · Feb 17, 2014 at 06:17 PM · shaderreflectionrenderqueueglassrefraction

Need help rendering beer glass in unity...

So I am making a simple game in which you control a beer glass sliding along a bar avoiding obstacles, and I am trying to come up with a way of rendering a realistic pint, preferably with refraction, bubbles, etc, but for now, I am just trying to use two transparent objects (the beer will eventually get a diffuse map applied too).

The problem at the moment is that I can't seem to control the render order of the objects so the beer always appears inside the glass, it only appears through the glass from a low angle, so it appears in the reflection, but not from the angle which the game will be played from. For the glass I am using one of the hard surface shaders from here: https://www.assetstore.unity3d.com/#/content/729 and for the beer I am using a default unity transparent material, although the issue also happens with any trans material.

Firstly, if someone can help me ensure this renders correctly from all angles, that would be great.

Second, if someone can come up with a better way to make a glass of beer in unity, that looks really, REALLY good, that would be so awesome you have no idea! ;P

Thanks for any and all help in advance!

-WBC

beer glass from top beer glass from top

from top without wood from top without wood

beer glass from below beer glass from below

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 deltamish · Feb 17, 2014 at 06:37 PM 0
Share

Hi, Creating Refraction in unity is quite complex you need to rotate the normal in accordance with view direction.You could download HardSurfaceShader Free version it does have refraction.Or you could create yuor own effect easily but you need Unity pro

Ps the game looks pretty good already

avatar image Hoeloe · Feb 17, 2014 at 07:45 PM 0
Share

Transparency sorting is awkward, and Unity doesn't support anything other than per-object sorting for transparent objects. You can do it in other ways, but it is a lot more complex, and a lot slower. The trouble is, most objects are sorted using a z-buffer, which writes in the depth of each pixel, so it can ignore any pixels behind that point. However, transparent objects can't use this, because this would stop you being able to see through them (okay, technically you CAN use the z-buffer with transparent objects by using a different render queue, as Unity does, but it does mean you won't be able to see other transparent objects through it). To get this to work properly, I think you're going to have to look into more complex solutions, most of which will involve re-routing Unity's rendering pipeline. You may want to look into a raytracer, as they can give very realistic results, and handle reflection and refraction very easily, as well as being ideal for transparent surfaces. Alternatively, you could look into per-vertex transparency sorting, but keep in $$anonymous$$d that both of these methods can get very computationally expensive very quickly.

0 Replies

· Add your reply
  • Sort: 

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

21 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

Related Questions

Refraction is also reflection? Or a bug? 0 Answers

Creating realistic glass 4 Answers

Creating realistic lantern (glass) 0 Answers

How do I orient my glass reflection properly? 1 Answer

how to bring a refraction effect in unity? 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