Talos docs

POST /environment

Since 0.6

A partial sky merged onto the live one.

Plain text

Goes through the simulation like the other mutating routes, because uploading a panorama and rebuilding the environment cube touch the renderer, which belongs to the sim thread.

Request

Request body: EnvironmentRequest

POST /environment request: a partial sky, merged onto the live one.

FieldTypeRequiredDescription
skySkyPatchnoThe sky fields to change. Absent leaves the sky alone.
ambientnumbernoThe flat ambient fill. Absent leaves it alone.

Request body: SkyPatch

The sky fields a swap may set. Absent means "leave this one as it is".

FieldTypeRequiredDescription
kindstringno"procedural", "hdr", "color" or "atmosphere" (an atmosphere sky's own settings are written in the scene file).
presetstringnoA named procedural sky: clear-noon, golden-hour, overcast, dusk, night. Setting a preset with no kind switches to procedural, because that is the only thing a preset can mean.
assetstringnoThe envmap asset id for an hdr sky. It must already be in scene.assets: this endpoint swaps skies, it does not add assets to a scene.
intensitynumbernoScalar on the whole environment. Free to change: no rebuild.
rotationnumbernoYaw applied to the whole sky, radians. Free to change: no rebuild.
sun_from_skybooleannoWhether the scene's directional light should follow the sky's sun.
sun_elevationnumbernoSun elevation above the horizon for a procedural sky, radians. Negative is below it.
sun_azimuthnumbernoSun azimuth for a procedural sky, radians. Setting either angle sets both, so a request giving only one keeps the other from the live sky.
turbiditynumbernoAtmospheric haze for a procedural sky, within TURBIDITY_MIN..=TURBIDITY_MAX.

Response

Response: EnvironmentResponse

POST /environment response: the environment after the swap, and where it went.

FieldTypePresentDescription
kindstringalways"procedural", "hdr" or "color".
presetstringsometimesThe preset name, for a procedural sky.
assetstringsometimesThe asset id behind an hdr sky that loaded.
asset_pathstringsometimesThe file that asset resolved to, as the engine opened it.
intensitynumberalwaysScalar on the whole environment.
rotationnumberalwaysYaw applied to the sky, radians.
sun_directionnumber[3]sometimesTravel direction of the sun the sky casts (sun -> scene), when it has one. A color sky has none.
sun_colornumber[3]sometimesLinear RGB of that sun.
sun_intensitynumbersometimesIts scene-referred irradiance. 0 when the sun is below the horizon.
sun_from_skybooleanalwaysWhether the scene's directional light is following that sun.
ambientnumbersometimesThe flat fill added on top of the image-based diffuse, when the scene has no sky field and ambient therefore still means what it meant before D7.
findingsstring[]sometimesWhy this is not what the scene asked for: a missing panorama, an undecodable file. Empty when the sky is exactly what was written.
persistedbooleanalwaysAlways false: this endpoint reports the live sky, and a live sky is never on disk until someone edits the scene file. Present so a client does not have to infer it.
frameintegeralwaysThe frame the new sky is first drawn on.
changedstring[]sometimesWhat was actually changed, so a caller sees that a field it sent was a no-op.

Example

curl -X POST "http://127.0.0.1:7700/environment" --json @body.json

Start a server with argus run --serve; the port is --port (7700 by default). The request and response fields are in the query API guide.