mirror of
https://github.com/libretro/slang-shaders.git
synced 2024-06-02 19:38:36 -04:00
182766b2a1
* 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
33 lines
964 B
Plaintext
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);
|
|
}
|