Quantcast
Viewing all 760 articles
Browse latest View live

Download link syntax error

Hi

I tried downloading the latest version from this URL: https://www.babylonjs.com/versionBuilder/

After nothing happened when pressing "Generate", I checked the page source and found what I think is a syntax error. The download link (generateURL in index.js) does not end with a slash (/), so when generateUrl() adds a question mark (?), the link becomes invalid. Adding a slash seems to do the trick.

When downloading from what I think is the correct link (http://babyloncomponentselector.azurewebsites.net/api/buildbabylon/?stable=true&minified=false) the file is named "babylon.custom.js", when it would be nicer if it was named "babylon.2.5.max.js" or something - but maybe that was because I screwed up the download link by not adding any "&components" to the end?


CYOS bugs

hi 

1. cant save Cyos 

2. this shader result is not corrct in Cyos but have correct result in PG

*notic this line in vertex shader :  vNormal = normal; 

if you remove that shader render correctly

http://www.babylonjs-playground.com/#Y0RQ2F#3

precision highp float;

// Attributes
attribute vec3 position;
attribute vec3 normal;
attribute vec2 uv;

// Uniforms
uniform mat4 worldViewProjection;

// Varying
varying vec2 vUV;
varying vec4 vPosition;
varying vec3 vNormal;

void main(void) {
      vec4 p = vec4( position, 1. );

    vPosition = p;
    vNormal = normal; 
    vUV = uv;

    gl_Position = worldViewProjection * p;
}

 

precision highp float;

varying vec2 vUV;

varying vec4 vPosition;
varying vec3 vNormal;

uniform sampler2D textureSampler;

void main(void) {
    gl_FragColor = texture2D(textureSampler, vUV);
}

I can't use external video for videoTexture

compiling with strictNullChecks: true causes compile error

This is a very minor issue, but it also has a very minor fix I think.

When building a TS project which includes the latest preview babylon.js typings, with the strictNullCheck:true flag set, the following error happens during compilation:

lib/babylon.d.ts(674,5): error TS2403: Subsequent variable declarations must have the same type.
 Variable 'crossOrigin' must be of type 'string | null', but here has type 'string'.

The Typescript provided lib.d.ts defines crossOrigin as 'string | null' as the error suggests. Admittedly I am not sure of the build process used for BJS, But I think that this line https://github.com/BabylonJS/Babylon.js/blob/92ab030b50fc277904a823be642755d3f0fef006/src/babylon.mixins.ts#L155

just needs to be changed to match the lib.d.ts shape ( string | null ). I've never contributed to this project, but can create a PR if you want.

Error with loadFromDataString (preview release)

I'm testing out the preview release of babylon.js

When I run this line on desktop and mobile browsers:

diffuseTexture1 = BABYLON.Texture.LoadFromDataString("diffuse",data,scene);                    

I get the errors shown in the image below.  It works fine in current version of babylon.js

Image may be NSFW.
Clik here to view.
draw_image_errors.jpg

HighlightLayer does not work

Hello,

on demo of documentation , HighlightLayer does not work. 

http://www.babylonjs-playground.com/#1KUJ0A#0

Error console:

Failed to load resource: the server responded with a status of 404 (Not Found)
babylon.js:3 Uncaught Error: Error status: 404 - Unable to load /src/Shaders/glowMapMerge.vertex.fx
    at XMLHttpRequest.e.onreadystatechange (babylon.js:3)
/src/Shaders/glowBlurPostProcess.fragment.fx Failed to load resource: the server responded with a status of 404 (Not Found)
babylon.js:3 Uncaught Error: Error status: 404 - Unable to load /src/Shaders/glowBlurPostProcess.fragment.fx
    at XMLHttpRequest.e.onreadystatechange (babylon.js:3)
/src/Shaders/glowMapGeneration.vertex.fx Failed to load resource: the server responded with a status of 404 (Not Found)
babylon.js:3 Uncaught Error: Error status: 404 - Unable to load /src/Shaders/glowMapGeneration.vertex.fx
    at XMLHttpRequest.e.onreadystatechange (babylon.js:3)

Unable to save babylon playground when DOM manipulating

Edit: NEVERMIND, I checked noscript and that was blocking urls! I havn't had troubles saving before so didnt think of that!.
Here's the url if you want to see it in action!
http://babylonjs-playground.azurewebsites.net/#NJ8S1D

Hi, I'm guessing this probably isn't a bug and is a security feature but I was creating a playground where I was projecting a world position to screenspace and then using css to position a div to make sure it was correct.

I couldn't find any information about unable to save a playground mentioning DOM manipulation.

Heres the code that is unable to save with the error  Unable to save your code. It may be too long.

var createScene = function () {

    // This creates a basic Babylon Scene object (non-mesh)
    var scene = new BABYLON.Scene(engine);

    // This creates and positions a free camera (non-mesh)
    var camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(0, 5, -10), scene);

    // This targets the camera to scene origin
    camera.setTarget(BABYLON.Vector3.Zero());

    // This attaches the camera to the canvas
    camera.attachControl(canvas, true);

    // This creates a light, aiming 0,1,0 - to the sky (non-mesh)
    var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene);

    // Default intensity is 1. Let's dim the light a small amount
    light.intensity = 0.7;

    // Our built-in 'sphere' shape. Params: name, subdivs, size, scene
    var sphere = BABYLON.Mesh.CreateSphere("sphere1", 16, 2, scene);

    // Move the sphere upward 1/2 its height
    sphere.position.y = 1;

    // Our built-in 'ground' shape. Params: name, width, depth, subdivs, scene
    var ground = BABYLON.Mesh.CreateGround("ground1", 6, 6, 2, scene);

    var time = 0;

    var blob = document.getElementById("blobby");
    var canvasZone = document.getElementById("canvasZone");
    canvasZone.style.position = "relative";

if ( !blob ) {
    blob = document.createElement("div");
    blob.style.position = "absolute";
    blob.style.backgroundColor = "red";
    blob.style.left = "0";
    blob.style.top = "0";
    blob.style.width = "5px";
    blob.style.height = "5px";
    blob.id = "blobby";
    blob.style.zIndex = 10000000;

    canvasZone.appendChild(blob);
}    

    scene.afterRender = function() {
        time += 1 / 120;

        sphere.position.x = 0 + 20 * Math.sin( time );

        var scene = sphere.getScene();
        var cameraViewport = camera.viewport;

        let projectedVector = BABYLON.Vector3.Project(  sphere.position, 
                                                        BABYLON.Matrix.Identity(), 
                                                        //sphere.getWorldMatrix(),
                                                        scene.getTransformMatrix(), 
                                                        cameraViewport );
        
        const width = canvasZone.offsetWidth;
        const height = canvasZone.offsetHeight;

        blob.style.left = (width * projectedVector.x) + "px";
        blob.style.top = (height * projectedVector.y) + "px";
        
    }

    return scene;
};

 

applyDisplacementMap inverted by Y


Slow FPS remains even after prim.dispose()

Hi,

 

Just to report that on the example given in the documentation:  http://www.babylonjs-playground.com/#OWCCR#8 

Increasing the number of primitive slows down the fps, but when reducing that number fps stays low even after dispose(). 

 

I don't know it if was reported before, and I did not remember this behavior last time I checked this example... @Nockawa

3.0 with workerCollisions = true cannot move camera

Bump with PBR on Internet Explorer / Edge - 3.0

EdgesRenderer doesn't work anymore

[solved] ShowBoundingBox not working in latest BJS

ooookay, I guess I WON'T pile-on the edgesRenderer issue, and I'll make a fresh bug report for showBoundingBox.

mesh.showBoundingBox seems to be not working in latest release, as far as I can tell.  Works in 2.5.  Thx for listening.

[solved] Fractional .visibility broken?

Unable to get property 'handleEvent' on IE / Edge

Hello,

There is some warning consoles on the latest version of Edge and Internet Explorer.
They are visible on this page : https://www.babylonjs.com/demos/pbr/

They are related to these lines :

element.addEventListener("keydown", this._onKeyDown, false);
element.addEventListener("keyup", this._onKeyUp, false);

I didn't find any problem with this except the console message but that would clear my console :p.


markVerticesDataAsUpdatable not update changes

Hello,

When I use markVerticesDataAsUpdatable, my terrain was updated correctly via a file. But, now this seems  not to work today.

I do this:

$.getJSON("ground.data?" + (new Date()).getTime(), function(data) {			
    global.terrain.markVerticesDataAsUpdatable(BABYLON.VertexBuffer.PositionKind, true);
});

And the elevation of the vertices was updated automatically if the file was updated. But now retesting, this no longer seems to work.

Also, I do not find this function (intellisens) in the playground.

Are there any changes for this function or something else that prevents putting a days? 

Exporter blender : multi animations bug

Hello everybody,

We have a problem with Blender Exporter 4.6.1.

Let us explain to you :

We have two animations : one cube with skeleton and another with a standard animation.

In blender, after we export our scene with babylon exporter, it replaces all the animations by one.

In the babylon file, we have all animations that are merged one after another. For all meshes that contain animation, the exporter copy all the keys of all the animations in one animation.

Please find enclosed the file with source and video to show you this bug.

 

Thank you in advance for your help Image may be NSFW.
Clik here to view.
;)

Letsbro studio team.

cubeAnimBug.zip

Canvas2d/Rect2d - Small .scale - interesting error

Hi gang.  In this playground... play around with mousewheel unzooming... until rect2d is tiny dot.  Play with mousewheel there, while small.  Keep playing... in/out... until...

Error: Can't invert matrix, near null determinant  babylon.canvas2d.js:185:23

Extra stackdump data...

Matrix2D.prototype.invertToRef https://preview.babylonjs.com/canvas2D/babylon.canvas2d.js:185:23
    Matrix2D.Invert https://preview.babylonjs.com/canvas2D/babylon.canvas2d.js:144:13
    Prim2DBase.prototype.updateCachedStates https://preview.babylonjs.com/canvas2D/babylon.canvas2d.js:9337:48
    Prim2DBase.prototype.updateCachedStatesOf https://preview.babylonjs.com/canvas2D/babylon.canvas2d.js:9144:17
    Group2D.prototype._prepareGroupRender https://preview.babylonjs.com/canvas2D/babylon.canvas2d.js:11928:17
    Canvas2D.prototype._updateCanvasState https://preview.babylonjs.com/canvas2D/babylon.canvas2d.js:18228:13
    Canvas2D.prototype._render https://preview.babylonjs.com/canvas2D/babylon.canvas2d.js:18239:13
    Canvas2D/_this._afterRenderObserver< https://preview.babylonjs.com/canvas2D/babylon.canvas2d.js:17036:25
    e.prototype.notifyObservers https://preview.babylonjs.com/babylon.js:2:30355

The error kills the canvas2d and the prims.  They vanish... leaving the user saying "woah, dude", or something similarly profound.  Image may be NSFW.
Clik here to view.
:)

I tortured the poor .scale property (for the mainRect... in the renderLoop) and made it barf.  Rectangular barf!  Image may be NSFW.
Clik here to view.
:o
  

Just passing it along.  (eww)

I almost made a Trello card on @Nockawa's Canvas2D Trello site, but they wanted me to JOIN something, and I couldn't handle all that added responsibility.  :/

NaN produced by Prim2DBase._updateP_updatePositioning after dispose and recreate

Hi, 

So... my problem is a bit specific. I will try to reproduce it in the playgroud but I am not sure I will be able to. 

So I have a Rectangle2d that holds 4 rectangle2d children, the green background is the parent square and the children square are the 4 grey rectangles.

I am using the centering and margin system:

 I used to dispose of those rectangle children and recreate them at certain points in time, storing the newly created children in the same array replacing the hold ones.

The problem is that when I resize the window there is a call to Prim2DBase._updatePositioning that returns (NaN, NaN) as the _actualPosition (in the if (hasMargin) ... which they do). And it cause the parent and all its children to disappear from the screen. That's why i though it was linked to the bug @Wingnut mentionned yesterday.

 There are several variables that are NaN, one of them is Prim2d._size3... but i do not know why, nor do I see where it is define (I only see one definition that sets it to zero... I will look tonight into the typescript source to see if it is there...). This does not happen if I do not dispose of the children prim2d... 

 I had problems with Prim2d.dispose() before, and looking at it, I do not see where the prim2d is actually set to null. Maybe that is the problem? Some kind of persistant reference that interferes with the computation of the rectangles.

 

I will look more into it, but if it is something people have encountered I am interested to know their thoughts.

@Nockawa <3 

For now I am not disposing of the prims anymore Image may be NSFW.
Clik here to view.
:D
 

Tutorial Links broken

@ Someone : Just trying to go to tutorials from this page:

Tutorials

But clicking on a tutorial results in a 404 page not found. Are the links missing "/tutorials/" ?

cheers, gryff Image may be NSFW.
Clik here to view.
:)

 

Viewing all 760 articles
Browse latest View live