Giter Site home page Giter Site logo

synodic-software / soul-engine Goto Github PK

View Code? Open in Web Editor NEW
41.0 41.0 24.0 921 KB

Physically based renderer and simulation engine for real-time applications.

License: GNU General Public License v3.0

C++ 78.99% C 0.92% Cuda 14.77% Batchfile 0.03% GLSL 0.24% CMake 3.98% Objective-C 0.03% Python 1.04%
cuda game-engine path-tracer physics-engine rendering simulation-engine vulkan

soul-engine's People

Contributors

behemyth avatar benjaminrsherman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

soul-engine's Issues

Support plaintext and xml serialization of Settings

Settings currently only supports plaintext serialization. Investigate adding xml serialization as an option to the user, and implement this so the user can choose which way to serialize the data structure.

Shaders

Look into the state of the art in shaders (i.e. research papers on the subject) and then implement the shaders.

Creating multiple windows causes hang

When creating two windows:
''' WindowManager::CreateWindow(WINDOWED, "test1", 0, 0, 0, 300, 300);
''' WindowManager::CreateWindow(WINDOWED, "test2", 0, 0, 0, 300, 300);

The engine SOMETIMES hangs in the construction of the second window. Multi threading and window callback related

Dependency Management

Create a cmakelists file for all the required dependencies. Investigate conan.io and the ability to automatically handle certain packages.

Settings

Boost::PropertyTree is currently (successfully) being used for settings. However, it is very resource intensive. Another data structure should be designed to replace it, assuming such a data structure can be reasonably found in a library or developed. In the case it cannot, the functionality of the settings with property tree should be expanded as appropriate.

Create Storage for all Library Binaries/Dependancies

For example, we do not want our repository to contain all our static dependencies, but we want to be able to share them on demand. Options include, creating a separate repository for the library files, create a public Google Drive account and store/update libraries from there, or use Git LFS. More options can be explored and accounts can be made on demand.

Optimize Settings

The current settings functionality is around 25x faster than the boost implementation we previously relied on! (Thank you Anthony). However, the current code base could be refactored and optimized even further.

GPUBuffer Implementation

All CUDA buffers are sent to kernels with a pointer. All these should be abstracted into GPUBuffer objects. Find and replace all instances

Fiber Scheduler: Two Awaken Calls (Unnecessary)

When adding a task to the scheduler variables are added via the custom properties. Because the scheduler runs across multiple threads, the fibers are not guaranteed to modify their properties before being submitted. Therefore, when the are run, they change the properties, then yield, causing the values to update at the potential expense of two more context switches.

Check out the Boost/Fiber repository by olk

Message Passing System

A message passing system, somewhat similar to other graphics engines should be implemented. This should be a centralized system for the entire engine, and allow modules of the engine to communicate indirectly, thereby lowering coupling between modules. Such a system should be designed, implemented, tested, and documented.

Scheduler

currently inoperable, should be a priority if we wanna get multithreading working

Introducing SoulEngine to the Community

In order to get more community exposure for SoulEngine, maybe we could set up a google account (gmail/youtube) for demo videos and then sign up for a reddit account (post about the project in the opensource and github subreddits). Maybe we can get interested people to help contribute.

Color Class

Set up the framework for and develop a color class that internally represents colors as different wavelengths and tries to maintain that color despite displaying to a external monitor of any variety.

atomicAdd() undefined

atomicAdd() is undefined on line 376 in RayEngine.cu. Have not made changes to the ray engine.

atomicAdd(&(pt->x), col.x); atomicAdd(&(pt->y), col.y); atomicAdd(&(pt->z), col.z);

Only the first one is marked undefined, although putting my cursor over the second two does not show a type signature.

Disgusting Repo

remove all visual studio dependent code and add CMake files for platform building

Improved Fiber Scheduler

The current fiber scheduler shares a job to a global queue which is locked whenever it updates. Each thread tries to lock this queue to remove a job. This creates tension on the lock. All threads trying to access it at the same time. To minimize the amount of locks used, implement a 'work stealing' algorithm (There is one in the Boost::Fiber repo). This algorithm maintains a local job list for each thread. Only when it runs out does it access another thread's list.

Geometry Wrapper

Implement a templated and generic wrapper for storing/looking up geometry such that different mesh options are available, making adjacency queries fast at the cost of memory or performance.

Replace Camera Management

The Engine stores a single camera at the core level. This is akin to hard coding a solution and should be removed. Instead, store a camera in a scene and treat it as you would any other object.

Compute Backend

All compute code should be called once from any Soul Engine file. Under the hood, this code should run on primarily a CUDA device and fallback to OpenCL. Truly, large compute tasks should use everything, even the CPU

Implement Custom Memory Allocator

Since using malloc/new has a significant amount of overhead and is generally slow, a custom allocator must be created to improve performance and reduce the frequency of new/delete function calls. The implementation should be a simple linear allocator, since it is fast, easy to implement and suits the needs of the engine. A template for this allocator already exists within the "Soul-Engine/Soul Engine/ Source Files/Engine Core/Allocator" directory.

Server Setup

Think of and implement a server setup that logs player inputs, distributes them so they execute concurrently, but does not actually run the simulation. Without running the simulation, the server has no idea what is false input or real input, how should this be solved?

Scripting Language

Run-time scripting is a powerful tool for updating values in a project without waiting for a compilation stage. However, we do not want to stray from the performance C++ gives. Either create a scripting layer for per-file c++ compilation (Each file has its own .dll) or find a scripting library that barely strays from the C++ standard.

Website

A website is needed for this project which can automatically build and display Doxygen generated code. Additionally, module documentation (in the form of a webpage) that is hand created would override the Doxygen content, allowing high quality documentation to exist where effort is applied, and a backup where it is not.

Replacing Thrust

Thrust is functional but we can improve overall performance by replacing it with custom algorithms specifically suited to this project.

Tidying Up Code

The existing code could use some cleaning up/refactoring.

Object Importer

Create a generic backend that imports objects files (obj, collada, ect.) and places them in the engine's format.

Create cmakelists.txt

Create a cross-platform build solution for all operating systems and all building tool flavors with Cmake. Target all recent build tools and do not worry about backwards compatibility. For example, Visual Studio 2017, not 2015.

Add Parallel For with the Fiber Schedular

The "ParallelFor" function should divide a for loop into chucks which are each their own job. These jobs then execute through the fiber scheduler. Take a look at Soul Engine\Source\Parallelism\Fiber\Scheduler.h/.cpp at ForEachThread which executes a callable on each thread. You can implement different varieties of the "ParallelFor" function. Maybe one would be for std conforming containers like https://en.cppreference.com/w/cpp/algorithm/for_each. Maybe for pure iteration, you would take a parameter such as iterationCount and another for taskCount. Maybe the given callable would require a value i as its first parameter, allowing it to make use of its ID.

This is a smaller task, but heavy on C++ knowledge.

Raster Backend

Removing the gl core and its dependencies and replacing it with a slimmed down vulkan

Documentation

In order to make the code more accessible to others, we should add some more comments to the code (existing and future), and work on writing up a formal documentation.

Buffer Indexed Reads

TODOs in 'CameraManager.cpp'

The GPUBuffer object should have the option to intercept any read or write operations. As they are all internally represented as a 1D array, the ability to interface the data with a arbitrary pattern is useful for a good deal of things. For example, all the ray data is stored in a GPUBuffer. Memory coherency could be increased if all spatially similar indices on a 2D representation (lets say n, n+1, n+21, n+ 531, n + 532) were located next to each other in memory. Thus, bugger[0] would read a different value depending on a pattern/pre-processing step

OpenGL shader Compilation Error

On a Intel system with no discrete GPU, shader compilation crashes. This does not happen on a system with a discrete GPU.

Serialization

Investigate texture and object serialization. We don't want to load a slow object from file every time, just hot swap the already loaded binary file.

Replace Includes With Forward Declarations

Headers should not be included when a forward declaration suffices. If an #include is used for just a signature such as

  • void PushBack(const Dog$);
  • Dog* dog

and not as a storage requirement such as

  • Dog dog;

then the #include can be moved to the *.cpp file and a forward declaration used in its place class Dog;

Update Camera Structure

  • Separate the Camera class into a lens, a film, and a camera.
  • Sample the camera with normalized values, not explicit pixels. This will help extensions for future camera work and allow for some deprecated code to be removed.

Update Documentation for Custom Allocator

Add a page that contains the following information to the Soul Engine Wiki:

  • A description of the custom allocator and why it is being used for this project.

  • Function calls necessary to utilize the allocator

  • Example usage

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.