BodyLook型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What a body looks like in three.js: the shader code of its surface, how it glows, its atmosphere and its painted map.
インポート
import type { BodyLook } from "@johnmorrisdotca/wakusei-planets/look";
定義
interface BodyLook {
id: BodyId;
surface: string;
emissive?: boolean;
atmosphere?: Atmosphere;
limb?: number;
relief?: number;
wrap?: number;
ambient?: number;
painted?: PaintedMap;
mapped?: boolean;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
id | BodyId | |
surface | string | GLSL that defines |
emissive (省略可) | boolean | undefined | A glowing body (the Sun): no shading from outside light. |
atmosphere (省略可) | Atmosphere | undefined | |
limb (省略可) | number | undefined | How much the disc darkens toward the limb, 0 to 1. Default 0. |
relief (省略可) | number | undefined | How strongly the height shows as relief, 0 to 2. Default 0.6. |
wrap (省略可) | number | undefined | How far light wraps round the terminator: 0 is a hard edge (no air), 0.3 a soft one. Default 0.04, or 0.3 with an atmosphere. |
ambient (省略可) | number | undefined | How much of the night side shows (0 to 1). Default 0.04. |
painted (省略可) | PaintedMap | undefined | |
mapped (省略可) | boolean | undefined | Draw the painted map in the realistic look too: for a body with no honest drawing from numbers (the Earth's continents). |
例
import { registerLook, type BodyLook } from "@johnmorrisdotca/wakusei-planets/look";
const look: BodyLook = { id: "moon", surface: "vec4 surface(vec3 p) { return vec4(vec3(0.7), 0.0); }", ambient: 0.02 };
console.log(registerLook(look).id);moon出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。