mirror of
https://github.com/dyuri/repa-shader.git
synced 2026-09-23 19:44:21 +00:00
raw texture data
This commit is contained in:
+11
-12
@@ -26,20 +26,9 @@
|
||||
<repa-shader id="demoshader" fs-input="fsinput" alpha mouse snippets="noise.glsl" width=512 height=512>
|
||||
<repa-texture src="avatar.png" name="tex_avatar" wrap="mirrored_repeat"></repa-texture>
|
||||
<repa-texture src="futas.mp4"></repa-texture>
|
||||
<repa-texture filter="nearest">[[1, 2, 3, 4, 5, 6, 128, 255], [255, 128, 64, 32, 4, 3, 2, 1]]</repa-texture>
|
||||
<!-- repa-texture src="webcam"></repa-texture -->
|
||||
<!-- repa-texture ref="demoshader"></repa-texture -->
|
||||
<script type="x-shader/x-fragment">
|
||||
void main() {
|
||||
vec2 uv = gl_FragCoord.xy / resolution.xy;
|
||||
vec3 col = .5 + .5 * cos(uv.xyx + time + vec3(0, 2, 4));
|
||||
col *= texture(tex_avatar, 1.-uv).rgb;
|
||||
|
||||
float dist = distance(uv, mouse.xy);
|
||||
float circle = smoothstep(.1, .2, dist) * .5 + .5;
|
||||
vec4 acolor = vec4(col * circle, circle);
|
||||
outColor = vec4(acolor);
|
||||
}
|
||||
</script>
|
||||
<script type="x-shader/x-fragmen[DELETE]t">
|
||||
// https://twigl.app/?ol=true&ss=-NOAlYulOVLklxMdxBDx
|
||||
void main() {
|
||||
@@ -57,6 +46,16 @@ void main() {
|
||||
o+=pow(max(o-o,(a+.5)*.1*vec4(6,1,2,0)+.003/length(N)),o-o+.45);
|
||||
}
|
||||
</script>
|
||||
void main() {
|
||||
vec2 uv = gl_FragCoord.xy / resolution.xy;
|
||||
vec3 col = .5 + .5 * cos(uv.xyx + time + vec3(0, 2, 4));
|
||||
col *= texture(tex_avatar, uv).rgb;
|
||||
|
||||
float dist = distance(uv, mouse.xy);
|
||||
float circle = smoothstep(.1, .2, dist) * .5 + .5;
|
||||
vec4 acolor = vec4(col * circle, circle);
|
||||
outColor = vec4(acolor);
|
||||
}
|
||||
</repa-shader>
|
||||
<div>
|
||||
<textarea id="fsinput"></textarea>
|
||||
|
||||
Reference in New Issue
Block a user