Castor3D (C++)

Description

Castor3D is a 3D engine written in C++ 17.
It works on Windows and on GNU/Linux.
It uses Vulkan as rendering API.

Features

  • Deferred rendering for opaque objects.
  • Weighted Blended rendering for transparent objects.
  • Normal mapping.
  • Parallax Occlusion mapping.
  • Shadow Mapping (allowing to choose between Raw, PCF or Variance Shadow Maps).
  • Screen Space Ambient Occlusion (using Scalable Ambiant Obscurance implementation).
  • Reflection/Refraction Mapping.
  • PBR rendering (hybrid Metallic/Specular/Roughness workflow), and Phong/Blinn-Phongrendering.
  • HDR rendering with various tone mapping operators.
  • Screen Space Subsurface Scattering (without backlit transmittance yet).
  • Volumetric Light Scattering, for the directional light source.
  • Global Illumination, through Light Propagation Volules or Voxel Cone Tracing, your choice.
  • Scene graph.
  • Render graph.
  • Modular architecture through plug-ins.
  • Shaders are generated automatically from material and pass configuration.
  • Shaders are writable directly from C++ code.
  • Scenes are described using a text format easily comprehensible and extensible.
  • Asynchronous or synchronous rendering.
  • Using Mesh and Task shaders, if available.

Implemented plugins

Importers

Importer plugins can add support for new mesh file formats.
  • ASSIMP: Multiple format mesh importer.

PostEffects

  • Bloom: HDR Bloom implementation.
  • FilmGrain: To display some grain on the render.
  • GrayScale.
  • LightStreaks: using Kawase Light Streaks.
  • FXAA: a bad quality but fast antialiasing.
  • SMAA: a good quality but rather slow antialiasing (1X and T2X so far).
  • Linear Motion Blur.
  • DrawEdges : Detects and renders edges, based on normal, depth, and or object ID.
  • PbrBloom : PBR Bloom implementation.

Generators

They allow procedural generation of meshes or textures.
  • DiamondSquareTerrain: to generate terrains inside Castor3D scenes, using diamond-quare algorithm.

Generics

They're here to allow general extensions of the engine features.
  • CastorGUI: to build GUIs inside Castor3D scenes.
  • ToonMaterial: A toon material (to be combined with DrawEdges plugin).
  • FFTOceanRendering: Ocean rendering using FFT generated surfaces.
  • OceanRendering: Basic ocean rendering, specifying waves attributes.
  • WaterRendering: Plane water surfaces rendering, using normal maps.
  • AtmosphereScattering : Sky and atmosphere rendering.

ToneMappings

The definitions of tone mapping operators.
  • Linear: Default tone mapping.
  • Haarm Pieter Duiker.
  • Hejl Burgess Dawson (Filmicx).
  • Reinhard.
  • Uncharted 2.
  • ACES.

Other applications

Along with the engine and its plugins, the projects also comes with other applications:
  • CastorViewer, a scene visualizer, using Castor3D.
  • ImgConverter, image converter, from all images formats to XPM or ICO.
  • 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 a height map to a normal map.

Documentation

The project's documentation is contained in the headers, and can be generated with Doxygen.
The project itself is generable for supported platforms, using CMake.

Examples


Version 0.14.0

Date : 2022-11-21

Features

  • Allowed to change Castor3D engine length unit.
  • Allowed background passes customisation.
  • Added support for multi-pass blending.
  • Full rework of Pass, introducing PassComponent to improve flexibility.
  • Implemented full support of glTF material specification and extensions.
    Attenuation Clearcoat Sheen Iridescence Transmission
  • Implemented atmosphere scattering
    Atmosphere Scattering, Clouds, Island Atmosphere Scattering Atmosphere Scattering Surface
  • Improved DiamondSquareTerrain, adding island mode and support for biomes.
    Colored Terrain Textured Terrain with slope and biomes
  • Removed PlyImporter plugin.
  • Implemented PBR bloom, which blooms the whole image.
    PBR Bloom


Version 0.13.0

Date : 2022-06-08

Features

  • Drastic performance improvement.
  • Implemented mesh and task shader, with frustum culling and backface culling.
  • Full rework of external data import (meshes, skeletons, animations).
  • Implemented morph target animations, replacing the per-vertex animations.
  • Added support for multiple texture coordinates sets (up to 4).
  • Added vertex colour component.
  • Merged the two implemented PBR workflows into an hybrid one, more flexible regarding extern scenes import.


Version 0.12.0

Date : 2022-03-20

Features

  • Now using RenderGraph to build a frame graph.
    The scene voxellisation graph, generated with RenderGraph.
  • Now using bindless textures.
  • Using MultiDrawIndirect to draw scene objects.
  • Implemented a loading screen.
  • Implemented texture animations (tile maps and transforms).
  • Implemented scene node animations.
  • Added DrawEdges plugin, to detect and draw edges.
    DrawEdges
  • Implemented water rendering on plane surfaces.
  • Implemented basic ocean rendering plugin.
  • Implemented FFT based ocean rendering plugin.
  • Implemented toon materials collection.
    Pufi
  • Added ACES tone mapping plugin.
  • Added HeightMapToNormalMap application.


Version 0.11.0

Date : 2021-02-19

Features

  • Castor3D now relies on Ashes, allowing support for OpenGL, Direct3D11 and Vulkan renderers.
  • GlslWriter has been completely removed and replaced by ShaderWriter, allowing the generation of shaders in the appropriate rendering API shader language.
  • Added support for cross skyboxes.
  • Enabled anisotropic filtering control from scene file.
  • Added support for shadow map filtering choice (Raw, PCR or VSM).
  • Added sendEvent function to Engine, to be able to execute an event directly if there is an enabled device.
  • Extracted binary/text write/parse classes to new files, to reduce includes dependencies.
  • Reworked mip level management for textures loaded from files.
  • Added volumetric light scattering.
    Volumetric Light Scattering
  • Upgraded scene files, meshes can now hold a default material.
  • Render queue now uses SceneCuller from its render pass, and this culler is used for frustum culling.
  • Cascaded shadow maps are implemented and functional.
    Cascaded Shadow Maps
  • Overlays are now rendered in their own framebuffer, and then combined with the 3D rendering.
  • Shadow maps now use texture arrays (2D or Cube).
  • Added Light Propagation Volumes global illumination implementation.
    Park with LPV San Miguel with LPV
  • Added Voxel Cone Tracing global illumination implementation.
    Sponza VCT Park + VCT
  • Implemented texture animations (UV rotate and translate).
  • Création de l'effet LinearMotionBlur.
  • ShaderDialog now displays all the shaders for the pipeline used to display a pass.


Version 0.10.0

Date : 2017-12-30

Features

  • Renamed namespace Castor3D to castor3d.
  • Emissive in a material is now stored on a single floating point (emissive maps still hold a colour though).
  • Implemented Physical Based Rendering, using both metallic/roughness and specular/glossiness workflows.
    PBR/SSR comparison
  • RenderPipeline now also holds the shader program.
  • Implemented Screen Space Subsurface Scattering (without backlit transmittance, though).
    Without SSSSS With SSSSS Detail comparison
  • The light pass result is now stored in two render targets: diffuse and specular.
  • Vertex buffers now use a buddy allocated pool.
  • Shadow mapping now uses variance shadow maps.
  • Transparent meshes are now rendered using Weighted Blended OIT rendering.
  • Screen Space Ambiant Occlusion has been improved, using Scalable Ambiant Obscurance implementation.
    SSAO comparison
  • Parallax Occlusion mapping is implemented.
    Parallax Occlusion Mapping
  • Reflection and refraction mapping have been implemented.
    Reflection and Refraction
  • Deferred rendering has been fully integrated to the engine, for opaque objects rendering.
  • Created components for submeshes, to move functionalities out of Submesh, and make it more flexible.
  • Rendering now uses a depth prepass.
  • Created ColourSkybox, to handle background colour and skyboxes in the same way.
  • Created ShaderBuffer class, to be able to handle SSBOs or TBOs in a similar way, choosing the most appropriate one, depending on running machine.
  • Created a plugin to generate terrains using Diamond Square algorithm.
    Diamond Square terrain
  • Events from CastorGUI are now forwarded to the user.
  • Removed almost every importer plugin, keeping only Assimp, OBJ, and PLY importers.
  • Created SMAA post effect.
    SMAA comparison
  • Created Kawase Light Streaks post effect.
    Kawase Light Streaks
  • Created Film Grain post effect.
  • Technique plugins have been completely removed.
  • Created Uncharted 2 tone mapping plugin.

Bugs corrections

  • Fixed bounding boxes for per-vertex animated and skeleton animated meshes.
  • Repaired an reenabled frustum culling.
  • Fixed alpha rejection.

Downloads



Version 0.9.0

Date : 2017-03-26

Features

  • Complete review of the render loop: RenderPipeline is not a unique instance anymore, it now holds any necessary informations to render on object type (states, shader program, uniform buffer bindings, ...).
  • The rendering has been dispatched in RenderPass instances, which hold one ore more RenderQueues, which are updated asynchronously on CPU, using a thread pool. This allows the GPU loop to be free of almost all CPU computations.
  • Skyboxes have been added.
  • Binary export has been reviewed completely, using now a chunk data format (like 3DS or LWO). It is used for meshes and skeletons.
  • Basic fog algorithms have been implemented (linear, exponential, and squared exponential).
  • Added support for per-vertex animations.
  • Implemented frustum culling.
  • Implemented a colour picking pass.
  • Implemented shadow mapping, the light sources can produce shadows, and objects can project and/or receive shadows.
  • Implemented particle systems, letting the developer choose the implementation (CPU through inheritance, GPU via Transform Feedback or Compute Shaders).
  • Fixed the GLSL lighting computations, and the light sources management (they are now rotated via scene node only), to have a correct rendering, without dirty hacks.
  • Added Compute Shaders, along with Shader Storage Buffers and Atomic Counter Buffers.
  • Textures implementation has been greatly modified, we now have TextureLayout, which holds the TextureImages and the TextureStorage per image. It allowed the creation of cube textures.
  • The billboards rendering doesn't use geometry shaders anymore, it now relies on hardware instancing.
  • FrameVariableBuffer has been replaced by UniformBuffer, which doesn't depend on the shader program anymore, and by UniformBufferBinding which depends on it. The UniformBufferBinding instances are stored in the RenderPipeline.
  • FrameVariable has been replaced by two classes: Uniform (for uniform variables coming from a UniformBuffer), and PushUniform (for uniform variables that don't).

Bugs corrections

  • Textures data transfer to RAM has been fixed.

Downloads



Version 0.8.0

Date : 2016-04-07

Features

  • The text overlays now can have a horizontal and a vertical alignment.
  • The back frame buffers are retrieved and bindable, though you cannot add attachments to it.
  • SceneFileParser has been extended, to be able to use parsers from external plug-ins.
  • The skeleton animation system is now finished and working.
  • Castor3D can now read scenes from zip archive files.
  • Castor3D now renders the scenes using HDR and tone mapping.
  • Implemented a Phong tessellation subdivider.
  • Implemented a FBX importer plug-in.
  • The first post effect plug-in has been implemented: HDR Bloom.
  • New plug-in, allowing creation of GUIs inside Castor3D scenes: CastorGUI.

Bugs corrections

  • Fixed hardware instantiation.
  • Fixed a bug in border panel overlays material management.
  • Fixed an overlays bug, revealed with on Intel GPUs
  • The billboards are now fixed.
  • Fixed PN Triangles subdivider, to use Bezier patches.

Downloads




Version 0.6.5.0

Date : 2011-08-30

Features

  • Tangent space computed for created primitives. You can access it over GLSL with 'attribute/in vec3 tangent'
    Normal mapping on an OBJ model Relief Mapping
  • Added UV map retrieval in cscn text format mesh description.
  • Works now under Linux (Gtk), tested with Debian (Squeeze and Wheezy), Fedora 13 and Mandriva 10

Bugs corrections

  • Crash when closing application - Corrected, caused by ShaderManager

Downloads



Version 0.6.1.2

Date : 2011-03-17

Features

  • Created a renderer selection dialog when lauching CastorViewer and CastorShape, added a splash screen for thos applications.
    Renderer selector Splash screen
  • Added a small application to convert any image file type to XPM to ease the multi OS development with wxWidgets.
  • Added new directives to scene file (alpha_rejection, rgb_blend, alpha_blend, hl_shader_program, ...).
  • Improved CMakeLists and 'cmake_modules' files in order to manage various client configurations in a better way.
  • Revised VertexBuffer and IndexBuffer system, introduced VertexDeclaration and BufferElement so user can create VertexBuffers using what hr want into it from this list : positions, normals, tangents, diffuse colour, texture coordinates (from 0 to 4), and ordered as user wants.
  • Vertex class now extends BufferElement.
  • TextureEnvironment will disappear in next version, multitexturing is now managed directly by Pass and TextureUnit.

Downloads



Version 0.6.1.1

Date : 2011-01-21

Features

  • Created a CMakeLists to generate solution from CMake.
  • Reordered file system to ease the use with CMake
  • Splitted Plugin class in 3 : RenderPlugin, DividerPlugin and ImporterPlugin. Importers and dividers will be created and modified without recompiling all projects.
  • Created a project for each existing importer (OBJ, PLY, MD2, MD3, 3DS, ...)
    PLY Model MD3 Model MD2 Model 3DS Model
  • Created a plugin for LoopDivider but PNTrianglesDivider remains in Castor3D because it is used in Icosahedron generation.
    Loop subdivided torrus
  • Started Cg shaders implementation. It implied a modification of scene files because in Cg and uniform variables are attached to a program (vertex, pixel, geometry) instead of being attached to the whole shader as it is in GLSL.
  • Buffers used for the render (Vertex, attribute, Texture, Normals, ...) are npw created by the RenderSystem so they can be created directly in Castor3D and not only in renderers (GL2, GL3 and future D3D).
  • Suppressed Singletons for the Managers (Image, Font, Material, Animation and Mesh).
  • Remerged the SceneNodes to ease their use.
  • Subdividers can also make their job in a thread and launch a callback at the end of it (cf. CastorShape).
  • Submesh::AddPoint now creates IdPoints and Submesh::AddFace uses it to create the vertices.

Bugs corrections

  • Corrected LoopDivider that didn't move newly created vertices, leaving them unchanged.

Downloads



Version 0.6.1.0

Date : 2010-12-10

Features

  • TransformationMatrix class is no more, it has been resumed to a functions collection working on 4x4 square matrix, regrouped in a namespace : MtxUtils.
  • Modified SceneNode management : a base class (NodeBase) holding all informations from old SceneNode and 3 derived classes (GeometryNode, CameraNode and LightNode) holding render specifics for respective linked objects (Geometry, Camera and Light).
  • MovableObject class now has less functionalities (now just a name and a NodeBase), Light and Camera classes now derive from this one for more uniformity in their moves, compared to geometries.
  • Renamed UniformVariable in FrameVariable to have a better view of what it is and to link this less to OpenGL.

Bugs corrections

  • Corrected a crash when closing the application compiled in release.

Downloads



Version 0.6.0.0

Date : 2010-11-05

Features

  • Added a class to manage matrices, in order to be able to suppress fixed pipeline support in OpenGL
  • Modified render system : added Renderable class which is in charge of creating the associated Renderer in order to ease the creation of this class's derived, such as submesh, scene node, light or camera.
  • Changed scene/material/meshes file extensions (respectively to cscn/cmtl/cmsh)

Bugs corrections

  • Protected shared datas with recursive mutexes (essentially in managers) to avoid random crashes.

Downloads



Version 0.5.0.2

Date : 2010-09-14

Features

  • New primitive : projection which performs a projection of an arc along depth axis and joins origin and projection with faces.
  • Better materials import from MD3 files (conatined in .skin and .shader files).
  • Better material import from 3DS files, especially colours : Ambient, Diffuse, Specular and Shininess

Bugs corrections

  • Corrected normals generation (they were inverted).

Downloads




Image Large