Skip to content

Commit

Permalink
Merge pull request #18 from galacean/feat/particle-case
Browse files Browse the repository at this point in the history
feat: max particle amount
  • Loading branch information
gz65555 authored May 22, 2024
2 parents d286663 + 6737bd6 commit b11dd40
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
12 changes: 5 additions & 7 deletions src/babylon/particle-benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ const createScene = function () {
// Camera
var camera = new UniversalCamera(
"ArcRotateCamera",
new Vector3(0, 0, -100),
new Vector3(0, 0, -180),
scene
);
// This attaches the camera to the canvas
camera.attachControl(canvas, true);

// Set up new rendering pipeline
const pipeline = new DefaultRenderingPipeline("default", true, scene);
Expand All @@ -48,10 +46,10 @@ const createScene = function () {
);

// Fire!
const xCount = 12;
const yCount = 15;
const xSpacing = 2.2;
const ySpacing = 3.5;
const xCount = 25;
const yCount = 30;
const xSpacing = 3;
const ySpacing = 5;

for (let i = 0; i < xCount; i++) {
for (let j = 0; j < yCount; j++) {
Expand Down
6 changes: 3 additions & 3 deletions src/galacean/particle-benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ WebGLEngine.create({

// Create camera
const cameraEntity = rootEntity.createChild("camera_entity");
cameraEntity.transform.position = new Vector3(0, 0, 100);
cameraEntity.transform.position = new Vector3(0, 0, 180);

const camera = cameraEntity.addComponent(Camera);
camera.farClipPlane = 200;
camera.fieldOfView = 60;

const xCount = 12;
const yCount = 15;
const xCount = 25;
const yCount = 30;
const xSpacing = 3;
const ySpacing = 5;

Expand Down
9 changes: 4 additions & 5 deletions src/three/particle-benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ const camera = new THREE.PerspectiveCamera(
0.1,
1000
);
camera.position.z = 100;
camera.position.z = 180;

const canvas = document.getElementById("canvas");
const renderer = new THREE.WebGLRenderer({ canvas: canvas });
renderer.setSize(window.innerWidth, window.innerHeight);
const controls = new OrbitControls(camera, renderer.domElement);

// Load texture for particles

Expand Down Expand Up @@ -79,9 +78,9 @@ loader.load(

const system = new ParticleSystem();

const xCount = 15;
const yCount = 12;
const xSpacing = 4;
const xCount = 25;
const yCount = 30;
const xSpacing = 3;
const ySpacing = 5;

for (let x = 0; x < xCount; x++) {
Expand Down

0 comments on commit b11dd40

Please sign in to comment.