-
Notifications
You must be signed in to change notification settings - Fork 5
/
grid.yaml
41 lines (38 loc) · 1.32 KB
/
grid.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
import:
- ../block.yaml
- ../patterns/grid.yaml
styles:
filter-grid:
mix: [block, patterns-grid]
doc:
author:
name: Patricio Gonzalez Vivo
twitter: patriciogv
version: 0.0.1
tangram-version: 0.0.7
licence: MIT
description: |
Apply a grid filter to the syle.
ui:
shaders:
defines:
GRID_AMOUNT:
type: number
label: Amount
range:
min: 0.
max: 1.
step: 0.01
GRID_BLEND:
type: dropdownArray
label: 'Blend mode'
values: ['ADD', 'SUBTRACT', 'MULTIPLY']
test:
grid: { defines: { v_pos: 'v_texcoord' }, uniforms: { u_tex0: "https://tangrams.github.io/blocks/test.jpg" }, blocks: { color: " color = texture2D(u_tex0,v_texcoord.xy);" } }
shaders:
defines:
GRID_AMOUNT: .2
GRID_BLEND: 'ADD'
blocks:
filter: |
color.rgb = color.rgb GRID_BLEND (tileGrid()*GRID_AMOUNT);