Sign in to follow this  
TomaszFurca

[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:

https://postimg.org/image/ng3imoicz/

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:

https://postimg.org/image/t3f1nj21x/

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Yes :D. 

Sorry for that, human code is in the end of the file.

Textures are not loaded, because is no need to recreate this problem.

 

map01 variable is scene from blender, exported by tower of babel. On babylon exporter scene is displayed not correct too.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
On 14.06.2017 at 9:03 PM, Deltakosh said:

Do you think that an human can read that? :D

The whole idea of a repro case is to reduce the problem to a few lines of code :D

a human*

It is not french :D.

Share this post


Link to post
Share on other sites

@TomaszFurca

 

 

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.

 

Share this post


Link to post
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);

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.