ohzi-core 12.3.0 → 12.3.2
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/package.json
CHANGED
|
@@ -12,7 +12,7 @@ import { SceneManager } from '../SceneManager';
|
|
|
12
12
|
|
|
13
13
|
class UnrealBloomRender extends BaseRender
|
|
14
14
|
{
|
|
15
|
-
constructor(use_antialiasing, use_half_float, use_hight_luminosity_pass)
|
|
15
|
+
constructor(use_antialiasing, use_half_float, use_hight_luminosity_pass, use_rendering_size = false)
|
|
16
16
|
{
|
|
17
17
|
super();
|
|
18
18
|
|
|
@@ -26,6 +26,7 @@ class UnrealBloomRender extends BaseRender
|
|
|
26
26
|
minFilter: NearestFilter,
|
|
27
27
|
magFilter: NearestFilter
|
|
28
28
|
};
|
|
29
|
+
this.use_rendering_size = use_rendering_size;
|
|
29
30
|
this.main_RT = new WebGLRenderTarget(1, 1, rt_settings);
|
|
30
31
|
this.main_RT.texture.colorSpace = LinearSRGBColorSpace;
|
|
31
32
|
this.main_RT.texture.minFilter = NearestFilter;
|
|
@@ -110,9 +111,11 @@ class UnrealBloomRender extends BaseRender
|
|
|
110
111
|
|
|
111
112
|
__check_RT_size()
|
|
112
113
|
{
|
|
113
|
-
|
|
114
|
+
const width = this.use_rendering_size ? OScreen.render_width : OScreen.width;
|
|
115
|
+
const height = this.use_rendering_size ? OScreen.render_height : OScreen.height;
|
|
116
|
+
if (this.main_RT.width !== width || this.main_RT.height !== height)
|
|
114
117
|
{
|
|
115
|
-
this.main_RT.setSize(
|
|
118
|
+
this.main_RT.setSize(width, height);
|
|
116
119
|
}
|
|
117
120
|
}
|
|
118
121
|
}
|
|
@@ -87,11 +87,14 @@ class CameraUtilities
|
|
|
87
87
|
}
|
|
88
88
|
else
|
|
89
89
|
{
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
const pos = new Vector3(NDC.x * camera.right, NDC.y * camera.top, 0);
|
|
91
|
+
pos.applyQuaternion(camera.quaternion);
|
|
92
|
+
pos.add(camera.position);
|
|
93
|
+
const dir = new Vector3(0, 0, -1).applyQuaternion(camera.quaternion);
|
|
94
|
+
this.ray.set(pos, dir);
|
|
92
95
|
}
|
|
93
|
-
|
|
94
96
|
this.ray.intersectPlane(this.plane, tmp_vec);
|
|
97
|
+
|
|
95
98
|
return tmp_vec;
|
|
96
99
|
}
|
|
97
100
|
|