slang-shaders/crt/shaders/cathode-retro/cathode-retro-util-downsample-2x-horz.slang
hunterk 182766b2a1
Point ntsc-adaptive to guest.r's version; add initial cathode-retro port (#514)
* initial cathode-retro port

* move ntsc-adaptive and most associated presets over to use guest.r's modified version

* fix some ctrl^H goofs

* add license blocks to cathode-retro shaders

* updates to cathode-retro; signal stuff is still broken but less so maybe
2023-11-27 07:59:22 -06:00

33 lines
964 B
Plaintext

#version 450
/*
A port of DeadlyRedCube's Cathode-Retro shader to slang format
based on a snapshot from https://github.com/DeadlyRedCube/Cathode-Retro circa Nov. 2023
ported by hunterk
license: MIT
*/
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Downsample an input image by 2x along a given axis by using a lanczos filter.
#include "slang_params.inc"
#include "cathode-retro-util-lanczos.inc"
#define inTexCoord vTexCoord
//DECLARE_TEXTURE2D(g_sourceTexture, g_sampler);
layout(set = 0, binding = 2) uniform sampler2D Source;
#define g_sourceTexture Source
// The direction that we're downsampling along. Should either be (1, 0) to downsample to a half-width texture or
// (0, 1) to downsample to a half-height texture.
vec2 g_filterDir = vec2(1., 0.);
void main()
{
FragColor = Lanczos2xDownsample(
g_sourceTexture,
inTexCoord,
g_filterDir);
}