This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//See the link "https://github.com/BabylonJS/Website/tree/master/build/Demos/WebGPU" in detail. | |
(async function() { | |
if (!navigator.gpu) { | |
alert("Web GPU is not supported on your platform so far."); | |
return; | |
} | |
const canvas = document.getElementById("renderCanvas"); | |
const divFps = document.getElementById("fps"); | |
const engine = new BABYLON.WebGPUEngine(canvas); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>Performance Test on Babylon.js</title> | |
<!-- Babylon.js --> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.6.2/dat.gui.min.js"></script> | |
<script src="https://assets.babylonjs.com/generated/Assets.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scene.registerAfterRender(function() { | |
// if(sphere.intersectsMesh(hitbox)) | |
F = engine.getFps(); | |
if((map["a"] || map["A"])){ | |
sphere.translate(BABYLON.Axis.X, -distance, BABYLON.Space.WORLD); | |
} | |
if((map["d"] || map["D"])){ | |
sphere.translate(BABYLON.Axis.X, distance, BABYLON.Space.WORLD); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sphere.physicsImpostor = new BABYLON.PhysicsImpostor(sphere, BABYLON.PhysicsImpostor.SphereImpostor, {mass: 2, restitution: 0.4}); | |
cube1.physicsImpostor = new BABYLON.PhysicsImpostor(cube1, BABYLON.PhysicsImpostor.SphereImpostor, {mass: 0, restitution: 0}); | |
cube2.physicsImpostor = new BABYLON.PhysicsImpostor(cube2, BABYLON.PhysicsImpostor.SphereImpostor, {mass: 0, restitution: 0}); | |
wall1.physicsImpostor = new BABYLON.PhysicsImpostor(wall1, BABYLON.PhysicsImpostor.SphereImpostor, {mass: 0, restitution: 0}); | |
wall2.physicsImpostor = new BABYLON.PhysicsImpostor(wall2, BABYLON.PhysicsImpostor.SphereImpostor, {mass: 0, restitution: 0}); | |
wall3.physicsImpostor = new BABYLON.PhysicsImpostor(wall3, BABYLON.PhysicsImpostor.SphereImpostor, {mass: 0, restitution: 0}); | |
wall4.physicsImpostor = new BABYLON.PhysicsImpostor(wall4, BABYLON.PhysicsImpostor.SphereImpostor, {mass: 0, restitution: 0}); | |
ground.physicsImpostor = new BABYLON.PhysicsImpostor(ground, BABYLON.PhysicsImpostor.BoxImpostor, {mass:0, restitution: 0, frictio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var map ={}; //object for multiple key presses | |
//キー入力を受け付ける宣言 | |
//キー入力があるたびに、map変数の値がセットされる | |
scene.actionManager = new BABYLON.ActionManager(scene); | |
scene.actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnKeyDownTrigger, function (evt) { | |
map[evt.sourceEvent.key] = evt.sourceEvent.type == "keydown"; | |
})); | |
scene.actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnKeyUpTrigger, function (evt) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Re:VIEW to make distribution file | |
# The workflow is triggered on pushes to the repository. | |
on: [push] | |
jobs: | |
build: | |
name: | |
runs-on: ubuntu-latest | |
steps: | |
# uses v2 Stable version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: vvakame/review:5.4 | |
build-pdf: | |
script: # build-in-docker.sh の終盤と同じもの | |
- ./setup.sh | |
- npm run pdf | |
artifacts: | |
paths: | |
- articles/ReVIEW-Template.pdf | |
tags: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var photonSwordParticleJson ={"name":"CPU particle system","id":"default system","capacity":10000,"disposeOnStop":false,"manualEmitCount":-1,"emitter":[0,0,0],"particleEmitterType":{"type":"PointParticleEmitter","direction1":[0,1,0],"direction2":[0,1,0]},"texture":{"tags":null,"url":"https://assets.babylonjs.com/textures/flare.png","uOffset":0,"vOffset":0,"uScale":1,"vScale":1,"uAng":0,"vAng":0,"wAng":0,"uRotationCenter":0.5,"vRotationCenter":0.5,"wRotationCenter":0.5,"homogeneousRotationInUVTransform":false,"isBlocking":true,"name":"https://assets.babylonjs.com/textures/flare.png","hasAlpha":false,"getAlphaFromRGB":false,"level":1,"coordinatesIndex":0,"coordinatesMode":0,"wrapU":1,"wrapV":1,"wrapR":1,"anisotropicFilteringLevel":4,"isCube":false,"is3D":false,"is2DArray":false,"gammaSpace":true,"invertZ":false,"lodLevelInAlpha":false,"lodGenerationOffset":0,"lodGenerationScale":0,"linearSpecularLOD":false,"isRenderTarget":false,"animations":[],"invertY":true,"samplingMode":3,"_useSRGBBuffer":false},"isLocal" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scene.registerBeforeRender(function () { | |
scene.meshes.forEach(function (m) { | |
if (m.name=="ballInstance" && (m.position.z <-100)||(m.position.z > 100)) { | |
m.dispose(); | |
} | |
}) | |
}); |