Giter Site home page Giter Site logo

volumecloud's Introduction

Volume Cloud for Unity3D

This is an volume cloud rendering implementation for Unity3D using methods from[1].

Settings

This is a post-process effect. You need to add the script VolumeCloud to camera.
A configuration file is required, so you can share same configuration between multiple cameras. Right-click in project window to generate one.
Some values can only be edited in the shader file CloudShaderHelper.cginc. e.g. sample step count, cloud layer position, thickness and earth radius(for correct atmosphere shape).
A Weather tex is required to make cloud only cover part of sky. A very simple example is included in Textures/. A better idea is to make textures on demand, or write a shader that renders a weather texture.
The weather tex uses 3 channals, R for coverage, G for density, B for cloud type. low coverage makes fewer clouds. lower density however won't change the count or size of shape, but affects the lighting of the cloud, it's reconmmended to use higher density for rain cloud(make it look darker). Larger cloud type value makes taller cloud shape.

Implementation details.

Most of the techniques are the same from the slides.

  1. The rendering is a post-processing effect.
  2. First a quarter-res buffer is rendered which is the main part, including building the cloud shape and sample for light etc.(The result contains intensity, density and depth).
  3. A history buffer is maintained, by blending history buffer(reprojected so to sample correctly) and the quarter-res buffer together to make new one.(quarter-res buffer is firstly shaded then blended with history buffer.)
  4. Blit the cloud image with final image.

Known issues

Cloud can only be rendered behind objects. This is not resolved in the original presentation either.
When moving the camera, the reprojection quality is not good, and whole image become blurred, the rendering process become very visible(especially when downsampled).

TODO

Add depth clipping stuff.

References

[1]The Real-time Volumetric Cloudscapes of Horizon: Zero Dawn
[2]Nubis: Authoring Real-Time Volumetric Cloudscapes with the Decima Engine
[3]TAA from playdead for reprojection code

History.

18/4/15 - Fixed "band" glitch.
18/7/7 - Added low-resolution rendering.

volumecloud's People

Contributors

yangrc1234 avatar

Stargazers

 avatar

Watchers

 avatar

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.