-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAugmenta_duplicator.isf
More file actions
79 lines (64 loc) · 1.59 KB
/
Augmenta_duplicator.isf
File metadata and controls
79 lines (64 loc) · 1.59 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Augmenta dots example shader
// by Augmenta (https://www.augmenta.tech)
// Ben Kuperberg, Thomas Weissgerber and David-Alexandre Chanel
/*{
"CREDIT": "Joseph Fiola",
"DESCRIPTION": "",
"CATEGORIES": [
"Generator"
],
"INPUTS": [
{
"NAME": "augmentaData",
"TYPE": "image"
},
{
"NAME": "augmentaMaxNumObjects",
"TYPE": "float",
"DEFAULT": 20,
"MIN": 1,
"MAX": 20
},
{
"NAME": "inputImage",
"TYPE": "image"
},
{
"NAME": "size",
"TYPE": "float",
"DEFAULT": 0.35,
"MIN": 0,
"MAX": 1
}
]
}*/
vec4 drawImage(vec2 pos, float st, float weight, float radius)
{
vec4 result = vec4(0,0,0,0);
vec2 uv = gl_FragCoord.xy / RENDERSIZE.xy;
float dist = length(uv - pos);
vec2 distCoord = vec2(uv.x - pos.x, -(uv.y - pos.y));
vec2 imageCoordCenter = vec2(0.5);
vec2 look2;
look2 = distCoord;
distCoord = distCoord*0.5/size + imageCoordCenter;
vec4 tColor = IMG_NORM_PIXEL(inputImage, distCoord);
float factor = step(-radius, look2.x)*(1-step(radius, look2.x))* step(-radius, look2.y)*(1-step(radius, look2.y));
result = factor * tColor * weight;
return result;
}
void main()
{
// Init
vec4 colorOut = vec4(0.0,0.0,0.0,0.0);
for(float i=0;i<augmentaMaxNumObjects;++i)
{
// Get the point
float uvX = (i+.5)/augmentaMaxNumObjects;
vec4 point = texture2D(augmentaData, vec2(uvX,0));
// Draw
if(point.x == 0 || point.y == 0 || point.w == 0) continue;
colorOut += drawImage(point.xy, point.z, point.w, size);
}
gl_FragColor = colorOut;
}