Hi, I have a fog material that can be used in a Niagara System to create randomly moving fog in a scene.
Now I don’t want to fill just a room with fog, but an entire level.
Also, the fog doesn’t have to move. It might as well be static, e.g. just sit there where I put it.
Now I wondered:
Should I still use a Niagara System? I would have to create an emitter that only bursts once, in an area that covers my whole scene and disable any sort of movement; I would still use the randomness of the burst
Or can I add the fog material to a huge static mesh instead (one that covers my whole scene)? In that case how do I achieve something that isn’t a uniform distribution?
Seems to be great tool, with a well-defined use case at a very reasonable price.
However, most of the features I don’t need. And even with EasyFog I would still have to find a way to populate my entire scene with fog programmatically, i.e. I want to distribute the fog over a huge scene mostly uniformly with a bit of random noise.
It really depends on a lot of things. How big your scene is, do you want the fog to be volumetric, etc.
For example, if you want it everywhere, except a few places, then you use a noise material ( or volume fog ), and vertex paint out some parts. I’ve never actually tried that, but I assume it would work. It would be a huge mesh, though. Or many smaller meshes.
First thing I think of is to use a 2D perlin noise generator. It creates a cloud like noise pattern which you can use over absolute world coordinates, for which you can also control its pattern “size”. You could use it as is, or generate a mask from it by clamping to a range of values. normally it generates a -1 to 1 range but you can make a 0 to 1 range and use it as an alpha for your effects.
// Get perlin between 0 and 1.
float Perlin = (FMath::PerlinNoise2D(FVector2D(U, V)) + 1.f) / 2.f;