Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kimkulling/osre
An open source render engine
https://github.com/kimkulling/osre
3d-graphics cpp cpp11 engine opengl vulkan
Last synced: 6 days ago
JSON representation
An open source render engine
- Host: GitHub
- URL: https://github.com/kimkulling/osre
- Owner: kimkulling
- License: mit
- Created: 2015-04-09T08:06:35.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-10-24T14:22:41.000Z (14 days ago)
- Last Synced: 2024-10-26T17:50:34.590Z (12 days ago)
- Topics: 3d-graphics, cpp, cpp11, engine, opengl, vulkan
- Language: C++
- Homepage: https://kimkulling.github.io/osre/
- Size: 68.2 MB
- Stars: 187
- Watchers: 11
- Forks: 12
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-game-engine-dev - OSRE - Just another "Open Source Render Engine". (Libraries / C++)
- AwesomeCppGameDev - osre
README
# OSRE - Just another Open Source Render Engine
This is just another open-source render engine / game engine made by Kim Kulling. This is a playground project for me to work on my side projects.
Don't expect too much, I will not invest too much time into it. But If you are interested in playing around with 3D stuff feel free to discuss
these things on Reggit or in the Discussion Forum.# The Features: #
- CMake base build environment
- Multithreaded Renderer
- OpenGL
- Platform abstraction to support Windows, Linux, and more.
- Input
- UI
- Component-based entity system
- Transformation components
- Render components
- Event-System
- Event bus
- More than 40 3D formats supported thanks to Assimp
- Virtual file system for reading zip-archives
- Instancing# Documentation #
- Please check [OSRE-Docs](https://osre-doc.readthedocs.io/en/latest/).# Project activities #
![Alt](https://repobeats.axiom.co/api/embed/71f422c76a23d1da904af0e5c23de54df6c0d0b2.svg "Repobeats analytics image")# Join out community
We have a discord server at [Discord](https://discord.gg/kqJQW5dQ)# Build instructions
- See [Build instruction in the Wiki](https://github.com/kimkulling/osre/wiki/Build)# Questions
- Take a look into our [OSRE-Forum](https://github.com/kimkulling/osre/discussions)
- Please check our [Reddit-Community](https://www.reddit.com/r/osre/)# Build Status
[![Build status](https://github.com/kimkulling/osre/actions/workflows/cmake.yml/badge.svg)](https://github.com/kimkulling/osre/actions/workflows/cmake.yml)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/13242/badge.svg)](https://scan.coverity.com/projects/kimkulling-osre)
[![Documentation Status](https://readthedocs.org/projects/osre-doc/badge/?version=latest)](https://osre-doc.readthedocs.io/en/latest/?badge=latest)# Supported compilers
- Windows:
- Visual Studio 2019
- Visual Studio 2022
- Linux:
- GCC
- Clang# Quick Start
```cpp
#include
#include
#include
#include
#include
#include
#includeusing namespace ::OSRE;
using namespace ::OSRE::App;
using namespace ::OSRE::RenderBackend;class QuickStartApp : public AppBase {
/// The transform block, contains the model-, view- and projection-matrix
TransformMatrixBlock m_transformMatrix;
/// The entity to render
Entity *mEntity;public:
/// The class constructor with the incoming arguments from the command line.
QuickStartApp(int argc, char *argv[]) :
AppBase(argc, (const char **)argv),
m_transformMatrix(),
mEntity(nullptr) {
// empty
}/// The class destructor, default impl.
~QuickStartApp() override = default;protected:
/// The creation callback, will get called on system startup.
bool onCreate() override {
if (!AppBase::onCreate()) {
return false;
}// The window
AppBase::setWindowsTitle("Quickstart! Rotate with wasd, scroll with qe");
// The world to work in
World *world = getActiveWorld();
// The entity for your triangle
mEntity = new Entity("entity", *AppBase::getIdContainer(), world);
// The camera to watch the scene
Scene::Camera *camera = world->addCamera("camera_1");
ui32 w, h;
AppBase::getResolution(w, h);
camera->setProjectionParameters(60.f, (f32)w, (f32)h, 0.001f, 1000.f);// Create and add the triangle
Scene::MeshBuilder meshBuilder;
RenderBackend::Mesh *mesh = meshBuilder.allocTriangles(VertexType::ColorVertex, BufferAccessType::ReadOnly).getMesh();
if (nullptr != mesh) {
mEntity->addStaticMesh(mesh);
world->addEntity(mEntity);
// And observer the triangle
camera->observeBoundingBox(mEntity->getAABB());
}return true;
}/// The update, will be called for each render frame
void onUpdate() override {
glm::mat4 rot(1.0);
if (AppBase::isKeyPressed(Platform::KEY_A)) {
m_transformMatrix.m_model *= glm::rotate(rot, 0.01f, glm::vec3(1, 0, 0));
}
if (AppBase::isKeyPressed(Platform::KEY_D)) {
m_transformMatrix.m_model *= glm::rotate(rot, -0.01f, glm::vec3(1, 0, 0));
}if (AppBase::isKeyPressed(Platform::KEY_W)) {
m_transformMatrix.m_model *= glm::rotate(rot, 0.01f, glm::vec3(0, 1, 0));
}if (AppBase::isKeyPressed(Platform::KEY_S)) {
m_transformMatrix.m_model *= glm::rotate(rot, -0.01f, glm::vec3(0, 1, 0));
}if (AppBase::isKeyPressed(Platform::KEY_Q)) {
m_transformMatrix.m_model *= glm::scale(rot, glm::vec3(1.01f, 1.01, 1.01f));
}if (AppBase::isKeyPressed(Platform::KEY_E)) {
m_transformMatrix.m_model *= glm::scale(rot, glm::vec3(0.99f, 0.99f, 0.99f));
}// Set the model-matrix in the renderpass
RenderBackendService *rbSrv = getRenderBackendService();rbSrv->beginPass(PipelinePass::getPassNameById(RenderPassId));
rbSrv->beginRenderBatch("b1");rbSrv->setMatrix(MatrixType::Model, m_transformMatrix.m_model);
rbSrv->endRenderBatch();
rbSrv->endPass();AppBase::onUpdate();
}
};OSRE_MAIN(QuickStartdApp)
```# OSRE-Ed
![ESRE-Ed](assets/Images/sponza.png)
The engine provdes an 3D-Editor called OSRE-Ed. It is still experimental: