@driftengine/script 4.11.0 → 4.11.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/capabilities.json +26 -0
- package/dist/bindings/render.js +5 -0
- package/package.json +12 -12
- package/src/bindings/render.ts +10 -0
package/capabilities.json
CHANGED
|
@@ -6259,6 +6259,32 @@
|
|
|
6259
6259
|
"doc": "Where this frame's lens is focused and how deep the sharp zone is, in metres, and how much of the depth-of-field ceiling to take, 0 to 1. Held until changed. `scale` is required here though the engine defaults it to 1, because taking the whole ceiling is the expensive answer and a script author is further from that cost than a TypeScript caller.",
|
|
6260
6260
|
"implementation": "drift/render.focus"
|
|
6261
6261
|
},
|
|
6262
|
+
{
|
|
6263
|
+
"module": "drift/render",
|
|
6264
|
+
"name": "occlusionFade",
|
|
6265
|
+
"signature": "fn(renderer: Renderer, distance: f32, radius: f32) -> void",
|
|
6266
|
+
"params": [
|
|
6267
|
+
{
|
|
6268
|
+
"name": "renderer",
|
|
6269
|
+
"type": "Renderer"
|
|
6270
|
+
},
|
|
6271
|
+
{
|
|
6272
|
+
"name": "distance",
|
|
6273
|
+
"type": "f32"
|
|
6274
|
+
},
|
|
6275
|
+
{
|
|
6276
|
+
"name": "radius",
|
|
6277
|
+
"type": "f32"
|
|
6278
|
+
}
|
|
6279
|
+
],
|
|
6280
|
+
"returns": "void",
|
|
6281
|
+
"effects": [
|
|
6282
|
+
"scene.write"
|
|
6283
|
+
],
|
|
6284
|
+
"deterministic": false,
|
|
6285
|
+
"doc": "Where ambient occlusion fades out with distance: whole up to `distance` metres from the eye and gone `radius` metres past it, so far scenery and a distant sky are not shaded in rings that follow the depth buffer. A negative distance is no fade, the default. Held until changed. Does nothing when the quality profile's `ambientOcclusion` is 0.",
|
|
6286
|
+
"implementation": "drift/render.occlusionFade"
|
|
6287
|
+
},
|
|
6262
6288
|
{
|
|
6263
6289
|
"module": "drift/render",
|
|
6264
6290
|
"name": "medium",
|
package/dist/bindings/render.js
CHANGED
|
@@ -107,6 +107,10 @@ export const RENDER_CAPABILITIES = [
|
|
|
107
107
|
'of the depth-of-field ceiling to take, 0 to 1. Held until changed. `scale` is required ' +
|
|
108
108
|
'here though the engine defaults it to 1, because taking the whole ceiling is the expensive ' +
|
|
109
109
|
'answer and a script author is further from that cost than a TypeScript caller.'),
|
|
110
|
+
define('occlusionFade', [R, { name: 'distance', type: 'f32' }, { name: 'radius', type: 'f32' }], 'Where ambient occlusion fades out with distance: whole up to `distance` metres from the eye ' +
|
|
111
|
+
'and gone `radius` metres past it, so far scenery and a distant sky are not shaded in rings ' +
|
|
112
|
+
'that follow the depth buffer. A negative distance is no fade, the default. Held until ' +
|
|
113
|
+
"changed. Does nothing when the quality profile's `ambientOcclusion` is 0."),
|
|
110
114
|
define('medium', [
|
|
111
115
|
R,
|
|
112
116
|
{ name: 'density', type: 'f32' },
|
|
@@ -156,6 +160,7 @@ export function renderImplementation() {
|
|
|
156
160
|
motionBlur: (renderer, scale) => renderer.setCameraMotionBlur(scale),
|
|
157
161
|
speedBlur: (renderer, strength) => renderer.setSpeedRush(strength),
|
|
158
162
|
focus: (renderer, distance, range, scale) => renderer.setDepthOfField(distance, range, scale),
|
|
163
|
+
occlusionFade: (renderer, distance, radius) => renderer.setAmbientOcclusionFade(distance, radius),
|
|
159
164
|
medium: (renderer, density, albedo, anisotropy, maxDistance) => renderer.setGlobalMedium(density, albedo, anisotropy, maxDistance),
|
|
160
165
|
veil: (renderer, red, green, blue, alpha) => renderer.setFrameVeil(red, green, blue, alpha),
|
|
161
166
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@driftengine/script",
|
|
3
|
-
"version": "4.11.
|
|
3
|
+
"version": "4.11.1",
|
|
4
4
|
"description": "The drift/* capability bindings: what this engine provides to DriftScript, and the only place the two are coupled",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -31,17 +31,17 @@
|
|
|
31
31
|
"driftscript": "1.17.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@driftengine/ai": "4.11.
|
|
35
|
-
"@driftengine/animation": "4.11.
|
|
36
|
-
"@driftengine/audio": "4.11.
|
|
37
|
-
"@driftengine/chemistry": "4.11.
|
|
38
|
-
"@driftengine/core": "4.11.
|
|
39
|
-
"@driftengine/editor": "4.11.
|
|
40
|
-
"@driftengine/entities": "4.11.
|
|
41
|
-
"@driftengine/network": "4.11.
|
|
42
|
-
"@driftengine/terrain": "4.11.
|
|
43
|
-
"@driftengine/ui2d": "4.11.
|
|
44
|
-
"@driftengine/xr": "4.11.
|
|
34
|
+
"@driftengine/ai": "4.11.1",
|
|
35
|
+
"@driftengine/animation": "4.11.1",
|
|
36
|
+
"@driftengine/audio": "4.11.1",
|
|
37
|
+
"@driftengine/chemistry": "4.11.1",
|
|
38
|
+
"@driftengine/core": "4.11.1",
|
|
39
|
+
"@driftengine/editor": "4.11.1",
|
|
40
|
+
"@driftengine/entities": "4.11.1",
|
|
41
|
+
"@driftengine/network": "4.11.1",
|
|
42
|
+
"@driftengine/terrain": "4.11.1",
|
|
43
|
+
"@driftengine/ui2d": "4.11.1",
|
|
44
|
+
"@driftengine/xr": "4.11.1"
|
|
45
45
|
},
|
|
46
46
|
"author": "Drift Technologies",
|
|
47
47
|
"repository": {
|
package/src/bindings/render.ts
CHANGED
|
@@ -146,6 +146,14 @@ export const RENDER_CAPABILITIES: readonly CapabilityDefinition[] = [
|
|
|
146
146
|
'here though the engine defaults it to 1, because taking the whole ceiling is the expensive ' +
|
|
147
147
|
'answer and a script author is further from that cost than a TypeScript caller.',
|
|
148
148
|
),
|
|
149
|
+
define(
|
|
150
|
+
'occlusionFade',
|
|
151
|
+
[R, { name: 'distance', type: 'f32' }, { name: 'radius', type: 'f32' }],
|
|
152
|
+
'Where ambient occlusion fades out with distance: whole up to `distance` metres from the eye ' +
|
|
153
|
+
'and gone `radius` metres past it, so far scenery and a distant sky are not shaded in rings ' +
|
|
154
|
+
'that follow the depth buffer. A negative distance is no fade, the default. Held until ' +
|
|
155
|
+
"changed. Does nothing when the quality profile's `ambientOcclusion` is 0.",
|
|
156
|
+
),
|
|
149
157
|
define(
|
|
150
158
|
'medium',
|
|
151
159
|
[
|
|
@@ -213,6 +221,8 @@ export function renderImplementation(): Record<string, unknown> {
|
|
|
213
221
|
speedBlur: (renderer: RendererApi, strength: number) => renderer.setSpeedRush(strength),
|
|
214
222
|
focus: (renderer: RendererApi, distance: number, range: number, scale: number) =>
|
|
215
223
|
renderer.setDepthOfField(distance, range, scale),
|
|
224
|
+
occlusionFade: (renderer: RendererApi, distance: number, radius: number) =>
|
|
225
|
+
renderer.setAmbientOcclusionFade(distance, radius),
|
|
216
226
|
medium: (
|
|
217
227
|
renderer: RendererApi,
|
|
218
228
|
density: number,
|