@geoblocks/cesium-post-process 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +29 -0
- package/README.md +235 -2
- package/analog-video.js +138 -0
- package/blur.js +39 -0
- package/cesium-post-process.js +23 -0
- package/cloud-cover.js +49 -0
- package/cloud-map.js +122 -0
- package/cloud-noise.js +229 -0
- package/clouds.js +684 -0
- package/color-isolation.js +69 -0
- package/depth-test.js +37 -0
- package/digital-video.js +108 -0
- package/drone-display.js +170 -0
- package/effect.js +64 -0
- package/focus.js +25 -0
- package/frame-clock.js +61 -0
- package/height.js +23 -0
- package/infrared.js +40 -0
- package/jello.js +146 -0
- package/lens-distortion.js +68 -0
- package/lightning.js +321 -0
- package/motion-blur.js +117 -0
- package/package.json +55 -4
- package/precipitation.js +493 -0
- package/shaders/Alpenglow.js +2 -0
- package/shaders/AnalogVideo.js +2 -0
- package/shaders/Beam.js +2 -0
- package/shaders/CloudsBlur.js +2 -0
- package/shaders/CloudsComposite.js +2 -0
- package/shaders/CloudsDensity.js +2 -0
- package/shaders/CloudsDepth.js +2 -0
- package/shaders/CloudsMarch.js +2 -0
- package/shaders/CloudsResolve.js +2 -0
- package/shaders/CloudsShadow.js +2 -0
- package/shaders/CloudsShadowMap.js +2 -0
- package/shaders/CloudsSlab.js +2 -0
- package/shaders/ColorIsolation.js +2 -0
- package/shaders/DepthEdges.js +2 -0
- package/shaders/DigitalVideo.js +2 -0
- package/shaders/DroneDisplay.js +2 -0
- package/shaders/EyeFromDepth.js +2 -0
- package/shaders/Filmic.js +2 -0
- package/shaders/Flashlight.js +2 -0
- package/shaders/Fog.js +2 -0
- package/shaders/Frame.js +2 -0
- package/shaders/Hash.js +2 -0
- package/shaders/Height.js +2 -0
- package/shaders/Hsl.js +2 -0
- package/shaders/Infrared.js +2 -0
- package/shaders/Jello.js +2 -0
- package/shaders/LensDistortion.js +2 -0
- package/shaders/Lightning.js +2 -0
- package/shaders/MotionBlur.js +2 -0
- package/shaders/MotionBlurVelocity.js +2 -0
- package/shaders/Noise.js +2 -0
- package/shaders/Normal.js +2 -0
- package/shaders/Phase.js +2 -0
- package/shaders/Precipitation.js +2 -0
- package/shaders/PrecipitationShaftBlur.js +2 -0
- package/shaders/PrecipitationShafts.js +2 -0
- package/shaders/PrecipitationWind.js +2 -0
- package/shaders/RainHaze.js +2 -0
- package/shaders/Shockwave.js +2 -0
- package/shaders/SkyTable.js +2 -0
- package/shaders/SnowLine.js +2 -0
- package/shaders/SpeedLines.js +2 -0
- package/shaders/Spotlight.js +2 -0
- package/shaders/SpotlightBeam.js +2 -0
- package/shaders/SpotlightBeamBlur.js +2 -0
- package/shaders/SpotlightCone.js +2 -0
- package/shaders/Super8.js +2 -0
- package/shaders/Technicolor.js +2 -0
- package/shaders/TiltShift.js +2 -0
- package/shaders/Toy.js +2 -0
- package/shaders/Trails.js +2 -0
- package/shaders/ValleyFog.js +2 -0
- package/shaders/WeatherMap.js +2 -0
- package/shaders/WhiteModel.js +2 -0
- package/snow-line.js +108 -0
- package/speed-lines.js +71 -0
- package/spotlight.js +193 -0
- package/strikes.js +30 -0
- package/super8.js +164 -0
- package/technicolor.js +56 -0
- package/tilt-shift.js +124 -0
- package/toy.js +192 -0
- package/valley-fog.js +105 -0
- package/weather-map.js +290 -0
- package/white-model.js +105 -0
package/white-model.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import {Cartesian2} from '@cesium/core';
|
|
2
|
+
import Toy from './toy.js';
|
|
3
|
+
import WhiteModelShader from './shaders/WhiteModel.js';
|
|
4
|
+
|
|
5
|
+
const valuesScratch = new Cartesian2();
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A white model's look, as an architect's plaster model or clay render: every color turned to its
|
|
9
|
+
* value, the values pressed into a narrow range of whites (the darkest left black: a section's
|
|
10
|
+
* poché), darker where surfaces meet, the edges lit and shaded and finely outlined as the toy's,
|
|
11
|
+
* the sky a pale gradient if asked. A `Toy` with another grading: its options and properties,
|
|
12
|
+
* `saturation` 0 (an accent's hue kept above it), `warm` the plaster's tint.
|
|
13
|
+
*/
|
|
14
|
+
export default class WhiteModel extends Toy {
|
|
15
|
+
/**
|
|
16
|
+
* @param {import('@cesium/engine').CesiumWidget} viewer
|
|
17
|
+
* @param {{light?: number, shade?: number, bevel?: number, outline?: number, jump?: number, saturation?: number, warm?: [number, number, number], values?: [number, number], poche?: number, occlusion?: number, radius?: number, sky?: [import('@cesium/core').Color, import('@cesium/core').Color]}} [options]
|
|
18
|
+
*/
|
|
19
|
+
constructor(viewer, options = {}) {
|
|
20
|
+
// the toy's options, each the white model's default when not given, or given as undefined
|
|
21
|
+
super(viewer, {
|
|
22
|
+
...options,
|
|
23
|
+
light: options.light ?? 0.08,
|
|
24
|
+
shade: options.shade ?? 0.12,
|
|
25
|
+
outline: options.outline ?? 0.25,
|
|
26
|
+
saturation: options.saturation ?? 0,
|
|
27
|
+
warm: options.warm ?? [1, 0.995, 0.985],
|
|
28
|
+
});
|
|
29
|
+
this.values_ = options.values ?? [0.35, 0.97];
|
|
30
|
+
this.poche_ = options.poche ?? 0.1;
|
|
31
|
+
this.occlusion_ = options.occlusion ?? 0.35;
|
|
32
|
+
this.radius_ = options.radius ?? 1.5;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @override
|
|
37
|
+
* @protected
|
|
38
|
+
*/
|
|
39
|
+
shader_() {
|
|
40
|
+
return WhiteModelShader;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @override
|
|
45
|
+
* @protected
|
|
46
|
+
*/
|
|
47
|
+
uniforms_() {
|
|
48
|
+
return {
|
|
49
|
+
...super.uniforms_(),
|
|
50
|
+
values: () => Cartesian2.fromArray(this.values_, 0, valuesScratch),
|
|
51
|
+
poche: () => this.poche_,
|
|
52
|
+
occlusion: () => this.occlusion_,
|
|
53
|
+
radius: () => this.radius_,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The darkest and the lightest values, from 0 to 1: the scene's black and its white.
|
|
59
|
+
*/
|
|
60
|
+
get values() {
|
|
61
|
+
return this.values_;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
set values(value) {
|
|
65
|
+
this.values_ = value;
|
|
66
|
+
this.viewer.scene.requestRender();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The value under which a color keeps it rather than being pressed into the whites, fading into
|
|
71
|
+
* them about it: a section's poché, solid black; 0 to press every color.
|
|
72
|
+
*/
|
|
73
|
+
get poche() {
|
|
74
|
+
return this.poche_;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
set poche(value) {
|
|
78
|
+
this.poche_ = value;
|
|
79
|
+
this.viewer.scene.requestRender();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* How much darker the surfaces get where they meet, in a corner or at a wall's foot, 0 for none.
|
|
84
|
+
*/
|
|
85
|
+
get occlusion() {
|
|
86
|
+
return this.occlusion_;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
set occlusion(value) {
|
|
90
|
+
this.occlusion_ = value;
|
|
91
|
+
this.viewer.scene.requestRender();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* How wide the corners' shadow is, in meters, 48 pixels at the most.
|
|
96
|
+
*/
|
|
97
|
+
get radius() {
|
|
98
|
+
return this.radius_;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
set radius(value) {
|
|
102
|
+
this.radius_ = value;
|
|
103
|
+
this.viewer.scene.requestRender();
|
|
104
|
+
}
|
|
105
|
+
}
|