|
682 | 682 | { |
683 | 683 | "imports": { |
684 | 684 | "three": "https://cdn.jsdelivr.net/npm/three@0.170.0/build/three.module.js", |
685 | | - "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.170.0/examples/jsm/", |
686 | | - "three/examples/jsm/": "https://cdn.jsdelivr.net/npm/three@0.170.0/examples/jsm/" |
| 685 | + "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.170.0/examples/jsm/" |
687 | 686 | } |
688 | 687 | } |
689 | 688 | </script> |
@@ -919,9 +918,6 @@ <h2 class="section-title">Ready to Find Your Nth Party?</h2> |
919 | 918 |
|
920 | 919 | <script type="module"> |
921 | 920 | import * as THREE from 'three'; |
922 | | -import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; |
923 | | -import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; |
924 | | -import { BokehPass } from 'three/addons/postprocessing/BokehPass.js'; |
925 | 921 |
|
926 | 922 | // ── CONFIG ── |
927 | 923 | const NODE_COUNT = 120; |
@@ -1184,22 +1180,11 @@ <h2 class="section-title">Ready to Find Your Nth Party?</h2> |
1184 | 1180 | } |
1185 | 1181 |
|
1186 | 1182 | // ── RESIZE ── |
1187 | | -// ── POST-PROCESSING (Depth of Field) ── |
1188 | | -const composer = new EffectComposer(renderer); |
1189 | | -composer.addPass(new RenderPass(scene, camera)); |
1190 | | -const bokehPass = new BokehPass(scene, camera, { |
1191 | | - focus: 4.0, |
1192 | | - aperture: 0.008, |
1193 | | - maxblur: 0.012, |
1194 | | -}); |
1195 | | -composer.addPass(bokehPass); |
1196 | | - |
1197 | 1183 | function resize() { |
1198 | 1184 | const rect = hero.getBoundingClientRect(); |
1199 | 1185 | const w = rect.width; |
1200 | 1186 | const h = rect.height; |
1201 | 1187 | renderer.setSize(w, h); |
1202 | | - composer.setSize(w, h); |
1203 | 1188 | camera.aspect = w / h; |
1204 | 1189 | camera.updateProjectionMatrix(); |
1205 | 1190 | } |
@@ -1229,8 +1214,6 @@ <h2 class="section-title">Ready to Find Your Nth Party?</h2> |
1229 | 1214 | const lookY = Math.sin(t2 * 0.8) * 0.4; |
1230 | 1215 | const lookZ = Math.cos(t3 * 0.6) * 1.2; |
1231 | 1216 | camera.lookAt(lookX, lookY, lookZ); |
1232 | | - // Update DOF focus to distance between camera and look target |
1233 | | - bokehPass.uniforms['focus'].value = camera.position.distanceTo(new THREE.Vector3(lookX, lookY, lookZ)); |
1234 | 1217 |
|
1235 | 1218 | // Pulse primary glow |
1236 | 1219 | const glowScale = 0.35 + 0.08 * Math.sin(elapsed * 1.5); |
@@ -1275,7 +1258,7 @@ <h2 class="section-title">Ready to Find Your Nth Party?</h2> |
1275 | 1258 | } |
1276 | 1259 | } |
1277 | 1260 |
|
1278 | | - composer.render(); |
| 1261 | + renderer.render(scene, camera); |
1279 | 1262 | } |
1280 | 1263 | animate(); |
1281 | 1264 | </script> |
|
0 commit comments