www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Babylon JS-like game engine or complete port

reply karabuta <karabutaworld gmail.com> writes:
I like the feel when using Babylon JS(http://www.babylonjs.com/) 
and how the APIs are designed. It has glTF, STL & OBJ importers 
and many more cool features for game devs 
(http://www.babylonjs.com/#featuresdemossection).

But, it does give me the power and performance I need since it is 
based on webGL and JS.

Now, how practical will it be to port this JS game engine to D 
(OpenGL / Vulkhan/ **)? There seems to be a Haxe Version 
(http://babylonhx.gamestudiohx.com/) which has something to do 
with C++ (seems Haxe can target C++).


Is anyone doing something like that?

Example;

  // Babylon
     var engine = new BABYLON.Engine(canvas, true);
     var scene = new BABYLON.Scene(engine);
     var camera = new BABYLON.FreeCamera("Camera", new 
BABYLON.Vector3(-190, 120, -243), scene);
     camera.setTarget(new BABYLON.Vector3(-189, 120, -243));
     camera.rotation = new BABYLON.Vector3(0.30, 1.31, 0);

     camera.attachControl(canvas);


I can handle brutal honesty so, destroy :)
Feb 10 2016
next sibling parent Rikki Cattermole <alphaglosined gmail.com> writes:
On 11/02/16 9:07 AM, karabuta wrote:
 I like the feel when using Babylon JS(http://www.babylonjs.com/) and how
 the APIs are designed. It has glTF, STL & OBJ importers and many more
 cool features for game devs
 (http://www.babylonjs.com/#featuresdemossection).

 But, it does give me the power and performance I need since it is based
 on webGL and JS.

 Now, how practical will it be to port this JS game engine to D (OpenGL /
 Vulkhan/ **)? There seems to be a Haxe Version
 (http://babylonhx.gamestudiohx.com/) which has something to do with C++
 (seems Haxe can target C++).


 Is anyone doing something like that?

 Example;

   // Babylon
      var engine = new BABYLON.Engine(canvas, true);
      var scene = new BABYLON.Scene(engine);
      var camera = new BABYLON.FreeCamera("Camera", new
 BABYLON.Vector3(-190, 120, -243), scene);
      camera.setTarget(new BABYLON.Vector3(-189, 120, -243));
      camera.rotation = new BABYLON.Vector3(0.30, 1.31, 0);

      camera.attachControl(canvas);


 I can handle brutal honesty so, destroy :)
We have no need to port. We can do better. Interested on working on an audio lib playing/recording/abstractions? Its the last major thing missing that something like that has.
Feb 10 2016
prev sibling parent reply Guillaume Piolat <contact gam3sfrommars.fr> writes:
On Wednesday, 10 February 2016 at 20:07:24 UTC, karabuta wrote:
 I like the feel when using Babylon 
 JS(http://www.babylonjs.com/) and how the APIs are designed. It 
 has glTF, STL & OBJ importers and many more cool features for 
 game devs (http://www.babylonjs.com/#featuresdemossection).

 But, it does give me the power and performance I need since it 
 is based on webGL and JS.

 Now, how practical will it be to port this JS game engine to D 
 (OpenGL / Vulkhan/ **)? There seems to be a Haxe Version 
 (http://babylonhx.gamestudiohx.com/) which has something to do 
 with C++ (seems Haxe can target C++).


 Is anyone doing something like that?

 Example;

  // Babylon
     var engine = new BABYLON.Engine(canvas, true);
     var scene = new BABYLON.Scene(engine);
     var camera = new BABYLON.FreeCamera("Camera", new 
 BABYLON.Vector3(-190, 120, -243), scene);
     camera.setTarget(new BABYLON.Vector3(-189, 120, -243));
     camera.rotation = new BABYLON.Vector3(0.30, 1.31, 0);

     camera.attachControl(canvas);


 I can handle brutal honesty so, destroy :)
Javascript world beat us easily in things being easy. The current D offering is not as integrated but each component is pretty much better. OBJ is not a fantastic mesh format. For loading it requires triangularization, spatial hash for vertex values, and generally using a subset of it because it's crazy. 3DS, Collada or FBX are usually favoured. You can use them thanks to the D bindings to ASSIMP. With Derelict bindings to windowing libraries and OpenGL, it doesn't even complicates your build. We have plenty of wrappers over these libraries that makes it a bit easier than using the C API directly (which is also a good solution). Here a "modern OpenGL" example: https://github.com/d-gamedev-team/gfm/blob/master/examples/simpleshader/simpleshader.d You can also use bgfx which is an abstraction over 3D graphics APIs, at the cost of more complexity. https://github.com/bkaradzic/bgfx A camera doesn't need it's own abstraction, it is a regular 4x4 matrix like any other. I don't know why JS engines insist on "camera" being a thing. It only complicates things. You don't necessarily need scene graphs :) You can go immensely far without scene graphs.
Feb 11 2016
next sibling parent karabuta <karabutaworld gmail.com> writes:
On Thursday, 11 February 2016 at 10:25:00 UTC, Guillaume Piolat 
wrote:
 On Wednesday, 10 February 2016 at 20:07:24 UTC, karabuta wrote:
 [...]
Javascript world beat us easily in things being easy. The current D offering is not as integrated but each component is pretty much better. [...]
Waw! code looks clean
Feb 11 2016
prev sibling parent reply karabuta <karabutaworld gmail.com> writes:
On Thursday, 11 February 2016 at 10:25:00 UTC, Guillaume Piolat 
wrote:
 On Wednesday, 10 February 2016 at 20:07:24 UTC, karabuta wrote:
 [...]
Javascript world beat us easily in things being easy. The current D offering is not as integrated but each component is pretty much better. [...]
Does it have a loader? I don't think I saw something like that in the docs.
Feb 11 2016
parent reply Guillaume Piolat <name.lastname gmail.com> writes:
On Thursday, 11 February 2016 at 18:42:41 UTC, karabuta wrote:
 On Thursday, 11 February 2016 at 10:25:00 UTC, Guillaume Piolat 
 wrote:
 On Wednesday, 10 February 2016 at 20:07:24 UTC, karabuta wrote:
 [...]
Javascript world beat us easily in things being easy. The current D offering is not as integrated but each component is pretty much better. [...]
Does it have a loader? I don't think I saw something like that in the docs.
I don't see what you have quoted with [...] If you are talking about bgfx, there is a dynamic loader and a static binding: http://code.dlang.org/packages/bgfx-d http://code.dlang.org/packages/derelict-bgfx For ASSIMP there is a dynamic loader: http://code.dlang.org/packages/derelict-assimp3
Feb 11 2016
parent reply Karabuta <Karabutaworld gmail.com> writes:
On Thursday, 11 February 2016 at 21:59:55 UTC, Guillaume Piolat 
wrote:
 On Thursday, 11 February 2016 at 18:42:41 UTC, karabuta wrote:
 On Thursday, 11 February 2016 at 10:25:00 UTC, Guillaume 
 Piolat wrote:
 On Wednesday, 10 February 2016 at 20:07:24 UTC, karabuta 
 wrote:
 [...]
Javascript world beat us easily in things being easy. The current D offering is not as integrated but each component is pretty much better. [...]
Does it have a loader? I don't think I saw something like that in the docs.
I don't see what you have quoted with [...] If you are talking about bgfx, there is a dynamic loader and a static binding: http://code.dlang.org/packages/bgfx-d http://code.dlang.org/packages/derelict-bgfx For ASSIMP there is a dynamic loader: http://code.dlang.org/packages/derelict-assimp3
Was referring to assimp. Which one do you recommended for newbie(physics, animation, importing of prebuilt asserts)?
Feb 12 2016
parent reply Guillaume Piolat <contact gam3sfrommars.fr> writes:
On Friday, 12 February 2016 at 11:24:27 UTC, Karabuta wrote:
 Was referring to assimp. Which one do you recommended for 
 newbie(physics, animation, importing of prebuilt asserts)?
I'd recommend to use SDL2 (or any other windowing library) and OpenGL directly with Derelict until you feel comfortable with them. And after that think about meshes but the need won't necessarily come fast. Rendering mesh is rather involved, ASSIMP only does loading.
Feb 12 2016
parent reply karabuta <karabutaworld gmail.com> writes:
On Friday, 12 February 2016 at 12:04:12 UTC, Guillaume Piolat 
wrote:
 On Friday, 12 February 2016 at 11:24:27 UTC, Karabuta wrote:
 Was referring to assimp. Which one do you recommended for 
 newbie(physics, animation, importing of prebuilt asserts)?
I'd recommend to use SDL2 (or any other windowing library) and OpenGL directly with Derelict until you feel comfortable with them. And after that think about meshes but the need won't necessarily come fast. Rendering mesh is rather involved, ASSIMP only does loading.
I would prefer to use blender and import assets. How about that?
Feb 13 2016
next sibling parent Guillaume Piolat <name.lastname gmail.com> writes:
On Saturday, 13 February 2016 at 09:07:03 UTC, karabuta wrote:
 On Friday, 12 February 2016 at 12:04:12 UTC, Guillaume Piolat 
 wrote:
 On Friday, 12 February 2016 at 11:24:27 UTC, Karabuta wrote:
 Was referring to assimp. Which one do you recommended for 
 newbie(physics, animation, importing of prebuilt asserts)?
I'd recommend to use SDL2 (or any other windowing library) and OpenGL directly with Derelict until you feel comfortable with them. And after that think about meshes but the need won't necessarily come fast. Rendering mesh is rather involved, ASSIMP only does loading.
I would prefer to use blender and import assets. How about that?
Maybe one of the packages here can render meshes: http://code.dlang.org/?sort=updated&category=library.graphics
Feb 13 2016
prev sibling parent reply Tanel =?UTF-8?B?VGFnYXbDpGxp?= <tanel58 hotmail.com> writes:
On Saturday, 13 February 2016 at 09:07:03 UTC, karabuta wrote:
 I would prefer to use blender and import assets. How about that?
I made a program that does exactly that[0] using GFM, SDL and assimp. [0] https://github.com/clinei/3ddemo
Feb 15 2016
parent Guillaume Piolat <contact gam3sfrommars.fr> writes:
On Monday, 15 February 2016 at 11:07:31 UTC, Tanel Tagaväli wrote:
 On Saturday, 13 February 2016 at 09:07:03 UTC, karabuta wrote:
 I would prefer to use blender and import assets. How about 
 that?
I made a program that does exactly that[0] using GFM, SDL and assimp. [0] https://github.com/clinei/3ddemo
Cool, it runs just well here.
Feb 15 2016