GithubHelp home page GithubHelp logo

richies-dev / light-show-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 54.59 MB

The source code of my game/graphics boilerplate.

C++ 41.41% C 56.08% CMake 1.03% Objective-C 0.29% Batchfile 0.27% GLSL 0.91% Lua 0.01%
opengl game-engine cplusplus graphics rendering

light-show-boilerplate's Introduction

Light-Show-Boilerplate

LightShow is a 3D boilerplate created for my own projects with the purpose of flexibility, scalability, and simplicity. LightShow is meant to be used as a template for creating OpenGL applications. Specifically, games.

Two other projects are used for 3D model exporting and font atlas file creation. Both are currently private.

Index

Features

  • 3D skeletal Animation
  • Networking via GameNetworkingSockets
  • Directional and Omnidirectional Shadow Mapping
  • Physics, Collision, Callbacks and Triggers via Bullet3
  • Audio and Music Support
  • Text rendering
  • Point and Directional lights
  • Particle Systems via Instanced Rendering
  • Bone Colliders (updates scale, position and rotation of a collision object according to a bone)
  • Entity Component System structure

Images

LSBP-1 LSBP-2 LSBP-3

Getting Started

Prerequisites

Required: A linux or windows system that supports OpenGL 3.3+

Windows 10 install for Visual Studio Cross Platform with Linux

  • Git clone --recursive
  • open root dir in Visual Studio
  • Supply CMake settings
  • install https://slproweb.com/products/Win32OpenSSL.html - both 86 and 64. These are used to build Google protobuf
  • navigate to /lib/protobuf_build
  • run populate_all.bat and supply your version of VsDevCmd.bat as an arg.

ex: populate_all.bat "C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\Common7\Tools\VsDevCmd.bat"

Protobuf should then be installed in C:\sdk\protobuf This WILL take a while.

  • navigate to /lib/gamenetworksockets_build
  • run populate_all.bat and supply your version of VsDevCmd.bat as an arg.

ex: populate_all.bat "C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\Common7\Tools\VsDevCmd.bat"

GameNetworkSockets should then be installed in /lib/gamenetworksockets_build This shouldn't take as long as it took protobuf to build.

  • Create a vm for linux. I used Ubuntu 16.04. This could also be a real machine you can ssh into.
  • Configure ssh login for linux machine (not going to go into this, plenty of tutorials)
  • Add machine ssh credentials to cmakesettings
  • in launch.vs.json, your pipeArgs should look something like this:
"pipeArgs": [
          "/s",
          "${debugInfo.remoteMachineId}",
          "/p",
          "${debugInfo.parentProcessId}",
          "/c",
          "export DISPLAY=:0;${debuggerCommand}",
          "--tty=${debugInfo.tty}"
],

The export DISPLAY=:0; is a MUST or else you will get a segfault. Additionally, if you are using a linux VM you may have to prepend export MESA_GL_VERSION_OVERRIDE=3.3; to your pipeArgs after export DISPLAY=:0;.

Verify the configuration name in your launch.vs.json file matches your cmake executable name.

Configure linux machine for development

Install SDL2:

apt install libsdl2-dev  
apt install libsdl2-mixer-dev
apt install libsdl2-image-dev

Install libssl:

apt install libssl-dev

You will most likely need to update libssl because apt-get wont do the job. This awesome q/a will show you how to update libssl from it's source: https://askubuntu.com/questions/1102803/how-to-upgrade-openssl-1-1-0-to-1-1-1-in-ubuntu-18-04

Install protobuf:

apt install libprotobuf-dev protobuf-compiler

Install cmake:

apt install cmake

Install ninja:

apt install ninja-build

Install gamenetworkingsockets:

git clone 
cd GameNetworkingSockets
mkdir build
cd build
cmake -G Ninja ..
ninja

Optional but I move the output files into lib

cd src
mv libGameNetworkingSockets_s.a /usr/lib
mv libGameNetworkingSockets.so /usr/lib

With that, you should have a dev environment running on Microsoft Visual Studio capable of compiling and debugging for Windows, and Linux.

Building on Linux (standalone)

I haven't tested building only on linux, however it should be easier to setup. Install everything mentioned above then run:

  • git clone --recursive
  • run cmake
  • run make

You will need to provide certain variables in the CMake config to make this work.

Debugging Build System

  • Double check CMakeSettings like SDL2_DIR and GNS_LIB_DIR, they should both point to their library directories.
  • In Windows, the populate_all scripts need to be supplied with VsDevCmd.bat. The path for VsDevCmd.bat differs on each version of visual studio.

Documentation

The documentation for this project is located here. (Special thanks to DoxyGen.)

Built With

  • Bullet3
  • SDL2
  • SDL_Mixer
  • SDL_Image
  • OpenGL
  • GLM
  • GLew
  • GameNetworkingSockets
  • Lua
  • Sol2

Top

light-show-boilerplate's People

Contributors

richies-dev avatar

Watchers

 avatar

light-show-boilerplate's Issues

Implement scene json

Should be structured like so:

{
"scene_name":{
EntityA:{position:{"","",""}}
EntityB,
EntityC
},
"scene_2_name":{
EntityA:{position:{"","",""}}
EntityB,
EntityC
}
}

The GameState class should then have a function to retrieve a scene index from the scene name and an overloaded function to change the scene with just a name.
The scenes array should be a Game member variable and the Scenes.h file should be removed.

See https://docs.google.com/document/d/1YNOlBKQ47xBfquEm3A-WS3hdAMlQeaa3VJyQvaQ9BPE/edit for more info on scenes.

Fix DebugDrawer

Might not be a bad idea to split it into two classes: PhysicsDebug and DebugDrawer.
PhysicsDebug should only be used for the PhysicsWorld class and DebugDrawer should be a component.

Implement file structure for src

File Structure should be very straightforward and thought should be put into naming. Some components such as BoneCollisionMesh may need to be switched to just be objects so there is a clear distinct picture of what is part of the engine, and what is part of the game.
Nesting should only go as far as 2 folders.

Example:

src

  • engine
    • Window
    • shapes
      • Sphere
      • Cube
      • Line
    • Collision
      • BoneCollisionMesh
      • x
    • models
      • AnimatedModel
    • effects
      • ParticleEmitter
      • DirectionalShadowMap
      • OmniDirectionalShadowMap
      • SkyBox
    • ui
      • x
    • helper / global
      • HelpingHand
      • GlobalInformation
    • input
      • Input
    • patterns
      • ecs
        • Entity
        • Component
        • SystemBase
      • Messenger
    • debug
      • Debug
  • Game
    • Game
    • Settings
      • x
      • x
    • Components
      • PlayerController
      • CameraController
    • Systems
      • FixedUpdating
      • Updating
      • Rendering
      • SubSystems
        • PlayerController
        • CameraController

Brush up shaders

Shaders are a bit messy. Need to be cleaned, simplified, and the amount of shaders needs to be knocked down.

Revise Input

Add is key up function and fix keyPressedOnce since it only returns true once in a frame

Revise readme

Complete after everything else in 'Revise and clean' milestone

Create new 3D Model Exporter using boilerplate.

New exporter should utilize imgui (old version used console input) and json files for batch exporting.
Functionality should include existing in old program such as:

  • import Animated and non animated files
  • splitting animations into multiple via start frame & end frame
  • delete and play animation clips
  • modifying orientation (trans,rot,scale)
  • batch importing and exporting 3D models using json such as:
{[
	{input:"assets/obj.gltf"
	output:"obj.3DMA"
	animations: [
		{name:"walk", "start:20, end:30},
		{name:"run", "start:30, end:40}
	]},
	{input:"assets/obj2.gltf"
	output:"obj2.3DMA"
	animations: [
		{name:"idle", "start:0, end:60}
	]}
]}

Should be moved to a new repository as a seperate program.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.