Code Monkey home page Code Monkey logo

water-shader's Introduction

Procedural Water

A procedural water shader, multi platforrm support(Unity, GLSL, HLSL), for a variety of water types.

water-main

Features

The water shader is designed for various water types: lakes, ocean and rivers.

Current implemented features are:

  • multiple maps(height, normal, shore, sky)
  • configurable refraction and reflection
  • colour extiction based water depth
  • mean sky radiance
  • displacement
  • enabling/disabling features
  • bicubic filtering
  • configurable shore foam
  • HLSL/GLSL/Unity support(for GLSL use the conversion script to SPIR-V)

Usage

The shader requires refraction and reflection maps of the scene, the refraction map also requires the depth. See the textures folder for examples of sky, shore, foam, height and normal maps.

Certain features can be switched off via the following defines:

  • USE_DISPLACEMENT, adds displacement of gerstner and sinve waves, with an additional height map
  • USE_MEAN_SKY_RADIANCE, adds mean sky radiance reflectance, requires a sky map
  • USE_FILTERING, enable/disable bicubic filtering
  • BLINN_PHONG, use simplified specular

Preview

video

water-prev1

Composition of the water(final, shore, refraction+depth colour, reflection + distortion, diffuse + ambient, normals): water-layers

water-settings

Future improvements

Planned improvements are:

  • caustics
  • underwater mode with light rays
  • cascading depth maps
  • improved water displacement/simulation(FFT)

Contributing

Based on:

Bug reports and pull requests are welcome on GitHub at https://github.com/tuxalin/water-shader.

License

The code is available as open source under the terms of the MIT License.

water-shader's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

water-shader's Issues

May I ask the compiler env?

I just tried to open HLSL ver by Render Monkey but didn`t show up

May I ask what viewer(etc) you used to open this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.