I'm working on some clouds using particles, because particles are cheap but look good. Right the clouds are limited to a cube shape, and the noise is rendered in local space(I'm going to change it to world space so it looks more realistic). Right now it looks pretty plain, I'll keep adding features until it looks nice.
Update link to the github repository here: https://github.com/Dpschoonmaker/Godot-particle-clouds
Very nice so far. Sometimes, the techniques of the past are still good in the present. :) Do you plan to have sun light affect the clouds (faked or not)?
Thanks, it's not much yet though. So far I don't have anything fancy for light(no refraction or similar), I just have a simple shader for each particle that has transmission. It looks too shadowed without it.
The shader combines noise and a circular gradient texture for alpha, so that you don't see any edges. It just uses the default quadmesh uvs, but I think I'll modify the uvs in the shader (maybe render in world space) so that it looks more like one cloud and not a bunch of particles.
One observation: if you haven't already, you might want to make your circular gradient have a non-linear falloff since clouds are a gaseous formation and experience pressure from the surrounding atmosphere. This is an oversimplified statement though, to be sure.
If the gradient is non-linear, should it be more gradual or closer to a solid circle?
I've worked with cloud rendering before, so I'd say bell shaped curve for a gradient. https://upload.wikimedia.org/wikipedia/commons/thumb/5/57/Smoothstep_and_Smootherstep.svg/220px-Smoothstep_and_Smootherstep.svg.png But the shape can be a little more complicated than that.
Good idea, I'll try to do that. I think I'll have to generate the gradient in the shader, right now I'm just using a texture from an external program.
Okay, thanks for the smoothstep idea. I coded a smoothstep gradient inside the shader, now I don't need a texture for the gradient :). I changed some settings so the cloud shape looks a little more random, adjusted the transmission, changed the height, and various other tweaks to get this: Last but not least, I added an albedo parameter for different cloud colors: Oh and proximity fade: Unfortunately proximity fade doesn't work on the water shader.
Next I'm going to add distance fade and some sort of trickery to simulate refraction/diffraction.
I know I should've asked sooner, but when you say refraction, do you mean scattering? Refraction is normally associated with solid surfaces.
Participating media can do four things with light. In-scattering Out-scattering Absorption Emission
I don't really know many terms for it, refraction is probably the wrong one. I just mean the bouncing around of light inside clouds, it's talked about in this video
That's a complicated and expensive way to do it, I'm going to do some fake and cheap method. I'm not entirely sure what yet.
Yeah I've actually watched video before. It was very insightful. It would've been great if I watched while I was making my cloud tracer.
@Dschoonmaker said: I don't really know many terms for it, refraction is probably the wrong one. I just mean the bouncing around of light inside clouds,
So you do mean scattering. Alright understood. :)
Your volume renderer would be great for higher quality clouds(I want something cheap, Godot isn't a powerful engine and I have two cameras rendering simultaneously).
Scattering, that's what it's called. I'll search for that instead.
I know my renderer is meant for higher quality computers. Your clouds would definitely be well suited for low end devices.
Your renderer is really awesome, but I saw you got about 10 FPS on Intel 4400.
Depends on the settings. I get about 12 fps with 16x tile size, 64 samples, but it's only because an integrated graphics processor. They're notorious for being low-end graphics hardware.
Yeah, I'm thinking of replacing mine.
I added a shader for the particles process material, I think I'm done with the graphics, unless I can think of a way to fake shadows(because the clouds are way beyond the maximum shadow casting distance). I'll make a system for cloud movement/lots of clouds, maybe even a weather system next.
You know I just realized something. Doesn't the Godot shading language come with a builtin smoothstep function?
smoothstep
It looks like you can use smoothstep with floats or with vectors: Shading-Language built-in functions.
Out of curiosity, and this is slightly off-topic, but what is there a difference between smoothstep and mix?
mix
Edit: Nevermind, I found this site (paulbourke.net) showing the different interpolation functions mapped. It looks like it a smoother version of interpolation, similar to cubic interpolation visually.
Well the difference between smoothstep and cubic is that cubic interpolation (1D for example) would take 4 sample points, while smoothstep still takes 2.