forked from jamieowen/glsl-blend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
all.glsl
183 lines (180 loc) · 4.81 KB
/
all.glsl
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
#pragma glslify: blendHardMix = require(./hard-mix)
#pragma glslify: blendVividLight = require(./vivid-light)
#pragma glslify: blendLinearLight = require(./linear-light)
#pragma glslify: blendPinLight = require(./pin-light)
#pragma glslify: blendGlow = require(./glow)
#pragma glslify: blendHardLight = require(./hard-light)
#pragma glslify: blendPhoenix = require(./phoenix)
#pragma glslify: blendOverlay = require(./overlay)
#pragma glslify: blendNormal = require(./normal)
#pragma glslify: blendNegation = require(./negation)
#pragma glslify: blendMultiply = require(./multiply)
#pragma glslify: blendReflect = require(./reflect)
#pragma glslify: blendAverage = require(./average)
#pragma glslify: blendLinearBurn = require(./linear-burn)
#pragma glslify: blendLighten = require(./lighten)
#pragma glslify: blendScreen = require(./screen)
#pragma glslify: blendSoftLight = require(./soft-light)
#pragma glslify: blendSubtract = require(./subtract)
#pragma glslify: blendExclusion = require(./exclusion)
#pragma glslify: blendDifference = require(./difference)
#pragma glslify: blendDarken = require(./darken)
#pragma glslify: blendColorDodge = require(./color-dodge)
#pragma glslify: blendColorBurn = require(./color-burn)
#pragma glslify: blendAdd = require(./add)
#pragma glslify: blendLinearDodge = require(./linear-dodge)
vec3 blendMode( int mode, vec3 base, vec3 blend ){
if( mode == 1 ){
return blendAdd( base, blend );
}else
if( mode == 2 ){
return blendAverage( base, blend );
}else
if( mode == 3 ){
return blendColorBurn( base, blend );
}else
if( mode == 4 ){
return blendColorDodge( base, blend );
}else
if( mode == 5 ){
return blendDarken( base, blend );
}else
if( mode == 6 ){
return blendDifference( base, blend );
}else
if( mode == 7 ){
return blendExclusion( base, blend );
}else
if( mode == 8 ){
return blendGlow( base, blend );
}else
if( mode == 9 ){
return blendHardLight( base, blend );
}else
if( mode == 10 ){
return blendHardMix( base, blend );
}else
if( mode == 11 ){
return blendLighten( base, blend );
}else
if( mode == 12 ){
return blendLinearBurn( base, blend );
}else
if( mode == 13 ){
return blendLinearDodge( base, blend );
}else
if( mode == 14 ){
return blendLinearLight( base, blend );
}else
if( mode == 15 ){
return blendMultiply( base, blend );
}else
if( mode == 16 ){
return blendNegation( base, blend );
}else
if( mode == 17 ){
return blendNormal( base, blend );
}else
if( mode == 18 ){
return blendOverlay( base, blend );
}else
if( mode == 19 ){
return blendPhoenix( base, blend );
}else
if( mode == 20 ){
return blendPinLight( base, blend );
}else
if( mode == 21 ){
return blendReflect( base, blend );
}else
if( mode == 22 ){
return blendScreen( base, blend );
}else
if( mode == 23 ){
return blendSoftLight( base, blend );
}else
if( mode == 24 ){
return blendSubtract( base, blend );
}else
if( mode == 25 ){
return blendVividLight( base, blend );
}
}
vec3 blendMode( int mode, vec3 base, vec3 blend, float opacity ){
if( mode == 1 ){
return blendAdd( base, blend, opacity );
}else
if( mode == 2 ){
return blendAverage( base, blend, opacity );
}else
if( mode == 3 ){
return blendColorBurn( base, blend, opacity );
}else
if( mode == 4 ){
return blendColorDodge( base, blend, opacity );
}else
if( mode == 5 ){
return blendDarken( base, blend, opacity );
}else
if( mode == 6 ){
return blendDifference( base, blend, opacity );
}else
if( mode == 7 ){
return blendExclusion( base, blend, opacity );
}else
if( mode == 8 ){
return blendGlow( base, blend, opacity );
}else
if( mode == 9 ){
return blendHardLight( base, blend, opacity );
}else
if( mode == 10 ){
return blendHardMix( base, blend, opacity );
}else
if( mode == 11 ){
return blendLighten( base, blend, opacity );
}else
if( mode == 12 ){
return blendLinearBurn( base, blend, opacity );
}else
if( mode == 13 ){
return blendLinearDodge( base, blend, opacity );
}else
if( mode == 14 ){
return blendLinearLight( base, blend, opacity );
}else
if( mode == 15 ){
return blendMultiply( base, blend, opacity );
}else
if( mode == 16 ){
return blendNegation( base, blend, opacity );
}else
if( mode == 17 ){
return blendNormal( base, blend, opacity );
}else
if( mode == 18 ){
return blendOverlay( base, blend, opacity );
}else
if( mode == 19 ){
return blendPhoenix( base, blend, opacity );
}else
if( mode == 20 ){
return blendPinLight( base, blend, opacity );
}else
if( mode == 21 ){
return blendReflect( base, blend, opacity );
}else
if( mode == 22 ){
return blendScreen( base, blend, opacity );
}else
if( mode == 23 ){
return blendSoftLight( base, blend, opacity );
}else
if( mode == 24 ){
return blendSubtract( base, blend, opacity );
}else
if( mode == 25 ){
return blendVividLight( base, blend, opacity );
}
}
#pragma glslify:export(blendMode)