Top Related Projects
This repo contains the DirectX Graphics samples that demonstrate how to build graphics intensive applications on Windows.
One stop solution for all Vulkan samples
C++ examples for the Vulkan graphics API
Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
minimal cross-platform standalone C headers
Quick Overview
Cauldron is a framework for developing graphics applications and rendering techniques. It provides a collection of helper classes and functions to simplify the creation of cross-platform graphics applications using DirectX 12 and Vulkan. Cauldron aims to accelerate development by offering a unified interface for common graphics tasks.
Pros
- Cross-platform support for DirectX 12 and Vulkan
- Simplifies complex graphics programming tasks
- Includes various helper classes and utilities for common operations
- Actively maintained by AMD's GPUOpen initiative
Cons
- Learning curve for developers new to graphics programming
- May have limitations for highly specialized or custom rendering techniques
- Documentation could be more comprehensive for some components
- Dependency on specific versions of DirectX and Vulkan SDKs
Code Examples
- Initializing the Cauldron framework:
#include "Cauldron.h"
int main()
{
Cauldron::CauldronInit();
// ... Application code ...
Cauldron::CauldronShutdown();
return 0;
}
- Creating a simple renderer:
class MyRenderer : public Cauldron::Renderer
{
public:
void OnCreate(const Cauldron::DeviceCreationParameters& params) override
{
// Initialize renderer
}
void OnDestroy() override
{
// Cleanup resources
}
void OnRender(double deltaTime) override
{
// Render frame
}
};
- Loading a texture:
Cauldron::Texture* LoadTexture(const char* filename)
{
Cauldron::TextureLoadInfo loadInfo = {};
loadInfo.filename = filename;
loadInfo.generateMips = true;
return Cauldron::CreateTextureFromFile(loadInfo);
}
Getting Started
-
Clone the Cauldron repository:
git clone https://github.com/GPUOpen-LibrariesAndSDKs/Cauldron.git
-
Install required dependencies (DirectX 12 SDK, Vulkan SDK)
-
Build the project using CMake:
mkdir build && cd build cmake .. cmake --build .
-
Include Cauldron headers in your project and link against the built libraries
-
Initialize Cauldron in your main function:
#include "Cauldron.h" int main() { Cauldron::CauldronInit(); // Your application code here Cauldron::CauldronShutdown(); return 0; }
Competitor Comparisons
This repo contains the DirectX Graphics samples that demonstrate how to build graphics intensive applications on Windows.
Pros of DirectX-Graphics-Samples
- Comprehensive coverage of DirectX 12 features and techniques
- Official Microsoft samples, ensuring up-to-date and best practice implementations
- Extensive documentation and comments within the code
Cons of DirectX-Graphics-Samples
- Focused solely on DirectX, limiting cross-platform development options
- May have a steeper learning curve for beginners due to its advanced nature
- Less emphasis on performance optimization compared to Cauldron
Code Comparison
DirectX-Graphics-Samples (D3D12HelloTriangle.cpp):
ComPtr<ID3D12Resource> m_vertexBuffer;
D3D12_VERTEX_BUFFER_VIEW m_vertexBufferView;
// Create the vertex buffer.
{
// Define the geometry for a triangle.
Vertex triangleVertices[] =
{
{ { 0.0f, 0.25f * m_aspectRatio, 0.0f }, { 1.0f, 0.0f, 0.0f, 1.0f } },
{ { 0.25f, -0.25f * m_aspectRatio, 0.0f }, { 0.0f, 1.0f, 0.0f, 1.0f } },
{ { -0.25f, -0.25f * m_aspectRatio, 0.0f }, { 0.0f, 0.0f, 1.0f, 1.0f } }
};
Cauldron (TriangleVS.hlsl):
struct VSInput
{
float3 Position : POSITION;
float3 Color : COLOR;
};
struct VSOutput
{
float4 Position : SV_POSITION;
float3 Color : COLOR;
};
One stop solution for all Vulkan samples
Pros of Vulkan-Samples
- Extensive collection of Vulkan samples covering a wide range of topics
- Official repository maintained by Khronos Group, ensuring up-to-date and accurate implementations
- Cross-platform support with builds for Windows, Linux, macOS, and Android
Cons of Vulkan-Samples
- Focused solely on Vulkan, lacking support for other graphics APIs
- May be overwhelming for beginners due to the large number of samples and advanced topics
Code Comparison
Vulkan-Samples (Initialization):
VkInstanceCreateInfo instance_info = {};
instance_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
instance_info.pApplicationInfo = &app_info;
vkCreateInstance(&instance_info, nullptr, &instance);
Cauldron (Initialization):
Device* pDevice = new Device();
pDevice->OnCreate("Cauldron", "Sample", false, nullptr);
SwapChain* pSwapChain = new SwapChain();
pSwapChain->OnCreate(pDevice, 1280, 720);
Cauldron provides a higher-level abstraction for device and swapchain creation, while Vulkan-Samples demonstrates raw Vulkan API usage. Cauldron's approach may be more accessible for beginners, but Vulkan-Samples offers more direct control over the Vulkan implementation.
C++ examples for the Vulkan graphics API
Pros of Vulkan
- Extensive collection of Vulkan examples covering various techniques and features
- Well-documented code with detailed explanations for each example
- Actively maintained with frequent updates and community contributions
Cons of Vulkan
- Focused solely on Vulkan, lacking support for other graphics APIs
- May be overwhelming for beginners due to the large number of examples
- Less emphasis on creating a reusable framework compared to Cauldron
Code Comparison
Vulkan (Basic triangle rendering):
void buildCommandBuffers()
{
VkCommandBufferBeginInfo cmdBufInfo = vks::initializers::commandBufferBeginInfo();
VkClearValue clearValues[2];
clearValues[0].color = defaultClearColor;
clearValues[1].depthStencil = { 1.0f, 0 };
VkRenderPassBeginInfo renderPassBeginInfo = vks::initializers::renderPassBeginInfo();
renderPassBeginInfo.renderPass = renderPass;
renderPassBeginInfo.renderArea.offset.x = 0;
renderPassBeginInfo.renderArea.offset.y = 0;
renderPassBeginInfo.renderArea.extent.width = width;
renderPassBeginInfo.renderArea.extent.height = height;
renderPassBeginInfo.clearValueCount = 2;
renderPassBeginInfo.pClearValues = clearValues;
// ...
}
Cauldron (Basic rendering setup):
void Sample::LoadScene()
{
m_pGltfLoader = new GLTFCommon();
if (m_pGltfLoader->Load(m_jsonConfigFile.c_str()) == false)
{
MessageBox(NULL, "The selected GLTF file is invalid or can't be found", "Cauldron Viewer", MB_ICONERROR);
return;
}
// ...
}
Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
Pros of bgfx
- More mature and widely adopted, with a larger community and ecosystem
- Supports a broader range of platforms and rendering APIs
- Offers more low-level control and flexibility for advanced graphics programming
Cons of bgfx
- Steeper learning curve due to its lower-level nature
- Less focus on modern rendering techniques and PBR workflows
- Requires more manual setup and configuration compared to Cauldron
Code Comparison
bgfx example:
bgfx::init(init);
bgfx::setViewClear(0, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH, 0x303030ff, 1.0f, 0);
bgfx::setViewRect(0, 0, 0, uint16_t(width), uint16_t(height));
Cauldron example:
Device* pDevice = new Device();
SwapChain* pSwapChain = new SwapChain(pDevice);
ResourceViewHeaps* pResourceViewHeaps = new ResourceViewHeaps(pDevice);
bgfx provides a more low-level API with direct control over rendering states, while Cauldron offers a higher-level abstraction with object-oriented design. bgfx requires more explicit setup of rendering parameters, whereas Cauldron handles many of these details internally.
Both libraries aim to simplify cross-platform graphics development, but they cater to different levels of abstraction and use cases. bgfx is better suited for developers who need fine-grained control and maximum performance, while Cauldron is designed for ease of use and rapid prototyping of modern rendering techniques.
Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
Pros of Filament
- Cross-platform support: Android, iOS, Windows, macOS, Linux, and WebGL
- Extensive documentation and examples
- Active development and community support
Cons of Filament
- Steeper learning curve due to its comprehensive feature set
- Larger codebase and potentially higher resource usage
- Less focus on AMD-specific optimizations
Code Comparison
Filament (Material definition):
material {
name : "MyMaterial",
parameters : [
{ type : float3, name : "baseColor" }
],
requires : [
uv0
],
shadingModel : unlit
}
Cauldron (Material definition):
MaterialInstance* pMaterial = MaterialInstance::CreateMaterialInstance(pDevice, "MyMaterial");
pMaterial->SetParameter("baseColor", float3(1.0f, 0.0f, 0.0f));
pMaterial->SetTexture("albedoMap", pTexture);
Both Filament and Cauldron provide powerful rendering capabilities, but Filament offers broader platform support and more extensive documentation. Cauldron, being developed by AMD, may have better optimizations for AMD hardware. The code examples show different approaches to material definition, with Filament using a more declarative style and Cauldron using a programmatic approach.
minimal cross-platform standalone C headers
Pros of sokol
- Lightweight and minimalistic, focusing on simplicity and ease of use
- Supports multiple platforms (Windows, macOS, Linux, iOS, Android, and web)
- Single-file header-only libraries for easy integration
Cons of sokol
- Less comprehensive feature set compared to Cauldron
- May require more manual setup and configuration for complex rendering scenarios
- Limited built-in support for advanced graphics techniques
Code Comparison
Sokol (initializing a window and graphics context):
#include "sokol_app.h"
#include "sokol_gfx.h"
sapp_desc sokol_main(int argc, char* argv[]) {
return (sapp_desc){ .width = 800, .height = 600, .init_cb = init, .frame_cb = frame };
}
Cauldron (initializing a window and graphics context):
#include "Application.h"
#include "Renderer.h"
int main(int argc, char* argv[]) {
Application app;
app.Init();
Renderer renderer;
renderer.Init(app.GetWindow());
return app.Run();
}
The code comparison shows that sokol offers a more concise initialization process, while Cauldron provides a more structured approach with separate classes for application and renderer management.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Cauldron
A simple framework for rapid prototyping on Vulkan or DirectX12.
Cauldron was developed by AMD and is used internally to develop prototypes, demos and SDK samples.
Cauldron is compiled as a static library. To see it in action check projects below.
Projects that feature Cauldron
- FidelityFX-SPD Single Pass Downsampler (SPD)
- FidelityFX-SSSR Stochastic Screen Space Reflections (SSSR)
- FidelityFX-LPM Luma Preserving Mapper (LPM)
- FidelityFX-CACAO Combined Adaptive Compute Ambient Occlusion (CACAO)
- FidelityFX-VariableShading Variable Rate Shading (VRS)
- FidelityFX-ParallelSort GPU-based optimised sorting
- FidelityFX-CAS Contrast Adaptive Sharpenening (CAS)
- FidelityFX-FSR Super Resolution (FSR)
- FidelityFX-FSR2 Super Resolution 2.0 (FSR2)
- TressFX, a library that simulates and renders realistic hair and fur
- glTFSample, a simple demo app to show off Cauldron's features
Cauldron Features
- glTF 2.0 File loader
- Animation for cameras, objects, skeletons and lights
- Skinning
- Baking skinning into buffers (DX12 only)
- PBR Materials
- Metallic-Roughness
- Specular-Glossiness (
KHR_materials_pbrSpecularGlossiness
)
- Lighting
- KHR_lights_punctual extension
- Point
- Directional
- Spot Lights w/ Shadows (up to 4)
- Image-based Lighting (IBL) CubeMaps
- KHR_lights_punctual extension
- Shadow techniques
- shadow maps (PCF)
- shadow masks (DX12 only)
- Configurable GBuffer, supported techniques:
- Full forward
- Motion vectors
- Normals
- Depth
- Specular-roughness
- Diffuse-alpha
- Postprocessing
- TAA
- Bloom
- HDR/Tonemapping
- Texture Loaders for DDS (including the BCn formats), JPEG and PNG formats
- MIP Map generation for powers-of-two textures
- In-app user interface using Dear ImGui
- Rendering Resource Management
- Command Buffer Ring
- Timestamp Queries
- Memory Heap Manager (Linear Allocator)
- Static buffers for VB/IB/CB with suballocation support
- Dynamic buffers for VB/IB/CB using a ring buffer
- Debug Rendering
- Wireframe Bounding Boxes
- Light Frustums
- Window management & swapchain creation
- Fullscreen/Windowed Modes
- Support for DXC/SM6.x
- Shader Binary & PSO caching
- FreeSync :tm: 2 HDR support
- Multithreading loading & creation of resources
- Textures & MIP map generation
- Shader compilation
- Pipeline creation
- VK extensions can be enabled from the app side
- Benchmarking
Directory Structure
build
: Build scripts & generated solution files/folderslibs
: LibrariesAGS
: AMD helper library for querying GPU infoVulkanMemoryAllocator
: Helper library for memory management with Vulkan applicationsd3d12x
: The D3D12 helper librarydxc
: DirectX Shader Compilerimgui
: Graphical User Interface libraryjson
: Library for adding JSON support w/ C++ syntaxstb
:stb_image.h
andstb_image_write.h
from stb
media
: Builtin textures and other datasrc
: Source code files
Note: more info on the rendering backends can be found in the Readme of their respective folders.
Build
Prerequisites
How-to-Build
- Run the
GenerateSolutions.bat
file in thebuild
directory. build/VK
andbuild/DX12
folders will contain theCauldron_*.sln
files- Simply build the solution file for the desired API
build/DX12/src/DX12/
directory will contain the compiled static libraryFramework_DX12.lib
for DX12 (similar for VK) under the selected configuration (Debug/Release) folder.
Framework Architecture
Every feature in Cauldron has been implemented in a single file using C++11.
The main features could be grouped in 4 categories:
- Resource managers & loaders
- Texture loaders - can load
DDS
,PNG
,JPG
and any other file supported by the WIC subsystem. It can also create image views. - StaticBufferPool - holds vertices and indices for static geometry. It creates a huge buffer and then suballocates chunks from it in a linear fashion. Chunks cannot be freed.
- DynamicBufferRing - holds constant buffers and also vertices and indices. Same as before but allocation happens in a ring fashion.
- ResourceViewHeaps - holds the Descriptor Sets.
- UploadHeap - system memory buffer that holds the texture data to be uploaded to video memory via DMA
- CommandListRing - allocates a number of command buffers from a ring buffer and returns a ready-to-use command buffer.
- Device - all the device related code.
- Texture loaders - can load
- Renderers
- GLTF* - loads and renders the model using a certain technique
- PostProcPS/PS - draws a 2D quad using a custom shader, used by the post processing passes.
- ImGUI - code for driving the ImGUI
- Widgets
- Wireframe - draws a wireframe cube (used for rendering bounding boxes and light/camera frustums)
- Axis - draws the coordinate axis of a matrix
- Vulkan specific helpers & setup code
- InstanceVK - creates an instance and enables the validation layer
- Extension helpers
- ExtDebugMarkers - sets up the debug markers
- ExtFp16 - enables FP16 extension
- ExtFreeSync2 - enables FreeSync extension
- ExtValidation - enables the validation layer
- Commons & OS-specific code
- Swapchain - handles resizing, fullscreen/windowed modes, etc.
- FrameworkWindows - creates a window, processes windows message pump
Cauldron was originally written using DX12 and later on ported to Vulkan using the same structure. This would make Cauldron ideal for learning Vulkan if you're coming from DirectX12, or vice versa.
Known Issues
Please bear in mind that in order to keep Cauldron simple we are only covering the most frequently used features (for now).
Please feel free to open an issue for bug reports.
Contribution
Cauldron should be very easy to extend, should you want to contribute to Cauldron, you can open a pull request.
3rd-Party Open Source Projects Used
Top Related Projects
This repo contains the DirectX Graphics samples that demonstrate how to build graphics intensive applications on Windows.
One stop solution for all Vulkan samples
C++ examples for the Vulkan graphics API
Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
minimal cross-platform standalone C headers
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot