Reference · How a body is drawn with three.js
Atmospheretype
A rim of air: the colour it scatters (0 to 1 each), how strong it is and how thin the rim is.
Import it
import type { Atmosphere } from "@johnmorrisdotca/wakusei-planets/look";
Definition
interface Atmosphere {
colour: readonly [
number,
number,
number
];
strength: number;
power?: number;
}
Members
| Name | Type | Description |
|---|---|---|
colour | readonly [number, number, number] | |
strength | number | |
power (optional) | number | undefined | How thin the rim is: higher is thinner. Default 3. |
Examples
import { registerLook, type Atmosphere } from "@johnmorrisdotca/wakusei-planets/look";
const air: Atmosphere = { colour: [0.5, 0.7, 1], strength: 0.4 };
registerLook({ id: "venus", surface: "vec4 surface(vec3 p) { return vec4(vec3(0.9), 0.0); }", atmosphere: air });
console.log(air.strength);0.4What it prints (run when this page was built)