ohzi-core 13.3.0 → 15.0.0
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/README.md +2 -1
- package/build/index.mjs +1 -1
- package/build/index.mjs.map +1 -1
- package/package.json +12 -6
- package/src/Capabilities.ts +0 -2
- package/src/Debug.ts +38 -33
- package/src/Graphics.ts +2 -2
- package/src/Initializer.ts +2 -1
- package/src/SceneManager.ts +4 -5
- package/src/action_sequencer/NumberInterpolator.ts +2 -0
- package/src/blitter_index.ts +1 -2
- package/src/camera_controller/CameraController.ts +106 -63
- package/src/camera_controller/states/common/CommonCameraState.ts +2 -1
- package/src/components/AxisHelper.ts +1 -0
- package/src/components/Line.ts +35 -27
- package/src/components/PlaneHelper.ts +1 -1
- package/src/components/Text2D.ts +3 -1
- package/src/components/WorldImage.ts +27 -20
- package/src/components/sdf_text/SDFTextBatch.ts +16 -26
- package/src/dev_bridge/CameraBridge.ts +363 -0
- package/src/dev_bridge/CaptureService.ts +256 -0
- package/src/dev_bridge/CommandDispatcher.ts +114 -0
- package/src/dev_bridge/ConsoleBuffer.ts +286 -0
- package/src/dev_bridge/DebugDrawer.ts +399 -0
- package/src/dev_bridge/DevBridge.ts +195 -0
- package/src/dev_bridge/InputSynthesizer.ts +287 -0
- package/src/dev_bridge/PerformanceProbe.ts +118 -0
- package/src/dev_bridge/RenderModeRegistry.ts +66 -0
- package/src/dev_bridge/SceneEditor.ts +288 -0
- package/src/dev_bridge/SceneInspector.ts +388 -0
- package/src/dev_bridge/ViewNavigator.ts +101 -0
- package/src/dev_bridge/protocol.ts +31 -0
- package/src/index.ts +21 -14
- package/src/materials/AddMaterial.ts +14 -7
- package/src/materials/BlitNodeMaterial.ts +85 -0
- package/src/materials/BloomComposeMaterial.ts +21 -9
- package/src/materials/BoxBlurMaterial.ts +26 -6
- package/src/materials/ClearDepthNormalMaterial.ts +12 -6
- package/src/materials/DepthNormalMaterial.ts +25 -14
- package/src/materials/DualFilteringBlurMaterial.ts +32 -5
- package/src/materials/GaussianBlurMaterial.ts +36 -14
- package/src/materials/LineMaterial.ts +52 -0
- package/src/materials/LuminosityHighPassMaterial.ts +23 -10
- package/src/materials/NormalMaterial.ts +10 -11
- package/src/materials/SDFTextMaterial.ts +63 -16
- package/src/materials/SSAOComposeMaterial.ts +14 -5
- package/src/materials/SSAOMaterial.ts +123 -24
- package/src/materials/ScreenSpaceTextureMaterial.ts +19 -31
- package/src/materials/UnrealBloomComposeMaterial.ts +41 -32
- package/src/materials/WorldImageMaterial.ts +51 -0
- package/src/materials/deferred/DeferredPointLightMaterial.ts +45 -14
- package/src/materials/deferred/depth_normal_encoding.ts +36 -0
- package/src/primitives/Cube.ts +1 -1
- package/src/primitives/Sphere.ts +1 -1
- package/src/raycast/GroupRaycaster.ts +2 -2
- package/src/render_mode/BloomRender.ts +18 -4
- package/src/render_mode/DebugNormalsRender.ts +6 -1
- package/src/render_mode/DeferredRender.ts +5 -34
- package/src/render_mode/NormalAORender.ts +9 -19
- package/src/render_mode/UnrealBloomRender.ts +2 -1
- package/src/render_mode/VRRender.ts +6 -3
- package/src/render_utilities/Blitter.ts +4 -4
- package/src/render_utilities/Blurrer.ts +7 -0
- package/src/render_utilities/DualFilteringBlurrer.ts +26 -10
- package/src/resource_loader/AudioLoader.ts +5 -3
- package/src/resource_loader/HDRTextureLoader.ts +1 -1
- package/src/scenes/AbstractScene.ts +7 -3
- package/src/scenes/Compilator.ts +5 -1
- package/src/scenes/loading_states/LoadingState.ts +15 -7
- package/src/scenes/loading_states/RegularLoadingState.ts +2 -1
- package/src/utilities/CameraUtilities.ts +57 -79
- package/src/utilities/HTMLUtilities.ts +2 -1
- package/src/utilities/MeshSampler.ts +8 -1
- package/src/utilities/OrthographicFrustumPointFitter.ts +53 -4
- package/src/view_components/ApplicationView.ts +1 -1
- package/src/view_components/ViewComponent.ts +1 -1
- package/src/view_components/ViewManager.ts +7 -1
- package/src/view_components/transition/DrawIOAnimationSheet.ts +1 -1
- package/types/Capabilities.d.ts +0 -1
- package/types/SceneManager.d.ts +1 -1
- package/types/blitter_index.d.ts +1 -2
- package/types/camera_controller/CameraController.d.ts +9 -0
- package/types/components/Line.d.ts +3 -2
- package/types/components/WorldImage.d.ts +3 -2
- package/types/index.d.ts +2 -7
- package/types/materials/AddMaterial.d.ts +2 -2
- package/types/materials/BlitNodeMaterial.d.ts +18 -0
- package/types/materials/BloomComposeMaterial.d.ts +2 -2
- package/types/materials/BoxBlurMaterial.d.ts +2 -2
- package/types/materials/ClearDepthNormalMaterial.d.ts +2 -2
- package/types/materials/DepthNormalMaterial.d.ts +2 -2
- package/types/materials/DualFilteringBlurMaterial.d.ts +2 -2
- package/types/materials/GaussianBlurMaterial.d.ts +2 -2
- package/types/materials/LuminosityHighPassMaterial.d.ts +2 -2
- package/types/materials/NormalMaterial.d.ts +2 -2
- package/types/materials/SDFTextMaterial.d.ts +2 -2
- package/types/materials/SSAOComposeMaterial.d.ts +2 -2
- package/types/materials/SSAOMaterial.d.ts +2 -2
- package/types/materials/ScreenSpaceTextureMaterial.d.ts +2 -2
- package/types/materials/UnrealBloomComposeMaterial.d.ts +2 -2
- package/types/materials/deferred/DeferredPointLightMaterial.d.ts +2 -2
- package/types/render_mode/DeferredRender.d.ts +0 -2
- package/types/render_mode/NormalAORender.d.ts +0 -2
- package/types/render_utilities/Blitter.d.ts +2 -2
- package/types/render_utilities/DualFilteringBlurrer.d.ts +0 -2
- package/types/utilities/CameraUtilities.d.ts +0 -1
- package/types/utilities/OrthographicFrustumPointFitter.d.ts +14 -8
- package/build/index.module.js +0 -2
- package/build/index.module.js.map +0 -1
- package/src/components/EdgeMesh.ts +0 -150
- package/src/components/GeometryEdgeVisualizer.ts +0 -49
- package/src/components/MultiLinePath.ts +0 -25
- package/src/components/MultiLineText2D.ts +0 -65
- package/src/components/Shape2D.ts +0 -42
- package/src/components/Shape3D.ts +0 -38
- package/src/gpu_particles/GPUParticleSystem.ts +0 -122
- package/src/gpu_particles/ParticleAttribute.ts +0 -110
- package/src/gpu_particles/ParticlePositionAttribute.ts +0 -46
- package/src/materials/AlphaFilterMaterial.ts +0 -21
- package/src/materials/BaseShaderMaterial.ts +0 -20
- package/src/materials/BlitMaterial.ts +0 -27
- package/src/materials/DeferredRendererComposeMaterial.ts +0 -36
- package/src/materials/DisplayNormalTextureMaterial.ts +0 -18
- package/src/materials/FXAAMaterial.ts +0 -12
- package/src/materials/MedianFilterMaterial.ts +0 -46
- package/src/materials/SDFScreenTextMaterial.ts +0 -32
- package/src/materials/UnrealBlurMaterial.ts +0 -20
- package/src/materials/UnrealComposeMaterial.ts +0 -27
- package/src/materials/ViewPositionMaterial.ts +0 -19
- package/src/materials/gpu_particles/AttributeUpdateMaterial.ts +0 -35
- package/src/materials/gpu_particles/BasicParticleMaterial.ts +0 -25
- package/src/materials/gpu_particles/ParticleStorageMaterial.ts +0 -36
- package/src/materials/gpu_particles/PositionStorageMaterial.ts +0 -27
- package/src/render_utilities/MedianFilter.ts +0 -72
- package/src/render_utilities/ViewPositionRenderer.ts +0 -53
- package/src/shaders/add/add.frag +0 -28
- package/src/shaders/anti_aliasing/fxaa.frag +0 -72
- package/src/shaders/basic_color/basic_color.frag +0 -6
- package/src/shaders/basic_color/basic_color.vert +0 -10
- package/src/shaders/basic_line/basic_line.frag +0 -37
- package/src/shaders/basic_line/basic_line.vert +0 -37
- package/src/shaders/basic_texture/basic_texture.frag +0 -10
- package/src/shaders/basic_texture/basic_texture.vert +0 -17
- package/src/shaders/bloom/bloom_compose.frag +0 -22
- package/src/shaders/bloom/cheap_bloom_compose.frag +0 -13
- package/src/shaders/box_blur/box_blur.frag +0 -24
- package/src/shaders/box_blur/compose.frag +0 -31
- package/src/shaders/clear/clear_depth_normal.frag +0 -25
- package/src/shaders/copy/copy.frag +0 -7
- package/src/shaders/copy/copy.vert +0 -6
- package/src/shaders/deferred/blit_copy.vert +0 -11
- package/src/shaders/deferred/deferred_compose.frag +0 -59
- package/src/shaders/deferred/point_light.frag +0 -66
- package/src/shaders/deferred/point_light.vert +0 -13
- package/src/shaders/depth_normals/debug_normals.frag +0 -48
- package/src/shaders/depth_normals/depth_normals.frag +0 -30
- package/src/shaders/depth_normals/depth_normals.vert +0 -13
- package/src/shaders/dual_filter_blur/alpha_filter.frag +0 -14
- package/src/shaders/dual_filter_blur/downsample.frag +0 -21
- package/src/shaders/dual_filter_blur/upsample.frag +0 -24
- package/src/shaders/edge_visualizer/edge_visualizer.frag +0 -18
- package/src/shaders/edge_visualizer/edge_visualizer.vert +0 -16
- package/src/shaders/edges/corners.frag +0 -11
- package/src/shaders/edges/corners.vert +0 -31
- package/src/shaders/edges/edges.frag +0 -7
- package/src/shaders/edges/edges.vert +0 -27
- package/src/shaders/gaussian_blur/gaussian_blur.frag +0 -44
- package/src/shaders/gaussian_blur/unreal_bloom_compose.frag +0 -36
- package/src/shaders/gpu_particles/common_utils.glsl +0 -13
- package/src/shaders/gpu_particles/generic_storage.frag +0 -6
- package/src/shaders/gpu_particles/store/store_position.vert +0 -14
- package/src/shaders/gpu_particles/update/basic_update.frag +0 -21
- package/src/shaders/gpu_particles/visualize/visualize.frag +0 -11
- package/src/shaders/gpu_particles/visualize/visualize.vert +0 -12
- package/src/shaders/grid/grid.frag +0 -17
- package/src/shaders/grid/grid.vert +0 -10
- package/src/shaders/luminosity_high_pass/luminosity_high_pass.frag +0 -38
- package/src/shaders/median_filter/median_filter.frag +0 -134
- package/src/shaders/normal/normal.frag +0 -6
- package/src/shaders/normal/normal.vert +0 -6
- package/src/shaders/sdf_text/sdf_screen_text.frag +0 -51
- package/src/shaders/sdf_text/sdf_screen_text.vert +0 -42
- package/src/shaders/sdf_text/sdf_text.frag +0 -53
- package/src/shaders/sdf_text/sdf_text.vert +0 -42
- package/src/shaders/ssao/hbao.frag +0 -264
- package/src/shaders/ssao/ssao.frag +0 -95
- package/src/shaders/ssao/ssao.vert +0 -11
- package/src/shaders/ssao/ssao_compose.frag +0 -14
- package/src/shaders/transparent_mix/copy.frag +0 -7
- package/src/shaders/transparent_mix/transparent_mix.frag +0 -19
- package/src/shaders/transparent_mix/transparent_mix.vert +0 -8
- package/src/shaders/ui/ss_texture.frag +0 -11
- package/src/shaders/ui/ss_texture.vert +0 -32
- package/src/shaders/ui/ws_texture.vert +0 -39
- package/src/shaders/unreal_blur/unreal_blur.frag +0 -25
- package/src/shaders/unreal_blur/unreal_compose.frag +0 -24
- package/src/shaders/write_view_position/write_view_position.frag +0 -7
- package/src/shaders/write_view_position/write_view_position.vert +0 -9
- package/src/types.d.ts +0 -14
- package/types/components/EdgeMesh.d.ts +0 -16
- package/types/components/GeometryEdgeVisualizer.d.ts +0 -8
- package/types/components/MultiLinePath.d.ts +0 -8
- package/types/components/MultiLineText2D.d.ts +0 -12
- package/types/components/Shape2D.d.ts +0 -7
- package/types/components/Shape3D.d.ts +0 -6
- package/types/gpu_particles/GPUParticleSystem.d.ts +0 -19
- package/types/gpu_particles/ParticleAttribute.d.ts +0 -20
- package/types/gpu_particles/ParticlePositionAttribute.d.ts +0 -6
- package/types/materials/AlphaFilterMaterial.d.ts +0 -7
- package/types/materials/BaseShaderMaterial.d.ts +0 -4
- package/types/materials/BlitMaterial.d.ts +0 -4
- package/types/materials/DeferredRendererComposeMaterial.d.ts +0 -10
- package/types/materials/DisplayNormalTextureMaterial.d.ts +0 -4
- package/types/materials/FXAAMaterial.d.ts +0 -5
- package/types/materials/MedianFilterMaterial.d.ts +0 -8
- package/types/materials/SDFScreenTextMaterial.d.ts +0 -8
- package/types/materials/UIElementMaterial.d.ts +0 -4
- package/types/materials/UnrealBlurMaterial.d.ts +0 -5
- package/types/materials/UnrealComposeMaterial.d.ts +0 -5
- package/types/materials/ViewPositionMaterial.d.ts +0 -5
- package/types/materials/gpu_particles/AttributeUpdateMaterial.d.ts +0 -8
- package/types/materials/gpu_particles/BasicParticleMaterial.d.ts +0 -5
- package/types/materials/gpu_particles/ParticleStorageMaterial.d.ts +0 -5
- package/types/materials/gpu_particles/PositionStorageMaterial.d.ts +0 -5
- package/types/render_utilities/MedianFilter.d.ts +0 -12
- package/types/render_utilities/ViewPositionRenderer.d.ts +0 -12
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { CameraManager } from '../CameraManager';
|
|
2
2
|
import { OScreen } from '../OScreen';
|
|
3
|
-
import { OMath } from '../utilities/OMath';
|
|
4
3
|
|
|
5
|
-
import type { Camera, Object3D } from 'three';
|
|
6
|
-
import { Box3, Matrix4, Plane, Ray,
|
|
4
|
+
import type { Camera, Object3D, OrthographicCamera, PerspectiveCamera as ThreePerspectiveCamera } from 'three';
|
|
5
|
+
import { Box3, Matrix4, Plane, Ray, Vector3 } from 'three';
|
|
7
6
|
|
|
8
7
|
import type { Input } from '../lib/Input';
|
|
9
8
|
import type { Vector2 } from '../lib/Vector2';
|
|
@@ -16,9 +15,6 @@ class CameraUtilities
|
|
|
16
15
|
input: Input;
|
|
17
16
|
plane: Plane;
|
|
18
17
|
ray: Ray;
|
|
19
|
-
reference_position: Vector3;
|
|
20
|
-
reference_rotation: Vector3;
|
|
21
|
-
reference_zoom: number;
|
|
22
18
|
tmp_mat: Matrix4;
|
|
23
19
|
tmp_size: Vector3;
|
|
24
20
|
tmp_unproj: Vector3;
|
|
@@ -97,7 +93,13 @@ class CameraUtilities
|
|
|
97
93
|
}
|
|
98
94
|
else
|
|
99
95
|
{
|
|
100
|
-
|
|
96
|
+
// The same frustum OrthographicCamera.updateProjectionMatrix() builds.
|
|
97
|
+
const orthographic_camera = camera as OrthographicCamera;
|
|
98
|
+
const center_x = (orthographic_camera.right + orthographic_camera.left) / 2;
|
|
99
|
+
const center_y = (orthographic_camera.top + orthographic_camera.bottom) / 2;
|
|
100
|
+
const half_width = (orthographic_camera.right - orthographic_camera.left) / (2 * orthographic_camera.zoom);
|
|
101
|
+
const half_height = (orthographic_camera.top - orthographic_camera.bottom) / (2 * orthographic_camera.zoom);
|
|
102
|
+
const pos = new Vector3(center_x + NDC.x * half_width, center_y + NDC.y * half_height, 0);
|
|
101
103
|
pos.applyQuaternion(camera.quaternion);
|
|
102
104
|
pos.add(camera.position);
|
|
103
105
|
const dir = new Vector3(0, 0, -1).applyQuaternion(camera.quaternion);
|
|
@@ -108,50 +110,34 @@ class CameraUtilities
|
|
|
108
110
|
return tmp_vec;
|
|
109
111
|
}
|
|
110
112
|
|
|
113
|
+
// Fits the points as the current camera sees them, flattened onto its view
|
|
114
|
+
// plane. zoom_scale scales the area to fit.
|
|
111
115
|
fit_points_on_camera(points: Array<Vector3>, zoom_scale = 1)
|
|
112
116
|
{
|
|
113
|
-
const
|
|
114
|
-
const
|
|
115
|
-
const camera_forward = this.get_forward_dir(CameraManager.current).clone();
|
|
116
|
-
|
|
117
|
-
const plane = new Plane().setFromNormalAndCoplanarPoint(camera_forward, world_space_center);
|
|
118
|
-
|
|
119
|
-
const points_on_plane = OMath.project_points_on_plane(points, plane);
|
|
120
|
-
|
|
121
|
-
const projected_points_center = new Vector3();
|
|
122
|
-
let box = new Box3().setFromPoints(points_on_plane);
|
|
123
|
-
box.getCenter(projected_points_center);
|
|
124
|
-
|
|
125
|
-
const up = new Vector3(0, 1, 0).applyQuaternion(CameraManager.current.quaternion);
|
|
126
|
-
const right = up.clone().cross(camera_forward).normalize();
|
|
127
|
-
const mat = new Matrix4().set(right.x, up.x, camera_forward.x, world_space_center.x,
|
|
128
|
-
right.y, up.y, camera_forward.y, world_space_center.y,
|
|
129
|
-
right.z, up.z, camera_forward.z, world_space_center.z,
|
|
130
|
-
0, 0, 0, 1);
|
|
131
|
-
|
|
132
|
-
const inverse_mat = mat.invert();
|
|
133
|
-
for (let i = 0; i < points_on_plane.length; i++)
|
|
134
|
-
{
|
|
135
|
-
points_on_plane[i].applyMatrix4(inverse_mat);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
const size = new Vector3();
|
|
139
|
-
box = new Box3().setFromPoints(points_on_plane);
|
|
140
|
-
box.getSize(size);
|
|
141
|
-
size.multiplyScalar(zoom_scale);
|
|
142
|
-
const projected_center = new Vector3();
|
|
143
|
-
box.getCenter(projected_center);
|
|
117
|
+
const bounds = new OrthographicFrustumPointFitter().get_view_bounds(points, CameraManager.current.quaternion);
|
|
118
|
+
const size = bounds.size.clone().multiplyScalar(zoom_scale);
|
|
144
119
|
|
|
145
120
|
return {
|
|
146
|
-
position:
|
|
121
|
+
position: bounds.center,
|
|
147
122
|
zoom: this.get_zoom_to_fit_rect(size.x / 2, size.y / 2)
|
|
148
123
|
};
|
|
149
124
|
}
|
|
150
125
|
|
|
126
|
+
// Fits a half width and half height on the current camera. For a
|
|
127
|
+
// perspective camera this is a distance; for an orthographic camera it is
|
|
128
|
+
// the camera zoom.
|
|
151
129
|
get_zoom_to_fit_rect(width: number, height: number)
|
|
152
130
|
{
|
|
153
|
-
const
|
|
154
|
-
|
|
131
|
+
const camera = CameraManager.current as Camera as ThreePerspectiveCamera | OrthographicCamera;
|
|
132
|
+
|
|
133
|
+
if ((camera as OrthographicCamera).isOrthographicCamera)
|
|
134
|
+
{
|
|
135
|
+
return new OrthographicFrustumPointFitter().get_zoom_to_fit_size(camera as OrthographicCamera, width * 2, height * 2);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const perspective_camera = camera as ThreePerspectiveCamera;
|
|
139
|
+
const v_fov = (perspective_camera.fov / 2) * Math.PI / 180;
|
|
140
|
+
const h_fov = (2 * Math.atan(Math.tan(v_fov) * perspective_camera.aspect)) / 2;
|
|
155
141
|
|
|
156
142
|
const distV = height / Math.tan(v_fov);
|
|
157
143
|
const distH = width / Math.tan(h_fov);
|
|
@@ -159,31 +145,18 @@ class CameraUtilities
|
|
|
159
145
|
return Math.max(Math.abs(distH), Math.abs(distV));
|
|
160
146
|
}
|
|
161
147
|
|
|
148
|
+
// For a perspective camera this is a distance; for an orthographic camera it
|
|
149
|
+
// is the camera zoom.
|
|
162
150
|
get_zoom_to_fit_box(bb: Box3, camera: Camera)
|
|
163
151
|
{
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
const obj_x = this.tmp_size.x;
|
|
169
|
-
const obj_y = this.tmp_size.y;
|
|
170
|
-
const object_aspect = obj_x / obj_y;
|
|
171
|
-
if (OScreen.aspect_ratio / object_aspect > 1)
|
|
172
|
-
{
|
|
173
|
-
return OScreen.height / obj_y;
|
|
174
|
-
}
|
|
175
|
-
else
|
|
176
|
-
{
|
|
177
|
-
return OScreen.width / obj_x;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
else
|
|
152
|
+
camera = camera || CameraManager.current;
|
|
153
|
+
|
|
154
|
+
if (bb.isEmpty())
|
|
181
155
|
{
|
|
182
|
-
|
|
183
|
-
const size = new Vector3();
|
|
184
|
-
bb.getSize(size);
|
|
185
|
-
return this.get_zoom_to_fit_rect(size.x, size.y);
|
|
156
|
+
return (camera as OrthographicCamera).isOrthographicCamera ? (camera as OrthographicCamera).zoom : 0;
|
|
186
157
|
}
|
|
158
|
+
|
|
159
|
+
return this.fit_bounding_box_points(camera, bb).zoom;
|
|
187
160
|
}
|
|
188
161
|
|
|
189
162
|
get_html_screen_pos(object: Object3D, camera: Camera)
|
|
@@ -214,12 +187,14 @@ class CameraUtilities
|
|
|
214
187
|
|
|
215
188
|
update_projection(camera: Camera)
|
|
216
189
|
{
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
190
|
+
const orthographic_camera = camera as OrthographicCamera & { aspect: number };
|
|
191
|
+
|
|
192
|
+
orthographic_camera.left = -OScreen.width / 2;
|
|
193
|
+
orthographic_camera.right = OScreen.width / 2;
|
|
194
|
+
orthographic_camera.top = OScreen.height / 2;
|
|
195
|
+
orthographic_camera.bottom = -OScreen.height / 2;
|
|
196
|
+
orthographic_camera.aspect = OScreen.aspect_ratio;
|
|
197
|
+
orthographic_camera.updateProjectionMatrix();
|
|
223
198
|
}
|
|
224
199
|
|
|
225
200
|
fit_bounding_box_points(camera: Camera, bb: Box3, scale = 1)
|
|
@@ -242,16 +217,16 @@ class CameraUtilities
|
|
|
242
217
|
|
|
243
218
|
fit_points(camera: Camera, points: Array<Vector3>, zoom_scale = 1)
|
|
244
219
|
{
|
|
245
|
-
|
|
220
|
+
const perspective_camera = camera as ThreePerspectiveCamera;
|
|
221
|
+
|
|
222
|
+
if (perspective_camera.isPerspectiveCamera)
|
|
246
223
|
{
|
|
247
224
|
const camera_forward_dir = new Vector3(0, 0, -1).applyQuaternion(camera.quaternion);
|
|
248
225
|
const camera_backward_dir = camera_forward_dir.clone().multiplyScalar(-1);
|
|
249
226
|
|
|
250
227
|
const fitter = new PerspectiveFrustumPointFitter();
|
|
251
228
|
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
const camera_pos = fitter.fit_points(points, camera.quaternion, camera.fov * zoom_scale, aspect_ratio);
|
|
229
|
+
const camera_pos = fitter.fit_points(points, camera.quaternion, perspective_camera.fov * zoom_scale, perspective_camera.aspect);
|
|
255
230
|
const box = new Box3().setFromPoints(points);
|
|
256
231
|
const center = new Vector3();
|
|
257
232
|
box.getCenter(center);
|
|
@@ -273,17 +248,20 @@ class CameraUtilities
|
|
|
273
248
|
}
|
|
274
249
|
else
|
|
275
250
|
{
|
|
251
|
+
// An orthographic camera frames through its zoom. It keeps its distance
|
|
252
|
+
// to the points when that fits their depth between the near and far planes.
|
|
253
|
+
const orthographic_camera = camera as OrthographicCamera;
|
|
276
254
|
const fitter = new OrthographicFrustumPointFitter();
|
|
277
|
-
const
|
|
255
|
+
const bounds = fitter.get_view_bounds(points, camera.quaternion);
|
|
256
|
+
const camera_backward_dir = new Vector3(0, 0, 1).applyQuaternion(camera.quaternion);
|
|
278
257
|
|
|
279
|
-
|
|
280
|
-
|
|
258
|
+
const current_distance = camera.position.clone().sub(bounds.center).dot(camera_backward_dir);
|
|
259
|
+
const distance = fitter.get_distance_to_fit_depth(orthographic_camera, bounds.size.z / 2, current_distance);
|
|
281
260
|
|
|
282
|
-
const forward = new Vector3(0, 0, 1).applyQuaternion(camera.quaternion);
|
|
283
261
|
return {
|
|
284
|
-
zoom:
|
|
285
|
-
reference_position:
|
|
286
|
-
camera_position:
|
|
262
|
+
zoom: fitter.get_zoom_to_fit_size(orthographic_camera, bounds.size.x, bounds.size.y, zoom_scale),
|
|
263
|
+
reference_position: bounds.center,
|
|
264
|
+
camera_position: bounds.center.clone().addScaledVector(camera_backward_dir, distance)
|
|
287
265
|
};
|
|
288
266
|
}
|
|
289
267
|
}
|
|
@@ -59,7 +59,8 @@ class HTMLUtilities
|
|
|
59
59
|
|
|
60
60
|
static load_elements(container: HTMLElement, selector: string)
|
|
61
61
|
{
|
|
62
|
-
|
|
62
|
+
// Any element with a src attribute (img, video, source, iframe...).
|
|
63
|
+
const elements = container.querySelectorAll<HTMLElement & { src: string }>(selector);
|
|
63
64
|
|
|
64
65
|
for (let i = 0; i < elements.length; i++)
|
|
65
66
|
{
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { BufferGeometry } from 'three';
|
|
2
2
|
import { Vector2, Vector3 } from 'three';
|
|
3
3
|
|
|
4
|
+
// What sample_point_in_face needs from a point, which Vector2 (UVs) and Vector3 both provide.
|
|
5
|
+
interface Sampleable<T> {
|
|
6
|
+
add(v: T): T;
|
|
7
|
+
clone(): T;
|
|
8
|
+
multiplyScalar(scalar: number): T;
|
|
9
|
+
}
|
|
10
|
+
|
|
4
11
|
interface Face {
|
|
5
12
|
a: Vector3;
|
|
6
13
|
b: Vector3;
|
|
@@ -205,7 +212,7 @@ class MeshSampler
|
|
|
205
212
|
return vec1.cross(vec2).length() / 2;
|
|
206
213
|
}
|
|
207
214
|
|
|
208
|
-
sample_point_in_face(w1: number, w2: number, v1:
|
|
215
|
+
sample_point_in_face<T extends Sampleable<T>>(w1: number, w2: number, v1: T, v2: T, v3: T): T
|
|
209
216
|
{
|
|
210
217
|
if (w1 + w2 > 1)
|
|
211
218
|
{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Quaternion } from 'three';
|
|
1
|
+
import type { OrthographicCamera, Quaternion } from 'three';
|
|
2
2
|
import { Box3, Vector3 } from 'three';
|
|
3
3
|
|
|
4
4
|
class OrthographicFrustumPointFitter
|
|
@@ -10,7 +10,21 @@ class OrthographicFrustumPointFitter
|
|
|
10
10
|
|
|
11
11
|
fit_points(points: Vector3[], camera_quaternion: Quaternion, vertical_fov: number, aspect: number)
|
|
12
12
|
{
|
|
13
|
-
const
|
|
13
|
+
const bounds = this.get_view_bounds(points, camera_quaternion);
|
|
14
|
+
|
|
15
|
+
const distance = this.get_distance_to_fit_rect(bounds.size.x / 2, bounds.size.y / 2, vertical_fov, aspect);
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
center: bounds.center,
|
|
19
|
+
distance_to_center: distance
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Bounds of the points as seen by a camera with this rotation: the center in
|
|
24
|
+
// world space, and the size along the camera right (x), up (y) and view (z) axes.
|
|
25
|
+
get_view_bounds(points: Vector3[], camera_quaternion: Quaternion)
|
|
26
|
+
{
|
|
27
|
+
const inverse_camera_quat = camera_quaternion.clone().invert();
|
|
14
28
|
|
|
15
29
|
const inverted_points = [];
|
|
16
30
|
|
|
@@ -23,7 +37,13 @@ class OrthographicFrustumPointFitter
|
|
|
23
37
|
const size = new Vector3();
|
|
24
38
|
box.getSize(size);
|
|
25
39
|
|
|
26
|
-
|
|
40
|
+
// Points lined up along an axis leave rounding noise, not 0, across it.
|
|
41
|
+
const epsilon = 1e-9 * Math.max(size.x, size.y, size.z);
|
|
42
|
+
size.set(
|
|
43
|
+
size.x > epsilon ? size.x : 0,
|
|
44
|
+
size.y > epsilon ? size.y : 0,
|
|
45
|
+
size.z > epsilon ? size.z : 0
|
|
46
|
+
);
|
|
27
47
|
|
|
28
48
|
const center = new Vector3();
|
|
29
49
|
box.getCenter(center);
|
|
@@ -32,10 +52,39 @@ class OrthographicFrustumPointFitter
|
|
|
32
52
|
|
|
33
53
|
return {
|
|
34
54
|
center: center,
|
|
35
|
-
|
|
55
|
+
size: size
|
|
36
56
|
};
|
|
37
57
|
}
|
|
38
58
|
|
|
59
|
+
// The camera zoom that shows a width x height area through the camera
|
|
60
|
+
// frustum, times scale. A degenerate area keeps the current zoom, unscaled.
|
|
61
|
+
get_zoom_to_fit_size(camera: OrthographicCamera, width: number, height: number, scale = 1)
|
|
62
|
+
{
|
|
63
|
+
const zoom = Math.min(
|
|
64
|
+
Math.abs((camera.right - camera.left) / width),
|
|
65
|
+
Math.abs((camera.top - camera.bottom) / height)
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
return Number.isFinite(zoom) ? zoom * scale : camera.zoom;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// An orthographic camera frames through its zoom, so its distance to the
|
|
72
|
+
// center only has to keep a depth of +-half_depth between the near and far
|
|
73
|
+
// planes. The preferred distance is kept when it does; if nothing does, the
|
|
74
|
+
// near plane wins.
|
|
75
|
+
get_distance_to_fit_depth(camera: OrthographicCamera, half_depth: number, preferred_distance: number)
|
|
76
|
+
{
|
|
77
|
+
const closest = half_depth + camera.near;
|
|
78
|
+
const farthest = camera.far - half_depth;
|
|
79
|
+
|
|
80
|
+
let distance = Math.max(preferred_distance, closest);
|
|
81
|
+
if (distance > farthest)
|
|
82
|
+
{
|
|
83
|
+
distance = Math.max(closest, farthest);
|
|
84
|
+
}
|
|
85
|
+
return distance;
|
|
86
|
+
}
|
|
87
|
+
|
|
39
88
|
get_distance_to_fit_rect(width: number, height: number, vertical_fov: number, aspect: number)
|
|
40
89
|
{
|
|
41
90
|
const v_fov = (vertical_fov / 2) * Math.PI / 180;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { ApplicationView } from './ApplicationView';
|
|
2
2
|
import { TransitionManager } from './TransitionManager';
|
|
3
3
|
|
|
4
|
+
// The app registers a view named 'transition' that loads the next view in between.
|
|
5
|
+
interface TransitionView extends ApplicationView
|
|
6
|
+
{
|
|
7
|
+
set_next_view(view: ApplicationView, reload?: boolean): void;
|
|
8
|
+
}
|
|
9
|
+
|
|
4
10
|
class ViewManager
|
|
5
11
|
{
|
|
6
12
|
browser_title_suffix: string;
|
|
@@ -34,7 +40,7 @@ class ViewManager
|
|
|
34
40
|
go_to_scene(scene_name: string, change_url = false, skip = false)
|
|
35
41
|
{
|
|
36
42
|
const next_view = this.get(scene_name);
|
|
37
|
-
const transition_view = this.get('transition');
|
|
43
|
+
const transition_view = this.get('transition') as TransitionView;
|
|
38
44
|
|
|
39
45
|
transition_view.set_next_view(next_view);
|
|
40
46
|
this.go_to_view(transition_view.name, change_url, skip);
|
package/types/Capabilities.d.ts
CHANGED
package/types/SceneManager.d.ts
CHANGED
package/types/blitter_index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Blitter } from './render_utilities/Blitter';
|
|
2
2
|
import { Blurrer } from './render_utilities/Blurrer';
|
|
3
3
|
import { GaussianBlurrer } from './render_utilities/GaussianBlurrer';
|
|
4
|
-
import { MedianFilter } from './render_utilities/MedianFilter';
|
|
5
4
|
import { DualFilteringBlurMaterial } from './materials/DualFilteringBlurMaterial';
|
|
6
|
-
export { Blitter, Blurrer, DualFilteringBlurMaterial, GaussianBlurrer
|
|
5
|
+
export { Blitter, Blurrer, DualFilteringBlurMaterial, GaussianBlurrer };
|
|
@@ -85,4 +85,13 @@ export declare class CameraController {
|
|
|
85
85
|
get_current_orientation(): number;
|
|
86
86
|
get_current_azimuth(): number;
|
|
87
87
|
__get_zoom_to_show_rect(width: number, height: number, scale?: number): number;
|
|
88
|
+
__is_orthographic(): boolean;
|
|
89
|
+
__fit_orthographic(quaternion: Quaternion, points: Vector3[], zoom_scale: number): {
|
|
90
|
+
zoom: number;
|
|
91
|
+
center: Vector3;
|
|
92
|
+
distance: number;
|
|
93
|
+
};
|
|
94
|
+
__get_orthographic_distance(half_depth: number): number;
|
|
95
|
+
__get_orthographic_zoom(width: number, height: number, scale?: number): number;
|
|
96
|
+
__set_orthographic_zoom(zoom: number): void;
|
|
88
97
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { Color,
|
|
1
|
+
import type { Color, Vector3 } from "three";
|
|
2
|
+
import type { NodeMaterial } from "three/webgpu";
|
|
2
3
|
import { Mesh } from "three";
|
|
3
4
|
export class Line extends Mesh {
|
|
4
5
|
constructor(points?: Vector3[]);
|
|
5
|
-
material:
|
|
6
|
+
material: NodeMaterial;
|
|
6
7
|
_length: number;
|
|
7
8
|
accumulated_length: number;
|
|
8
9
|
set thickness(arg: any);
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Texture, Vector2, Vector3 } from "three";
|
|
2
|
+
import type { NodeMaterial } from "three/webgpu";
|
|
2
3
|
import { Mesh } from "three";
|
|
3
4
|
|
|
4
5
|
export class WorldImage extends Mesh {
|
|
5
6
|
constructor(texture: Texture, pivot?: Vector2);
|
|
6
7
|
current_scale: number;
|
|
7
8
|
tmp_bb_size: Vector3;
|
|
8
|
-
material:
|
|
9
|
+
material: NodeMaterial;
|
|
9
10
|
update_texture(): void;
|
|
10
11
|
set size(arg: Vector3);
|
|
11
12
|
get size(): Vector3;
|
package/types/index.d.ts
CHANGED
|
@@ -29,17 +29,13 @@ import { Text2D } from "./components/Text2D";
|
|
|
29
29
|
import { UpdatableMaterialMesh } from "./components/UpdatableMaterialMesh";
|
|
30
30
|
import { WorldImage } from "./components/WorldImage";
|
|
31
31
|
import { SDFTextBatch } from "./components/sdf_text/SDFTextBatch";
|
|
32
|
-
import { GPUParticleSystem } from "./gpu_particles/GPUParticleSystem";
|
|
33
|
-
import { ParticleAttribute } from "./gpu_particles/ParticleAttribute";
|
|
34
|
-
import { ParticlePositionAttribute } from "./gpu_particles/ParticlePositionAttribute";
|
|
35
32
|
import { CSSAnimator } from "./html_utilities/CSSAnimator";
|
|
36
33
|
import { AsyncAbstractLoader } from "./loaders/AsyncAbstractLoader";
|
|
37
34
|
import { AsyncAudiosLoader } from "./loaders/AsyncAudiosLoader";
|
|
38
35
|
import { AsyncObjectsLoader } from "./loaders/AsyncObjectsLoader";
|
|
39
36
|
import { AsyncTexturesLoader } from "./loaders/AsyncTexturesLoader";
|
|
40
37
|
import { AddMaterial } from "./materials/AddMaterial";
|
|
41
|
-
import {
|
|
42
|
-
import { BlitMaterial } from "./materials/BlitMaterial";
|
|
38
|
+
import { BlitNodeMaterial } from "./materials/BlitNodeMaterial";
|
|
43
39
|
import { DualFilteringBlurMaterial } from "./materials/DualFilteringBlurMaterial";
|
|
44
40
|
import { UnrealBloomComposeMaterial } from "./materials/UnrealBloomComposeMaterial";
|
|
45
41
|
import { Arrow } from "./primitives/Arrow";
|
|
@@ -56,7 +52,6 @@ import { VRRender } from "./render_mode/VRRender";
|
|
|
56
52
|
import { Blurrer } from "./render_utilities/Blurrer";
|
|
57
53
|
import { DualFilteringBlurrer } from "./render_utilities/DualFilteringBlurrer";
|
|
58
54
|
import { GaussianBlurrer } from "./render_utilities/GaussianBlurrer";
|
|
59
|
-
import { MedianFilter } from "./render_utilities/MedianFilter";
|
|
60
55
|
import { AbstractLoader } from "./resource_loader/AbstractLoader";
|
|
61
56
|
import { AsyncTextureLoader } from "./resource_loader/AsyncTextureLoader";
|
|
62
57
|
import { AudioLoader } from "./resource_loader/AudioLoader";
|
|
@@ -104,5 +99,5 @@ import { ViewManager } from "./view_components/ViewManager";
|
|
|
104
99
|
import { ActionSequencerBuilder } from "./view_components/transition/ActionSequencerBuilder";
|
|
105
100
|
import { DrawIOAnimationSheet } from "./view_components/transition/DrawIOAnimationSheet";
|
|
106
101
|
import { TransitionTable } from "./view_components/transition/TransitionTable";
|
|
107
|
-
export { AbstractLoader, AbstractScene, ActionEvent, ActionInterpolator, ActionSequencer, ActionSequencerBuilder, AddMaterial, ApplicationView, ArrayUtilities, Arrow, AsyncAbstractLoader, AsyncAudiosLoader, AsyncObjectsLoader, AsyncTextureLoader, AsyncTexturesLoader, AudioLoader, BaseApplication, BaseRender,
|
|
102
|
+
export { AbstractLoader, AbstractScene, ActionEvent, ActionInterpolator, ActionSequencer, ActionSequencerBuilder, AddMaterial, ApplicationView, ArrayUtilities, Arrow, AsyncAbstractLoader, AsyncAudiosLoader, AsyncObjectsLoader, AsyncTextureLoader, AsyncTexturesLoader, AudioLoader, BaseApplication, BaseRender, BasisLoader, BlitNodeMaterial, Blurrer, Browser, BufferGeometryUtils, CameraManager, CameraUtilities, CanvasDrawer, Capabilities, CSSAnimator, Cube, CubemapLoader, DAELoader, Debug, DebugNormalsRender, DrawIOAnimationSheet, DualFilteringBlurMaterial, DualFilteringBlurrer, EasingFunctions, FileLoader, FontLoader, FrustumPointFitter, GaussianBlurrer, GeometryUtilities, GLTFDRACOLoader, GLTFLoader, Graphics, Grid, HDRCubeTextureLoader, HDRTextureLoader, HighQualityLoadingState, HorizontalPlane, HTMLUtilities, ImageUtilities, Initializer, JSONLoader, KeyboardInput, Line, LoadingState, MeshSampler, ModelUtilities, NormalAORender, NormalRender, NumberInterpolator, ObjectUtilities, OBJLoader, OMath, OrthographicCamera, OrthographicFrustumPointFitter, OS, OScreen, PerspectiveCamera, PerspectiveFrustumPointFitter, PointArrayLoader, RegularLoadingState, RenderLoop, ResourceBatch, ResourceContainer, SceneManager, Screen, SDFTextBatch, SimpleTextDrawer, Sphere, StringUtilities, Text2D, TextLoader, TextureLoader, Time, TimeUtilities, TransitionManager, TransitionTable, UnrealBloomComposeMaterial, UnrealBloomRender, UpdatableMaterialMesh, Validation, VectorInterpolator, VerticalPlane, VideoLoader, ViewComponent, ViewComponentManager, ViewManager, VRRender, WorldImage };
|
|
108
103
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export class AddMaterial extends
|
|
1
|
+
export class AddMaterial extends BlitNodeMaterial {
|
|
2
2
|
constructor(nMips: any);
|
|
3
3
|
set_add_texture(tex: any): void;
|
|
4
4
|
}
|
|
5
|
-
import {
|
|
5
|
+
import { BlitNodeMaterial } from "./BlitNodeMaterial";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { texture } from 'three/tsl';
|
|
2
|
+
import { type Node, NodeMaterial } from 'three/webgpu';
|
|
3
|
+
type TextureNode = ReturnType<typeof texture>;
|
|
4
|
+
declare class BlitNodeMaterial extends NodeMaterial {
|
|
5
|
+
uniforms: {
|
|
6
|
+
[uniform: string]: {
|
|
7
|
+
value: any;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
uv_by_texture: Map<import("three/webgpu").TextureNode<"vec4">, Node<"vec2">>;
|
|
11
|
+
top_left_origin_by_texture: Map<import("three/webgpu").TextureNode<"vec4">, Node<"bool">>;
|
|
12
|
+
constructor();
|
|
13
|
+
uv_for(texture_node: TextureNode): Node<"vec2">;
|
|
14
|
+
texture_uv_at(texture_node: TextureNode, quad_uv: Node<'vec2'>): Node<"vec2">;
|
|
15
|
+
sample(texture_node: TextureNode, offset?: Node<'vec2'>): Node<"vec4">;
|
|
16
|
+
sample_main_tex(offset?: Node<'vec2'>): Node<"vec4">;
|
|
17
|
+
}
|
|
18
|
+
export { BlitNodeMaterial };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare class BloomComposeMaterial extends
|
|
1
|
+
import { BlitNodeMaterial } from './BlitNodeMaterial';
|
|
2
|
+
declare class BloomComposeMaterial extends BlitNodeMaterial {
|
|
3
3
|
constructor(alpha_blending?: boolean);
|
|
4
4
|
}
|
|
5
5
|
export { BloomComposeMaterial };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export class ClearDepthNormalMaterial extends
|
|
1
|
+
export class ClearDepthNormalMaterial extends BlitNodeMaterial {
|
|
2
2
|
constructor(clear_depth: any, clear_normal: any);
|
|
3
3
|
}
|
|
4
|
-
import {
|
|
4
|
+
import { BlitNodeMaterial } from "../materials/BlitNodeMaterial";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export class DepthNormalMaterial extends
|
|
1
|
+
import { NodeMaterial } from "three/webgpu";
|
|
2
|
+
export class DepthNormalMaterial extends NodeMaterial {
|
|
3
3
|
constructor();
|
|
4
4
|
set far_plane(arg: any);
|
|
5
5
|
get far_plane(): any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare class GaussianBlurMaterial extends
|
|
1
|
+
import { BlitNodeMaterial } from './BlitNodeMaterial';
|
|
2
|
+
declare class GaussianBlurMaterial extends BlitNodeMaterial {
|
|
3
3
|
constructor(kernel_radius: number);
|
|
4
4
|
set_size(w: number, h: number): void;
|
|
5
5
|
set_direction(x: number, y: number): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export class LuminosityHighPassMaterial extends
|
|
1
|
+
export class LuminosityHighPassMaterial extends BlitNodeMaterial {
|
|
2
2
|
constructor(kernel_radius: any);
|
|
3
3
|
}
|
|
4
|
-
import {
|
|
4
|
+
import { BlitNodeMaterial } from "./BlitNodeMaterial";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { BaseShaderMaterial } from './BaseShaderMaterial';
|
|
2
1
|
import type { Texture } from 'three';
|
|
3
2
|
import { Vector2 } from 'three';
|
|
4
|
-
|
|
3
|
+
import { NodeMaterial } from 'three/webgpu';
|
|
4
|
+
declare class SDFTextMaterial extends NodeMaterial {
|
|
5
5
|
constructor(texture: Texture);
|
|
6
6
|
set_atlas_size(size: Vector2): void;
|
|
7
7
|
set_boldness(value: number): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DataTexture, Vector3 } from "three";
|
|
2
|
-
import {
|
|
3
|
-
export class SSAOMaterial extends
|
|
2
|
+
import { BlitNodeMaterial } from "../materials/BlitNodeMaterial";
|
|
3
|
+
export class SSAOMaterial extends BlitNodeMaterial {
|
|
4
4
|
constructor();
|
|
5
5
|
__get_sample_kernel(): Vector3[];
|
|
6
6
|
__get_rotation_kernel(): DataTexture;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Texture } from 'three';
|
|
2
|
-
import {
|
|
3
|
-
declare class ScreenSpaceTextureMaterial extends
|
|
2
|
+
import { BlitNodeMaterial } from './BlitNodeMaterial';
|
|
3
|
+
declare class ScreenSpaceTextureMaterial extends BlitNodeMaterial {
|
|
4
4
|
constructor();
|
|
5
5
|
set_position(x: number, y: number): void;
|
|
6
6
|
set_texture(tex: Texture, w: number, h: number): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export class UnrealBloomComposeMaterial extends
|
|
1
|
+
export class UnrealBloomComposeMaterial extends BlitNodeMaterial {
|
|
2
2
|
constructor(nMips: any);
|
|
3
3
|
set_blur_texture_0(texture: Texture): void;
|
|
4
4
|
set_blur_texture_1(texture: Texture): void;
|
|
@@ -13,5 +13,5 @@ export class UnrealBloomComposeMaterial extends BlitMaterial {
|
|
|
13
13
|
set_tint_color_3(col_string: any): void;
|
|
14
14
|
set_tint_color_4(col_string: any): void;
|
|
15
15
|
}
|
|
16
|
-
import {
|
|
16
|
+
import { BlitNodeMaterial } from "./BlitNodeMaterial";
|
|
17
17
|
|