HanetakaChou / PatriotEngine

PatriotEngine aims to be a state-of-the-art real-time image synthesis engine.
https://hanetakachou.github.io/PatriotEngine
GNU Lesser General Public License v3.0
23 stars 4 forks source link

### Project Description
PatriotEngine aims to be a state-of-the-art real-time image synthesis(rendering) engine and I believe that more and more programmers unabatedly endeavor to develop their own engines.

Although there is no official standard of the rendering engine at present, the functionality of the rendering engine has steadily stabilized due to the evolution of the rendering engine during the past few decades and thus has formed the de facto standard.

It is widely establish that "program = data structure + algorithm" and this engine will elaborate the rendering from two aspects: scene (data structure) and rendering pipeline (algorithm).

Here is the document of this engine: https://hanetakachou.github.io/PatriotEngine/index.html

Continuous build status

Build Type Status
Build Win32 Desktop Build Win32
Build Posix Linux Glibc Build Posix Linux Glibc

Design Philosophy

We may treat the image synthesis engine as the 3D version X11 server.
The geometry(e.g. mesh, hair, terrain) / material / texture / light(e.g. directional light, punctual light, area light, light probe) are analogous to the pixmap on X11 server
and the hierarchy of the scenetree / scenegraph are analogous to the relationship of the "child-parent" window on X11 server.

The asset streaming process is totally asynchronous. This means that the calling thread will not halt at all. Thus we can definitely call these functions in the gameplay logic and no performance penalty will be introduced.

    pt_gfx_connection_init
    pt_gfx_connection_destroy

    // scene related
    pt_gfx_connection_create_node // Top-Level-Structure // to reuse mesh etc 
    gfx_connection_create_selector //LOD etc  
    gfx_connection_create_...

    pt_gfx_node_set_mesh
    pt_gfx_node_set_material
    gfx_node_set ...

    // asset related
    pt_gfx_connection_create_mesh
    gfx_connection_create_hair
    pt_gfx_connection_create_texture
    gfx_connection_create_light_probe
    gfx_connection_create_...

    // asset streaming
    pt_gfx_mesh_read_input_stream
    pt_gfx_material_init_with_texture
    pt_gfx_mesh_destroy
    pt_gfx_material_destroy

    // wsi related
    gfx_connection_wsi_on_resized

    // usage
    // [current thread] app on_redraw_needed //drawInMTKView 
    // [arbitrary thread] app update info which doesn't depend on accurate time ( scenetree etc ) //app may update in other threads 
    // [current thread] app call gfx acquire //gfx sync ( from other threads ) and flatten scenetree //and then gfx frame throttling
    // [current thread] app update time-related info ( animation etc ) //frame throttling make the time here less latency //scenetree update here (include update from other threads) is ignored in current frame and to impact on the next frame
    // [current thread] app call gfx release //gfx draw and present //gfx not sync scenetree here
    gfx_connection_wsi_on_redraw_needed_acquire

    // app related update

    gfx_connection_wsi_on_redraw_needed_release

Platform Support

Feature List