[nostalgia/core/opengl] Cleanup fragment shader

This commit is contained in:
Gary Talent 2023-12-14 23:47:00 -06:00
parent 13ddbd981e
commit 1f2e9917f1

View File

@ -54,14 +54,8 @@ constexpr ox::StringView bgfshadTmpl = R"glsl(
uniform sampler2D image; uniform sampler2D image;
uniform vec2 fSrcImgSz; uniform vec2 fSrcImgSz;
uniform vec4 fPalette[256]; uniform vec4 fPalette[256];
vec2 pixelSz;
vec4 getColor(vec2 offset) {
vec2 p = fTexCoord + pixelSz * offset;
int idx = int(texture(image, p).rgb.r * 256);
return fPalette[idx];
}
void main() { void main() {
pixelSz = vec2(1, 1) / (fSrcImgSz); vec2 pixelSz = vec2(1, 1) / (fSrcImgSz);
vec2 pixelCoord = floor(fTexCoord / pixelSz) * pixelSz; vec2 pixelCoord = floor(fTexCoord / pixelSz) * pixelSz;
outColor = fPalette[int(texture(image, fTexCoord).rgb.r * 256)]; outColor = fPalette[int(texture(image, fTexCoord).rgb.r * 256)];
//outColor = vec4(0.0, 0.7, 1.0, 1.0); //outColor = vec4(0.0, 0.7, 1.0, 1.0);