Skip to content

iammagical/Cloud-Shader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Cloud-Shader

A simplified version of the cloud shader that I'm currently using for a game idea! Here's the post! You can modify/study/use it however you want. If you do use it for your projects, I'd appreciate crediting me and maybe a coffee!!

2024-02-01.02-06-09.mp4

How the Shader Works!

Basically, it's a billboarded quad mesh with vertex displacement to give it the appearance of a spherical volume, it's overall pretty simple! I chose this method because it doesn't seem graphically intensive (I haven't truly tested it though, so it might not be as efficient as I thought). Follow the basic setup and use it as particles to create pretty cool looking clouds! I recommend this video on how to setup the clouds using the GPUParticle3D Tears of the Kingdom Style Clouds in Godot 4! - Tutorial

Basic Setup:

image image

Apply the shader onto a QuadMesh, with a subdivided width/depth of 20 (could be higher or lower, depending on your preference for quality vs. performance).

Parameters:

  • Color - Overall color of the quad; the albedo color
  • Time Scale - How fast you want the noise texture to shift
  • Noise Texture - Create a noise texture, it's used for creating the fluffy, cloud-like feel, and is also used for height displacement
  • Noise Normal Texture - Normalmap from a provided noise texture
  • Cloud Texture - Your cloud shape mask; this is your overall cloud shape (Create a cloud shape image with alpha transparency)
  • Noise Height - How high/wide you want the cloud vertex to be displaced by

The lighting code is a modified snippit of NekoArts' Botw shader !Warning! Because of how light and shadow is calculated, using an Omnilight, Spotlight3D, etc. with DirectionalLight3D will cause lighting artifacts, so make sure your mesh is on a different layer/cull mask then your non-directional lights.

  • Normal Bias - How much the light is going to be affected by the mesh's normal
  • Light Bias - Shifts how the light is going to affect the mesh
  • Shadow Size - Changes shadow size
  • Shadow Blend - Changes how much the shadow blends
  • Shadow Extra Intensity - Darkens/increases contrast of the shadow
  • Shadow Color - The shadow's color
  • Light Tint - Tints the light

If you like this shader consider buying me a coffee!

About

A basic cloud shader

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published