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 Anonymoose54 · Mar 16, 2014 at 10:37 PM · waterunderwatertransparent-texture

Underwater Effect

Hi, I was just experimenting with the advanced water in Unity. I had it so that the water was opaque on both sides, but I wanted it to be transparent. I managed to adjust the fresnel, etc. to make it transparent when looking at it from above, but when you go underneath it and look up at it the water is completely opaque. I've tried adjusting a multitude of properties but I can't get the underside to be transparent. Also, I don't have Unity pro, which is probably the biggest problem, but is there a way to make it work without it? Thanks in advance. Maybe it has to do with the shader? Any ideas? Thanks in advance.

Comment
Add comment · Show 6
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 Anonymoose54 · Mar 16, 2014 at 10:46 PM 0
Share

The same thing happens with both the Water4Example(Advanced) and Water4Example(Simple) Prefabs

avatar image getyour411 · Mar 22, 2014 at 02:49 AM 0
Share

Duplicate the water, change the copy Y value to be a hair less than the orig, and flip it over, then test again

avatar image supernat · Mar 22, 2014 at 03:41 AM 0
Share

I would bet it's because it's not the Pro water, but you probably want to get in the shader and change the culling to cull out the underside (it sounds like it's set to CULL OFF, but you'll want to cull CCW (or CW depending on the mesh format)). Generally culling is on, so I'm surprised it's off.

avatar image AlucardJay · Mar 22, 2014 at 06:28 AM 0
Share

You can make the free water transparent, check my answer here

This answer will get the simple water mesh double-sided.

Another great answer by Aldo for adding underwater fog settings.

avatar image Anonymoose54 · Mar 28, 2014 at 12:38 AM 0
Share

Hi, thanks for all the answers, but in relation to supernat's answer, cull was set to off on both subshaders, and it didn't recognize CW or CCW.

Also, thanks for the answer alucardj, but both scripts didn't have any effect. I am fairly certain it is because I don't have unity pro.

Show more comments

1 Reply

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

Answer by AlucardJay · Mar 28, 2014 at 01:50 AM

from my comment :

You can make the free water transparent, check my answer here

This answer will get the simple water mesh double-sided.

Another great answer by Aldo for adding underwater fog settings.

Edit :

I do not have pro, this works.

1 : Scene with terrain and Daylight Simple Water (2 cameras to show above and below water)

2 : After modifying the FX-Water Simple shader

3 : Don't forget to modify the alpha value

4 : After adding the double-sided mesh script to the water object

alt text


underwater.jpg (321.4 kB)
Comment
Add comment · Show 4 · 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 Anonymoose54 · Mar 28, 2014 at 02:33 AM 0
Share

Hey thanks for the answer, it really helped! One small problem though: it won't render any trees, grass, or any other gameobjects for that matter on the opposite side of the water! Any ideas?

avatar image AlucardJay · Mar 28, 2014 at 07:48 AM 0
Share

Thanks for letting me know this method doesn't render anything behind the water. I have modified the answer on my other question to hopefully fix this, basically change the Tags line.

at line 58-59 of the FX-Water Simple shader, after

 // -----------------------------------------------------------
 // Fragment program

replace :

 Subshader {
     Tags { "RenderType"="Opaque" }
     Pass {

with :

 Subshader {
     Tags { "Queue"="Transparent" "RenderType" = "Transparent" }
     Blend SrcAlpha One$$anonymous$$inusSrcAlpha
     Color$$anonymous$$ask RGB
     Pass {

tested with trees and grass :

alt text

underwaterfix.jpg (258.8 kB)
avatar image AlucardJay · Mar 28, 2014 at 08:14 AM 0
Share

Another reference link I had bookmarked and forgot about :

  • http://kostiantyn-dvornik.blogspot.com.au/2013/05/unity-worlds-coolest-tutorial-about.html

There's some easier stuff on youtube by speedtutor :

  • http://www.youtube.com/watch?v=FoZwgRE5LYI

  • http://www.youtube.com/watch?v=GHYUJO8P4_Y

  • http://www.youtube.com/watch?v=2qi5CwjlrN$$anonymous$$

avatar image Anonymoose54 · Apr 01, 2014 at 01:31 AM 0
Share

Thank you your answer was perfect! Turns out all I needed was the "Queue" = "Transparent" statement.

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

22 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 avatar image

Related Questions

Underwater implementation 1 Answer

How do I make the area under my water (a plane) look like its underwater? 4 Answers

Swimming/Underwater 3 Answers

water3, problem beeing underwater (game stucks) 4 Answers

need water!!! 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