Jump to content

[solved] Render in babylon 3.0


Recommended Posts

Today i was start develop GUI of my game. When i started reading about new babylon GUI i decided to change old CastorGUI. So to start work with babylon GUI i need to init babylon 3.0 instead 2.5. 

GUI works fine, but my scene is rendered in half:


when i change position of my orho camerai can see that:

https://postimg.org/image/f2vgtin7f/9ddf0387/ - not visible shadows, and half of last tree


This is scene from BJS 2.5:


Link to comment
Share on other sites

Did you make it with TypeScript? Because when I upgraded, the code checker showed me which parts I had to rewrite. I also had some hacks in place that worked for 2.5 only, so that's also something you could check. Finally, the 3.0 version is being updated all the time, so you could check if an earlier version does work:

https://github.com/BabylonJS/Babylon.js/commits/master/dist/preview release/babylon.js

Link to comment
Share on other sites

On 13/06/2017 at 10:05 PM, TomaszFurca said:

When i started reading about new babylon GUI i decided to change old CastorGUI

LOL, It is not that old, I rewrote it with ECEMAScript 6 :D (The deposit has moved) But you have reasons BABYLON.GUI is awesome rather than a layer on top of the canvas as does CastorGUI.

Link to comment
Share on other sites




It must be the thing that makes objects and meshes disappear from the distance.

The trees and rocks are getting erased together with the ground; hence, this is something is making things get erased from a certain distance.

Did you have a line in which it states that the game shouldn't render anything farther or nearer than a certain distance?

If yes, that's the problem.


Link to comment
Share on other sites

When I disable orthocamera, then everything is displayed correct. Maybe this is some problem with orthocamera.

This is my all code of camera definition (I do not have any distance options, yet):

        var camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(0, 0, 0), scene);
        camera.mode = BABYLON.Camera.ORTHOGRAPHIC_CAMERA;
        camera.orthoTop = 18;
        camera.orthoBottom = 0;
        camera.orthoLeft = -15;
        camera.orthoRight = 15;
        var ratio = window.innerWidth / window.innerHeight ;
        var zoom = camera.orthoTop;
        var newWidth = zoom * ratio;
        camera.orthoLeft = -Math.abs(newWidth);
        camera.orthoRight = newWidth;
        camera.orthoBottom = -Math.abs(zoom/4);
        camera.rotation = new BABYLON.Vector3(0.4, -0.98, 0);


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...