Clouds Shader by todoval - 1

Shaders & Effects

Realtime Volumetric Clouds for Unity 3D

Unknown VersionUnknown LicenseUpdated 110 days agoCreated on March 17th, 2020
Go to source

Realtime Volumetric Clouds for Unity 3D

How to use

This asset contains both a script (and shaders) for cloud generation and, as a subproduct, a script for noise generation. The cloud shader package ALSO contains the script for noise generation, so downloading both assets is unnecessary!

How to use the cloud asset:

  1. import the unity package found in https://github.com/todoval/CloudsShader/blob/master/CloudShader.unitypackage to your project
  2. create a new 3D Cube object as a container for the clouds
  3. turn off the Mesh renderer of the container
  4. find the CloudShader/CloudGenerator.cs script and add it to a camera (a camera MUST be present in the scene)
  5. set the following properties of the script:
    • Container: set this to your created cube container
    • Cloud Rendering Shader: set this to CloudShader/CloudRendering
    • Environment Blending Shader: set this to CloudShader/EnvironmentBlending
  6. set other script properties according to your liking
    • beware, properties such as Cloud Size, Ray March Step Size, Ray March Step Decrease, Absorption Coefficient, Density Multiplier and Speed must be set to values other than 0 in order for the cloud shader to work
  7. run the game (the script will run in edit mode also)

The Cloud Generation Script

How to use the noise generation asset:

  1. import the unity package found in https://github.com/todoval/CloudsShader/blob/master/NoiseGenerator.unitypackage to your project
  2. add the CloudShader/NoiseGenerator/NoiseGenerator.cs script to any object
  3. set the following properties of the script:
    • Noise Texture Generator: set this to Assets/CloudShader/NoiseGenerator/NoiseTextureGenerator.compute
    • Slicer: set this to Assets/CloudShader/NoiseGenerator/Slicer.compute
  4. set other script properties according to your liking
  5. run the game
  6. use buttons in the script (Create Shape Texture, Create Detail Texture, Create Weather Map) to create the desired textures
    • game MUST be running at this point!
  7. textures will be stored in the Resources/texture_name folder

The Noise Generation Script

What the Resources folder should look like after importing either one of the scripts

Project Results

This section shows some of the results that can be achieved with the Cloud Generation asset:


Linked down below are also the presentation and a video that was used for the project defense, as this asset was created as a part of a Computer Graphics for Computer Games course on MatFyz:

Future work

Following are the future plans for this project:

  • Directional light support
  • User-adjustable wind direction
  • Performance improvements:
    • Temporal reprojection
    • Temporal upsampling improvement

References

Show all projects by todoval