SilverLining and Triton both integrate with your scene by being given a view (“camera”) matrix, and a projection matrix used for drawing the sky, clouds, or ocean. Sometimes, however, what to pass in isn’t entirely straightforward. If you’re having trouble getting our environmental effects to show up where they should, here are some tips:

The normal case

In most setups, you can just pass in the same view and projection matrix being used for your application’s camera via Triton::Environment::SetCameraMatrix(), Triton::Environment::SetProjectionMatrix(), SilverLining::Atmosphere::SetCameraMatrix(), and SilverLining::Atmosphere::SetProjectionMatrix(). Sometimes, however, your application’s conventions for row-major vs. column-major matrices may be different from our own. If you know there’s nothing unusual about how your application transforms vertices into camera space, try just transposing the matrices you’re passing in if you’re having trouble.

Right-handed vs. left-handed

SilverLining needs to be told explicitly if you’re using a left-handed coordinate system. Use the rightHanded parameter on SilverLining::Atmosphere::Initialize() for this.

Clever precision tricks

Some Earth-Centered-Earth-Fixed (ECEF) applications use a trick to avoid “jitter” arising from precision issues – everything is actually drawn relative to the camera, and not from the coordinate system’s origin. Triton and SilverLining have their own ways of preserving precision, and expect that you are drawing them relative to the origin. If this sounds like your application, try multiplying in a translation matrix representing the true camera position into the view matrix you pass in to SilverLining or Triton.

Unusual world units

Remember, both Triton and SilverLining assume that one unit in your coordinate system is equal to one meter. If that’s not the case, you need to tell Triton and SilverLining about it – or else things won’t appear where they should. You can use Triton::Environment::SetWorldUnits() and SilverLining::Atmosphere::SetWorldUnits() for this purpose.

Unusual Earth models

If your Earth model isn’t a standard ECEF coordinate system or isn’t WGS84, don’t try and compensate for this by manipulating the matrices you pass in. Both SilverLining and Triton have configuration settings you can use instead. In Silverlining.config, see geocentric-z-is-up, z-is-on-prime-meridian, earth-radius-meters-polar, and earth-radius-meters-equatorial. In Triton.config, see equatorial-earth-radius-meters, polar-earth-radius-meters, and mean-earth-radius-meters.

Getting that first scene up and running can sometimes be tricky, but hopefully these tips will help!