Basic framework for D3D11 init, model/texture loading, shader compilation and camera movement.

Overview

reed-framework

Basic framework for D3D11 init, model/texture loading, camera movement, etc.

Instructions:

  • #include
  • Link with framework.lib, or just add framework.vcxproj to your solution and reference it
  • Also link with d3d11.lib, dxgi.lib, and xinput_9_1_0.lib (or the newer xinput1_4.dll)

Current features:

  • Asset compilation system for pre-processing graphics data into an engine-friendly format
    • Compiles meshes from .obj format; also parses .mtl materials
    • Compiles textures from any format stb_image supports, resampling to power-of-two size and generating mipmaps
    • Stores compiled data in an asset pack in .zip format for easy distribution
    • Identifies out-of-date assets by timestamp or file format version number, and recompiles only out-of-date or missing ones
  • COM smart pointer—handles COM reference counting while being mostly transparent
  • D3D11 window class—handles window creation, D3D11 init, message loop, resizing, etc.
  • Functions for blitting textures
  • Function for drawing a full-screen triangle
  • Common D3D11 state objects—rasterizer, depth/stencil, blend, sampler
  • D3D11 constant buffer class
  • D3D11 texture classes: 2D, cubemap, 3D
  • D3D11 render target class
  • D3D11 mesh class
  • Texture and material library classes: map string names to textures/materials stored in an asset pack
  • Mipmap size calculations
  • Camera classes—FPS-style and Maya-style, and object hierarchy for adding more
  • CPU timer—smooths timestep for stability; also tracks total time since startup
  • GPU profiler—manages queries, buffers a few frames, and smooths the results

Todo list (in no particular order):

  • Debug line rendering
  • AntTweakBar integration / extensions
  • Console for displaying realtime errors/warnings without stopping the world
  • Video memory usage prediction/tracking
  • Shader compilation framework
  • Scene rendering framework, supporting multiple objects/materials, etc.
  • Postprocessing framework
  • Multicore asset compilation
  • Async asset loading
  • Better input system; gamepad support
  • Screenshotting—both LDR and HDR
  • Multi-monitor and multi-GPU awareness
  • GPU clock speed monitoring à la GPU-Z
  • OpenGL & cross-platform support
Comments
  • Support relative paths in assets properly

    Support relative paths in assets properly

    There are a bunch of issues with paths in asset packs.

    • The path provided to the compiler has to be pre-normalized (i.e. lowercase with forward slashes).
    • The internal path from the root of the pack to the asset has to be the same as the relative path provided to the asset compiler to find the source file. In other words, you can't build an asset pack from a root other than the current directory.
    • OBJs can only reference MTLs in the same directory as the OBJ.
    enhancement 
    opened by Reedbeta 0
  • Detect duplicate materials and unused materials

    Detect duplicate materials and unused materials

    The material compiler currently doesn't warn about duplicate names in an .mtl file, but then the dupes get dropped on the floor when they're loaded and stored in a hash table.

    Also, we don't currently do anything about unused materials. There are two parts to this: 1. clean up empty material ranges in meshes; 2. clean up materials in the library that are never referenced by any material range in the mesh.

    enhancement 
    opened by Reedbeta 1
  • Switch to LZ4 instead of ZIP compression

    Switch to LZ4 instead of ZIP compression

    ZIP decompression is quite slow. In part this is due to a CRC32 check of the decompressed data, but even when that's disabled, decompression in miniz is slower than HDD read speeds. Should switch to LZ4 for faster loading.

    enhancement 
    opened by Reedbeta 0
  • Asset pack doesn't get updated due to wrong version, if no assets of that version type

    Asset pack doesn't get updated due to wrong version, if no assets of that version type

    For example, if an asset pack has no meshes, then the system doesn't think it needs to be updated when I bump the mesh version. However, it still fails to load due to the version mismatch.

    Possible solutions:

    • Store asset version numbers with the individual assets, so there'd be no mismatch if no assets of that type
    • Smarten update logic, to have the notion of updating the pack (i.e. writing new version numbers) even if no individual assets need updating
    • Smarten loading logic, to ignore mismatched versions if there are no assets of that type
    bug 
    opened by Reedbeta 0
  • Separate D3D device creation from window/swapchain creation

    Separate D3D device creation from window/swapchain creation

    Today, D3D11Window::Init() just does everything. Should at least split it into two init methods: one for the D3D device, shaders, state blocks etc. and another for the window and swap chain. In fact, it should possibly be split into two classes, so you can easily have one device and several (or zero) windows/swapchains.

    enhancement 
    opened by Reedbeta 0
Owner
Nathan Reed
3D rendering at Adobe; formerly at 343, Sucker Punch, and NVIDIA. Math & coding blog writer, sometime musician, sci-fi & physics nerd. He/him.
Nathan Reed
My computer graphics playground. Currently has a raytracer implemented with D3D11 compute shader.

Graphics Playground I use this project as my "toy" engine. I'll be implementing various graphics projects in this repository. The code here is not sui

Berk Emre Sarıbaş 4 Aug 26, 2021
OpenGL Object Loading can load virtually every 3d.obj file you can find on the internet, without using another object loading library

OpenGL Object Loading can load virtually every 3d.obj file you can find on the internet, without using another object loading library (assimp for example). The program can load Object with 12M+ triangles and more

Phan Sang 15 Dec 18, 2022
The DirectX Shader Compiler project includes a compiler and related tools used to compile High-Level Shader Language (HLSL) programs into DirectX Intermediate Language (DXIL) representation

DirectX Shader Compiler The DirectX Shader Compiler project includes a compiler and related tools used to compile High-Level Shader Language (HLSL) pr

Microsoft 2.4k Jan 3, 2023
Advanced DXTc texture compression and transcoding library

crunch/crnlib v1.04 - Advanced DXTn texture compression library Copyright (C) 2010-2017 Richard Geldreich, Jr. and Binomial LLC http://binomial.info F

Unity Technologies 211 Dec 8, 2022
WebGL Texture plugin for Flutter

So far there is no way to render 3D objects efficiently in Flutter. Also directly accessing and programming the GPU from Dart isn't supported yet. This plugin shall close this gap.

null 99 Dec 14, 2022
GPU Texture Generator

Imogen GPU/CPU Texture Generator GPU Texture generator using dear imgui for UI. Not production ready and a bit messy but really fun to code. This is a

Cedric Guillemet 708 Dec 3, 2022
DirectXTex texture processing library

DirectXTex texture processing library http://go.microsoft.com/fwlink/?LinkId=248926 Copyright (c) Microsoft Corporation. November 8, 2021 This package

Microsoft 1.4k Dec 29, 2022
Blend text in a HLSL shader and have it look like native DirectWrite

dwrite-hlsl This project demonstrates how to blend text in a HLSL shader and have it look like native DirectWrite. License This project is an extract

Leonard Hecker 11 May 24, 2022
A physically based shader for woven cloth

ThunderLoom A physically based shader for woven cloth This projects consits of three main parts: Irawan shading model At its core is an implementation

null 92 Oct 29, 2022
SPIRV-Reflect is a lightweight library that provides a C/C++ reflection API for SPIR-V shader bytecode in Vulkan applications.

SPIRV-Reflect SPIRV-Reflect is a lightweight library that provides a C/C++ reflection API for SPIR-V shader bytecode in Vulkan applications. SPIRV-Ref

The Khronos Group 457 Dec 26, 2022
DirectX shader bytecode cross compiler

HLSLcc DirectX shader bytecode cross compiler. Originally based on https://github.com/James-Jones/HLSLCrossCompiler. This library takes DirectX byteco

Unity Technologies 742 Dec 29, 2022
A 3D Printable Retro-style Raspberry Pi HQ Camera

3D Printable Retro-style Raspberry Pi HQ Camera

Ping-Hsun 416 Jan 4, 2023
Event Camera Calibration

Event Camera Calibration 'modules/camera_calibration/cv_calib' is the conventional camera calibration module. 'modules/camera_calibration/dbscan' is t

null 28 Dec 27, 2022
Single-header single-function C/C++ immediate-mode camera for your graphics demos

Single-header single-function C/C++ immediate-mode camera for your graphics demos

Nicolas Guillemot 106 Oct 20, 2022
Model synthesis is a technique for generating 2D and 3D shapes from examples.

Model Synthesis Model synthesis is a technique for generating 2D and 3D shapes from examples. It is inspired by texture synthesis. Model synthesis was

Paul Merrell 82 Jan 4, 2023
General purpose model viewer

Foxotron ASSIMP based general purpose model viewer ("turntable") created for the Revision 2021 3D Graphics Competition Usage Check the wiki for inform

null 56 Dec 30, 2022
A minimalist library with basic facilities for developing interactive real-time 3D applications, with a strong emphasis on simplicity and ease of use.

SlimEngine A minimalist and platform-agnostic base project for interactive graphical applications (2D/3D) with a strong emphasis on simplicity, ease o

Arnon Marcus 67 Oct 29, 2022
Demonstrates basic advantages of integrating the Data Distribution Service (DDS) and Time-Sensitive Networking (TSN) Ethernet.

ROS2-DDS-TSN integration demo This repository demonstrates basic advantages of integrating the Data Distribution Service (DDS) and Time-Sensitive Netw

NXP 60 Jan 6, 2023
A basic 3D scene implemented with various engines, frameworks or APIs.

Here be dragons Hic sunt dracones. This repository contains multiple implementations of the same 3D scene, using different APIs and frameworks on vari

Simon Rodriguez 1.7k Dec 27, 2022