Questions tagged [babylonjs]

JavaScript framework for building 3D games with HTML5 and WebGL.

Official site, Github, documentation.

Features

  • Complete scene graph with lights, cameras, materials and meshes
  • Collisions engine
  • Scene picking
  • Antialiasing
  • Animations engine
  • Particles Systems
  • Sprites and 2D layers
  • Optimizations engines:
    • Frustum clipping
    • Sub-meshes clipping
    • Hardware scaling
    • Selection octrees
    • Offline mode (Assets are saved locally to prevent reloading them)
    • Incremental loading
  • Standard material is a per pixel material that supports:
    • Diffuse lightning and texture
    • Ambient lightning and texture
    • Specular lightning
    • Opacity texture
    • Reflection texture (Spheric, planar, cubic and projection)
    • Mirror texture
    • Emissive texture
    • Specular texture
    • Bump texture
    • Up to 4 lights (points, directionals, spots, hemispherics)
    • Custom materials
    • Skybox
    • Vertex color
    • Bones (Animations and shadows are supported)
  • Special FX
    • Fog
    • Alpha blending
    • Alpha testing
    • Billboarding
    • Fullscreen mode
    • Shadow Maps and Variance Shadow Maps
    • Rendering layers
    • Post-processes (blur, refraction, black'n'white, fxaa, customs...)
  • Textures:
    • Render target textures
    • Dynamic textures (canvas)
    • Video textures
  • Cameras (Perspective and orthographic):
    • Arc rotate camera
    • Free camera
    • Touch camera
  • Meshes:
    • Mesh cloning
    • Dynamic meshes
    • Height maps
  • Import:
    • Babylon scene file can be converted from .OBJ, .FBX, .MXB
    • Exporter for Blender
469 questions
8
votes
2 answers

Babylon.js, how to remove a mesh from scene?

How can I remove mesh from scene in Babylon.js in runtime? Tried to search, didn't find, also tried to view the scene methods in debugger, also can't find.
user4124520
6
votes
1 answer

Using GLSL to render a smooth reference grid on a plane

I'm trying to write a GLSL fragment shader that renders a reference grid on a flat ground plane. I'm using BabylonJS to create a WebGL application. The code can be seen in action here: http://www.babylonjs.com/cyos/#IBHRN#2 #extension…
josef.van.niekerk
  • 11,941
  • 20
  • 97
  • 157
6
votes
2 answers

Load a .obj and .stl in Babylon.js

I want to load a file, using Babylon.js, that has been uploaded by the user. I've looked around but can only find examples of loading babylon scene files. Is there a way of loading .obj and/or .stl files directly with Babylon.js without having to…
Oli
  • 1,112
  • 1
  • 10
  • 25
5
votes
3 answers

@Babylonjs (ES6) in Nextjs failes with unexpected token 'export'

I'm building my website with Nextjs and importing Bablyonjs was throwing up the following error. syntaxError: Unexpected token 'export' module.exports = require("@babylonjs/core") I'm using the standard nextjs setup with tsconfig.json I'm refering…
Emile
  • 11,451
  • 5
  • 50
  • 63
5
votes
2 answers

Angular9/Typescript3.8/Babylon4.1.0 - Typescript compilation error - Cannot find module ‘react’/Cannot find namespace ‘JSX’

I'm currently facing compilation issues with Babylon4.1.0 in the context of an angular9 app. It seems like the inspector cannot import the internally used "react" module. The issue can be reproduced by * Creating a bootstrap angular9 app with the…
timmwagener
  • 2,368
  • 2
  • 19
  • 27
5
votes
1 answer

babylon.js meshes get same material

I'm using BabylonJS V3 with Blender 2.79 to create product visualizations. Many times, it is necessary to define more complex shaders in the JS code. I'm using lines like scene.meshes[1].material.emissiveColor = new BABYLON.Color3(1, 0, 0); to…
yann
  • 51
  • 5
5
votes
2 answers

Babel, Maximum call stack size exceeded while using path.replaceWith

I was trying to play with babel modules, babylon, babel-traverse. When I tried to replace a node, the program crashed with Maximum call stack size exceeded. Here is my code import * as babylon from 'babylon' import traverse from…
hjl
  • 2,794
  • 3
  • 18
  • 26
5
votes
2 answers

Character Movement using Babylon.js

In a game demo I am putting up for school I need to move my character using the W-A-S-D keys and also the arrow keys. I put up a function and set up a switch case to listen for any of the key presses. Here is my code snippet: //Handles the player's…
user3838697
  • 115
  • 3
  • 12
5
votes
1 answer

Babylon.js Mesh Picking & Ignoring Some Meshes

I am currently working on a small project using the new Babylon.js framework. One of the issues I have run into is that I basically have two meshes. One of the meshes is supposed to be the background, and the other is supposed to follow the cursor…
Zerocaliber
  • 53
  • 1
  • 5
4
votes
1 answer

Unable to retrieve all meshes once imported in the scene

I am trying to import meshes using SceneLoader.ImportMesh function, however, when I try to access all meshes using scenes.meshes, the only one that appears is ground, despite me being able to see the objects in the scene. After reading documentation…
BrownPanther
  • 153
  • 6
4
votes
1 answer

Babylon JS - How can I make the transparent background

I have an online project running with Babylon JS where I need to remove the gray and white background (which Babylon JS has by default), and leave the canvas completely transparent. I need to see what's behind the canvas, and I can not ... :( How is…
Pablo_Web
  • 423
  • 2
  • 14
4
votes
0 answers

Why does most game / graphics js code use var instead of more modern syntax?

I've been a js developer for few years now. I've recently got into graphics / webgl programming and game engines etc. And no matter where I look, most code avoids the use of newer syntax such as () => {}, let, const etc. Sticking almost…
Lesbaa
  • 1,979
  • 2
  • 12
  • 15
4
votes
1 answer

import an extension module in node

I have a Node.js Angular app which I am trying to import babylon.js into. Current Setup 1) npm install --save babylonjs to get the npm repo installed in my project's node modules. The following image depicts the folder structure of the npm repo. …
Chris Haugen
  • 825
  • 1
  • 7
  • 22
4
votes
1 answer

How to calculate in babylon.js the camera position to the loaded model intermeddle in screen?

I need to boot the entire model got completely into the viewport. Because if the model has a large size, it does not got completely into the viewport, for example: To solve this problem I need set the desired camera position: …
alex10
  • 2,726
  • 3
  • 22
  • 35
4
votes
1 answer

How to set gravity to the center of a big sphere (planet) in Babylon.js?

I made a sphere in Babylon.js at the point [0,0,0], I want it to be like a planet with it's own gravity. Then I want a sphere (that will be the player) to be attracted to the center of the big sphere ("planet"). Here is the demo I…
Giovanne Afonso
  • 666
  • 7
  • 21
1
2 3
31 32