Giter Site home page Giter Site logo

dragonjoker / castor3d Goto Github PK

View Code? Open in Web Editor NEW
430.0 12.0 19.0 1.39 GB

Multi-OS 3D engine.

Home Page: https://dragonjoker.github.io/Castor3D

License: MIT License

CMake 2.66% Shell 0.01% C++ 84.10% C 13.10% Python 0.12% Batchfile 0.01% Objective-C++ 0.01%
multiplatform vulkan c-plus-plus-20

castor3d's Introduction

Build status

Castor3D

Castor3D is a 3D engine written in C++ 20. It works on Windows and GNU/Linux and using Vulkan as rendering API. The project itself is compilable on supported platforms using CMake and vcpkg (\ref build).

Features

  • Clustered lighting to compute all light sources.
  • Using a visibility buffer for opaque objects.
  • Blended Weighted rendering for transparent objects.
  • Normal mapping (using Mikktspace or explicit bitangents specification).
  • Shadow Mapping (allowing to choose between Raw, PCF or Variance Shadow Maps).
  • Parallax Occlusion mapping.
  • Screen Space Ambient Occlusion (using Scalable Ambiant Obscurance).
  • Reflection/Refraction Mapping.
  • PBR rendering (Metallic and Specular workflows), and Phong/Blinn-Phong rendering.
  • HDR rendering with various tone mapping operators and various colour grading operators.
  • Screen Space Subsurface Scattering (without backlit transmittance yet).
  • Volumetric Light Scattering for the directional light source, if it projects shadows.
  • Cascaded Shadow Maps for the directional light source.
  • Global Illumination, through Light Propagation Volumes (layered or non layered, with or without geometry injection), or through Voxel Cone Tracing.
  • Frustum culling.
  • Scene graph.
  • Render graph.
  • Modular architecture through plug-ins.
  • Shaders are generated automatically from pipeline configuration.
  • Shaders are writable directly from C++ code.
  • Scenes are described using a text format easily comprehensible and extensible.
  • Synchronous (user defined) or asynchronous (thread) rendering.
  • Using Mesh and Task shaders, if available.
  • GUI primitives.

Implemented Plug-ins

Importers

  • ASSIMP: Multiple format mesh importer.
  • glTF: glTF 2.0 importer, more precise than assimp's provided one, using fastgltf library.

PostEffects

  • Bloom: HDR Bloom implementation.
  • PbrBloom: PBR Bloom implementation.
  • DrawEdges: Detects and renders edges, based on normal, depth, and or object ID.
  • FilmGrain: To display some grain on the render.
  • GrayScale: Converts render in gray scale.
  • LightStreaks (using Kawase Light Streaks).
  • FXAA Antialiasing.
  • SMAA Antialiasing (1X and T2X so far).
  • Linear Motion Blur.
  • DepthOfField: Implementation of this depth of field

Generators

  • DiamondSquareTerrain: to generate terrains inside Castor3D scenes, using diamond-quare algorithm.

Generic

  • ToonMaterial: A toon material (to be combined with DrawEdges plugin).
  • WaterMaterial: Water material, using normal maps.
  • FFTOceanRendering: Ocean rendering using FFT generated surfaces.
  • WavesRendering: Basic ocean rendering, specifying waves attributes.
  • AtmosphereScattering : Sky and atmosphere rendering (using Scalable and Production Ready Sky and Atmosphere Rendering Technique).

ToneMappings

  • LinearToneMapping: Default tone mapping.
  • HaarmPieterDuikerToneMapping: Haarm Pieter Duiker tone mapping.
  • HejlBurgessDawsonToneMapping: Hejl Burgess Dawson tone mapping.
  • ReinhardToneMapping: Reinhard tone mapping.
  • Uncharted2ToneMapping: Uncharted 2 tone mapping.
  • ACES: ACES tone mapping.

Other applications

  • CastorViewer: A scene viewer based on Castor3D.
  • CastorMeshConverter: A converter from various mesh files to Castor3D mesh format.
  • CastorMeshUpgrader: Upgrades from earlier versions of Castor3D mesh format to the latest one.
  • HeightMapToNormalMap: Converts height maps to normal maps.
  • ImgConverter: Allows you to convert any image file type to XPM or ICO.

Links

Contact

You can reach me on the Discord server dedicated to my projects: DragonJoker's Lair

Screenshots

Intel Sponza, Candles Sponza, VCT Cerberus Park Nyra, PBR SanMiguel, PBR SanMiguel, PBR, LPV Bistro, PBR, VCT AtmosphereScattering, Terrain, FFTOcean

castor3d's People

Contributors

dragonjoker 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  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  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

castor3d's Issues

Rework LightCache

Currently the lights buffer is reordered at each frame, and even worse : for each render target.
The lights buffer should contain all scene lights, and used lights should be handled by the render target.

Scene render nodes descriptor sets uniformisation

Find a way to have scene objects nodes use the same descriptor sets across render passes.
This implies to rework render passes that add specific bindings (such as ShadowMap UBO for shadow map passes, or Picking UBO...)

Implement a TextureLayout cache

It will allow to handle the textures preparation smoothly, reorder them, and eventually, one day, implement some kind of atlas..

Texture channels replacement

The textures in Castor3D currently use a TextureChannel, which specifies what the texture applies to (normals, diffuse, height...).

This works fine but is not flexible at all.
For instance, we can't have a single texture that holds multiple channels (R: roughness, G: metalness, B: occlusion...).
Another problem with that, is that having one texture per channel consumes both memory and GPU objects.

TextureChannel needs to be replaced by a texture configuration structure, that will be used by the shaders.
Such a structure could look like this:

struct TextureConfiguration
{
    uint normalMask;
    uint opacityMask;
    uint emissiveMask;
    uint heightMask;
    uint occlusionMask;
    uint transmittanceMask;
    uint albedoMask;
    uint roughnessMask;
    uint metalnessMask;
    float normalFactor;
    float normalGMultiplier;
    float heightFactor;
};

An idea would to then store all texture configurations inside a SSBO/TBO, then pass a tiny UBO with just the textures count and the texture configuration indices, and pass the textures as an array of textures:

#define MAX_TEXTURES 9 // I have currently 9 distinct texture channels.
sampler2D textures[MAX_TEXTURES];
layout(std430) buffer TextureConfigurations
{
    TextureConfiguration configs[];
};
layout(std140) uniform Textures
{
    uint texturesCount;
    uint texturesIndices[MAX_TEXTURES];
};

This will also imply changes to the scene file format for texture units:

texture_unit
{
    image "foo.png"
    sampler "bar"
    levels 10
    albedoMask 0x00FFFFFF
    opacityMask 0xFF000000
}
texture_unit
{
    image "baz.dds"
    sampler "bar"
    roughnessMask 0x000000FF
    metalnessMask 0x0000FF00
    occlusionMask 0x00FF0000
}

Fix cascades

Looks like there is an issue with the matrices for this one.

Rework RenderTechnique initialisation

Currently, on initialisation of RenderTechnique, everything is initialised, even unused shadow maps, or unused light pass types.
This wastes a lot of memory (both RAM and VRAM), and makes this initialisation especially slow.

Fix that !

Use LPV in transparent pass.

Currently it is limited to opaque pass, through shadow light passes.
It needs to be extracted from there, to be put at the same level as castor3d::ShadowMap, in order to be used from transparent pass.

Complete Pass pluginisation

In order to implement new materials, such as toon materials (#312) Pass must become "pluginisable", with no reference to derived passes in the rest of the engine.

[request] Please provide detail info about "How to Build Castor3D" for noob?

i have no idea how to build Castor, i meant i don't know where to start as i see cmake list file in most of the place. other lib or software usually provide "main" cmake list file in the root directory so i just need to point the cmake Gui to where that "main" cmake list file be. i'm sorry for my bad english.

thanks in advance
Kenji

Texture Atlas/Arrays

Generalise FontTexture to make it a texture atlas, to use it in batching.
Or implement batching through texture arrays.

Review RenderQueue

It is completely suboptimal.
I need to avoid rebuilding it completely when there is a change is a scene.
It may require to create a class FrustumCuller, that would generate a frustum hash.

Rework TextWriter

Those are currently member classes, they should be external classes, for more flexibility

Batching

Regourp same type VBOs into a unique one, to reduce the draw calls.
Hence we must remove the VBO from the submesh (or just keep an offset to the VBO)
Requires texture Atlas/Arrays.

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.