本文へ移動

Chikyu Earth地球

世界の国の輪郭を線で描いた地球儀です。地球と同じ速さで回ります。宇宙から見たような地球と、好きな場所の目印も使えます。

「地球」(ちきゅう) は、私たちが住む星の名前です。 名前について(英語)

目次

リファレンス · リアルな地球の計算部分

airFrag関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

The air as light scattered once, worked out for each pixel: a ray from the camera through the shell, sampled view times, each sample looking light times toward the Sun. Rayleigh scattering (the air's own molecules: thicker the longer the path, and bluer) and Mie scattering (haze and dust: a bright halo round the Sun's direction), with the scale heights and coefficients of the standard sea-level air (Rayleigh 8 km, Mie 1.2 km; the Mie coefficient is that of very clear air, 0.4 of the usual, so the haze stays blue). What the sums give, and nothing drawn: the blue haze thickening toward the limb on the day side, the glow toward the Sun, the reddening along the day and night line (the Sun's light has crossed a long, low path) and the thin lit ring seen from the night side looking toward the Sun. The surface under it is dimmed by what the air takes out of the light (the shader's alpha is what gets through) and what it adds is the colour. Our own code, from the published single-scattering model (Nishita and others, 1993; O'Neil, GPU Gems 2, chapter 16), no code taken from any project. The air can be drawn thicker than it is (thick, a uniform: 1 is the true 100 km, 3 the default of the elements): the shell and both scale heights grow by it and what each unit of length holds shrinks by it, so the same air gives the same colours over a wider glow. The Sun is in the world's axes (sunDir, toward the Sun); ortho is 1 when the camera looks down the z axis from far away (the realistic Earth) and 0 for a camera at a place (the space view).

インポート

import { airFrag } from "@johnmorrisdotca/chikyu-earth/realistic";

定義

function airFrag(samples: AirSamples): string

引数

名前型説明
samplesAirSamples

How many samples to take (AIR_QUALITY.full or AIR_QUALITY.light).

戻り値

string

The fragment program's source, for a ShaderMaterial.

例

import { airFrag, AIR_QUALITY } from "@johnmorrisdotca/chikyu-earth/realistic";
console.log(airFrag(AIR_QUALITY.light).includes("N_VIEW 6"));
true

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/chikyu-earth 0.51.1 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。