Quantcast
Channel: Bugs Latest Topics
Viewing all 760 articles
Browse latest View live

Babylon.js + glTF Loader does not support glTF 1.1


Baffled by Missing Textures. Need Help.

$
0
0

I am seeking help to solve this issue that has been a real challenge to me. I have a scene with an interactive car. The model was updated in Blender 2.78 and Blender exporter 5.1.2. The body, doors, hood, and trunk are separate meshes that use the same material.  Everything seem to be okay when I view the scene in the sandbox. (All the meshes, materials and textures seem to be just right.) When I view the scene locally, a couple of the meshes will have the correct material and textures applied to them while they would be missing from other meshes that use the same material. When I view the scene live online, all the the textures will be missing. I have attached a couple of screen captures to explain what I mean. Here is the link to the online scene. Here is a link to the Babylon Scene and Blend File download. 

Note:

  • I applied new materials to the meshes via the html file. I am not sure if this is an issue. 
  • The scene does not load in Firefox 50.1.0
  • The scene works in Google Chrome, Microsoft Edge and Opera.

Scene as viewed in Sandbox.jpg

Scene as viewed locally.jpg

Scene as viewed online (live).jpg

Screen capture showing an old version of the scene.jpg

Cannot read property 'normal' of null

$
0
0

First off BabylonJS is awesome!

I am having a problem with CSG currently. This error I get only seems to happen on Chrome on Windows. Edge on Windows and all Mac works fine. 

I have an app that is creating CSG on the fly. This is for a foam case building app that I am working on. For a gun shape that has two circles for finger notches as seen in the 2d image below. You can also see in the image below the points of the polygon I am rendering. We've added two circles to the render as well. When I run this as a `CSG subtract` in BabylonJS on Chrome on Windows for certain shapes, with an example below. I get the following error: 

Jacob Schatz
 

Uncaught TypeError: Cannot read property 'normal' of null
   at Plane.splitPolygon (eval at globalEval (app.js:1), <anonymous>:48668:68)
   at Node.build (eval at globalEval (app.js:1), <anonymous>:48826:28)
   at Node.build (eval at globalEval (app.js:1), <anonymous>:48836:27)
   at Node.build (eval at globalEval (app.js:1), <anonymous>:48836:27)
   at Node.build (eval at globalEval (app.js:1), <anonymous>:48836:27)
   at Node.build (eval at globalEval (app.js:1), <anonymous>:48836:27)
   at Node.build (eval at globalEval (app.js:1), <anonymous>:48836:27)
   at Node.build (eval at globalEval (app.js:1), <anonymous>:48836:27)
   at Node.build (eval at globalEval (app.js:1), <anonymous>:48836:27)
   at Node.build (eval at globalEval (app.js:1), <anonymous>:48836:27)

 

This error is a little bit beyond my understanding of Babylon. I don't think that I have any complex lines where the lines are over lapping one another and I also don't know how to catch this error. Would be great to be able to catch the error if we can't fix it. 

Again thanks for the great library. 

ss_ 2017-01-02 at 1.06.57 PM.png

ss_ 2017-01-02 at 1.08.20 PM.png

ss_ 2017-01-02 at 1.09.14 PM.png

Resize window and viewport

$
0
0

When resizing the browser, the viewport of the second camera is no longer correct. (Sorry if this is not a bug, and in this case, how to make the camera window 2 remains at a fixed size or does not distort it.)

http://www.babylonjs-playground.com/#UCFKM#12

Mirror texture, bump/paralax maping errors

$
0
0

Hello All
This is my first post :)

Here is a bug i have found while using mirrortexture:
The normal vector seems to be inverted ( or not inverted if it needs to be)in some way when rendering mirror content, this makes displaying errors when using bumpmapping,  with parallax it is even worse.

Here is playground for bumpmapping, look at the blue wall near the edge of mirror
http://babylonjs-playground.azurewebsites.net/#I1CQH#0

Paralax example, try to rotate the camera, it is clearly something wrong with the way reflection image behaves.
http://babylonjs-playground.azurewebsites.net/#1SGTPA#3

best regards
Ceedee
 

bumpmap_paralax.jpg

parallax mapping, directional light bug

$
0
0

Lighting of parallax mapped object seems to be inverted when using directional light.

playground:  http://babylonjs-playground.azurewebsites.net/#1SGTPA#5
 

The scene contains paralax mapped rectagle and few spheres,  the only light on the scene is directional light with the direction equal to (0,-1,0)
The mirror is not so important here.

When looking from the side of spheres,  light on the plane goes from down,    on spheres it goes from the top
but when we rotate the camera and look on the back face of plane,  suddenly light there goes from the top

same example, but light direction changed to (1,-1,0):
http://babylonjs-playground.azurewebsites.net/#1SGTPA#6
 

 

paralax_dirlight2.jpg

paralax_dirlight1.jpg

shadowGenerator self shadows

$
0
0

Objects which at the same time produce and receive shadows show some strange glitches.

http://babylonjs-playground.azurewebsites.net/#1SGTPA#9

I tested it on Nvidia NVS3100M  and Intel HD Graphics (1 st gen.)  On each of those cards the  the size of circles is different,  but looks bad anyway.


When you comment lines 92,93:

  //  shadowGenerator.getShadowMap().renderList.push(plane);
  //  shadowGenerator.getShadowMap().renderList.push(videoPlane);

Planes start to look ok, but it is not a solution at all, in case of more complicated meshes/scenes selfshadowing is an important feature.
Only in very limited scenes it is possible to make it good by disabling some meshes shadows.
 

 

 

selfshadows.jpg

Latest 2.6 alpha crashes on mesh.dispose

$
0
0

Has anyone else used the latest nightly 2.6 alpha (on 1/5/2017)... Because now all of sudden all my mesh disposal code crashes... I go back to a version i had forked on (1/3/2017) and includes my #1641 onCollideEvent and particle system customShader... it works great... Somehow, Something got put in after 1/3/2017 in addition to my changes that is now crashing... Its hard to make a playground ... Is toolkit project.

I will keep trying to investigate what could be the culprit that got got changed sine the last couple commits... Just wondering if anybody else is having an issue with the nightly build on 1/5/2017

@Deltakosh ... Has there been ANY new commits lately that deal with life cycle or disposal ???

 

 


MacOS Sierra and Skybox / Cube texture bug

$
0
0

Hey,

 

I just upgraded to OSX Sierra and this bit of code does not work anymore on chrome :

/* --- Skybox --- */
  var skyboxObject = BABYLON.Mesh.CreateBox("skyBox", 10000.0, scene);
  var skyboxMaterial = new BABYLON.StandardMaterial("skyBox" + sceneKey, scene);
  skyboxMaterial.backFaceCulling = false;
  skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture(taskObject.ASSETS_FOLDER + "/textures/fantasy/Sky",
    scene, ["_px.png", "_py.png", "_pz.png", "_nx.png", "_ny.png", "_nz.png"]);
  skyboxMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE;
  skyboxMaterial.diffuseColor = new BABYLON.Color3(0, 0, 0);
  skyboxMaterial.specularColor = new BABYLON.Color3(0, 0, 0);
  skyboxObject.material = skyboxMaterial;
  skyboxObject.rotation.x = Math.PI;

 

I get this :

Screen Shot 2016-10-04 at 18.02.46.png

 

Only one side of the cube. No error in the console.

 

I will try to get more information on this, I have been swamped these past few days... sorry.

 

This bug is not present in safari.

Rectangle2D.dispose() creates a WebGL error

$
0
0

Hi,

I have 4 sprite2D buttons in an array. They are the only visible sprites on a canvas, but not the only one (several with opacity 0).

If I dispose of 3 among the 4 everything is fine.

elements2D.levelButtons[0].dispose();
elements2D.levelButtons[1].dispose();
// elements2D.levelButtons[2].dispose();
elements2D.levelButtons[3].dispose();

But if I dispose of all of them webGL throws a warning on a couple of render() - i'd say around 100 engine.render(). During those render any call to add primitives is not taken into account, resulting in a slight delay. Then, without any reason the warnings stop and calls to render and modify sprite are taking into account and rendered.

babylon.2.5.max.js:7685 WebGL: INVALID_OPERATION: drawElements: no buffer is bound to enabled attribute
Engine.draw @ babylon.2.5.max.js:7685
Rectangle2DRenderCache.render @ babylon.2.5.canvas2d.max.js:8864
Group2D._renderTransparentData @ babylon.2.5.canvas2d.max.js:8415
Group2D._groupRender @ babylon.2.5.canvas2d.max.js:8287
Canvas2D._render @ babylon.2.5.canvas2d.max.js:13009
(anonymous) @ babylon.2.5.canvas2d.max.js:11954
Observable.notifyObservers @ babylon.2.5.max.js:3605
Scene.render @ babylon.2.5.max.js:18697
(anonymous) @ catch-the-wolf-mri.js:653
Engine._renderLoop @ babylon.2.5.max.js:7166
requestAnimationFrame (async)
Tools.QueueNewFrame @ babylon.2.5.max.js:4878
Engine._renderLoop @ babylon.2.5.max.js:7173
requestAnimationFrame (async)
Tools.QueueNewFrame @ babylon.2.5.max.js:4878
Engine._renderLoop @ babylon.2.5.max.js:7173
requestAnimationFrame (async)
Tools.QueueNewFrame @ babylon.2.5.max.js:4878
Engine._renderLoop @ babylon.2.5.max.js:7173
requestAnimationFrame (async)
Tools.QueueNewFrame @ babylon.2.5.max.js:4878
Engine._renderLoop @ babylon.2.5.max.js:7173

I have no idea where it is coming from. It is not due to the fact that they are in an array, if I add another unrelated button to the scene I can dispose of the four rect without warning.

 

This is my function creating the button, but I am not sure it is coming from that, I sometime had the same behavior when using dispose() in other contexts.

var addButton = function (stateManager = mandatory(), options = null) {
    return new Promise(function (resolve, reject) {
      if (typeof stateManager._parent.parentTaskObject === "undefined") {
        throw new Error("stateManager.addButton: stateManager._parent.parentTaskObject is undefined");
      }

      var baseOptions = {
        id: "button" + stateManager.timeInMs,
        text: "text",
        x: 50,
        y: 50,
        width: 100,
        height: 50,
        fill: BABYLON.Canvas2D.GetSolidColorBrush(new BABYLON.Color4(0.8, 0.8, 0.8, 1)),
        clickEventData: null,
        fontName: "30pt Arial",
        baseOpacity: 0.8,
        hoverOpacity: 1
      };

      options = _.extend(baseOptions, options);

      var elements2D = stateManager.getGlobal("elements2D");
      var canvas = elements2D.canvas;

      // create button and add to canvas 
      var buttonRect = new BABYLON.Rectangle2D({
        parent: canvas,
        id: options.id,
        x: options.x,
        y: options.y,
        width: options.width,
        height: options.height,
        fill: options.fill,
        roundRadius: 0,
        children: [
          new BABYLON.Text2D(options.text, {
            fontName: options.fontName,
            marginVAlignment: "v: center",
            marginHAlignment: 3
          })
        ]
      });

      buttonRect.opacity = options.baseOpacity;

      // Add an observable for hovering
      buttonRect.pointerEventObservable.add(function (d, s) {
        buttonRect.opacity = options.hoverOpacity;
      }, BABYLON.PrimitivePointerInfo.PointerOver);

      buttonRect.pointerEventObservable.add(function (d, s) {
        buttonRect.opacity = options.baseOpacity;
      }, BABYLON.PrimitivePointerInfo.PointerOut);

      // Add an observable for clicking
      if ((options.clickEventData !== null) && (options.clickEventData.constructor === EventData)) {
        buttonRect.pointerEventObservable.add(function (d, s) {

          options.clickEventData.happenedAt = stateManager.timeInMs;
          options.clickEventData.data.button = buttonRect;

          stateManager.addEvent(options.clickEventData);
        }, BABYLON.PrimitivePointerInfo.PointerUp);
      }

      resolve(buttonRect);
    });
  };

Did that happen to someone else ? Any clue ?

 

To circumvent the problem I create a 1*1 pixel button with opacity 0 at position 0,0 and that allows me to dispose() all the real buttons without error.

 

Thanks !

GLTF Loader not setting BoundingInfo

$
0
0

Hi,

I'm having an issue getting the method getBoundingInfo() working with the GLTF Loader plugin. Using other formats this data would be automatically set when using ImportMesh, for instance with the skull.babylon example:

1.	BoundingInfo
1.	_isLocked:false
2.	boundingBox:BoundingBox
3.	boundingSphere:BoundingSphere
4.	isLocked:false
5.	maximum:Vector3
1.	x:23.7722
2.	y:30.4701
3.	z:29.0242
6.	minimum:Vector3
1.	x:-23.7722
2.	y:-30.4938
3.	z:-29.0169

Using the same code but replacing skull.babylon with duck.gltf :

1.	BoundingInfo
1.	_isLocked:false
2.	boundingBox:BoundingBox
3.	boundingSphere:BoundingSphere
4.	isLocked:(...)
5.	maximum:Vector3
1.	x:0
2.	y:0
3.	z:0
6.	minimum:Vector3
1.	x:0
2.	y:0
3.	z:0

All values get set to 0, including those on boundingBox and boundingSphere. I'm seeing the same result with other GLTF models I've tried.

Is this a bug in the GLTF loader, or is there something else I need to do to set the bounding info for these meshes?

[FIXED] Calling dispose on a mesh causes entire custom render target to disappear

$
0
0

Hi there,

I have a minimap implemented by having a secondary camera in a RenderTargetTexture applied on a plane. In the 2.6 preview version since a change committed on Dec 21st 2016, something has been broken. So when I dispose an object in my scene, the entire plane which holds the minimap (the RenderTargetTexture of a camera) disappears too. This is obviously not the expected behaviour.
I traced the problematic commits and they happened to be these:

commit 49e419016287753a9720a46114bbc605df69db79
Merge: 55f1083 d0fbbc9
Author: David Catuhe <david.catuhe@live.fr>
Date:   Wed Dec 21 12:23:33 2016 -0800

    Merge pull request #1622 from haxiomic/UseOpenGLProjectionMatricies
    
    Use OpenGL projection matricies over Direct3D for better depth precision

To reproduce the problem, please download the attached zip and run index.html. The code has setTimeout that will dispose the sphere. You will see that the minimap disappears too. Then when you modify index.html to reference good-babylon.js instead of bad-babylon.js you will see that when the sphere disappears, the minimap will not disappear. bad-babylon.js is the current preview version built from master, whereas good-babylon.js is from a version before the problematic commit.

 

I hope someone knowledgeable of the changed area of code fix the issue for us.

bug.zip

2.6 Particle System preventAutoStart NOT working anymore

$
0
0

It seems that preventAutoStart no longer has any effect... I have babylon scene with preventAutoStart set to true but they still auto start.

 

Anybody else having this issue?

 

glTF models for Skinning has orientation problem

Dispose RenderingPipeline


Shadow generator with dispose

[NOT-A-BUG] disabling meshes causes intersectsMesh to always return true

$
0
0

Hi,

Why is it that when I have a mesh disabled (i.e. mesh.setEnabled(false)) any intersectsMesh by it or against it returns true? Setting the method's second parameter 'precise' to true does not help.

This output seems counter intuitive and I do not believe it is what anyone would expect. In fact, my intuitive expectation is that by having the mesh disabled, any intersectsMesh on it or against it should return false (even if the mesh being tested with it is in the same position that it would appear in if enabled).

What do you think?

 

Playground showing the problem (watch out for the browser console which prints the result of the intersectsMesh method testing two exclusive spheres in position which one of them is disabled): http://www.babylonjs-playground.com/#PD7PP#0

Babylon.js + glTF Loader does not support glTF Materials Common?

$
0
0

I added a sample of glTF Materials Common to the sample list below.

However, it was all displayed in gray. Is Babylon.js + glTF Loader unsupported by glTF-MaterialsCommon?

https://cx20.github.io/gltf-test/

glTF-MaterialsCommon_samples.png

glTF-MaterialsCommon/Duck.gltf

glTF-MaterialsCommon_Duck.png

glTF-MaterialsCommon/Box.gltf

glTF-MaterialsCommon_Box.png

Uncaught TypeError: Cannot read property 'push' of undefined

$
0
0

I don't know if this is the proper place to report bugs, but I couldnt find the Issues link of this project github page.

I am trying to use babylon as a browserify module with the budo webserver: https://github.com/mattdesl/budo

Here is my index.js:

	var BABYLON = require('babylonjs/babylon.max');
var html = require('bel');
var canvas = html`<canvas id="renderCanvas"></canvas>`;
document.body.appendChild(canvas);
	window.addEventListener('DOMContentLoaded', function() {
    console.log('DOMContentLoaded');
    console.log(canvas);
    var engine =  new BABYLON.Scene(canvas, true);
});
	

Then, when I open localhost:9966 I get the error of the title:

"Uncaught TypeError: Cannot read property 'push' of undefined"

The line that throws this error is the line 16958 of babylon.max.js which might be coming from https://github.com/BabylonJS/Babylon.js/blob/49bde9f67194ecc773c07a4ee0064fe836914b59/src/babylon.scene.ts#L575

Any ideas of what I could be doing wrong?

Thanks!

Latest 2.6 - Another Issue With HDR

$
0
0

Hey @Deltakosh

The latest 2.6 alpha now gives a BUNCH of error when using HDRCubeTexture:

[.Offscreen-For-WebGL-0x7fc2bf02b800]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering.

Sorry... Correct it crashes when being deserialized (also with 2.5)

You can download the whole build folder (with the scene file, index page and all textures) at Samples Build Folder

Viewing all 760 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>