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 MaT227 · May 13, 2013 at 12:36 PM · shadermaterialwater

2D Water Shader

I am trying to build a 2D Water shader and I am using Unity 4.

Here is an example of what I am trying to reproduce :

Limbo water shader

Are there any good tutorial or whitepaper about creating such effect blur and displacement ? I am not talking about waves or something but only the depth of the water.

Is it a Camera shader or an object shader ?

Thanks a lot !

Comment
Add comment · Show 1
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 MaT227 · May 15, 2013 at 06:46 AM 0
Share

Any good tutorial ?

4 Replies

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

Answer by MaT227 · May 16, 2013 at 08:45 AM

I have Unity Pro. I saw that the best way to achieve such effect is to use Grabpass in the shader. But there are two problems with this system :

  • It seems that Grabpass is quite heavy for mobile as said here Using Grabpass & IOS/Android devices . But as I am learning shader, I don't know any other system to create refraction.

  • There is an issue with foreground objects, they are refracted too. There is a solution here GPU Gems - Refractions . But is this solution available ?

Another interesting link : Unite 11 - Shadowgun The fluid part is at about 30:00.

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

Answer by tanoshimi · Feb 19, 2016 at 10:24 AM

Not sure why this question has resurfaced on the front page of UA but, for the sake of anyone viewing this in 2016, I thought I'd point out that RenderTextures have been a free feature available in all versions of Unity since 5.x. In fact, there's a standard asset water shader included in Unity that'll give you a textured water plane with reflections, surface waves etc. just fine with either 2d or 3d scenes, and from there it's fairly trivial to add blur/displacement etc., so you might want to start with that.

Comment
Add comment · Show 1 · 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 Cherno · Feb 19, 2016 at 01:21 PM 0
Share

However, I think that water shader looks rather plain when viewed from above. It also looks nothing like the water in Limbo. On the other hand, the water in Limbo doesn't look special anyway :)

avatar image
0

Answer by Ferb · Sep 30, 2014 at 05:02 PM

With Unity Pro, a simple method would be to have your main camera draw the screen to a RenderTexture. Then you can take that texture and perform whatever extra effects you like on it before finally drawing it to the screen - blur it, displace it, swirl it, whatever. If you have Pro, and you want to do a blur on a texture you've already drawn the screen to, just look up Gaussian blur, it's quite a simple technique - basically averaging the colour across a few surrounding pixels.

But with Unity Free, the only method I can think of would be to draw your objects distorted in the first place. That means if any object is in the water, you'd have to give it a special material, with a special shader, that draws it with the blur or whatever other distortion you want. And it would be complicated even more by the fact that an object might only be partially in the water, so your shader would probably have to accept a second texture that tells it which parts to draw distorted, and update that texture each frame (although Unity Free doesn't have RenderTextures that can be drawn to by the camera, it has procedural textures which can be edited with SetPixels).

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

Answer by ravingbots · Feb 09, 2016 at 10:00 AM

You might be interested in our 2d water material: http://u3d.as/o75 - it has animated waves, a refractive (glass) shader, some splash FX with sounds, and an example of buoyancy physics. It uses the grabpass method and works on mobile devices. It does not require Unity Pro and can be used with the Personal Edition.

https://youtu.be/zIK0aFTLOvA

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

18 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

Related Questions

Standard Asset water material is pink 4 Answers

Why is my Pro Water Material Grey? 1 Answer

How to create this top down water effect using spriteshape? 2 Answers

Material doesn't have a color property '_Color' 4 Answers

Water Shaders Question 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