We recently had an interesting support call from one of our customers – they were using SilverLining in a system with geometric distortion on a dome surface, and encountering visible seams in clouds that spanned the channels that made up the display.
Normally, getting our clouds to line up seamlessly across channels is easy – you just set a consistent random seed using SilverLining::RandomNumberGenerator::Seed() prior to calling SilverLining::CloudLayer::SeedClouds(), and any cloud layers will be consistent across channels. And in our initial test where we just visualized the flattened channels they were working with, everything appeared fine.
But, once the channels were distortion-corrected in software, the billboards that make up cumulus clouds no longer aligned perfectly. An example of this technique is the osgDistortion sample that comes with OpenSceneGraph; the high-level idea is to render each channel to a texture, then render that texture on a 3D model of the surface you intend to project it onto. For some reason, our billboards became inconsistent across channels in this step.
Billboards work by rotating a flat 2D image to point toward the eyepoint, giving it the illusion of having volume when it really doesn’t. Cumulus and stratocumulus-particles cloud layer types in SilverLining rely on lots of these billboards. The problem seems to arise from that vector toward the eye also being distorted in the projection process. In a small billboard, like for a tree or something, this isn’t enough of an effect to really matter. But for the billboards that make up clouds, these can be thousands of feet across, and this small error adds up.
In the end, we recommended several tweaks to the settings in Resources/SilverLining.config to make things look better. The main change is to make the cloud billboards smaller, so that they suffer less from this effect. Some other changes are just there to ensure that the clouds are sorted consistently from every channel, based on distance from the camera instead of any view-dependent deprojections:
sort-by-screen-depth = no
cumulus-congestus-voxel-dimension = 200.0
billboard-world-screen-blend-factor = 0
billboard-use-ndc = no
cumulus-billboards-per-cloud = yes
cloud-never-allow-intersection = yes
This helps a lot (the result is seen above), but ultimately the only perfect solution is to use cloud layer types that don’t depend on billboards at all. This would include stratus and stratocumulus (not stratocumulus-particles,) as well as cirrus and cirrostratus. Stratocumulus cloud layers may be configured to look essentially identical to a cumulus-congestus layer, so for many applications this may be a viable and superior option.
If you’re using SilverLining in a dome display with distortion correction being done in software and wondering why our billboards don’t line up – try the tips above, and it should help.