Skip to content

Instantly share code, notes, and snippets.


butterw butterw

  • France
View GitHub Profile
TheRealMJP / Tex2DCatmullRom.hlsl
Last active Sep 1, 2020
An HLSL function for sampling a 2D texture with Catmull-Rom filtering, using 9 texture samples instead of 16
View Tex2DCatmullRom.hlsl
// The following code is licensed under the MIT license:
// Samples a texture with Catmull-Rom filtering, using 9 texture fetches instead of 16.
// See for more details
float4 SampleTextureCatmullRom(in Texture2D<float4> tex, in SamplerState linearSampler, in float2 uv, in float2 texSize)
// We're going to sample a a 4x4 grid of texels surrounding the target UV coordinate. We'll do this by rounding
// down the sample location to get the exact center of our "starting" texel. The starting texel will be at
// location [1, 1] in the grid, where [0, 0] is the top left corner.
float2 samplePos = uv * texSize;
igv / SSimSuperRes.glsl
Last active Nov 12, 2020
Usage: glsl-shaders="~~/SSimSuperRes.glsl"
View SSimSuperRes.glsl
// SSimSuperRes by Shiandow
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 3.0 of the License, or (at your option) any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
You can’t perform that action at this time.