Coder Social home page Coder Social logo

siebencorgie / jakar-engine Goto Github PK

View Code? Open in Web Editor NEW
19.0 19.0 0.0 22.68 MB

Formerly "Ori-Engine" is an hobby project of mine. Target is an Rust/Vulkan engine for games and visualization software.

License: MIT License

GLSL 5.02% Rust 94.98%
engine game rust visualization vulkan

jakar-engine's People

Contributors

siebencorgie avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

jakar-engine's Issues

Save engine configuration

Currently the engine config is created at creation time and used.
Best would be to

  • Save the config of the engine as .ron file
  • Create a seperate graphics configuration
  • use the graphics configuration at renderer creation time

Fix the normal mapping

I am currently having a rather strange normal mapping issue with my TBN matrix which leads to incorrect behaviour of light and its sources. However I don't know why. It might be an input problem. I am going to investigate this as the next issue because it seriously hurts the graphical appearance.

Do not save location and direction in light

Currently the lights can sit within a tree (together with attributes like location and rotation) but they also hold location and rotation withing the light struct.
In the future the location and rotation sent to the shader should be optained from the node attrbutes.

Don't order all meshes in the view frustum, but only the transparent ones

Coming with the next push, the engine will sort every mesh based on the distance to the player, then the farthest objects will be rendered first to get a correct blending behaviour for the transparent objects. However, this is not optimal.

I'll have to integrate flags for meshes based on their material, then only sort the transparent ones and draw them last.
reference: #19

Add mipmapping

All the textures are currently not having any mipmaps. However, since I want to be able to seamlessly import the images from the gltf format I would have to create the mipmaps on the run, maybe store them somewhere after first import, but still, they would have to be generated.

Idea: Take the image and blit it to a half sized new image several times till we reach a dimension of 1x1.

Recreate images when resizing

Currently only the swapchain images are recreated when the dimensions change, but we have to recreate the depth buffer image and later any other intermediate image as well.

Change the shader storing to a "shader-manager + shader module" methode

While investigating the alignment problem (SiebenCorgie/ori-engine#16) I found out that this part:

#[derive(VulkanoShader)]
#[ty = "vertex"]
#[path = "data/test.vs"]
struct Dummy;

Actually creates all struct in the shader as Rust structs.
That's the reason why I'll move the shaders to a "One shader = one module" abroach.
The in this ways the material can, based on the pipeline send the correct, filled struct to the shader.
For instance for the directional lights a vertex_shader::directional_lights struct created from a struct definition in the shader. The struct creation might be handled by the shader itself though. I'll see.

Write shader analyzer

It would be nice to load the shader at compile time to a string, analyse the "main shader" string and if a special keyword like #include is in there use the following name to replace this line with another string aka a shader part.

This way I could ensure that input structs are always the same size and the guy who writes the shader also has to write a shader just once.

However, atm the structs are set in a *.glsl file and the shader-writer has to copy them manually.

Change CpuAccessibleBuffer to the right type

Currently all buffers send to any shader are CpuAccessibleBuffer. However, most of them don't need to be read by the cpu again after creation. So after I got the clustered culling to work, I have to change them to the right type each.

Move "Max_*_Light_Count" into specialization constants

At the moment I don't use any of the specialisation constants, However, with the new, dynamic pipeline creation workflow it should be easy to define them as well.
I just have to decide if it should be defined by the engine (there for the same number in every pipeline) or if it should be set on a per pipeline basis.

Create a command system for node tree changes

Currently, if you change something in the tree (like translating a node) it is done for every child at once.
It would be nice to record a Vector of things to do into a tasks field. When calling update on a tree every task will be executed. This way the system would have to "walk down" the tree only once per update, instead of several time (once per action).

API mock up:

  • update(&mut self, jobs: Option<Vec<Job>>) : applies all jobs, then applies its own jobs, after that appends its own jobs to the recieved jobs and passes them down to all its children

  • add_job(&mut self, new_job: Job) : Adds new_job of the enum Job to the nodes tasks field.

The only thing which could be optimized after that is some kind of "Scene Registry" which keeps a pointer to every node, sorted by their names. This way the get_node() function could become faster. But we would have to store this big registry.
We'll see if its needed when building scenes at a bigger scale.

Change to Descriptorset pools

Currently every descriptorset (except the one for the light data) is coming from Persistent descriptor sets. However I found out that it is much faster to allocate from a pool. Therefore I should implement them where needed/ appropriate.

Make asset system thread save

The current asset manager is not thread save. However, it should be to make it easier for tools in other threads to access and manipulate data.
This will include to change all types to Arc<MutexT>> Types as well as implementing automated MutexGuard borrowing for the front-end functions like get_scene_manager() which should return a scene_manager::SceneManager and not a Arc<Mutex<scene_manager::SceneManager>>.
There will also be a get_scene_manager_copy() which will return the Arc<Mutex<T>> type.

Together with making it thread save there should be this implemented: SiebenCorgie/ori-engine#26

Make the front end more "pretty"

Make the frontend more "pretty".

Currently loading and adding models as well as loading and adding textures is a bit ugly but could be made nice quiet easily with some lines of code in the asset manager.

Create a configuration loading and writing tool

At the moment the engine gets configured at run-time by some hard coded values which could be loaded nicely from a file as well.
There are several ways to handle configuration. I think the best way here would be either some "ron" file or some json files.

They could groupe the configuration into several topics like "game", "physics", "gameplay"/"runtime", "graphics".

Created asset system update loops

The asset system currently gets updated in the rendering thread. This should be moved to a parallel approach which updates all "dirty" assets in fixed time steps.
The time steps have o be found out but I guess something around 120 times / second is a good speed. Might be configurable.

Create GUI overlay

I'll have to create GUI system.
What I am currently thinking about, at least for the editor:
A GUI rendering pass which is blended with the already rendered scene.

The components of the GUI should be created in a separate, single threaded environment. Each GUI element can be described by some mathematical property (origin, width, height). An algorithms is creating the vertices setup based on them as well as based on some "theme" textures.
Most basic elements for an editor:

  • Spacer
  • Button (with Icon representation)
  • Text field
  • Notebook
  • Relationship graph (maybe later, but would be good to have it for the scene graph)

However, the whole thing might be big enough to be moved into an custom crate.

Add a post processing

Well, for some better screen effects like blur, bloom and HDR I need to add some post processing passes to the render pass, I plan to make the configurable as well (maybe with specialisation of the renderpass at vulkan context creation time). However, I need to make the renderer a little bit more modular before doing this.

Also might make it possible to create debug views like a "depth" or "normal" view. But they should be dynamic changeable.

Migrate to winit 0.9

The new winit version made the EventsLoop unsendable. Now I have to find a way to first start the Eventsloop and the renderer in parallel, then wait for the vulkan instance in the window creation and send back the window or something... have to find out the best way.

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.