Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #196

Merged
merged 26 commits into from
Nov 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e9b6d8f
Update README.md
GlynLeine Nov 12, 2020
24b73ea
add include folder and auto include generation
GlynLeine Nov 12, 2020
6799e42
Merge pull request #190 from Legion-Engine/feature/update-readme
GlynLeine Nov 12, 2020
18b8278
fix breaking post build events
GlynLeine Nov 17, 2020
705eb99
Merge pull request #191 from Legion-Engine/hotfix/broken-postbuild-ev…
GlynLeine Nov 17, 2020
da64874
fix mesh import normal flip, entity const correctness, lighting
GlynLeine Nov 17, 2020
7ced223
fix missing linker folder
GlynLeine Nov 17, 2020
51bc96c
Merge pull request #193 from Legion-Engine/hotfix/fix-linker
GlynLeine Nov 17, 2020
ddb4b59
fix build action issue
GlynLeine Nov 17, 2020
d33b7d2
Merge remote-tracking branch 'origin/develop' into feature/lighting
GlynLeine Nov 17, 2020
a200980
some more materials, fix parallex mapping
GlynLeine Nov 17, 2020
17a2623
minor changes to pbr shader and new materials
GlynLeine Nov 17, 2020
cd6d2c4
Warm starting Framework and minor bug fixes (#182)
Developer-The-Great Nov 17, 2020
acb3a0e
misc material updates
GlynLeine Nov 17, 2020
c1e5b20
added ini loader for materials
Algo-ryth-mix Nov 17, 2020
18e4625
ignored the monovm
Algo-ryth-mix Nov 17, 2020
dd227f9
material file loader works!
Algo-ryth-mix Nov 17, 2020
8827d00
Delete ini.hpp
Algo-ryth-mix Nov 17, 2020
792202b
reorganize textures, paint material
GlynLeine Nov 17, 2020
fe4fee7
You can never have to many badges!
Algo-ryth-mix Nov 17, 2020
836906a
link license badge to license in repo
GlynLeine Nov 17, 2020
d6020b5
Merge pull request #194 from Legion-Engine/feature/mat-ini-loader
GlynLeine Nov 17, 2020
02b1a94
fix strange height scaling of parallex occlusion mapping
GlynLeine Nov 17, 2020
b66abf5
Merge pull request #195 from Legion-Engine/feature/moar-badges
Algo-ryth-mix Nov 18, 2020
2f2e972
Merge remote-tracking branch 'origin/develop' into feature/lighting
GlynLeine Nov 18, 2020
1ca6de1
Merge pull request #192 from Legion-Engine/feature/lighting
GlynLeine Nov 18, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,6 @@ bld/
deps/lib/legion*
*.shil
!**/applications/**/engine/**

# Mono VM
vm/**
99 changes: 99 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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