Skip to content

CottageLord/DX11-3D-Game-Engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DirectX11 3D Game Engine by Yang

A 3d renderer engine built from scratch with DirectX11 and Win32

Description

This renderer engine is a half-year-long personal project following ChiliTomatoNoodle's Tutorial. This document is a detailed review of the significant commits to this repository from the very beginning of the project.

Latest commits are shown first.

Alt text

Commit 26 SkyBox

Alt text

Commit 23, 24, 25 - Shadow Mapping, Percentage Close Filtering and Sloped-Scaled Shadow Bias

Implemented shadow map and Percentage Close Filtering (PCF) to the sponza scene. Shadow map technique was configured during model loading and controllable during the rendering. Users can specify which objects cast shadows and which receive. Applied shadow bias and PCF for better shadow performances.

Current render passes (implemented in GRAPHICS_RG_BlurOutlineRenderGraph.cpp):

  1. Generate shadow map
  2. Lambertian
  3. Outline mask (generate stencil buffer)
  4. Gauss blur (for outline effect)
  5. Camera wireframes and frustums

More detailed note about shadow mapping: GAMES 101 lecture note: shadow mapping.

Alt text

Alt text

Alt text

Alt text

New files

Basic shadow mapping

Filename Description
GRAPHICS_OBJ_ShadowCameraCBuffer.h | cpp
  • Contains transform/projection information for a shadow camera. This is the essential information for depth comparision during mapping.
GRAPHICS_OBJ_ShadowSampler.h | cpp
  • Configures a sampler for sampling shadow map.
ShadowTest_VS.hlsl | ShadowTest_PS.hlsl
  • A testing shader that allows objects from receiving shadows.
PlaceHolder.h | cpp

Percentage Close Filtering

Filename Description
_PShadow_Static.hlsli
  • A compute shader that samples shadow map and produces soft shadow. Static means the sample range is fixed.
  • Uses [unroll] to ultilize hardware acceleration.
_PShadow_Dynamic.hlsli
  • A compute shader that samples shadow map and produces soft shadow. Dynamic means the sample range is passed through parameter.
  • Combines [unroll] and if statements to ultilize hardware acceleration while allowing dynamic inputs.
PShadow.hlsli

Sloped-Scaled Shadow Bias

Filename Description
GRAPHICS_OBJ_ShadowRasterizer.h | cpp
  • Encapsulates DirectX settings for sloped scaled shadow bias.

Major updates

Commit Description
Basic Shadow Mapping
  • Basic shadow map implemented on cubes. Problems including self shadowing still exists.
Advanced Shadow Mapping
  • Advanced shadow mapping techniques including PCF and Slope Scaled Shadow Bias.

Commit 22 - Depth sampling from camera view

Added depth sampling from any camera. This is the prerequisite for shadow maps.

Alt text

New files

Filename Description
GRAPHICS_PASS_ShadowMappingPass.h
  • Configures a depth map generator from the light-camera perspective.
  • Registers global render graph source for future shadow map sampling.
GRAPHICS_OBJ_Channels.h | cpp
  • Only contains 2 binary masks - normal rendering or shadow depth sampling.
  • When submitting different tasks (either Main or Shadow), corresponding techniques will be used for rendering. Techniques contains pipeline information like depth stencil settings and shader constants settings.

Major updates

Commit Description
GRAPHICS_OBJ_DepthStencil.h | cpp
  • Now allows different usages of depth stencil. Configures corresponding data types for corresponding data storage.
  • Allows fetching depth map data from gpu side and output image files for dubugging.
Depth sampling
  • Cameras can sample depth map and produce texture for future references.

Commit 21 - Multuple Cameras

Added supports for setting multiple cameras. This is a prerequisite for shadow mapping.

Alt text

New files

Filename Description
GRAPHICS_PASS_WireframePass.h
  • A render pass that draws camera indicators (a camera shape) and frustums (a camera view zone) for all inactive cameras
GRAPHICS_OBJ_CameraContainer.h | cpp
  • A manager that holds references to all available camaras.
  • Capable of spawning control widgets for each camera, allowing users to switch between different camaras and modify their properties.
GRAPHICS_OBJ_Projection.h | cpp
  • A seperated class for holding each camera's projection information.
GRAPHICS_OBJ_Frustum.h | cpp
  • A drawable object. Represents a camera's view zone.
GRAPHICS_OBJ_CameraIndicator.h | cpp
  • A drawable object. Represents a camera's current position.

Major updates

Commit Description
Reorganized shader files, fixed bindable pool bug when resolving inputlayout
  • The former Bindable Pool register an input layout by its data type definitions. However, DirectX defines input layouts along with vertex shaders. During that process, if the input vertex data structure has more data types than shader needs, the returned input layout will discard those non-neccesary types. In this case, for example, if we define an input layout with both position and color, but construct DirectX layout with a position only shader, the retured layout only contains position layout. If we then use this layout in a position-color shader, error will happen.
  • Shaders now have better include structures, which reduced code redundancy.
Multiple cameras
  • Allowing multiple controllable cameras. Nota that only one camera can be set as the main render camera.

Commit 20 - Render Graph

A render graph (or frame graph) is a way of defining the rendering pipeline using self-contained nodes in an acyclic directed graph. Each node has a set of input and outputs, which link to other nodes or resources. When executed, the graph is traversed executing each node in turn. In the current version, every node represents a pass.

The render graph system takes in nodes (passes) with input/output and validates/links the nodes together. This system allows us to avoid hardcoding the render procedure, but configure it io a graph-like, more organized and automatic way.

To avoid name conflicts, the input and the output for each pass is named as sink (required input type for this pass) and source (output type from this pass).

Alt text

After this update, the current render process (in App.cpp) is:

  1. Engine Initialization(): Create a render graph, which initializes of all passes, creates and links all sinks/sources. Note that the sequenec of passes are specified by the order in a vector.

  2. Engine Initialization(): Import models. The Material.cpp automatically assign pass type (by universal pass name strings like "lambertian") to the leaf meshes according to the resource setting.

  3. Engine Start(): The model calls LinkTechniques(RenderGraph), passing the render graph all the way to the mesh leaves. When LinkTechniques() eventually hit the leaves, a leaf will notify its techniques and steps to get the real Pass reference from the render graph (previously just a name string assigned by Material.cpp).

  4. Engine Update(): All models will call Submit() to notify all leaf -> Technique -> Step to submit a job (contains the drawable with recent updates like transforms) to the target pass (reference got from previous step).

  5. Engine Update(): All the renderGraph.Execute() to render all passes and their jobs.

New files

Filename Description
GRAPHICS_RG_Sink.h | cpp | GRAPHICS_RG_Source.h | cpp
  • Represents an input (sink) or an output (source) of a pass.
  • Memorizing the links by storing the self name, pass name and the target (sink or source) name.
  • Has 3 variants:
  • 1) DirectBindableSink/Source: requires a specific sink/resource in the render graph, hence the data cannot be shared and delivered to mulltiple render graph nodes.
  • 2) DirectBufferSink/Source: requires a general sink.resource in the render graph, hence the data can be shared and and delivered to mulltiple render graph nodes.
  • 3) ContainerBindableSink: Only exists in BindingPass. Maintains a bindable[] and an index of the empty alot in the bindable[] that expect input from the incoming source. We do this in such way to prevent invalid pointer when we only stores the shared_ptr to the empty slot of a bindable[], and the bindable[] get resized.
GRAPHICS_RG_RenderGraph.h | cpp
  • Base class of all other render graphs.
  • Manages the global sinks and sources, like the back buffer.
  • Link the sinks and sources for the current passes. Syntax: SetSinkTarget("sinkName", "anotherPassName.sourceName"). Passes come with their own sinks and sources (currently defined in the constructor).
GRAPHICS_RG_BlurOutlineRenderGraph.h | cpp | GRAPHICS_RG_ScaleOutlineRenderGraph.h | cpp
  • Different render graphs with respective global sink/source settings and linkings.
  • Passes and their relationships are built in the constructors.
| GRAPHICS_PASS_RenderQueuePass.h | cpp | GRAPHICS_PASS_BindingPass.h | cpp | GRAPHICS_PASS_BufferClearPass.h | cpp | GRAPHICS_PASS_FullscreenPass.h | cpp | GRAPHICS_PASS_HorizontalBlurPass.h | cpp | GRAPHICS_PASS_VerticalBlurPass.h | cpp
  • Sets up each pass' unique bindables, constants (i.e Gauss) and render targets (i.e the fullscreen texture).
  • Configures the Execute() function for each pass.

Major updates

Commit Description
Render Graph
  • Many updates to previous codes for incorperating the render graph in the current system.

Commit 19 - Fullscreen Filtering and Sepatared Gauss Blur Effect

Applying blur effect to the pipeline output image. Due to the complex nature of applying outline effect in geometry space (model pivot not centered, mesh not contineous, cannot combine alpha channel, etc.), we now apply the outline effect to the screen space directly.

Alt text

Alt text

Alt text

New files

Filename Description
GRAPHICS_OBJ_DepthStencil.h | cpp
  • Separated manager class for configuring depth stencil.
GRAPHICS_OBJ_GraphicsResource.h | cpp
  • Separated manager for accessing DirectX graphic device and context.
GRAPHICS_OBJ_RenderTarget.h | cpp
  • Separated render target as we now need more render target other than the ones in the swap chain.
  • It is basically a texture like object to draw dinal images on.
GRAPHICS_OBJ_BlurPack.h | cpp
  • Configures the math for Separated Gauss Blur Effect.

Major updates

Commit Description
FullScreen Filters
  • Take the output from the pipeline as the input got fullscreen filter.
GRAPHICS_JOB_FrameCommander.h | cpp
  • Integrated the new blur functionality using the extra render target.
Separated Gauss Blur Effect
  • Added several shader files to incorporate Gauss blur into the rendering.

Commit 18 - Probe System: control every mesh node

This update extends the job system and allows automatic job detection by "probes" traverling in the model-hierarchy. The probe system has two major updates: 1) when hitting the leaf mesh, auto-gen job. 2) when hitting the leaf mesh, auto-gen controls in the UI menu.

Alt text

Alt text

Alt text

New files

Filename Description
GRAPHICS_JOB_ModelProbe.h | cpp
  • The base class for all probes. The probes travel through the model node hierarchy and take respective actions when hitting a leaf.
  • Probes are passed recursively like ModelRoot.Accept( probe ).
  • Model Probe is responsible for generating UI handles to the render options that Technique Probe generated.
GRAPHICS_JOB_TechniqueProbe.h | cpp
  • Base class for technique probes. Provides logical handles to leaf mesh render styles.
GRAPHICS_OBJ_Material.h | cpp
  • Initializes all techniques needed for loading materials (labertian, stencil, outline...).
  • Automatically assign techniques to model leaves according to supplied material data types. For example, assign a alpha testing pixel shader bindable object when alpha channel detected in textures.

Major updates

Commit Description
Basic probe system
  • This update provides accesses to model leaves' render styles (bindables, vertex data, etc.). This is essential for the later UI update.
GRAPHICS_OBJ_Model.h | cpp | GRAPHICS_OBJ_Node.h | cpp
  • Integrated into the Job System.
  • The node can now accept a probe, pass it to children nodes and allows probes to get information/update data.
GRAPHICS_OBJ_DynamicVertex.h | cpp
  • Uses the MACROS trick as in the Commit 16. Reduced code amount.
UI controll for model nodes.
  • This update enables users to tweak every individual item's render style in the scene.

Commit 17 - Job System and Multi-pass Rendeing

In previous code, meshes like the sponza scene are configured and rendered as a whole, which does not support scene graph which allows modification on sub-meshes. To apply different render techniques to respective parts, we have to manually separate the meshes and hard code the render order for dependency concern. Job system provides handles to all sub-meshes for individual rendering jobs/steps by specified techniques.

The new mesh-hierarchy hence becomes Drawable -> Model (like the Sponza) -> Nodes (like a vase) -> Meshes (the vase drawable shared between all vases) -> Techniques (like the outline effect) -> Steps (the actual process to make the outline, which contains references to bindables and the mesh data). For each step, we register a job (contains ptr to mesh data and ptr to step/bindables). Rendering

Alt text

New files

Filename Description
GRAPHICS_JOB_FrameCommander.h | cpp
  • A temporary solution for pass management. Will be replaced by a render graph later.
  • Provides interfaces for submitting jobs to a specific pass. Responsible for executing passes.
GRAPHICS_JOB_Technique.h | cpp
  • Describes a specific type of technique. For example, phone shading.
  • Contains an array of steps, which stores an array of bindables.
GRAPHICS_JOB_Step.h | cpp
  • Describes one of the steps to implement a technique.
  • Contains an array of bindables necessary for this step. Bindables like ps and vs shaders are configured when initializing a step.
GRAPHICS_JOB_Job.h | cpp
  • Describes a job, which correlates to steps in every technique.
  • Contains two pointers: 1) ptr to drawable data like vertecies. 2) ptr to step (bindables) like ps/vs shaders.
GRAPHICS_JOB_Pass.h | cpp
  • Describes a render pass. Ideally, shared render processes like all phong shading meshes are packed in one pass.
  • Contains an array of jobs (step bindables + drawable data).
GRAPHICS_OBJ_NullPixelShader.h | cpp
  • A placeholer for techniques/steps do not need pixel shader. For example, the stencil-writing pass for the outline effect.

Major updates

Commit and Files Description
TestCube.h | cpp
  • represents an outlined cube.
  • Demonstrate how techniques/steps are configured and how passes/jobs are registered.
Job System
  • Job system integrated into the old framework.

Commit 16 - Dynamic shader constant system with shader layout pool and basic outline effect

Alt text

Alt text

A system that examines model resources and automatically configures render procedures. For example, configure a alpha tester shader when alpha channel texture detected. This system also provides handles to all shader constants for run-time modification.

New files

Filename Description
GRAPHICS_OBJ_DynamicConstant.h | cpp
  • Implemented layout elements (leaf) and layout trees. These describes the essential data and procedure for a rendering style.
  • The layout tree is capable of defining shader data recursively. For example, array of matrix of float4.
  • Ultilized MACROS for leaf-node-types to reduce code redundancy (see GRAPHICS_OBJ_DynamicConstant.h).
GRAPHICS_OBJ_LayoutPool.h | cpp
  • A layout pool system that allowing reusing registered layouts.
GRAPHICS_OBJ_Stencil.h | cpp
  • A bindable object that allows writing/referencing to the stencil buffer.

Major updates

Commit Description
Dynamic constant layout system
  • Dynamic constant layout system integrated.
Stencil buffer
  • Created outline effects for cubes bind with stencil objects.

Commit 15 - [EXTRA] Cell Shading

Alt text

Demo Video [Youtube]

SC2 Video

Commit 14 - Alpha testing and optional back-face culling

Alt text

Alt text

New files

Filename Description
GRAPHICS_OBJ_Blender.h | cpp
  • A bindable object that could handle transparent textures (like a flower texture).
GRAPHICS_OBJ_Rasterizer.h | cpp
  • A bindable object that could handle sheet-like models painted double-sided (like a chain). Back-face culling will be implicitly disabled for this case.

Major updates

Commit Description
Alpha testing through shaders.
  • Also updated shader files to implement alpha test. For example, when sheet-model is rendered double-sided, the normal map z value should be flipped for the back face.

Commit 13 - Mipmapping and Anisotropic Filtering with more models

Alt text

Alt text

New files

Filename Description
GRAPHICS_HELP_MatrixTranslator.h | cpp GRAPHICS_HELP_NormalMapTwerker.h GRAPHICS_HELP_TexturePreprocessor.h | cpp
  • Several helper classes for adjusting imported art resources. For example, change from left-hand coordinate to the right hand one.

Major updates

Commit Description
Model loading
  • Loaded models for Sponza and several Genshin Impact characters.
Anisotropic filtering and mipmapping
  • Configured automatic mipmapping and anisotropic filtering through DirectX interface.

Commit 12 - Normal Mapping (Tangent Space)

Alt text

Alt text

Alt text

New files

Filename Description
PhongPSNormalMap.hlsl
  • Shader file for basic normal Map
TestPlane.h | cpp
  • A plane object that utilizes normal mapping.

Major updates

Commit Description
Tangen space normal mapping
  • Updated shader file structures, refactored several shader functions, created several helper shader header files.

Commit 11 - BindablePool system

Alt text

New files

Filename Description
GRAPHICS_OBJ_BindablePool.h | cpp
  • Maintains the unordered_map< string, shared_ptr< Bindable > >.
  • Using template programming/parameter pack to execute correct Bindable::Resolve<\Type>(param...).

Major updates

Commit Description
Model hierarchy loading
  • Implemented automatic/recursive hierarchy explorer that generates corresponding UI controllers for all model nodes - arms, legs, etc.
Mouse camera system
  • Allows camera to follow mouse movements.
Specular map loader
  • Added specular constants loading codes in Mesh.cpp.
  • Replaced StaticDrawInfo with shared_ptrs, ready for new BindablePool system.
BindablePool system
  • A bindable pool system that matches bindable data with there id. Allows drawables to share bindables if necessary.
  • Updated bindable base class such that all bindables need to implement resolve() to register themselves in bindable pool.

Commit 10 - Model loading

Alt text

New files

Filename Description
GRAPHICS_OBJ_Mesh.h | cpp
  • Consists of Model, Mesh (drawable) and Node classes.
  • Capable of reading model with filepath, parsing meshe/node-hierarchies and generating respective control window automatically (i.e. moving model's leg).
  • Ultilized the dynamic vertex system, but haven't do flexible data reflection - detecting whether normal, diffuse, specular, alpha mask, etc. files exists and generate different dynamic vertex layouts accordingly.
GRAPHICS_OBJ_DynamicVertex.cpp | GRAPHICS_OBJ_InputLayout.cpp
  • Seperated definition and declaration.

Major updates

Commit Description
Model loading
  • Moved all rendering pipeline related objects into the GPipeline namespace.
  • Imported assimp library.

Commit 9 - DynamicVertex system

Alt text

New files

Filename Description
GRAPHICS_OBJ_DynamicVertex.h
  • Provides an automatic vertex shader input layout/data manager. Previously the vertex data is defined manually in separate places (see duplicate codes in GRAPHICS_OBJ_Box.cpp).
  • Now we only need to do VertexLayout.Append() definition ahead, and the layout object will be capable of reading vertex data, validating data and configures D3D layout and match shader automatically.
  • Template programming and parameter pack are used to load vertex data flexibly (DynamicVertex::VertexBuffer::EmplaceBack()).
  • This will be the code base for future improvements, including shader reflection.
TexturedPhongVS.hlsl | TexturedPhongPS.hlsl
  • The phong shader capable of sampling texture.
AssTest.cpp.h | cpp
  • Some test objects.

Major updates

Filename Description
GRAPHICS_BUF_VertexBuffer.h | cpp
  • Now capable of transporting a DynamicVertex object into the pipeline configurations.

Commit 8 - Point light and phong shading

Alt text

Alt text

New files

Filename Description
IndexedPhongVS.hlsl | IndexedPhongPS.hlsl
  • Shaders responding to the new lighting settings and paint geometry faces with their respective face IDs.
GRAPHICS_OBJ_TestObject.h | GRAPHICS_OBJ_Cylinder.h | cpp
  • Some test objects.

Major updates

Filename Description
Commit details
  • Transform buffer now stores model, model-view, model-view-proj matricies respectively for different shader calculations. For example, the normal calculation cannot be done after geometry being projected.
  • Added slot parameter to transform and constant buffers for flexible registration.
  • The pointlight now have various lighting attribute constants.

Commit 7 - Point light and phong shading

Alt text

Alt text

Alt text

New files

Filename Description
GRAPHICS_LGT_PointLight.h | cpp
  • Manages the light data attributes, control window and the Solidsphere object as visual representation.
  • Updates the PixelConstantBuffer for shader's light computation.
GRAPHICS_OBJ_SolidSphere.h | cpp
  • Visualize the light source.
PhongVS.hlsl | PhongPS.hlsl
  • The Phong shaders.

Major updates

Filename Description
GRAPHICS_OBJ_IndexedTriangleList.h
  • Added normal generator for cubes.

Commit 6 - Imgui and camara system

Alt text

New files

Filename Description
SYS_CLASS_ImguiManager.h | cpp
  • Initialize Imgui system.
GRAPHICS_OBJ_Camera.h | cpp
  • Initialize camera positions, generate camera matrix using XMMatrixLookAtLH().
  • Spawns Imgui control window that updates camera parameters.

Major updates

Filename Description
SYS_CLASS_Graphics.h | cpp | SYS_CLASS_App.h | cpp
  • Integrated Imgui frame into the current graphics frame system.
  • Calls camera update.

Commit 5 - Texture mapping

Alt text

Alt text

New files

Filename Description
GRAPHICS_OBJ_Surface.h | cpp
  • A surface loader/modifier using Gdiplus. Convert image file into color data buffer.
  • Contains a Color class providing various data handler into the bit data. Built corresponding Exception handler.
GRAPHICS_SET_GDIPlusManager.h | cpp
  • Configures the Gdiplus.
GRAPHICS_OBJ_Texture.h | cpp
  • Take in the loaded Surface, register the D3D11_TEXTURE2D_DESC as D3D11_SHADER_RESOURCE_VIEW_DESC.
  • Configures texture settings like mipmap levels.
  • Bind to shader constant by PSSetShaderResources().
GRAPHICS_OBJ_Sampler.h | cpp
  • Configures the sampler settings like filter mode and wrapping mode.
  • Bind to shader constant by PSSetSamplers().

Major updates

None.

Commit 4 - Play with various geometries

Alt text

New files

Filename Description
SYS_SET_Math.h
  • Some math helpers that performs angle warp around, angle to radient and basic linear interpolation.
GRAPHICS_OBJ_IndexedTriangleList.h
  • An encapsulation of paired index and vertex buffers.
GRAPHICS_OBJ_Cube.h | GRAPHICS_OBJ_Cone.h | GRAPHICS_OBJ_Prism.h | GRAPHICS_OBJ_Plane.h | GRAPHICS_OBJ_Sphere.h
  • Various drawable geometries.

Major updates

None.

Commit 3 - The bindable system - Reusability, Flexibility and Persistence

Alt text

Alt text

New files

Filename Description
GRAPHICS_OBJ_Drawable.h | cpp
  • Represents a drawble entity such as a box.
  • Manages a collection of "bindables" objects that could be binded and shipped to rendering pipeline, such as vertex buffer, index buffer, transforms, shader constants and other topology settings.
GRAPHICS_OBJ_Bindable.h | cpp
  • The base class (interface) for all bindable objects.
  • The pure virtual function Bind(Graphics& gfx) expects different implementations from its children (like how vertex buffer and shader objects bind themselves to pipeline respectively).
GRAPHICS_BUF_VertexBuffer.h | cpp
  • Inherit from Bindable.
  • Takes in a vector of vertecies, store it as a member, and create buffer for D3D11_SUBRESOURCE_DATA as D3D11_BIND_VERTEX_BUFFER in the gfx device.
  • Bind the vertex using IASetVertexBuffers()
GRAPHICS_BUF_IndexBuffer.h | cpp
  • Inherit from Bindable.
  • Take in a vector of indecies, store it as a member, and create buffer for D3D11_SUBRESOURCE_DATA as D3D11_BIND_INDEX_BUFFER in the gfx device.
  • Bind the index using IASetIndexBuffer()
GRAPHICS_OBJ_PixelShader.h | cpp | VertexShader.h | cpp
  • Inherit from Bindable.
  • Take in the compiled-shader-file paths and register the corresponding shader objects.
  • Bind the shaders using VS | PSSetShader().
  • The vertex shader stores the input vertecies bytecode for InputLayout registration.
GRAPHICS_OBJ_InputLayout.h | cpp
  • Inherit from Bindable.
  • Take in the bytecode that will be sent to the Input Assembly stage, register the input layout by CreateInputLayout().
  • Bind the input layout using IASetInputLayout()
GRAPHICS_BUF_ConstantBuffers.h
  • Inherit from Bindable. Contains ConstantBuffer, VertexConstBuffer and PixelConstBuffer classes.
  • Take in the raw constants data, like struct with rgba floats, and register them to respective shader constants.
  • Bind the input layout using VS | PSSetConstantBuffers()
GRAPHICS_BUF_TransformCBuffer.h | cpp
  • Inherit from Bindable.
  • Take in the current view-space-transform of the draw target, apply the projection to it.
  • Bind the final transform matrix as VertexConstant to the shader.
GRAPHICS_OBJ_Topology.h | cpp
  • Inherit from Bindable.
  • Bind the Topology setting using IASetPrimitiveTopology, almost always D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST.
GRAPHICS_OBJ_StaticDrawInfo.h
  • Inherit from Drawable. Sit between the Drawable base and the actual drawable geometry object.
  • Ultilizaing the feature of the template programming. By using AddStaticBind() instead of the AddBind(), making sure that all Drawable(Box)s share the data including Vertex/Index data, Shaders, Constants, etc.
  • The hierarchy graph in the note above shows how the system eventually looklike. The Box code below also provides the example in practice.
GRAPHICS_OBJ_Box.h | cpp
  • Inherit from Drawable.
  • Instanciate a painted box and bind all data/settings using the bindable system.
SYS_SET_GraphicsThrowMacros.h | SYS_SET_WindowsThrowMacros.h
  • Holds respective exception detection MACROS.

Major updates

Filename Description
Commit detail
  • Reorganized the exception detection MACROS.

Commit 2 - The first triangle with shaders

Alt text

New files

None.

Major updates

Filename Description
SYS_CLASS_Graphics.h | cpp
  • Added test triangle drawer. Tested the procedure of configuring and feeding the rendering pipeline.
  • This process will be constantly modulared, generalized and optimized in the future commits.
SYS_CLASS_IO_Mouse.h | cpp
  • Improved mouse moving-out-of-window behavior. The mouse tracker now stops when mouse is outside the window, like most modern games do.
SYS_CLASS_IO_Keyboard.h | cpp
  • Distinguishes between text input and key pressing.

Commit 1 - a win32 window with customized IO and Exception system

Alt text

Alt text

Alt text

Alt text

New files

Filename Description
SYS_MAIN_Loop.h | cpp
  • The main loop of the program. Invokes App::Go().
  • Do the outmost exception handling.
SYS_CLASS_Graphics.h | cpp
  • A D3D11 Graphic Devices manager, configures swap chain, basic screnn buffer, sampler(anti-aliasing) and so on.
SYS_CLASS_App.h | cpp
  • Contains the program behavior in each frame. Responsible for instanciating, updating and rendering objects.
SYS_CLASS_MFException.h | cpp
  • Inherit from std::exception, the MFException is the base class for all exception handlers in this engine (Window, Graphics, Tools, etc.)
SYS_CLASS_Window.h | cpp
  • A singleton win32 window class that configures win32 settings.
  • Provides message communication between our app and the windows system.
SYS_CLASS_IO_Mouse.h | cpp | Keyboard.h | cpp
  • The IO event handlers that are envoked by Window::ProcessMessages.
  • Translate and process the raw data from the OS such that our app can use them more intuitively.

Major updates

None.

About

A 3d game engine built from scratch with DX11

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published