TomaszFurca Posted June 13, 2017 Share Posted June 13, 2017 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/ Quote Link to comment Share on other sites More sharing options...
Gijs Posted June 13, 2017 Share Posted June 13, 2017 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 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 13, 2017 Share Posted June 13, 2017 Can you reproduce in the PG? It's kind of tough to help with no code Quote Link to comment Share on other sites More sharing options...
TomaszFurca Posted June 14, 2017 Author Share Posted June 14, 2017 Cannot reproduce it on PG, because after save i can see error "Unable to save your code. It may be too long." So open my PG code from guthub https://raw.githubusercontent.com/furcatomasz/slavs/master/PG01.txt and put it on PG :). Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 14, 2017 Share Posted June 14, 2017 Do you think that an human can read that? The whole idea of a repro case is to reduce the problem to a few lines of code Quote Link to comment Share on other sites More sharing options...
TomaszFurca Posted June 14, 2017 Author Share Posted June 14, 2017 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. Quote Link to comment Share on other sites More sharing options...
TomaszFurca Posted June 15, 2017 Author Share Posted June 15, 2017 Oks - Today i preapre PG http://www.babylonjs-playground.com/#S2RF02, i was loaded JS fles from my server and now I can show only code to fix :). On first open you can see error, but click run and now everything will be ok. So problem is with shadows - its are not generated correctly. And next problem in babylon 3.0 is ortho camera. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 15, 2017 Share Posted June 15, 2017 I get a "map01 is not defined" error. Quote Link to comment Share on other sites More sharing options...
TomaszFurca Posted June 15, 2017 Author Share Posted June 15, 2017 Click RUN 2x, then you will see my scene :). Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 15, 2017 Share Posted June 15, 2017 Nope Even clicking run 10 times does not work. You should execute your code on script.onload Quote Link to comment Share on other sites More sharing options...
TomaszFurca Posted June 15, 2017 Author Share Posted June 15, 2017 With error but work on firefox and chrome http://www.babylonjs-playground.com/#S2RF02#2 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 15, 2017 Share Posted June 15, 2017 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 (The deposit has moved) But you have reasons BABYLON.GUI is awesome rather than a layer on top of the canvas as does CastorGUI. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 16, 2017 Share Posted June 16, 2017 This is all I get: Quote Link to comment Share on other sites More sharing options...
TomaszFurca Posted June 16, 2017 Author Share Posted June 16, 2017 Maybe using JQuery will work on your computer http://www.babylonjs-playground.com/#S2RF02#4 Quote Link to comment Share on other sites More sharing options...
Borislav Posted June 17, 2017 Share Posted June 17, 2017 On 14.06.2017 at 9:03 PM, Deltakosh said: Do you think that an human can read that? The whole idea of a repro case is to reduce the problem to a few lines of code a human* It is not french . Quote Link to comment Share on other sites More sharing options...
Borislav Posted June 17, 2017 Share Posted June 17, 2017 @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. Quote Link to comment Share on other sites More sharing options...
TomaszFurca Posted June 18, 2017 Author Share Posted June 18, 2017 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); Quote Link to comment Share on other sites More sharing options...
TomaszFurca Posted June 19, 2017 Author Share Posted June 19, 2017 Okey! - Problem was camera minZ - it works http://www.babylonjs-playground.com/#S2RF02#5 GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.