Skip to content

Instantly share code, notes, and snippets.

From time to time I receive questions on the depth aware upsampling mentioned in the INSIDE-rendering presentation: https://loopit.dk/rendering_inside.pdf#page=39

noisy blur

The goal of this technique is to take the texture-output from a half-resolution pass, containing the results of sampling volumetric fog - and scale it up to full resolution. This presents two challenges:

  • Making sure samples from the low-resolution buffer, do not spill on top of foreground objects in the high-resolution buffer
  • Making sure the samples in the volumetric fog can be properly accumulated by TAA after upsampling

@tcantenot
tcantenot / main.c
Created March 7, 2024 09:31 — forked from mattiasgustavsson/main.c
Minimal code example for creating a window to plot pixels to
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
#include <windows.h>
#pragma comment( lib, "user32.lib" )
#pragma comment( lib, "gdi32.lib" )
#define SCRW 640
#define SCRH 480
@tcantenot
tcantenot / tri.c
Created November 23, 2024 10:49 — forked from cshenton/tri.c
Seeing how fast a d3d11 swapchain can go.
#include <assert.h>
#include <stdio.h>
#include <time.h>
#define COBJMACROS
#include <windows.h>
#include <d3d11_1.h>
#include <d3dcompiler.h>
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
@tcantenot
tcantenot / exponentially_space_set.cpp
Last active May 30, 2025 08:50
Exponentially spaced set
// Based on: https://x.com/ptrschmdtnlsn/status/1840765584398840233
#include <stdint.h>
#include <stdio.h>
#include <string.h>
constexpr uint32_t N = 7;
constexpr uint32_t M = 1u << N;
constexpr uint32_t MaxNumStates = 6;
@tcantenot
tcantenot / main.c
Last active September 12, 2025 12:05
Precise sleep function on Windows written in C using high resolution timers
#include "precise_sleep.h"
int main()
{
const int use_nt_set_timer_resolution = 1;
InitPreciseSleepFunction(use_nt_set_timer_resolution);
// Your app code that uses PreciseSleep(sleep_duration_s);
DeinitPreciseSleepFunction();