Skip to content

Commit

Permalink
Merge pull request #196 from Legion-Engine/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Algo-ryth-mix committed Nov 18, 2020
2 parents 35ffc1d + 1ca6de1 commit 6c5603b
Show file tree
Hide file tree
Showing 782 changed files with 89,766 additions and 4,746 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -104,3 +104,6 @@ bld/
deps/lib/legion*
*.shil
!**/applications/**/engine/**

# Mono VM
vm/**
99 changes: 99 additions & 0 deletions README.md
Expand Up @@ -2,6 +2,105 @@
[![build](https://github.com/Legion-Engine/Legion-Engine/workflows/build-action/badge.svg)](https://github.com/Legion-Engine/Legion-Engine/actions?query=workflow%3Abuild-action)
[![analyze](https://github.com/Legion-Engine/Legion-Engine/workflows/analyze-action/badge.svg)](https://github.com/Legion-Engine/Legion-Engine/actions?query=workflow%3Aanalyze-action)
[![docs](https://github.com/Legion-Engine/Legion-Engine/workflows/docs-action/badge.svg)](https://docs.legion-engine.com)
[![License-MIT](https://img.shields.io/github/license/Legion-Engine/Legion-Engine)](https://github.com/Legion-Engine/Legion-Engine/blob/main/LICENSE)
[![Discord](https://img.shields.io/static/v1?label=Discord&message=Join%20Our%20Discord%20Server!&color=white&logo=discord)](https://discord.gg/unVNRbd)
# Legion-Engine
Legion-Engine is a data oriented C++17 OpenGL game engine built to make optimal use of modern hardware.<br><br>
The Legion-Core is built on an async compute minded design to take care of the logic and an ECS to take care of the data. This allows the engine and editor to utilize all the power they can find and to be extremely modular.

## Getting Started
### Prerequisites
The engine is by default build using Visual Studio 19 using the Clang++ compiler and C++17.
For linux we don't provide any default IDE support. However, you can still compile the engine using Clang++.
### Install
You can either build the engine yourself using Premake5 or the already provided Visual Studio 19 solution. As of now Legion does not support compilation to DLL.
Copy the include folder to your project and link the libraries you compiled.
### Setup
Legion already defines the C++ entry point in it's own source code. So in order to start making a program define ``LEGION_ENTRY`` and include any of modules main include files.
eg:
```cpp
#define LEGION_ENTRY
#include <core/core.hpp>
```
Since the entry point is already defined you need to define a different function to start working with Legion. Legion will already start itself, but it won't have any modules attached. In order to attach modules you need to define the ``reportModules`` function like so:
```cpp
#include "mymodule.hpp"
using namespace legion;

void LEGION_CCONV reportModules(Engine* engine)
{
engine->reportModule<MyModule>();
engine->reportModule<app::ApplicationModule>();
}
```
Of course in order to link your own modules you need to make one:
```cpp
#include <core/core.hpp>
#include "mysystem.hpp"
class TestModule : public legion::Module
{
public:
virtual void setup() override
{
reportComponentType<my_component>(); // Report a component type
reportSystem<MySystem>(); // Report a system
}
};
```
Legion engine uses an ECS for all of it's core functionality. So for your own project you need to define your own systems and components:
```cpp
#include <core/core.hpp>

struct my_component { int myVal; };

class MySystem final : public legion::System<MySystem>
{
virtual void setup()
{
createProcess<&MySystem::update>("Update");
}

void update(legion::time::span deltaTime)
{
// Do stuff every frame on the update thread
static auto myQuery = createQuery<my_component, position>();
for(auto entity : myQuery)
{
// Runs for every entity that has both my_component and a position component.
}
}
};
```
For more information about the engine usage see the [docs](https://docs.legion-engine.com).
## Dependencies
(All libraries can already be found in the [deps](https://github.com/Legion-Engine/Legion-Engine/tree/main/deps) folder)
* [OpenAL Soft](https://github.com/kcat/openal-soft)
* [GLM](https://glm.g-truc.net/)
* [OpenGL](https://www.khronos.org/opengl/)
* [GLFW](https://www.glfw.org)
* [OpenCL](https://www.khronos.org/opencl/)
* [TinyOBJ](https://github.com/tinyobjloader/tinyobjloader)
* [STB image](https://github.com/nothings/stb)
* [Cereal](http://uscilab.github.io/cereal/)
* [Spdlog](https://github.com/gabime/spdlog)
* [Minimp3](https://github.com/lieff/minimp3)
* [Legion shader preprocessor (lgnspre)](https://github.com/Legion-Engine/LegionShaderPreprocess)

## Contributing

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.

## Authors

* **Glyn Leine** - *Core architecture, ECS, scheduling, import pipeline, and renderer* - [[Website](https://glynleine.com)] [[Github](https://github.com/GlynLeine)] [[LinkedIn](https://www.linkedin.com/in/glyn-leine-7140a8167/)]
* **Raphael Baier** - *Filesystem, build pipeline, GPGPU compute, input system, meta nonsense* - [[Website](https://rbaier.me)] [[Github](https://github.com/Algo-ryth-mix)] [[LinkedIn](https://www.linkedin.com/in/raphael-baier-26800a188/)]
* **Raphael Priatama** - *Physics* - [[Website](https://developer-the-great.github.io)] [[Github](https://github.com/Developer-The-Great)] [[LinkedIn](https://www.linkedin.com/in/raphael-priatama-78a0a7189/?originalSubdomain=nl)]
* **Jelle Vrieze** - *Audio/3D audio* - [[Website](http://jellevrieze.nl)] [[Github](https://github.com/Jelled1st)] [[LinkedIn](https://www.linkedin.com/in/jelle-vrieze-2467661a7/)]
* **Rowan Ramsey** - *Serialization* - [[Website](https://blazinram.wixsite.com/rowanramsey)] [[Github](https://github.com/Ragingram2)] [[LinkedIn](https://www.linkedin.com/in/rowan-r-42a760125/)]

See also the list of [contributors](AUTHORS.md) who participated in this project.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
2 changes: 1 addition & 1 deletion applications/editor/engine/shaderlib/lighting.shinc
Expand Up @@ -18,7 +18,7 @@ struct Light
float falloff; // 4 28
vec3 position; // 12 32
float angle; // 4 44
vec3 color; // 12 48
vec3 color; // 12 48
float meta; // 4 60
};

Expand Down
2 changes: 1 addition & 1 deletion applications/editor/engine/shaderlib/lighting_input.shinc
Expand Up @@ -2,7 +2,7 @@
// Lighting Input //
//////////////////////

layout(std140) buffer LightsBuffer
layout(std140, binding = SV_LIGHTS) readonly buffer LightsBuffer
{
Light lights[];
};
Expand Down
7 changes: 7 additions & 0 deletions applications/sandbox/assets/materials/aluminum.material
@@ -0,0 +1,7 @@
[pbr]
material_input.albedo=../textures/aluminum/aluminum-albedo.png
material_input.normalHeight=../textures/aluminum/aluminum-normalHeight.png
material_input.MRDAo=../textures/aluminum/aluminum-MRDAo.png
material_input.emissive=../textures/aluminum/aluminum-emissive.png
material_input.heightScale=1.0
discardExcess=false
10 changes: 10 additions & 0 deletions applications/sandbox/assets/models/directional-light.mtl
@@ -0,0 +1,10 @@
# Blender MTL File: 'None'
# Material Count: 1

newmtl None
Ns 500
Ka 0.8 0.8 0.8
Kd 0.8 0.8 0.8
Ks 0.8 0.8 0.8
d 1
illum 2
3 changes: 3 additions & 0 deletions applications/sandbox/assets/models/directional-light.obj
Git LFS file not shown
12 changes: 12 additions & 0 deletions applications/sandbox/assets/models/plane.mtl
@@ -0,0 +1,12 @@
# Blender MTL File: 'None'
# Material Count: 1

newmtl None
Ns 500.000001
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.800000 0.800000 0.800000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
3 changes: 3 additions & 0 deletions applications/sandbox/assets/models/plane.obj
Git LFS file not shown
12 changes: 12 additions & 0 deletions applications/sandbox/assets/models/point-light.mtl
@@ -0,0 +1,12 @@
# Blender MTL File: 'None'
# Material Count: 1

newmtl None.001
Ns 500.000001
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.800000 0.800000 0.800000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
3 changes: 3 additions & 0 deletions applications/sandbox/assets/models/point-light.obj
Git LFS file not shown
12 changes: 12 additions & 0 deletions applications/sandbox/assets/models/spot-light.mtl
@@ -0,0 +1,12 @@
# Blender MTL File: 'None'
# Material Count: 1

newmtl None.002
Ns 500.000001
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.800000 0.800000 0.800000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
3 changes: 3 additions & 0 deletions applications/sandbox/assets/models/spot-light.obj
Git LFS file not shown
8 changes: 4 additions & 4 deletions applications/sandbox/assets/models/submeshtest.mtl
Expand Up @@ -11,12 +11,12 @@ Ni 1.000000
d 1.000000
illum 2

newmtl Material.002
Ns 92.156872
newmtl lambert1
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
Ni 1.450000
d 1.000000
illum 2
4 changes: 2 additions & 2 deletions applications/sandbox/assets/models/submeshtest.obj
Git LFS file not shown
4 changes: 2 additions & 2 deletions applications/sandbox/assets/models/suzanne.mtl
Expand Up @@ -2,8 +2,8 @@
# Material Count: 1

newmtl None
Ns 0
Ka 0.000000 0.000000 0.000000
Ns 500
Ka 0.8 0.8 0.8
Kd 0.8 0.8 0.8
Ks 0.8 0.8 0.8
d 1
Expand Down
4 changes: 2 additions & 2 deletions applications/sandbox/assets/models/suzanne.obj
Git LFS file not shown

0 comments on commit 6c5603b

Please sign in to comment.