Gameplay and API
Density queries
Sample cloud density on the GPU for gameplay decisions.
Cloud Density Query samples the cloud renderer's density function on the GPU. In Play mode, call TryQuery(layer, camera, positions, cloudWidth, cloudHeight, callback). A request accepts 1–256 world-space positions and one request may be in flight per component. The width and height must be the actual low-resolution cloud render target dimensions for the chosen camera; they control the shader's texture-detail sampling. The call returns false when it cannot accept a request, including unsupported asynchronous readback or floating-point texture formats, invalid inputs, unsupported camera settings, a missing query pass, an unavailable cloud layer, or a custom layer shader. Queries use the included Cloudscape shader; arbitrary custom shaders do not have a verified density-query contract. No callback is made for a rejected request.
An accepted request calls back asynchronously with Success, a density value for each input position in the same order, and the captured simulation time. A readback error, non-finite result, or a detected change to the layer, profile, source texture versions, camera matrices or wind timeline produces Success = false, no values, and an error string. Disabling or destroying the query component suppresses its callback; it retains the submitted resources until readback finishes. IsPending remains true until that cleanup completes. Keep the layer enabled and its assigned textures alive and unchanged until the callback; Scalar settings and camera matrices are captured at submission and checked again on completion. Time-dependent wind motion remains represented by the captured simulation time; query results can be delayed even when inputs remain unchanged. Avoid issuing more frequent requests than your gameplay needs.
These are samples of the renderer's detailed field, including cloud altitude, local placement bounds, weather maps, wind displacement, density, erosion, distance haze and detail level for the supplied camera. They are camera-dependent: distance haze and detail sampling change with the viewpoint and target width. Samples are not visibility or line-of-sight tests; they do not account for scene depth, transparency, cloud opacity integrated along a ray, temporal accumulation or occlusion. Perspective mono cameras are supported by this API. The result is not a physical measurement and should not be used as an authoritative collision or network synchronization signal. Exact behavior and performance depend on the graphics device and readback latency.
Still stuck?
Bring the sky with you.
Include the Cloudscape version, Unity and render-pipeline versions, operating system, graphics API, the Cloud Layer's camera setup inspection, relevant logs, and a minimal reproduction.