All Projects → shanecelis → Water Demo

shanecelis / Water Demo

Licence: other
A port of Evan Wallace's "Water Demo" for WebGL to Unity.

Labels

Projects that are alternatives of or similar to Water Demo

Unity Dithered Transparency Shader
Unity material and shader for applying clipped, dithered transparency
Stars: ✭ 174 (-27.5%)
Mutual labels:  shaderlab
Unity Ecs Job System Sph
Implementation of the SPH Algorithm (fluid simulation) in Unity, comparing singlethread and ECS/Job System performances.
Stars: ✭ 197 (-17.92%)
Mutual labels:  shaderlab
Inputsystem warriors
Example Project for the new Unity Input System
Stars: ✭ 219 (-8.75%)
Mutual labels:  shaderlab
Videolabtest
OP-Z videolab examples
Stars: ✭ 186 (-22.5%)
Mutual labels:  shaderlab
Unitywatersurface
Water Surface Simulation using CutomRenderTexture in Unity 2017.1
Stars: ✭ 190 (-20.83%)
Mutual labels:  shaderlab
Unity Shaders
✨ Shader demo - More than 300 examples
Stars: ✭ 198 (-17.5%)
Mutual labels:  shaderlab
Threedscans
Scanned statue models from the Three D Scans project, optimized for real-time rendering use.
Stars: ✭ 172 (-28.33%)
Mutual labels:  shaderlab
Lwrpscriptablerenderpass examplelibrary
Stars: ✭ 237 (-1.25%)
Mutual labels:  shaderlab
Outlined Diffuse Shader Fixed
This is a fixed version of diffused outline shader from http://wiki.unity3d.com/index.php/Outlined_Diffuse_3
Stars: ✭ 194 (-19.17%)
Mutual labels:  shaderlab
Universalshaderexamples
Sand box project containing example shaders and assets compatible with Unity Universal Render Pipeline.
Stars: ✭ 207 (-13.75%)
Mutual labels:  shaderlab
Isaura
An attempt at making a aura thingie with a isoline shader.
Stars: ✭ 187 (-22.08%)
Mutual labels:  shaderlab
Awesome Unity Shader
⛵ 关于炫酷的Unity3D Shader | About Cool Unity3D Shaders
Stars: ✭ 2,658 (+1007.5%)
Mutual labels:  shaderlab
Amplifyshadercommunityextras
Community made extras for Amplify Shader Editor
Stars: ✭ 201 (-16.25%)
Mutual labels:  shaderlab
Shaders
A collection of shaders written in CG/ShaderLab for Unity.
Stars: ✭ 173 (-27.92%)
Mutual labels:  shaderlab
Skyboxpanoramicshader
Skybox shader for support of 360/180/cubemap video and static content
Stars: ✭ 231 (-3.75%)
Mutual labels:  shaderlab
Nvjob Water Shader Simple And Fast
#NVJOB Simple Water Shaders. Free Unity Asset.
Stars: ✭ 172 (-28.33%)
Mutual labels:  shaderlab
Ssgi Urp
Screen Space Global Illumination for Unity Universal Render Pipeline
Stars: ✭ 198 (-17.5%)
Mutual labels:  shaderlab
Forcefieldfx
Stars: ✭ 238 (-0.83%)
Mutual labels:  shaderlab
Unity Vhsglitch
glitched VHS post-processing shader for Unity3D
Stars: ✭ 231 (-3.75%)
Mutual labels:  shaderlab
Spritesheetrenderer
A powerful Unity ECS system to render massive numbers of animated sprites.
Stars: ✭ 204 (-15%)
Mutual labels:  shaderlab

Water Demo

Water demo GIF showing caustics.

This is a port of Evan Wallace's Water Demo from WebGL to Unity.

Motivation

I ported this as an exercise to investigate different real-time caustics implementations. I've only surveyed a handful of research papers on real-time caustics, but it seems like Evan's work would be suitable for publication for both its simplicity and performance.

Requirements

  • Unity 2018.2.17f1

Usage

Create a new project using Unity 2018.2.17f1. Clone this repo into the "Assets" directory. Open the "cube-of-water" scene and hit play.

Click on water to cause a wave.

You can click on the water to cause a wave. You can drag to move the camera around. Hit "space" key to pause water simulation. Hit "n" key to update the simulation one time step.

Implementation Notes

This is a pretty faithful reproduction of Evan's demo. As such there are a number of cases where it deviates from Unity's conventions.

For instance, the shader that renders the sphere has variable sphereCenter, so the sphere rendering object is expected to located at the origin and if you change that, it probably will not look right.

The light direction is provided to shaders as a direction vector. It doesn't use Unity's lighting at all.

The shaders do not use the models' UV coordinates. For instance the cube's minimum and maximum model position are (-1, -1, -1) and (1, 1, 1), so any point on its surface is often just mapped directly to a UV coordinate [0, 1]^2 by transforming the point p by p * 0.5 + 0.5. This works fine for the purposes of the demo, but one would probably want to switch to UV coordinates in the future.

A lot of this is smoke and mirrors. The cube knows where the sphere is, so it renders its shadow. Great for a tech demo, but if you want to allow for multiple spheres or other objects, this will need to be reformulated significantly.

Bugs

  • WebGL build not working (major regression from original project).

  • Not all UI elements from original are preserved.

  • Underside of water does not reflect like it should. Seems like a HLSL lerp problem.

See the todo.org file for more details.

License

This project is released under the MIT license.

The tiles texture appears to be Patrick Hoesly's and was released under the Creative Commons Attribution (CC-BY) license.

Contact

I won't be providing any support for this, but if you want to follow me and the strange things I make you can find me on twitter @shanecelis.

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].