bucciafico-lib 1.0.5 → 1.0.7

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bucciafico-lib",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Modular 3D rendering engine for Minecraft skins based on Three.js",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -105,7 +105,7 @@ export class SkinViewer {
105
105
  * @returns {Object} The registered plugin instance.
106
106
  */
107
107
  addPlugin(plugin) {
108
- const name = plugin.constructor.name;
108
+ const name = plugin.name || plugin.constructor.name;
109
109
  if (this.plugins.has(name)) return this.plugins.get(name);
110
110
 
111
111
  if (plugin.init) plugin.init(this);
@@ -12,10 +12,18 @@ import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js';
12
12
  export class PostProcessingManager {
13
13
  constructor(renderer, scene, camera, width, height) {
14
14
  this.scene = scene;
15
+ this.renderer = renderer;
16
+
17
+ this.INTERNAL_HEIGHT = 1080;
18
+
19
+ const ratio = width / height;
20
+ const virtualW = this.INTERNAL_HEIGHT * ratio;
21
+ const virtualH = this.INTERNAL_HEIGHT;
15
22
 
16
23
  // 1. BLOOM COMPOSER (Renders glow map)
17
24
  this.bloomComposer = new EffectComposer(renderer);
18
25
  this.bloomComposer.renderToScreen = false;
26
+ this.bloomComposer.setSize(virtualW, virtualH);
19
27
  this.bloomComposer.addPass(new RenderPass(scene, camera));
20
28
 
21
29
  this.bloomPass = new UnrealBloomPass(new THREE.Vector2(width, height), 1.5, 0.4, 0.85);
@@ -23,6 +31,7 @@ export class PostProcessingManager {
23
31
 
24
32
  // 2. FINAL COMPOSER
25
33
  this.finalComposer = new EffectComposer(renderer);
34
+ this.finalComposer.setSize(width, height);
26
35
  this.finalComposer.addPass(new RenderPass(scene, camera));
27
36
 
28
37
  // 3. OUTLINE PASS (Selection highlight)
@@ -82,9 +91,14 @@ export class PostProcessingManager {
82
91
  }
83
92
 
84
93
  resize(width, height) {
85
- this.bloomComposer.setSize(width, height);
94
+ const ratio = width / height;
95
+
96
+ const virtualH = this.INTERNAL_HEIGHT;
97
+ const virtualW = virtualH * ratio;
98
+
99
+ this.bloomComposer.setSize(virtualW, virtualH);
86
100
  this.finalComposer.setSize(width, height);
87
- this.bloomPass.resolution.set(width, height);
101
+ this.bloomPass.resolution.set(virtualW, virtualH);
88
102
  this.outlinePass.setSize(width, height);
89
103
  }
90
104
 
@@ -24,7 +24,7 @@ export class IOPlugin {
24
24
  const state = {
25
25
  meta: {
26
26
  generator: "Bucciafico Studio",
27
- version: "1.0.4-BETA",
27
+ version: "1.0.7",
28
28
  timestamp: Date.now()
29
29
  },
30
30
  core: {}