Skip to content

Instantly share code, notes, and snippets.

View thennequin's full-sized avatar

Thibault Hennequin thennequin

  • Kylotonn
  • Paris, France
View GitHub Profile
@jakubtomsu
jakubtomsu / octviz.odin
Last active February 7, 2025 20:08
Odin program for visualizing spherical/hemispherical octahedral mapping with Raylib
// Octahedral mapping visualization in Odin and Raylib
// by Jakub Tomšů (@jakubtomsu_)
//
// Build and run with 'odin run octsphere.odin -file'.
// No additional dependencies required.
//
// Sources:
// https://gpuopen.com/learn/fetching-from-cubes-and-octahedrons/
// https://knarkowicz.wordpress.com/2014/04/16/octahedron-normal-vector-encoding/
@h3r2tic
h3r2tic / raymarch.hlsl
Last active June 27, 2025 05:10
Depth buffer raymarching for contact shadows, SSGI, SSR, etc.
// Copyright (c) 2023 Tomasz Stachowiak
//
// This contribution is dual licensed under EITHER OF
//
// Apache License, Version 2.0, (http://www.apache.org/licenses/LICENSE-2.0)
// MIT license (http://opensource.org/licenses/MIT)
//
// at your option.
#include "/inc/frame_constants.hlsl"
@JarkkoPFC
JarkkoPFC / bitonic_sort64.h
Last active December 3, 2024 22:23
Bitonic sort for 64 elements
template<typename T>
void bitonic_sort64(T vals_[64])
{
int h=-1;
do
{
for(unsigned i=0; i<32; ++i)
{
unsigned idx0=2*i;
unsigned idx1=4*(i&h)-2*(i+h)-1;
@kevinmoran
kevinmoran / SquirrelNoise5.hpp
Created July 22, 2022 22:45
Improvement on Squirrel3 noise-based RNG by Squirrel Eiserloh (https://twitter.com/SquirrelTweets/status/1421251894274625536)
//-----------------------------------------------------------------------------------------------
// SquirrelNoise5.hpp
//
#pragma once
/////////////////////////////////////////////////////////////////////////////////////////////////
// SquirrelNoise5 - Squirrel's Raw Noise utilities (version 5)
//
// This code is made available under the Creative Commons attribution 3.0 license (CC-BY-3.0 US):
@bblanchon
bblanchon / Open with Sublime Merge.reg
Last active August 13, 2024 13:15
Add "Open with Sublime Merge" to Windows Explorer context menu
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\smerge]
; %PROGRAMFILES%\Sublime Merge\sublime_merge.exe
"Icon"=hex(2):25,00,50,00,52,00,4f,00,47,00,52,00,41,00,4d,00,46,00,49,00,4c,\
00,45,00,53,00,25,00,5c,00,53,00,75,00,62,00,6c,00,69,00,6d,00,65,00,20,00,\
4d,00,65,00,72,00,67,00,65,00,5c,00,73,00,75,00,62,00,6c,00,69,00,6d,00,65,\
00,5f,00,6d,00,65,00,72,00,67,00,65,00,2e,00,65,00,78,00,65,00,00,00
@="Open with Sublime Merge"

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

@crypticsea
crypticsea / opus.c
Created February 23, 2021 06:30
opus build
// cl /I celt /I silk /I silk/float /I include /c opus.c
// lib opus.obj
#define OPUS_CPU_X64
#define USE_ALLOCA
#define OPUS_BUILD
#include "celt/bands.c"
#include "celt/celt.c"
#include "celt/celt_encoder.c"
@BruOp
BruOp / separating_axis_culling.hpp
Created February 9, 2021 18:18
Separate Axis culling
struct OBB
{
vec3 center = {};
vec3 extents = {};
// Orthonormal basis
union
{
vec3 axes[3] = {};
};
@GuyPaddock
GuyPaddock / concave_object_to_convex_objects_by_face.py
Last active December 28, 2024 01:04
Blender 2.91 Script for Convex Hull Decomposition into Separate Shapes Using Blender's Convex using "Split Concave Faces"
##
# A script to split simple, architectural geometry into convex pieces.
#
# This script makes use of Blender's built-in "Split Concave Faces" clean-up
# algorithm to break-up the faces of an object into convex pieces. The script
# attempts to identify all the edges that represent convex boundaries, and then
# it splits objects up along those edges. Each resulting piece is then made into
# a closed object by converting it into a convex hull.
#
# Be sure to select the object you wish the split into convex pieces before
@soufianekhiat
soufianekhiat / DearImGui.cpp
Last active April 16, 2024 19:03
Slider 2D & Slider 3D
bool InputVec2(char const* pLabel, ImVec2* pValue, ImVec2 const vMinValue, ImVec2 const vMaxValue, float const fScale /*= 1.0f*/)
{
return SliderScalar2D(pLabel, &pValue->x, &pValue->y, vMinValue.x, vMaxValue.x, vMinValue.y, vMaxValue.y, fScale);
}
bool InputVec3(char const* pLabel, ImVec4* pValue, ImVec4 const vMinValue, ImVec4 const vMaxValue, float const fScale /*= 1.0f*/)
{
return SliderScalar3D(pLabel, &pValue->x, &pValue->y, &pValue->z, vMinValue.x, vMaxValue.x, vMinValue.y, vMaxValue.y, vMinValue.z, vMaxValue.z, fScale);
}