All Projects → samdauwe → Babyloncpp

samdauwe / Babyloncpp

Licence: apache-2.0
A port of Babylon.js to C++

Projects that are alternatives of or similar to Babyloncpp

Magnum Examples
Examples for the Magnum C++11/C++14 graphics engine
Stars: ✭ 180 (-1.64%)
Mutual labels:  gamedev, opengl
Trial
Yet another Common Lisp game engine
Stars: ✭ 181 (-1.09%)
Mutual labels:  gamedev, opengl
Magnum Plugins
Plugins for the Magnum C++11/C++14 graphics engine
Stars: ✭ 66 (-63.93%)
Mutual labels:  gamedev, opengl
Glfw
Go bindings for GLFW 3
Stars: ✭ 1,069 (+484.15%)
Mutual labels:  gamedev, opengl
Blue Flame Engine
A 3D/2D game engine that supports both DirectX11 and OpenGL 4.5
Stars: ✭ 129 (-29.51%)
Mutual labels:  gamedev, opengl
Dds Ktx
Single header KTX/DDS reader
Stars: ✭ 62 (-66.12%)
Mutual labels:  gamedev, opengl
Duality
a 2D Game Development Framework
Stars: ✭ 1,231 (+572.68%)
Mutual labels:  gamedev, opengl
Pyglet
pyglet is a cross-platform windowing and multimedia library for Python, for developing games and other visually rich applications.
Stars: ✭ 756 (+313.11%)
Mutual labels:  gamedev, opengl
Bsf
Modern C++14 library for the development of real-time graphical applications
Stars: ✭ 1,640 (+796.17%)
Mutual labels:  gamedev, opengl
Fna3d
FNA3D - 3D Graphics Library for FNA
Stars: ✭ 111 (-39.34%)
Mutual labels:  gamedev, opengl
Simpleton Engine
What a stupid name for a library
Stars: ✭ 42 (-77.05%)
Mutual labels:  gamedev, opengl
Diligentsamples
Sample projects demonstrating the usage of Diligent Engine
Stars: ✭ 138 (-24.59%)
Mutual labels:  gamedev, opengl
Game Dogfight
Air to air combat game, created in Python 3 using HARFANG 3D.
Stars: ✭ 41 (-77.6%)
Mutual labels:  gamedev, opengl
3d Game Shaders For Beginners
🎮 A step-by-step guide to implementing SSAO, depth of field, lighting, normal mapping, and more for your 3D game.
Stars: ✭ 11,698 (+6292.35%)
Mutual labels:  gamedev, opengl
Hinterland
2D top-down shooter game
Stars: ✭ 34 (-81.42%)
Mutual labels:  gamedev, opengl
Magnum Bootstrap
Bootstrap projects for Magnum C++11/C++14 graphics engine
Stars: ✭ 69 (-62.3%)
Mutual labels:  gamedev, opengl
Lighthouse2
Lighthouse 2 framework for real-time ray tracing
Stars: ✭ 542 (+196.17%)
Mutual labels:  gamedev, opengl
Raylib
A simple and easy-to-use library to enjoy videogames programming
Stars: ✭ 8,169 (+4363.93%)
Mutual labels:  opengl, gamedev
Bgfx
Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
Stars: ✭ 10,252 (+5502.19%)
Mutual labels:  gamedev, opengl
Diligentengine
A modern cross-platform low-level graphics library and rendering framework
Stars: ✭ 2,142 (+1070.49%)
Mutual labels:  gamedev, opengl

BabylonCpp - A port of Babylon.js to C++

Babylon.js is a complete JavaScript framework for building 3D games with HTML 5 and WebGL. BabylonJS was chosen because it is the most efficient, most feature-rich, and most modern WebGL graphics library available.

The goal of BabylonCpp is to fully implement the relevant portions of the excellent Babylon.js 3D framework/engine in C++17, facilitating the creation of lightweight, cross-platform 3D games and applications with native performance.

It includes more than 200 examples, a graphical inspector for all 3D objects (based on ImGui), as well as an interactive playground for live coding and experiments.

BabylonCpp

Get the Sources

This repository contains submodules for some of the external dependencies, so when doing a fresh clone you need to clone recursively:

git clone --recursive https://github.com/samdauwe/BabylonCpp.git

Existing repositories can be updated manually:

git submodule init
git submodule update

Build BabylonCpp from Source

A build script named cmake_build.py is provided for compiling all sources from command line on Linux and Windows:

Release build:

python cmake_build.py all --mode=release

Debug build:

python cmake_build.py all --mode=debug

Linux / OSX

Build Status

Use the provided CMakeLists.txt with CMake to generate a build configuration for your favorite IDE or compiler.

iOS

Xcode project targeting iOS 12.0

cmake -G Xcode -DCMAKE_TOOLCHAIN_FILE=../external/ios-cmake/ios.toolchain.cmake -DPLATFORM=OS64COMBINED -DENABLE_ARC=0 -DDEPLOYMENT_TARGET=12 ..

Windows

Build status

A Visual Studio solution file can be generated by using the provided cmake_build.py script:

python cmake_build.py configure

If you're using a different IDE or compiler you can use the provided CMakeLists.txt for use with CMake to generate a build configuration for your toolchain.

Sample code

The following code initializes a basic scene by creating a camera, a light, and two basic meshes (a sphere and a ground plane).

void initializeScene(ICanvas* canvas, Scene* scene)
{
  // Create a FreeCamera, and set its position to (x:0, y:5, z:-10)
  auto camera = FreeCamera::New("camera1", Vector3(0, 5, -10), scene);

  // Target the camera to the scene origin
  camera->setTarget(Vector3::Zero());

  // Attach the camera to the canvas
  camera->attachControl(canvas, true);

  // Create a basic light, aiming 0,1,0 - meaning, to the sky
  auto light = HemisphericLight::New("light1", Vector3(0, 1, 0), scene);

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

  // Create a built-in "sphere" shape; its constructor takes 4 params: name,
  // subdivs, size, scene
  auto sphere = Mesh::CreateSphere("sphere1", 32, 2.f, scene);

  // Move the sphere upward 1/2 of its height
  sphere->position().y = 1.f;

  // Create a built-in "ground" shape.
  // Params: name, width, depth, subdivs, scene
  Mesh::CreateGround("ground1", 6, 6, 2, scene);
}

This code results in the following scene:

Basic scene

Examples

Example scenes can be found on the samples page.

Status

The master branch code is currently in unstable state due to the upgrade to Babylon.js v5.0.0-alpha.6 release of 2021/01/05.

For a more stable version that is in sync with the last Babylon.js v4.2.0 release of 2020/11/12, please revert to this commit.

The example scenes give a good overview which features are currenlty ported and working for Babylon.js 4.0.0.

Known issues are summarized here.

A summary of the development roadmap can be found on this page.

Dependencies

System

  • CMake (>= 3.9)
  • Python (>= 2.7) for the cmake_build.py build script

Available as git submodules

  • Earcut: A C++ port of earcut.js, a fast, header-only polygon triangulation library.
  • GLFW: Framework for OpenGL application development, used for the examples.
  • Google Test: Google's framework for writing C++ tests on a variety of platforms, used for the unit tests.
  • Dear ImGui: Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies.
  • ImGuiColorTextEdit:Syntax highlighting text editor for ImGui.
  • JSON for Modern C++
  • Runtime Compiled C++: Library that enables to reliably make major changes to your C++ code at runtime and see the results immediately.
  • ios-cmake: A CMake toolchain file for iOS, watchOS and tvOS C/C++/Obj-C++ development.

Supported Compilers

The compiler should implement all the features of the ISO C++ 2017 standard:

  • GCC >= 7.0.0
  • Clang >= 5.0.0
  • AppleClang >= 10.0
  • MSVC >= 2017

Supported Operating Platforms

  • Linux
  • MacOSX
  • Windows >= 7
  • iOS >= 12.0

Graphics APIs:

  • 2.1 through 4.6, core profile functionality and modern extensions

License

Open-source under Apache 2.0 license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].