Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
4
Question by ROM · Aug 16, 2010 at 04:45 PM · iphonewaterwavesunderwaterripple

Underwater effect?

Is it possible to do an underwater effect for Unity iPhone? By this I don't mean fog but rather the wavey kind of ripply lines that you get underwater to make everything look more organic. If there is then could someone point me in the right direction?

Thanks in advance!

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 mukul18khanna · Dec 26, 2017 at 11:37 AM 0
Share

@RO$$anonymous$$ this might help- https://medium.com/@mukulkhanna/creating-basic-underwater-effects-in-unity-9a9400bde928

5 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by Kos-Dvornik · Jun 08, 2013 at 08:47 PM

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

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
2

Answer by JJAPrograms · Mar 10, 2011 at 05:43 PM

Try using this code:


 //set your varibles here.
    var fog = false;
    var fogColor = Color (0, 0.4, 0.7, 0.6);
    var fogDensity = 0.04;
    var skybox : Material;
    //this is where you go underneath the water or in this case into the trigger aera
    //this is just the effect not anything to do with force.
    function OnTriggerEnter(other : Collider) {
        fog = true;
        RenderSettings.fog = fog;
        RenderSettings.fogColor = fogColor;
        RenderSettings.fogDensity = fogDensity;
        RenderSettings.skybox = skybox;
    }
    //this is where we are exiting the water and the effect of being underneath the water is ended.
    function OnTriggerExit(){
        fog = false;
        RenderSettings.fog = fog;
    }

Hope it helps!

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 Goody! · Aug 17, 2010 at 10:33 PM

I use the Unity specific Google search a lot: http://www.google.com/cse/home?cx=002470491425767499270:iugs1ezlsfq

It returned this link: http://forum.unity3d.com/viewtopic.php?p=237063

Which has one relevant sounding reply in the form of:

"Use a Particles/Additive shader for the water volume, with liquid animated texture.

And project a Particles/Additive shader with animated caustics on the -Y axis."

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 cregox · Jan 27, 2011 at 01:13 AM

Here's how I've done my underwater so far:

  1. Add underwatereffect.js to the camera (adapted from this):

var fog = true; var fogColor = Color (0, 0.4, 0.7, 0.6); var fogDensity = 0.04; var skybox : Material;

function Start () { RenderSettings.fog = fog; RenderSettings.fogColor = fogColor; RenderSettings.fogDensity = fogDensity; RenderSettings.skybox = skybox; }

  1. Add bubbles.js to underwater objects (made based on this):

var materials : Material[];

private var particlEmitter; private var particlAnimator; private var particlRenderer;

private var speed;

function Start () { particlEmitter = gameObject.AddComponent("EllipsoidParticleEmitter"); particlAnimator = gameObject.AddComponent("ParticleAnimator"); particlRenderer = gameObject.AddComponent("ParticleRenderer");

particlEmitter.minSize = 0.1; particlEmitter.maxSize = 0.2; particlEmitter.minEnergy = 0.5; particlEmitter.maxEnergy = 2; particlEmitter.minEmission = 10; particlEmitter.maxEmission = 20;

particlAnimator.doesAnimateColor = false; particlAnimator.sizeGrow = 0.5; particlAnimator.force.y = 2;

particlRenderer.materials = materials; }

function Update () { speed = rigidbody.velocity.magnitude 3; particlEmitter.minEmission = speed; particlEmitter.maxEmission = particlEmitter.minEmission 2; }

Comment
Add comment · Show 3 · 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 Tracey P · Feb 27, 2011 at 03:03 AM 0
Share

doesn't work exactly it applies the fog and effect to everything ins$$anonymous$$d of just underwater I modified it a little so that it only turns on when you go under water but it stays on forever ins$$anonymous$$d of going off. Any Ideas?

avatar image cregox · Feb 28, 2011 at 03:34 PM 0
Share

@Tracey it depends a lot on the game implementation, but in general you can set an update function to identify if the player Y position is higher or lower than a set level, and do the switch according.

avatar image JJAPrograms · Mar 10, 2011 at 05:35 PM 1
Share

change it so the fog script is. onEnter ins$$anonymous$$d of start and OnExit to exit the water.

avatar image
0

Answer by mukul18khanna · Dec 26, 2017 at 11:38 AM

This might help- https://medium.com/@mukulkhanna/creating-basic-underwater-effects-in-unity-9a9400bde928

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

Water wave ripple effect for mobile - koi pond 2 Answers

How do I alter vertex displacement based on UV coordinates? 0 Answers

Underwater Effect 1 Answer

Motion in my Ocean 0 Answers

Is it possible to modify the Gerstner Displace of Water 4 via script to change wave direction at runtime? 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