Skip to content

Commit

Permalink
fix: opt code
Browse files Browse the repository at this point in the history
  • Loading branch information
JujieX committed May 22, 2024
1 parent 167a3a5 commit 9e738d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/galacean/particle-benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ WebGLEngine.create({
const camera = cameraEntity.addComponent(Camera);
camera.farClipPlane = 500;

const xCount = 20;
const yCount = 25;
const xCount = 25;
const yCount = 20;
const xSpacing = 3;
const ySpacing = 5;

Expand Down
13 changes: 9 additions & 4 deletions src/three/particle-benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,21 @@ import ParticleSystem, {
// Initialize scene, camera, and renderer
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(
75,
45,
window.innerWidth / window.innerHeight,
0.1,
1000
);
camera.position.z = 220;

const canvas = document.getElementById("canvas");
const renderer = new THREE.WebGLRenderer({ canvas: canvas });
renderer.setSize(window.innerWidth, window.innerHeight);
const canvas = <HTMLCanvasElement>document.getElementById("canvas");
canvas.width = canvas.clientWidth * window.devicePixelRatio;
canvas.height = canvas.clientHeight * window.devicePixelRatio;

const renderer = new THREE.WebGLRenderer({
canvas: canvas,
antialias: true,
});

// Load texture for particles

Expand Down

0 comments on commit 9e738d4

Please sign in to comment.