Skip to content

Instantly share code, notes, and snippets.

View LVutner's full-sized avatar
💭
zaebis

LVutner

💭
zaebis
View GitHub Profile
@vertver
vertver / faithful_ntsc.fx
Last active September 10, 2026 19:41
Faithful NTSC HLSL filter
/***************************************************************************************
* Copyright (C) Anton Kovalev (vertver), 2026. All rights reserved.
* HLSL single-pass NTSC filter
* MIT License
***************************************************************************************
* shout out to LMP88959, which implemented an awesome NTSC emulation (fixed-point).
* https://github.com/LMP88959/NTSC-CRT
***************************************************************************************/
//Original: https://gist.github.com/vertver/670a85babb52f20ba6b5e08e5f02f08e
@jdupuy
jdupuy / SampleVndf_GGX.cpp
Last active December 30, 2024 13:11
Sampling Visible GGX Normals with Spherical Caps
// Helper function: sample the visible hemisphere from a spherical cap
vec3 SampleVndf_Hemisphere(vec2 u, vec3 wi)
{
// sample a spherical cap in (-wi.z, 1]
float phi = 2.0f * M_PI * u.x;
float z = fma((1.0f - u.y), (1.0f + wi.z), -wi.z);
float sinTheta = sqrt(clamp(1.0f - z * z, 0.0f, 1.0f));
float x = sinTheta * cos(phi);
float y = sinTheta * sin(phi);
vec3 c = vec3(x, y, z);
@h3r2tic
h3r2tic / raymarch.hlsl
Last active October 31, 2026 01:22
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"
@d7samurai
d7samurai / .readme.md
Last active April 17, 2026 01:56
Minimal D3D11 elaborations II