mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 15:45:38 +00:00
ac7029fa24
We're about to add Direct3D support, where shaders are written in HLSL. Rather than write shaders twice (or more), convert them to a GLSL variant understood by the glslcc cross-compiler and generate the OpenGL ES 2.0 and HLSL variants. The HLSL is used by a future change. Signed-off-by: Elias Naur <mail@eliasnaur.com>
23 lines
463 B
GLSL
23 lines
463 B
GLSL
#version 310 es
|
|
|
|
// SPDX-License-Identifier: Unlicense OR MIT
|
|
|
|
precision mediump float;
|
|
|
|
{{.Header}}
|
|
|
|
// Use high precision to be pixel accurate for
|
|
// large cover atlases.
|
|
layout(location = 0) in highp vec2 vCoverUV;
|
|
layout(location = 1) in vec2 vUV;
|
|
|
|
layout(binding = 1) uniform sampler2D cover;
|
|
|
|
layout(location = 0) out vec4 fragColor;
|
|
|
|
void main() {
|
|
fragColor = {{.FetchColorExpr}};
|
|
float cover = abs(texture(cover, vCoverUV).r);
|
|
fragColor *= cover;
|
|
}
|