-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtv.yaml
60 lines (57 loc) · 2.03 KB
/
tv.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import:
- ../block.yaml
styles:
filter-tv:
mix: [block]
doc:
author:
name: Patricio Gonzalez Vivo
twitter: patriciogv
version: 0.0.1
tangram-version: 0.0.7
licence: MIT
description: |
Apply an old TV effect to the style.
examples:
9845C:
url: https://tangrams.github.io/tangram-sandbox/styles/9845C.yaml
img: https://tangrams.github.io/tangram-sandbox/styles/9845C.png
ui:
shaders:
defines:
TV_FREQ:
type: number
label: Frequency
range:
min: 0.
max: 10.
step: 0.1
TV_SPEED:
type: number
label: Speed
range:
min: 0.
max: 10.
step: 0.1
TV_AMOUNT:
type: number
label: amount
range:
min: 0.
max: 1.
step: 0.01
TV_BLEND:
type: dropdownArray
label: 'blend mode'
values: ['ADD', 'SUBTRACT', 'MULTIPLY']
test:
tv: { uniforms: { u_tex0: "https://tangrams.github.io/blocks/test.jpg" }, blocks: { color: " color = texture2D(u_tex0,v_texcoord.xy);" } }
shaders:
defines:
TV_AMOUNT: 1.
TV_FREQ: 2.7
TV_SPEED: 5.
TV_BLEND: 'MULTIPLY'
blocks:
filter: |
color = color TV_BLEND (abs(cos((gl_FragCoord.y*(TV_FREQ/u_device_pixel_ratio)+u_time*TV_SPEED)))*TV_AMOUNT);