ohzi-core 6.2.1 → 6.3.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/build/index.module.js +1 -1
- package/build/index.module.js.map +1 -1
- package/package.json +3 -2
- package/src/CustomBezierCurve.js +2 -2
- package/src/Debug.js +28 -28
- package/src/EventManager.js +1 -1
- package/src/Graphics.js +12 -12
- package/src/KeyboardInput.js +1 -1
- package/src/OS.js +5 -5
- package/src/UI.js +1 -1
- package/src/action_sequencer/ActionSequencer.js +17 -12
- package/src/action_sequencer/VectorInterpolator.js +1 -1
- package/src/canvas_drawer/CanvasDrawer.js +8 -8
- package/src/canvas_drawer/MultiLineTextDrawer.js +3 -3
- package/src/canvas_drawer/SimpleTextDrawer.js +1 -1
- package/src/components/EdgeMesh.js +17 -17
- package/src/components/GeometryEdgeVisualizer.js +1 -1
- package/src/components/Grid.js +3 -3
- package/src/components/Line.js +16 -16
- package/src/components/MultiLinePath.js +1 -1
- package/src/components/MultiLineText2D.js +1 -1
- package/src/components/ObjectAxis.js +3 -3
- package/src/components/ObjectOrientedBoundingBox.js +19 -19
- package/src/components/Shape2D.js +7 -7
- package/src/components/Shape3D.js +5 -5
- package/src/components/Text2D.js +3 -3
- package/src/components/UIElement.js +2 -2
- package/src/components/UpdatableMaterialMesh.js +1 -1
- package/src/components/WorldImage.js +4 -4
- package/src/components/mouse_interactors/ObjectRotator.js +2 -2
- package/src/components/sdf_text/SDFText.js +10 -10
- package/src/components/sdf_text/SDFTextBatch.js +24 -24
- package/src/components/sdf_text/TextGlyph.js +2 -2
- package/src/data_textures/RGBADataTexture.js +1 -1
- package/src/data_textures/RGBAFloatDataTexture.js +1 -1
- package/src/data_textures/RGBDataTexture.js +1 -1
- package/src/data_textures/RGBFloatDataTexture.js +1 -1
- package/src/editor/ManipulatorHandle.js +4 -4
- package/src/editor/ObjectEditor.js +2 -2
- package/src/editor/ObjectManipulator.js +3 -3
- package/src/gpu_particles/GPUParticleSystem.js +4 -4
- package/src/gpu_particles/ParticleAttribute.js +4 -4
- package/src/gpu_particles/ParticlePositionAttribute.js +2 -2
- package/src/materials/MedianFilterMaterial.js +1 -1
- package/src/materials/SSAOMaterial.js +5 -5
- package/src/materials/ScreenSpaceTextureMaterial.js +2 -2
- package/src/materials/UnrealBloomComposeMaterial.js +1 -1
- package/src/materials/UnrealBlurMaterial.js +1 -1
- package/src/materials/UnrealComposeMaterial.js +1 -1
- package/src/object_pool/Pool.js +3 -3
- package/src/primitives/Arrow.js +6 -6
- package/src/primitives/Cube.js +2 -2
- package/src/primitives/HorizontalPlane.js +1 -1
- package/src/primitives/Sphere.js +2 -2
- package/src/primitives/VerticalPlane.js +1 -1
- package/src/render_mode/DeferredRender.js +10 -10
- package/src/render_mode/PlanarReflectionsRender.js +3 -3
- package/src/render_mode/TransparencyMixRender.js +1 -1
- package/src/render_utilities/Blitter.js +7 -7
- package/src/render_utilities/GaussianBlurrer.js +3 -3
- package/src/render_utilities/MedianFilter.js +1 -1
- package/src/resource_loader/AbstractLoader.js +1 -1
- package/src/resource_loader/BasisLoader.js +1 -1
- package/src/resource_loader/CubemapLoader.js +1 -1
- package/src/resource_loader/DAELoader.js +1 -1
- package/src/resource_loader/DDSLoader.js +1 -1
- package/src/resource_loader/FileLoader.js +1 -1
- package/src/resource_loader/FontLoader.js +1 -1
- package/src/resource_loader/GLTFDRACOLoader.js +1 -1
- package/src/resource_loader/GLTFLoader.js +1 -1
- package/src/resource_loader/HDRCubeTextureLoader.js +1 -1
- package/src/resource_loader/JSONLoader.js +1 -1
- package/src/resource_loader/OBJLoader.js +1 -1
- package/src/resource_loader/PointArrayLoader.js +6 -6
- package/src/resource_loader/RGBETextureLoader.js +1 -1
- package/src/resource_loader/SVGLoader.js +1 -1
- package/src/resource_loader/TextLoader.js +1 -1
- package/src/static_batcher/GeometryBatch.js +20 -20
- package/src/static_batcher/GeometryBatcher.js +7 -7
- package/src/static_batcher/MeshBatcher.js +8 -8
- package/src/utilities/ArrayUtilities.js +4 -4
- package/src/utilities/CameraUtilities.js +24 -24
- package/src/utilities/EasingFunctions.js +19 -8
- package/src/utilities/FrustumPointFitter.js +55 -55
- package/src/utilities/GeometryUtilities.js +7 -7
- package/src/utilities/ImageUtilities.js +4 -4
- package/src/utilities/MeshSampler.js +33 -33
- package/src/utilities/ModelUtilities.js +2 -2
- package/src/utilities/OMath.js +4 -4
- package/src/utilities/ObjectUtilities.js +4 -4
- package/src/utilities/OrthographicFrustumPointFitter.js +10 -10
- package/src/utilities/PerspectiveFrustumPointFitter.js +55 -55
- package/src/view_components/ApplicationView.js +2 -2
- package/src/view_components/ViewComponentManager.js +1 -1
- package/src/view_components/ViewManager.js +2 -2
- package/src/view_components/transition/ActionSequencerBuilder.js +18 -18
- package/src/view_components/transition/DrawIOAnimationSheet.js +20 -20
- package/src/view_components/transition/TransitionTable.js +1 -1
- package/src/view_components/transition/ViewStateTransitionHandler.js +2 -1
|
@@ -59,7 +59,7 @@ export default class ObjectManipulator extends Object3D
|
|
|
59
59
|
this.tmp_local_pos.copy(this.position);
|
|
60
60
|
this.target_obj.parent.worldToLocal(this.tmp_local_pos);
|
|
61
61
|
this.target_obj.position.copy(this.tmp_local_pos);
|
|
62
|
-
|
|
62
|
+
const scope = this;
|
|
63
63
|
EventManager.fire_unit_position_updated({
|
|
64
64
|
unit_id: scope.target_obj.name,
|
|
65
65
|
position: scope.target_obj.position
|
|
@@ -69,8 +69,8 @@ export default class ObjectManipulator extends Object3D
|
|
|
69
69
|
|
|
70
70
|
set_translation_axis(active_handle)
|
|
71
71
|
{
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
const vertical = active_handle.get_normalized_screen_direction().dot(this.tmp_up_v2);
|
|
73
|
+
const horizontal = active_handle.get_normalized_screen_direction().dot(this.tmp_right_v2);
|
|
74
74
|
|
|
75
75
|
if (Math.abs(vertical) > Math.abs(horizontal))
|
|
76
76
|
{
|
|
@@ -17,7 +17,7 @@ export default class GPUParticleSystem extends Object3D
|
|
|
17
17
|
// let position = new ParticlePositionAttribute("_Position");
|
|
18
18
|
if (init_attribute_uvs && geometry.getAttribute('storage_uv') === undefined)
|
|
19
19
|
{
|
|
20
|
-
|
|
20
|
+
const uv_storage_attr = this.build_uv_storage_attribute(geometry.getAttribute('position').count);
|
|
21
21
|
geometry.setAttribute('storage_uv', uv_storage_attr);
|
|
22
22
|
}
|
|
23
23
|
// position.init_from_geometry(geometry);
|
|
@@ -25,7 +25,7 @@ export default class GPUParticleSystem extends Object3D
|
|
|
25
25
|
|
|
26
26
|
// material.uniforms._Position.value = position.read.texture;
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
const points = new Points(geometry, material);
|
|
29
29
|
points.frustumCulled = false;
|
|
30
30
|
this.particles = points;
|
|
31
31
|
|
|
@@ -44,8 +44,8 @@ export default class GPUParticleSystem extends Object3D
|
|
|
44
44
|
|
|
45
45
|
build_uv_storage_attribute(particle_count)
|
|
46
46
|
{
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
const resolution = this.calculate_resolution(particle_count);
|
|
48
|
+
const uvs = new Float32Array(particle_count * 2);
|
|
49
49
|
for (let i = 0, j = 0; i < particle_count * 2; i += 2, j++)
|
|
50
50
|
{
|
|
51
51
|
uvs[i] = ((j % resolution) / resolution) + (0.5 / resolution);
|
|
@@ -35,8 +35,8 @@ export default class ParticleAttribute
|
|
|
35
35
|
|
|
36
36
|
build_RT(particle_count)
|
|
37
37
|
{
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
const resolution = this.calculate_resolution(particle_count);
|
|
39
|
+
const options = {
|
|
40
40
|
minFilter: NearestFilter,
|
|
41
41
|
magFilter: NearestFilter,
|
|
42
42
|
format: RGBAFormat,
|
|
@@ -56,7 +56,7 @@ export default class ParticleAttribute
|
|
|
56
56
|
|
|
57
57
|
swap_RT()
|
|
58
58
|
{
|
|
59
|
-
|
|
59
|
+
const tmp = this.read;
|
|
60
60
|
this.read = this.write;
|
|
61
61
|
this.write = tmp;
|
|
62
62
|
}
|
|
@@ -72,7 +72,7 @@ export default class ParticleAttribute
|
|
|
72
72
|
|
|
73
73
|
render_geometry_to_RT(geometry, material, RT)
|
|
74
74
|
{
|
|
75
|
-
|
|
75
|
+
const points = new Points(geometry, material);
|
|
76
76
|
points.frustumCulled = false;
|
|
77
77
|
// let scene = new Scene();
|
|
78
78
|
// scene.add( points );
|
|
@@ -10,11 +10,11 @@ export default class ParticlePositionAttribute extends ParticleAttribute
|
|
|
10
10
|
|
|
11
11
|
init_from_geometry(geometry)
|
|
12
12
|
{
|
|
13
|
-
|
|
13
|
+
const pos_attr = geometry.getAttribute('position');
|
|
14
14
|
this.read = this.build_RT(pos_attr.count);
|
|
15
15
|
this.write = this.build_RT(pos_attr.count);
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
const mat = new PositionStorageMaterial();
|
|
18
18
|
this.render_geometry_to_RT(geometry, mat, this.read);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -28,12 +28,12 @@ export default class SSAOMaterial extends BlitMaterial
|
|
|
28
28
|
|
|
29
29
|
__get_sample_kernel()
|
|
30
30
|
{
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
const sample_kernel = [];
|
|
32
|
+
const kernel_size = 64;
|
|
33
33
|
|
|
34
34
|
for (let i = 0; i < kernel_size; i++)
|
|
35
35
|
{
|
|
36
|
-
|
|
36
|
+
const dir = new Vector3(Math.random() * 2 - 1,
|
|
37
37
|
Math.random() * 2 - 1,
|
|
38
38
|
Math.random());
|
|
39
39
|
dir.normalize();
|
|
@@ -48,7 +48,7 @@ export default class SSAOMaterial extends BlitMaterial
|
|
|
48
48
|
|
|
49
49
|
__get_rotation_kernel()
|
|
50
50
|
{
|
|
51
|
-
|
|
51
|
+
const rotation_kernel = new Uint8Array(3 * 16);
|
|
52
52
|
for (let i = 0; i < 16; i++)
|
|
53
53
|
{
|
|
54
54
|
rotation_kernel[i * 3 + 1] = Math.floor(Math.random() * 255);
|
|
@@ -56,7 +56,7 @@ export default class SSAOMaterial extends BlitMaterial
|
|
|
56
56
|
rotation_kernel[i * 3 + 3] = 0;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
const rotation_texture = new DataTexture(rotation_kernel, 4, 4, RGBFormat);
|
|
60
60
|
rotation_texture.wrapS = RepeatWrapping;
|
|
61
61
|
rotation_texture.wrapT = RepeatWrapping;
|
|
62
62
|
|
|
@@ -4,7 +4,7 @@ export default class ScreenSpaceTextureMaterial extends BaseShaderMaterial
|
|
|
4
4
|
{
|
|
5
5
|
constructor(x, y, w, h)
|
|
6
6
|
{
|
|
7
|
-
|
|
7
|
+
const vert = `
|
|
8
8
|
uniform vec2 _ScreenSpacePosition;
|
|
9
9
|
uniform vec2 _ScreenSize;
|
|
10
10
|
uniform vec2 _TextureSize;
|
|
@@ -21,7 +21,7 @@ export default class ScreenSpaceTextureMaterial extends BaseShaderMaterial
|
|
|
21
21
|
vUv = uv;
|
|
22
22
|
}
|
|
23
23
|
`;
|
|
24
|
-
|
|
24
|
+
const frag = `
|
|
25
25
|
uniform sampler2D _MainTex;
|
|
26
26
|
varying vec2 vUv;
|
|
27
27
|
|
|
@@ -22,7 +22,7 @@ export default class UnrealBloomComposeMaterial extends BlitMaterial
|
|
|
22
22
|
this.uniforms.bloomFactors = { value: [1.0, 0.8, 0.6, 0.4, 0.2] };
|
|
23
23
|
this.uniforms.bloomRadius = { value: 0.0 };
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
const bloomTintColors = [
|
|
26
26
|
new Color('#FFFFFF'),
|
|
27
27
|
new Color('#FFFFFF'),
|
|
28
28
|
new Color('#FFFFFF'),
|
package/src/object_pool/Pool.js
CHANGED
|
@@ -16,7 +16,7 @@ export default class Pool
|
|
|
16
16
|
|
|
17
17
|
instantiate()
|
|
18
18
|
{
|
|
19
|
-
|
|
19
|
+
const obj = this.__create();
|
|
20
20
|
if (obj === undefined)
|
|
21
21
|
{
|
|
22
22
|
console.error('Class ' + this.constructor.name + ' does not implement __create() method correctly. It should return a new instance of the pooled object', obj);
|
|
@@ -39,7 +39,7 @@ export default class Pool
|
|
|
39
39
|
this.instantiate();
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
const obj = this.available.pop();
|
|
43
43
|
this.busy.push(obj);
|
|
44
44
|
obj.warm_up();
|
|
45
45
|
return obj;
|
|
@@ -47,7 +47,7 @@ export default class Pool
|
|
|
47
47
|
|
|
48
48
|
release(obj)
|
|
49
49
|
{
|
|
50
|
-
|
|
50
|
+
const index = this.busy.indexOf(obj);
|
|
51
51
|
if (index > -1)
|
|
52
52
|
{
|
|
53
53
|
this.busy.splice(index, 1);
|
package/src/primitives/Arrow.js
CHANGED
|
@@ -12,18 +12,18 @@ export default class Arrow extends Mesh
|
|
|
12
12
|
color = color || '#FF0000';
|
|
13
13
|
length = length || 1;
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const cone_height = 0.4;
|
|
16
|
+
const cylinder_height = length - cone_height;
|
|
17
|
+
const cylinder_geo = new CylinderBufferGeometry(0.01, 0.01, cylinder_height, 32);
|
|
18
18
|
cylinder_geo.translate(0, cylinder_height / 2, 0);
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
const cone_geometry = new ConeBufferGeometry(0.1, cone_height, 32);
|
|
21
21
|
cone_geometry.translate(0, cylinder_height + cone_height / 2, 0);
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
const buffer_geometry = BufferGeometryUtils.mergeBufferGeometries([cylinder_geo, cone_geometry]);
|
|
24
24
|
buffer_geometry.rotateX(3.14 / 2);
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
const material = new MeshBasicMaterial({ color: color });
|
|
27
27
|
super(buffer_geometry, material);
|
|
28
28
|
|
|
29
29
|
if (dir)
|
package/src/primitives/Cube.js
CHANGED
|
@@ -10,8 +10,8 @@ export default class Cube extends Mesh
|
|
|
10
10
|
size = size || new Vector3(1, 1, 1);
|
|
11
11
|
segments = segments || new Vector3(1, 1, 1);
|
|
12
12
|
color = color || 0xff0000;
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const geometry = new BoxGeometry(size.x, size.y, size.z, segments.x, segments.y, segments.z);
|
|
14
|
+
const material = new MeshBasicMaterial({ color: color });
|
|
15
15
|
super(geometry, material);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -11,7 +11,7 @@ export default class HorizontalPlane extends Mesh
|
|
|
11
11
|
color = color || '#FF0000';
|
|
12
12
|
material = material || new MeshBasicMaterial({ color: color });
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const geometry = new PlaneBufferGeometry(width, height);
|
|
15
15
|
geometry.rotateX(-3.14 / 2);
|
|
16
16
|
super(geometry, material);
|
|
17
17
|
}
|
package/src/primitives/Sphere.js
CHANGED
|
@@ -8,8 +8,8 @@ export default class Sphere extends Mesh
|
|
|
8
8
|
{
|
|
9
9
|
color = color || '#FF0000';
|
|
10
10
|
radius = radius || 1;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const geometry = new SphereBufferGeometry(radius, 64, 64);
|
|
12
|
+
const material = new MeshBasicMaterial({ color: color });
|
|
13
13
|
super(geometry, material);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -11,7 +11,7 @@ export default class VerticalPlane extends Mesh
|
|
|
11
11
|
color = color || '#FF0000';
|
|
12
12
|
material = material || new MeshBasicMaterial({ color: color });
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const geometry = new PlaneBufferGeometry(width, height);
|
|
15
15
|
super(geometry, material);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -26,10 +26,10 @@ export default class DeferredRender extends BaseRender
|
|
|
26
26
|
|
|
27
27
|
this.scene_lights = new Scene();
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
const light_intensity = 1;
|
|
30
|
+
const light_brightest_component = 1;
|
|
31
|
+
const radius_needed_for_intensity = Math.sqrt(4 * light_intensity * (light_brightest_component * (256.0 / 5.0))) / (2 * light_intensity);
|
|
32
|
+
const sphere = new Mesh(new SphereBufferGeometry(radius_needed_for_intensity), new DeferredPointLightMaterial(light_intensity));
|
|
33
33
|
// sphere.position.y = 2;
|
|
34
34
|
// this.scene_lights.add(sphere);
|
|
35
35
|
|
|
@@ -49,13 +49,13 @@ export default class DeferredRender extends BaseRender
|
|
|
49
49
|
// sphere5.position.z = 2;
|
|
50
50
|
// this.scene_lights.add(sphere5);
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
const light_row = 2;
|
|
53
|
+
const light_col = 2;
|
|
54
54
|
for (let x = 0; x < light_row; x++)
|
|
55
55
|
{
|
|
56
56
|
for (let y = 0; y < light_col; y++)
|
|
57
57
|
{
|
|
58
|
-
|
|
58
|
+
const clone = sphere.clone();
|
|
59
59
|
clone.position.set(x * 2 - light_row / 2, 1, y * 2 - light_col / 2);
|
|
60
60
|
this.scene_lights.add(clone);
|
|
61
61
|
}
|
|
@@ -84,9 +84,9 @@ export default class DeferredRender extends BaseRender
|
|
|
84
84
|
|
|
85
85
|
this.camera_inverse_proj_mat.getInverse(CameraManager.current.projectionMatrix);
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
const inverse_proj = this.camera_inverse_proj_mat;
|
|
88
|
+
const albedo_rt = this.main_rt;
|
|
89
|
+
const depth_normals_rt = Graphics.depth_normals_RT;
|
|
90
90
|
this.scene_lights.traverse((child) =>
|
|
91
91
|
{
|
|
92
92
|
if (child.material)
|
|
@@ -18,7 +18,7 @@ export default class PlanarReflectionsRender extends BaseRender
|
|
|
18
18
|
constructor()
|
|
19
19
|
{
|
|
20
20
|
super();
|
|
21
|
-
|
|
21
|
+
const color = 0.946;
|
|
22
22
|
this.plane_material_solid = new ShaderMaterial({
|
|
23
23
|
uniforms: {
|
|
24
24
|
_Color: { value: new Vector4(color, color, color, 0.5) }
|
|
@@ -46,11 +46,11 @@ export default class PlanarReflectionsRender extends BaseRender
|
|
|
46
46
|
this.gl = renderer.domElement.getContext('webgl');
|
|
47
47
|
CameraManager.current.parent = SceneManager.current;
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
const plane_material_mask = new MeshBasicMaterial({ color: CameraManager.current.clear_color, depthWrite: false });
|
|
50
50
|
this.plane_mask = new Mesh(ReflectionPlaneContext.target_geometry, plane_material_mask);
|
|
51
51
|
this.plane_solid = new Mesh(ReflectionPlaneContext.target_geometry, this.plane_material_solid);
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
const clear_color = CameraManager.current.clear_color;
|
|
54
54
|
this.plane_material_solid.uniforms._Color.value.set(clear_color.r, clear_color.g, clear_color.b, 0.5);
|
|
55
55
|
|
|
56
56
|
this.stencil_mask_scene.add(this.plane_mask);
|
|
@@ -47,7 +47,7 @@ export default class TransparencyMixRender
|
|
|
47
47
|
|
|
48
48
|
this.fxaa_material = this.__get_fxaa_material();
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
const geometry = new PlaneGeometry(1, 1);
|
|
51
51
|
this.render_plane = new Mesh(geometry, this.mix_material);
|
|
52
52
|
this.render_plane.frustumCulled = false;
|
|
53
53
|
|
|
@@ -22,9 +22,9 @@ export default class Blitter
|
|
|
22
22
|
{
|
|
23
23
|
this._blit_quad.material = this._blit_material;
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
const src_texture = src.isWebGLRenderTarget === true ? src.texture : src;
|
|
26
|
+
const src_width = src.isWebGLRenderTarget === true ? src.width : src.image.width;
|
|
27
|
+
const src_height = src.isWebGLRenderTarget === true ? src.height : src.image.height;
|
|
28
28
|
|
|
29
29
|
this._blit_quad.material.uniforms._MainTex.value = src_texture;
|
|
30
30
|
this._blit_quad.material.uniforms._Resolution.value.set(src_width, src_height);
|
|
@@ -52,9 +52,9 @@ export default class Blitter
|
|
|
52
52
|
|
|
53
53
|
blit_with_material(src, dst, mat)
|
|
54
54
|
{
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
const src_texture = src.isWebGLRenderTarget === true ? src.texture : src;
|
|
56
|
+
const src_width = src.isWebGLRenderTarget === true ? src.width : src.image.width;
|
|
57
|
+
const src_height = src.isWebGLRenderTarget === true ? src.height : src.image.height;
|
|
58
58
|
|
|
59
59
|
this._blit_quad.material = mat;
|
|
60
60
|
this._blit_quad.material.uniforms._MainTex.value = src_texture;
|
|
@@ -89,7 +89,7 @@ export default class Blitter
|
|
|
89
89
|
{
|
|
90
90
|
RT = RT === undefined ? null : RT;
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
const current_rt = this.renderer.getRenderTarget();
|
|
93
93
|
|
|
94
94
|
this.renderer.setRenderTarget(RT === undefined ? null : RT);
|
|
95
95
|
this.renderer.render(this._blit_scene, this._blit_camera);
|
|
@@ -45,7 +45,7 @@ export default class GaussianBlurrer
|
|
|
45
45
|
|
|
46
46
|
for (let i = 0; i < this.nMips; i++)
|
|
47
47
|
{
|
|
48
|
-
|
|
48
|
+
const mat = this.separableBlurMaterials[i];
|
|
49
49
|
|
|
50
50
|
mat.set_direction(1, 0);
|
|
51
51
|
Graphics.blit(inputRenderTarget, this.renderTargetsHorizontal[i], mat);
|
|
@@ -75,8 +75,8 @@ export default class GaussianBlurrer
|
|
|
75
75
|
|
|
76
76
|
for (let i = 0; i < this.nMips; i++)
|
|
77
77
|
{
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
const hor = new WebGLRenderTarget(1, 1, this.rt_pars);
|
|
79
|
+
const ver = new WebGLRenderTarget(1, 1, this.rt_pars);
|
|
80
80
|
|
|
81
81
|
hor.texture.generateMipmaps = false;
|
|
82
82
|
ver.texture.generateMipmaps = false;
|
|
@@ -25,7 +25,7 @@ export default class MedianFilter
|
|
|
25
25
|
|
|
26
26
|
filter(texture)
|
|
27
27
|
{
|
|
28
|
-
|
|
28
|
+
const tex_size = this.get_size(texture);
|
|
29
29
|
if (tex_size.x !== this.RT.width || tex_size.y !== this.RT.height)
|
|
30
30
|
{
|
|
31
31
|
this.RT.setSize(tex_size.x, tex_size.y);
|
|
@@ -70,7 +70,7 @@ export default class AbstractLoader
|
|
|
70
70
|
const reader = response.body.getReader();
|
|
71
71
|
|
|
72
72
|
// Step 2: get total length
|
|
73
|
-
|
|
73
|
+
const contentLength = +response.headers.get('Content-Length');
|
|
74
74
|
|
|
75
75
|
// Step 3: read the data
|
|
76
76
|
let receivedLength = 0; // received that many bytes at the moment
|
|
@@ -13,7 +13,7 @@ export default class PointArrayLoader extends AbstractLoader
|
|
|
13
13
|
|
|
14
14
|
on_preloaded_finished(resource_container)
|
|
15
15
|
{
|
|
16
|
-
|
|
16
|
+
const ctx = this;
|
|
17
17
|
|
|
18
18
|
this.loader.load(this.url, (text) =>
|
|
19
19
|
{
|
|
@@ -40,20 +40,20 @@ export default class PointArrayLoader extends AbstractLoader
|
|
|
40
40
|
|
|
41
41
|
parse_path(raw_data)
|
|
42
42
|
{
|
|
43
|
-
|
|
43
|
+
const string_array = raw_data.split('\n');
|
|
44
44
|
|
|
45
45
|
if (string_array[string_array.length - 1] === '')
|
|
46
46
|
{
|
|
47
47
|
string_array.pop();
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
const positions = [];
|
|
51
51
|
|
|
52
52
|
for (let i = 0; i < string_array.length; i += 3)
|
|
53
53
|
{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
const x = parseFloat(string_array[i + 0]);
|
|
55
|
+
const y = parseFloat(string_array[i + 1]);
|
|
56
|
+
const z = parseFloat(string_array[i + 2]);
|
|
57
57
|
positions.push(new THREEVector3(x, y, z));
|
|
58
58
|
}
|
|
59
59
|
return positions;
|