Elffuss BraidHub

kikocis/VibeCodeViewer public

main · 571 BRawPermalink
1/**
2 * Full-screen textured quad shader
3 */
4
5const CopyShader = {
6
7 name: 'CopyShader',
8
9 uniforms: {
10
11 'tDiffuse': { value: null },
12 'opacity': { value: 1.0 }
13
14 },
15
16 vertexShader: /* glsl */`
17
18 varying vec2 vUv;
19
20 void main() {
21
22 vUv = uv;
23 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
24
25 }`,
26
27 fragmentShader: /* glsl */`
28
29 uniform float opacity;
30
31 uniform sampler2D tDiffuse;
32
33 varying vec2 vUv;
34
35 void main() {
36
37 vec4 texel = texture2D( tDiffuse, vUv );
38 gl_FragColor = opacity * texel;
39
40
41 }`
42
43};
44
45export { CopyShader };