All Projects → real-marco-b → unity-water-shader2d

real-marco-b / unity-water-shader2d

Licence: MIT license
A 2D water shader for Unity

Programming Languages

C#
18002 projects
GLSL
2045 projects

Projects that are alternatives of or similar to unity-water-shader2d

URP Water
Water shader in unity urp.
Stars: ✭ 19 (-79.12%)
Mutual labels:  shader, water
webgl-noise-examples
examples about noise
Stars: ✭ 72 (-20.88%)
Mutual labels:  shader
UnityChanToonShaderVer2 VerticalDissolve
UnityChanToonShaderVer2 with VerticalDissolve
Stars: ✭ 31 (-65.93%)
Mutual labels:  shader
minimal gl
PC 4K Intro Editor
Stars: ✭ 36 (-60.44%)
Mutual labels:  shader
Unity StarGlow
Simple star-glow effect.
Stars: ✭ 39 (-57.14%)
Mutual labels:  shader
notebookdrawings-shader-unity
Unity3D port of the excellent 'notebook drawings' post-processing shader by flockaroo.
Stars: ✭ 34 (-62.64%)
Mutual labels:  shader
AndroidGLKit
AndroidGLKit provides OpenGL ES 2.0 boilerplate codes for Android.
Stars: ✭ 22 (-75.82%)
Mutual labels:  shader
Height-Based-Gradient-Color-Shaders-for-Unity
Height Based 2 color gradient shaders for Unity
Stars: ✭ 18 (-80.22%)
Mutual labels:  shader
Mesh-Animation
Fast GPU vertex shader based animation library for Unity (VAT, Vertex Animation Texture, Morphing Animation)
Stars: ✭ 113 (+24.18%)
Mutual labels:  shader
DissolveEffectForUGUI
A dissolve effect for uGUI, without material instancing. Please star and watch this project :)
Stars: ✭ 67 (-26.37%)
Mutual labels:  shader
VaKawaseBlur
Fast and furious Kawase blur implementation for Unreal Engine 4
Stars: ✭ 37 (-59.34%)
Mutual labels:  shader
URP-Sun-Shafts
A URP port of Unity's classic Standard Assets Effects package's Sun Shaft effect
Stars: ✭ 36 (-60.44%)
Mutual labels:  shader
card-game-GLSL
card game in the single GLSL shader
Stars: ✭ 20 (-78.02%)
Mutual labels:  shader
GuthrieSolv
Experimental small molecule hydration free energy dataset
Stars: ✭ 30 (-67.03%)
Mutual labels:  water
NNAOTest
Neural Network Ambient Occlusion for Unity
Stars: ✭ 72 (-20.88%)
Mutual labels:  shader
Shader
🌃 Make simple shade view with Shader!
Stars: ✭ 16 (-82.42%)
Mutual labels:  shader
hassle-rs
🦀 This crate provides an FFI layer and idiomatic rust wrappers for the new DirectXShaderCompiler library.
Stars: ✭ 34 (-62.64%)
Mutual labels:  shader
ada
A general porpose OpenGL app library
Stars: ✭ 105 (+15.38%)
Mutual labels:  shader
WernessDithering
Copy of dithering code by Brent Werness (Koloth) invented for Obra Dinn
Stars: ✭ 24 (-73.63%)
Mutual labels:  shader
ProjectKaya
Project Kaya for mobile game platform
Stars: ✭ 324 (+256.04%)
Mutual labels:  shader

Unity 2D Water Shader

Add a nice refraction water shader to your game!

Checkout the video:

Youtube Demo Video

Usage

Try it

Just clone or download the repository and open the folder within Unity.

Run the included Demo Scene.

Use it within your Game

  • Put the DisplacementBehaviour and DisplacementShader into your game. Keep the shader under Resources folder.

  • Attach the DisplacementBehaviour to your main camera and set up a noise and water texture as behaviour property (the sample ships with sample textures).

  • Limit the water effect to a certain scene area by adding planes to the built-in Water layer.

  • You can specify the turbulence (waviness) of the water by setting the Turbulence property of the DisplacementBehaviour. The turbulence will also influence the strength of refraction.

Implement Scrolling

When the camera scrolls left or right, the water waves need to change their phase offset. Otherwise they will appear to be a "camera overlay" flying over the scene.

The DisplacementBehaviour has a scroll offset parameter which can be incremented / decremented on scrolling.

Check out the included CamScrollBehaviour as a reference implementation for scrolling.

What's next

  • Physical Collision Behaviour (Ripples)

  • Better Effects (I'm experimenting ;) )

  • Better Demo Scene

Disclaimer

I am pretty new to shader programming, so the source may not be optimal. Contributions are welcome! :) I tested the shader on Windows, Mac OS, iPad Pro 9.7 and iPhone 7.

Implementation

I am currently writing a tutorial about the details. Stay tuned :)

Contact

Feel free to contact me if you have any questions. In case you are going to use this shader within some application, I'd be happy to hear about :)

Follow me on Twitter: twitter.com/mbue_coding

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].