-
-
Save lain-dono/9e8a278dc697de4ed959ca18465aa94e to your computer and use it in GitHub Desktop.
flat-maze-web-fox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Request to access cookie or storage on “<URL>” was blocked because it came from a tracker and content blocking is enabled. 27 | |
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://googleads.g.doubleclick.net/pagead/id. (Reason: CORS request did not succeed). | |
Loading failed for the <script> with source “https://static.doubleclick.net/instream/ad_status.js”. HawWnuMn1mc:1:1 | |
OpenGL ES 3.0 Renderer: Mozilla index.js:7:32275 | |
Error: WebGL warning: drawArrays: Using format enabled by implicitly enabled extension: EXT_float_blend. For maximal portability enable it explicitly. index.js:7:261188 | |
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://googleads.g.doubleclick.net/pagead/id. (Reason: CORS request did not succeed). | |
1: #version 300 es index.js:7:32275 | |
2: #define USE_TEXTURE_RECT index.js:7:32275 | |
3: #define USE_RGBA_SHADOWS index.js:7:32275 | |
4: #define USE_MATERIAL index.js:7:32275 | |
5: #define COLOR_USED index.js:7:32275 | |
6: precision highp float; index.js:7:32275 | |
7: precision highp int; index.js:7:32275 | |
8: precision highp sampler2D; index.js:7:32275 | |
9: precision highp samplerCube; index.js:7:32275 | |
10: precision highp sampler2DArray; index.js:7:32275 | |
11: index.js:7:32275 | |
12: uniform highp sampler2D color_texture; // texunit:0 index.js:7:32275 | |
13: /* clang-format on */ index.js:7:32275 | |
14: uniform highp vec2 color_texpixel_size; index.js:7:32275 | |
15: uniform highp sampler2D normal_texture; // texunit:1 index.js:7:32275 | |
16: index.js:7:32275 | |
17: in highp vec2 uv_interp; index.js:7:32275 | |
18: in highp vec4 color_interp; index.js:7:32275 | |
19: index.js:7:32275 | |
20: #if defined(SCREEN_TEXTURE_USED) index.js:7:32275 | |
21: index.js:7:32275 | |
22: uniform sampler2D screen_texture; // texunit:-3 index.js:7:32275 | |
23: index.js:7:32275 | |
24: #endif index.js:7:32275 | |
25: index.js:7:32275 | |
26: #if defined(SCREEN_UV_USED) index.js:7:32275 | |
27: index.js:7:32275 | |
28: uniform vec2 screen_pixel_size; index.js:7:32275 | |
29: #endif index.js:7:32275 | |
30: index.js:7:32275 | |
31: layout(std140) uniform CanvasItemData { index.js:7:32275 | |
32: index.js:7:32275 | |
33: highp mat4 projection_matrix; index.js:7:32275 | |
34: highp float time; index.js:7:32275 | |
35: }; index.js:7:32275 | |
36: index.js:7:32275 | |
37: #ifdef USE_LIGHTING index.js:7:32275 | |
38: index.js:7:32275 | |
39: layout(std140) uniform LightData { index.js:7:32275 | |
40: index.js:7:32275 | |
41: highp mat4 light_matrix; index.js:7:32275 | |
42: highp mat4 light_local_matrix; index.js:7:32275 | |
43: highp mat4 shadow_matrix; index.js:7:32275 | |
44: highp vec4 light_color; index.js:7:32275 | |
45: highp vec4 light_shadow_color; index.js:7:32275 | |
46: highp vec2 light_pos; index.js:7:32275 | |
47: highp float shadowpixel_size; index.js:7:32275 | |
48: highp float shadow_gradient; index.js:7:32275 | |
49: highp float light_height; index.js:7:32275 | |
50: highp float light_outside_alpha; index.js:7:32275 | |
51: highp float shadow_distance_mult; index.js:7:32275 | |
52: }; index.js:7:32275 | |
53: index.js:7:32275 | |
54: uniform highp sampler2D light_texture; // texunit:-1 index.js:7:32275 | |
55: in vec4 light_uv_interp; index.js:7:32275 | |
56: in vec2 transformed_light_uv; index.js:7:32275 | |
57: index.js:7:32275 | |
58: in vec4 local_rot; index.js:7:32275 | |
59: index.js:7:32275 | |
60: #ifdef USE_SHADOWS index.js:7:32275 | |
61: index.js:7:32275 | |
62: uniform highp sampler2D shadow_texture; // texunit:-2 index.js:7:32275 | |
63: in highp vec2 pos; index.js:7:32275 | |
64: index.js:7:32275 | |
65: #endif index.js:7:32275 | |
66: index.js:7:32275 | |
67: const bool at_light_pass = true; index.js:7:32275 | |
68: #else index.js:7:32275 | |
69: const bool at_light_pass = false; index.js:7:32275 | |
70: #endif index.js:7:32275 | |
71: index.js:7:32275 | |
72: uniform highp vec4 final_modulate; index.js:7:32275 | |
73: index.js:7:32275 | |
74: layout(location = 0) out highp vec4 frag_color; index.js:7:32275 | |
75: index.js:7:32275 | |
76: #if defined(USE_MATERIAL) index.js:7:32275 | |
77: index.js:7:32275 | |
78: /* clang-format off */ index.js:7:32275 | |
79: layout(std140) uniform UniformData { index.js:7:32275 | |
80: float m_iTime; index.js:7:32275 | |
81: int m_iFrame; index.js:7:32275 | |
82: float m_scale_v; index.js:7:32275 | |
83: bool m_clean_scr; index.js:7:32275 | |
84: bool m_clean_scr5; index.js:7:32275 | |
85: bool m_clean_scr10; index.js:7:32275 | |
86: float m_mousedl; index.js:7:32275 | |
87: float m_scr_posx; index.js:7:32275 | |
88: float m_scr_posy; index.js:7:32275 | |
89: float m_speed_x; index.js:7:32275 | |
90: int m_last_index; index.js:7:32275 | |
91: bool m_spawn1; index.js:7:32275 | |
92: bool m_spawn2; index.js:7:32275 | |
93: vec2 m_gravity; index.js:7:32275 | |
94: bool m_spwan_b_once; index.js:7:32275 | |
95: int m_anim_state; index.js:7:32275 | |
96: vec3 m_iMouse; index.js:7:32275 | |
97: index.js:7:32275 | |
98: index.js:7:32275 | |
99: }; index.js:7:32275 | |
100: /* clang-format on */ index.js:7:32275 | |
101: index.js:7:32275 | |
102: #endif index.js:7:32275 | |
103: index.js:7:32275 | |
104: /* clang-format off */ index.js:7:32275 | |
105: uniform sampler2D m_iChannel0; index.js:7:32275 | |
106: uniform sampler2D m_iChannel1; index.js:7:32275 | |
107: uniform sampler2D m_iChannel2; index.js:7:32275 | |
108: uniform sampler2D m_iChannel3; index.js:7:32275 | |
109: uniform sampler2D m_logic; index.js:7:32275 | |
110: uniform sampler2D m_color_map; index.js:7:32275 | |
111: uniform sampler2D m_force_collision; index.js:7:32275 | |
112: uniform sampler2D m_maze_map; index.js:7:32275 | |
113: index.js:7:32275 | |
114: ivec2 m_extra_dat_vel(vec2 m_p) index.js:7:32275 | |
115: { index.js:7:32275 | |
116: vec4 m_tval=texelFetch(m_iChannel0, ivec2(m_p), 0); index.js:7:32275 | |
117: int m_gxff=255; index.js:7:32275 | |
118: return ivec2((abs(int(m_tval.z))&m_gxff), (abs(int(m_tval.w))&m_gxff)); } index.js:7:32275 | |
119: index.js:7:32275 | |
120: int m_get_id(vec2 m_p) index.js:7:32275 | |
121: { index.js:7:32275 | |
122: ivec2 m_v2=m_extra_dat_vel(m_p); index.js:7:32275 | |
123: int m_iret=((m_v2[0]<<8)|(m_v2[1]<<0)); index.js:7:32275 | |
124: return m_iret; } index.js:7:32275 | |
125: index.js:7:32275 | |
126: ivec4 m_save_id(int m_id) index.js:7:32275 | |
127: { index.js:7:32275 | |
128: int m_gxff=255; index.js:7:32275 | |
129: int m_gxf=15; index.js:7:32275 | |
130: int m_a=((m_id>>20)&m_gxf); index.js:7:32275 | |
131: int m_b=((m_id>>16)&m_gxf); index.js:7:32275 | |
132: int m_c=((m_id>>8)&m_gxff); index.js:7:32275 | |
133: int m_d=((m_id>>0)&m_gxff); index.js:7:32275 | |
134: return ivec4(m_a, m_b, m_c, m_d); } index.js:7:32275 | |
135: index.js:7:32275 | |
136: int m_encodeval_vel(ivec2 m_colz) index.js:7:32275 | |
137: { index.js:7:32275 | |
138: int m_gxffff=65535; index.js:7:32275 | |
139: int m_gxff=255; index.js:7:32275 | |
140: return int((((m_colz[0]&m_gxffff)<<8)|((m_colz[1]&m_gxff)<<0))); } index.js:7:32275 | |
141: index.js:7:32275 | |
142: vec2 m_pack_vel(vec2 m_vel, ivec2 m_extra_val) index.js:7:32275 | |
143: { index.js:7:32275 | |
144: int m_gxffff=65535; index.js:7:32275 | |
145: int m_v1=abs(int((m_vel.x*float(m_gxffff)))); index.js:7:32275 | |
146: int m_v2=abs(int((m_vel.y*float(m_gxffff)))); index.js:7:32275 | |
147: float m_vx=float(m_encodeval_vel(ivec2(m_v1, m_extra_val.x))); index.js:7:32275 | |
148: float m_vy=float(m_encodeval_vel(ivec2(m_v2, m_extra_val.y))); index.js:7:32275 | |
149: float m_si=1.0; index.js:7:32275 | |
150: if ((m_vel.x<0.0)) index.js:7:32275 | |
151: { index.js:7:32275 | |
152: m_si=-1.0; index.js:7:32275 | |
153: } index.js:7:32275 | |
154: float m_si2=1.0; index.js:7:32275 | |
155: if ((m_vel.y<0.0)) index.js:7:32275 | |
156: { index.js:7:32275 | |
157: m_si2=-1.0; index.js:7:32275 | |
158: } index.js:7:32275 | |
159: return vec2((m_vx*m_si), (m_vy*m_si2)); } index.js:7:32275 | |
160: index.js:7:32275 | |
161: vec4 m_save_all(vec2 m_pos, vec2 m_vel, int m_id) index.js:7:32275 | |
162: { index.js:7:32275 | |
163: ivec4 m_tid=m_save_id(m_id); index.js:7:32275 | |
164: ivec2 m_extra_data_pos=m_tid.xy; index.js:7:32275 | |
165: ivec2 m_extra_data_vel=m_tid.zw; index.js:7:32275 | |
166: vec2 m_pos_ret=m_pos; index.js:7:32275 | |
167: vec2 m_vel_ret=m_pack_vel(m_vel, m_extra_data_vel); index.js:7:32275 | |
168: return vec4(m_pos_ret, m_vel_ret); } index.js:7:32275 | |
169: index.js:7:32275 | |
170: float m_rand(vec2 m_co) index.js:7:32275 | |
171: { index.js:7:32275 | |
172: return fract((sin(dot(m_co.xy, vec2(12.9898,78.233)))*43758.5)); } index.js:7:32275 | |
173: index.js:7:32275 | |
174: int m_pack_type_hp(int m_type, int m_hp) index.js:7:32275 | |
175: { index.js:7:32275 | |
176: int m_gxff=255; index.js:7:32275 | |
177: return (((m_type&m_gxff)<<8)|((m_hp&m_gxff)<<0)); } index.js:7:32275 | |
178: index.js:7:32275 | |
179: ivec2 m_unpack_type_hp(int m_id) index.js:7:32275 | |
180: { index.js:7:32275 | |
181: int m_gxff=255; index.js:7:32275 | |
182: return ivec2(((m_id>>8)&m_gxff), ((m_id>>0)&m_gxff)); } index.js:7:32275 | |
183: index.js:7:32275 | |
184: int m_get_id_by_color(vec3 m_col) index.js:7:32275 | |
185: { index.js:7:32275 | |
186: int m_ret=0; index.js:7:32275 | |
187: if (all(greaterThan(m_col, vec3(0.75,0.75,0.75)))) index.js:7:32275 | |
188: { index.js:7:32275 | |
189: m_ret=(3+7); index.js:7:32275 | |
190: } index.js:7:32275 | |
191: else index.js:7:32275 | |
192: { index.js:7:32275 | |
193: if (all(greaterThan(m_col, vec3(0.45,0.45,0.45)))) index.js:7:32275 | |
194: { index.js:7:32275 | |
195: m_ret=3; index.js:7:32275 | |
196: } index.js:7:32275 | |
197: else index.js:7:32275 | |
198: { index.js:7:32275 | |
199: if (((m_col.r>0.75)&&all(lessThan(m_col.gb, vec2(0.25,0.25))))) index.js:7:32275 | |
200: { index.js:7:32275 | |
201: m_ret=(1+7); index.js:7:32275 | |
202: } index.js:7:32275 | |
203: else index.js:7:32275 | |
204: { index.js:7:32275 | |
205: if (((m_col.r>0.45)&&all(lessThan(m_col.gb, vec2(0.25,0.25))))) index.js:7:32275 | |
206: { index.js:7:32275 | |
207: m_ret=1; index.js:7:32275 | |
208: } index.js:7:32275 | |
209: else index.js:7:32275 | |
210: { index.js:7:32275 | |
211: if (((m_col.g>0.75)&&all(lessThan(m_col.rb, vec2(0.25,0.25))))) index.js:7:32275 | |
212: { index.js:7:32275 | |
213: m_ret=(4+7); index.js:7:32275 | |
214: } index.js:7:32275 | |
215: else index.js:7:32275 | |
216: { index.js:7:32275 | |
217: if (((m_col.g>0.45)&&all(lessThan(m_col.rb, vec2(0.25,0.25))))) index.js:7:32275 | |
218: { index.js:7:32275 | |
219: m_ret=4; index.js:7:32275 | |
220: } index.js:7:32275 | |
221: else index.js:7:32275 | |
222: { index.js:7:32275 | |
223: if (((m_col.b>0.75)&&all(lessThan(m_col.gr, vec2(0.25,0.25))))) index.js:7:32275 | |
224: { index.js:7:32275 | |
225: m_ret=(5+7); index.js:7:32275 | |
226: } index.js:7:32275 | |
227: else index.js:7:32275 | |
228: { index.js:7:32275 | |
229: if (((m_col.b>0.45)&&all(lessThan(m_col.gr, vec2(0.25,0.25))))) index.js:7:32275 | |
230: { index.js:7:32275 | |
231: m_ret=5; index.js:7:32275 | |
232: } index.js:7:32275 | |
233: else index.js:7:32275 | |
234: { index.js:7:32275 | |
235: if (((m_col.b<0.25)&&all(greaterThan(m_col.rg, vec2(0.75,0.75))))) index.js:7:32275 | |
236: { index.js:7:32275 | |
237: m_ret=(3+7); index.js:7:32275 | |
238: } index.js:7:32275 | |
239: else index.js:7:32275 | |
240: { index.js:7:32275 | |
241: if (((m_col.b<0.25)&&all(greaterThan(m_col.rg, vec2(0.45,0.45))))) index.js:7:32275 | |
242: { index.js:7:32275 | |
243: m_ret=3; index.js:7:32275 | |
244: } index.js:7:32275 | |
245: else index.js:7:32275 | |
246: { index.js:7:32275 | |
247: if (((m_col.r<0.25)&&all(greaterThan(m_col.gb, vec2(0.75,0.75))))) index.js:7:32275 | |
248: { index.js:7:32275 | |
249: m_ret=(6+7); index.js:7:32275 | |
250: } index.js:7:32275 | |
251: else index.js:7:32275 | |
252: { index.js:7:32275 | |
253: if (((m_col.r<0.25)&&all(greaterThan(m_col.gb, vec2(0.45,0.45))))) index.js:7:32275 | |
254: { index.js:7:32275 | |
255: m_ret=6; index.js:7:32275 | |
256: } index.js:7:32275 | |
257: else index.js:7:32275 | |
258: { index.js:7:32275 | |
259: if (((m_col.g<0.25)&&all(greaterThan(m_col.rb, vec2(0.75,0.75))))) index.js:7:32275 | |
260: { index.js:7:32275 | |
261: m_ret=(0+7); index.js:7:32275 | |
262: } index.js:7:32275 | |
263: else index.js:7:32275 | |
264: { index.js:7:32275 | |
265: if (((m_col.g<0.25)&&all(greaterThan(m_col.rb, vec2(0.45,0.45))))) index.js:7:32275 | |
266: { index.js:7:32275 | |
267: m_ret=0; index.js:7:32275 | |
268: } index.js:7:32275 | |
269: } index.js:7:32275 | |
270: } index.js:7:32275 | |
271: } index.js:7:32275 | |
272: } index.js:7:32275 | |
273: } index.js:7:32275 | |
274: } index.js:7:32275 | |
275: } index.js:7:32275 | |
276: } index.js:7:32275 | |
277: } index.js:7:32275 | |
278: } index.js:7:32275 | |
279: } index.js:7:32275 | |
280: } index.js:7:32275 | |
281: } index.js:7:32275 | |
282: return m_ret; } index.js:7:32275 | |
283: index.js:7:32275 | |
284: vec2 m_get_force(vec2 m_p) index.js:7:32275 | |
285: { index.js:7:32275 | |
286: vec4 m_tval=texelFetch(m_force_collision, ivec2(int(m_p.x), int((0.0+m_p.y))), 0); index.js:7:32275 | |
287: return m_tval.xy; } index.js:7:32275 | |
288: index.js:7:32275 | |
289: vec2 m_get_force2(vec2 m_p) index.js:7:32275 | |
290: { index.js:7:32275 | |
291: vec4 m_tval=texelFetch(m_force_collision, ivec2(int(m_p.x), int((0.0+m_p.y))), 0); index.js:7:32275 | |
292: return m_tval.zw; } index.js:7:32275 | |
293: index.js:7:32275 | |
294: vec2 m_tile_uv(vec2 m_uv, vec2 m_iResolution) index.js:7:32275 | |
295: { index.js:7:32275 | |
296: ivec2 m_tuv=ivec2((m_uv*vec2(320.0,180.0))); index.js:7:32275 | |
297: return (vec2(m_tuv)/vec2(320.0,180.0)); } index.js:7:32275 | |
298: index.js:7:32275 | |
299: bool m_get_map(vec2 m_uv, vec2 m_iResolution) index.js:7:32275 | |
300: { index.js:7:32275 | |
301: return (texture(m_maze_map, m_tile_uv(m_uv, m_iResolution)).r>0.5); } index.js:7:32275 | |
302: index.js:7:32275 | |
303: vec3 m_get_col_map(vec2 m_uv, vec2 m_iResolution) index.js:7:32275 | |
304: { index.js:7:32275 | |
305: return texture(m_color_map, m_tile_uv(m_uv, m_iResolution)).rgb; } index.js:7:32275 | |
306: index.js:7:32275 | |
307: vec4 m_spawner(vec2 m_uv, vec2 m_middle, vec2 m_iResolution) index.js:7:32275 | |
308: { index.js:7:32275 | |
309: ivec2 m_iv=ivec2(m_middle); index.js:7:32275 | |
310: vec4 m_retc=vec4(-1.0,0.0,0.0,0.0); index.js:7:32275 | |
311: if ((((((m_iv.x%2)==0)&&((m_iv.y%2)==0))&&!m_get_map(m_uv, m_iResolution))&&((((m_iv.x>0)&&(m_iv.y>0))&&(m_iv.x<(1280-1)))&&(m_iv.y<(720-1))))) index.js:7:32275 | |
312: { index.js:7:32275 | |
313: { index.js:7:32275 | |
314: int m_id=m_pack_type_hp((4+m_get_id_by_color(m_get_col_map(m_uv, m_iResolution))), 1); index.js:7:32275 | |
315: vec2 m_pos=(m_middle+((m_rand(vec2(m_iv))-0.5)*0.25)); index.js:7:32275 | |
316: vec2 m_vel=vec2(0.0,0.0); index.js:7:32275 | |
317: m_retc=m_save_all(m_pos, m_vel, m_id); index.js:7:32275 | |
318: } index.js:7:32275 | |
319: ; index.js:7:32275 | |
320: } index.js:7:32275 | |
321: return m_retc; } index.js:7:32275 | |
322: index.js:7:32275 | |
323: vec2 m_my_normalize(vec2 m_v) index.js:7:32275 | |
324: { index.js:7:32275 | |
325: float m_len=length(m_v); index.js:7:32275 | |
326: if ((m_len==0.0)) index.js:7:32275 | |
327: { index.js:7:32275 | |
328: return vec2(0.0,0.0); } index.js:7:32275 | |
329: return (m_v/m_len); } index.js:7:32275 | |
330: index.js:7:32275 | |
331: vec2 m_get_screen_dir() index.js:7:32275 | |
332: { index.js:7:32275 | |
333: return texelFetch(m_logic, ivec2(0,0), 0).zw; } index.js:7:32275 | |
334: index.js:7:32275 | |
335: vec4 m_get_dir_by_anim() index.js:7:32275 | |
336: { index.js:7:32275 | |
337: vec2 m_dir=vec2(0.0,1.0); index.js:7:32275 | |
338: vec2 m_rdir=m_get_screen_dir(); index.js:7:32275 | |
339: vec2 m_tdir=m_my_normalize(m_rdir); index.js:7:32275 | |
340: if ((length(m_tdir)<=0.01)) index.js:7:32275 | |
341: { index.js:7:32275 | |
342: { index.js:7:32275 | |
343: if (((m_anim_state==0)||(m_anim_state==4))) index.js:7:32275 | |
344: { index.js:7:32275 | |
345: { index.js:7:32275 | |
346: m_dir=vec2(-1.0,0.0); index.js:7:32275 | |
347: } index.js:7:32275 | |
348: ; index.js:7:32275 | |
349: } index.js:7:32275 | |
350: else index.js:7:32275 | |
351: { index.js:7:32275 | |
352: if (((m_anim_state==1)||(m_anim_state==5))) index.js:7:32275 | |
353: { index.js:7:32275 | |
354: { index.js:7:32275 | |
355: m_dir=vec2(1.0,0.0); index.js:7:32275 | |
356: } index.js:7:32275 | |
357: ; index.js:7:32275 | |
358: } index.js:7:32275 | |
359: else index.js:7:32275 | |
360: { index.js:7:32275 | |
361: if (((m_anim_state==2)||(m_anim_state==6))) index.js:7:32275 | |
362: { index.js:7:32275 | |
363: { index.js:7:32275 | |
364: m_dir=vec2(0.0,1.0); index.js:7:32275 | |
365: } index.js:7:32275 | |
366: ; index.js:7:32275 | |
367: } index.js:7:32275 | |
368: else index.js:7:32275 | |
369: { index.js:7:32275 | |
370: if (((m_anim_state==3)||(m_anim_state==7))) index.js:7:32275 | |
371: { index.js:7:32275 | |
372: { index.js:7:32275 | |
373: m_dir=vec2(0.0,-1.0); index.js:7:32275 | |
374: } index.js:7:32275 | |
375: ; index.js:7:32275 | |
376: } index.js:7:32275 | |
377: } index.js:7:32275 | |
378: } index.js:7:32275 | |
379: } index.js:7:32275 | |
380: } index.js:7:32275 | |
381: ; index.js:7:32275 | |
382: } index.js:7:32275 | |
383: else index.js:7:32275 | |
384: { index.js:7:32275 | |
385: m_dir=m_tdir; index.js:7:32275 | |
386: } index.js:7:32275 | |
387: return vec4(m_dir, m_rdir); } index.js:7:32275 | |
388: index.js:7:32275 | |
389: vec4 m_spawner_bullets(vec2 m_uv, vec2 m_middle, vec2 m_iResolution) index.js:7:32275 | |
390: { index.js:7:32275 | |
391: ivec2 m_iv=ivec2(m_middle); index.js:7:32275 | |
392: int m_spawner_cd=35; index.js:7:32275 | |
393: vec4 m_retc=vec4(-1.0,0.0,0.0,0.0); index.js:7:32275 | |
394: if (((m_iFrame%m_spawner_cd)!=0)) index.js:7:32275 | |
395: { index.js:7:32275 | |
396: return m_retc; } index.js:7:32275 | |
397: vec2 m_nval=m_get_force(vec2(m_iv.xy)); index.js:7:32275 | |
398: if ((((((m_iv.x%2)==0)&&((m_iv.y%2)==0))&&((((m_iv.x>0)&&(m_iv.y>0))&&(m_iv.x<(1280-1)))&&(m_iv.y<(720-1))))&&((abs(m_nval.x)+abs(m_nval.y))>0.0))) index.js:7:32275 | |
399: { index.js:7:32275 | |
400: { index.js:7:32275 | |
401: vec4 m_dirl=m_get_dir_by_anim(); index.js:7:32275 | |
402: vec2 m_dir=m_dirl.xy; index.js:7:32275 | |
403: vec2 m_rdir=m_dirl.zw; index.js:7:32275 | |
404: int m_ttype=40; index.js:7:32275 | |
405: if (((m_dir.y>0.5)&&(m_dirl.y>abs(m_dirl.x)))) index.js:7:32275 | |
406: { index.js:7:32275 | |
407: m_ttype=42; index.js:7:32275 | |
408: } index.js:7:32275 | |
409: else index.js:7:32275 | |
410: { index.js:7:32275 | |
411: if (((m_dir.y<0.0)&&(abs(m_dirl.y)>abs(m_dirl.x)))) index.js:7:32275 | |
412: { index.js:7:32275 | |
413: m_ttype=43; index.js:7:32275 | |
414: } index.js:7:32275 | |
415: else index.js:7:32275 | |
416: { index.js:7:32275 | |
417: if (((m_dir.x>0.5)&&(m_dirl.x>abs(m_dirl.y)))) index.js:7:32275 | |
418: { index.js:7:32275 | |
419: m_ttype=40; index.js:7:32275 | |
420: } index.js:7:32275 | |
421: else index.js:7:32275 | |
422: { index.js:7:32275 | |
423: if (((m_dir.x<0.0)&&(abs(m_dirl.x)>abs(m_dirl.y)))) index.js:7:32275 | |
424: { index.js:7:32275 | |
425: m_ttype=41; index.js:7:32275 | |
426: } index.js:7:32275 | |
427: } index.js:7:32275 | |
428: } index.js:7:32275 | |
429: } index.js:7:32275 | |
430: int m_id=m_pack_type_hp(m_ttype, 150); index.js:7:32275 | |
431: vec2 m_pos=(m_middle+((m_rand(vec2(m_iv))-0.5)*0.25)); index.js:7:32275 | |
432: vec2 m_vel=(vec2(0.0,0.0)+m_dir); index.js:7:32275 | |
433: m_retc=m_save_all(m_pos, m_vel, m_id); index.js:7:32275 | |
434: } index.js:7:32275 | |
435: ; index.js:7:32275 | |
436: } index.js:7:32275 | |
437: return m_retc; } index.js:7:32275 | |
438: index.js:7:32275 | |
439: ivec2 m_index_x(int m_id) index.js:7:32275 | |
440: { index.js:7:32275 | |
441: ivec2 m_p_res=ivec2(1280,720); index.js:7:32275 | |
442: int m_x=(m_id%m_p_res.x); index.js:7:32275 | |
443: int m_y=(m_id/m_p_res.x); index.js:7:32275 | |
444: return ivec2(m_x, m_y); } index.js:7:32275 | |
445: index.js:7:32275 | |
446: bool m_is_alive(int m_id) index.js:7:32275 | |
447: { index.js:7:32275 | |
448: return true; if ((texelFetch(m_iChannel1, m_index_x(m_id), 0).y>0.0)) index.js:7:32275 | |
449: { index.js:7:32275 | |
450: return true; } index.js:7:32275 | |
451: return false; } index.js:7:32275 | |
452: index.js:7:32275 | |
453: float m_decodeval_vel(int m_varz) index.js:7:32275 | |
454: { index.js:7:32275 | |
455: int m_iret=0; index.js:7:32275 | |
456: m_iret=(m_varz>>8); index.js:7:32275 | |
457: int m_gxffff=65535; index.js:7:32275 | |
458: return (float(m_iret)/float(m_gxffff)); } index.js:7:32275 | |
459: index.js:7:32275 | |
460: vec4 m_getV(vec2 m_p) index.js:7:32275 | |
461: { index.js:7:32275 | |
462: if (((m_p.x<0.001)||(m_p.y<0.001))) index.js:7:32275 | |
463: { index.js:7:32275 | |
464: return vec4(0.0,0.0,0.0,0.0); } index.js:7:32275 | |
465: vec4 m_tval=texelFetch(m_iChannel0, ivec2(m_p), 0); index.js:7:32275 | |
466: if ((m_tval.x<0.0)) index.js:7:32275 | |
467: { index.js:7:32275 | |
468: return vec4(-1.0,0.0,0.0,0.0); } index.js:7:32275 | |
469: float m_p1=m_tval.x; index.js:7:32275 | |
470: float m_p2=m_tval.y; index.js:7:32275 | |
471: float m_v1=m_decodeval_vel(abs(int(m_tval.z))); index.js:7:32275 | |
472: float m_v2=m_decodeval_vel(abs(int(m_tval.w))); index.js:7:32275 | |
473: float m_si=1.0; index.js:7:32275 | |
474: if ((m_tval.z<0.0)) index.js:7:32275 | |
475: { index.js:7:32275 | |
476: m_si=-1.0; index.js:7:32275 | |
477: } index.js:7:32275 | |
478: float m_si2=1.0; index.js:7:32275 | |
479: if ((m_tval.w<0.0)) index.js:7:32275 | |
480: { index.js:7:32275 | |
481: m_si2=-1.0; index.js:7:32275 | |
482: } index.js:7:32275 | |
483: vec2 m_unp=vec2((m_si*m_v1), (m_si2*m_v2)); index.js:7:32275 | |
484: return vec4(vec2(m_p1, m_p2), m_unp.xy); } index.js:7:32275 | |
485: index.js:7:32275 | |
486: ivec2 m_type_hp_logic(ivec2 m_type_hp, vec2 m_vel) index.js:7:32275 | |
487: { index.js:7:32275 | |
488: int m_real_index=m_type_hp.x; index.js:7:32275 | |
489: if ((((((m_real_index>=4)&&(m_real_index!=40))&&(m_real_index!=41))&&(m_real_index!=42))&&(m_real_index!=43))) index.js:7:32275 | |
490: { index.js:7:32275 | |
491: { index.js:7:32275 | |
492: int m_tid=(m_real_index-4); index.js:7:32275 | |
493: if ((m_tid>=20)) index.js:7:32275 | |
494: { index.js:7:32275 | |
495: { index.js:7:32275 | |
496: m_type_hp.y+=-1; index.js:7:32275 | |
497: if ((m_type_hp.y<=0)) index.js:7:32275 | |
498: { index.js:7:32275 | |
499: { index.js:7:32275 | |
500: m_type_hp.x=3; index.js:7:32275 | |
501: m_type_hp.y=0; index.js:7:32275 | |
502: } index.js:7:32275 | |
503: ; index.js:7:32275 | |
504: } index.js:7:32275 | |
505: } index.js:7:32275 | |
506: ; index.js:7:32275 | |
507: } index.js:7:32275 | |
508: } index.js:7:32275 | |
509: ; index.js:7:32275 | |
510: } index.js:7:32275 | |
511: else index.js:7:32275 | |
512: { index.js:7:32275 | |
513: if ((m_real_index==3)) index.js:7:32275 | |
514: { index.js:7:32275 | |
515: { index.js:7:32275 | |
516: if (((m_iFrame%(13-int((6.0*min((length(m_vel)*20.0), 1.0)))))==0)) index.js:7:32275 | |
517: { index.js:7:32275 | |
518: { index.js:7:32275 | |
519: m_type_hp.y+=1; index.js:7:32275 | |
520: m_type_hp.y=(m_type_hp.y%10); index.js:7:32275 | |
521: } index.js:7:32275 | |
522: ; index.js:7:32275 | |
523: } index.js:7:32275 | |
524: } index.js:7:32275 | |
525: ; index.js:7:32275 | |
526: } index.js:7:32275 | |
527: else index.js:7:32275 | |
528: { index.js:7:32275 | |
529: if ((m_real_index==2)) index.js:7:32275 | |
530: { index.js:7:32275 | |
531: { index.js:7:32275 | |
532: if (((m_iFrame%(13-int((6.0*min((length(m_vel)*20.0), 1.0)))))==0)) index.js:7:32275 | |
533: { index.js:7:32275 | |
534: { index.js:7:32275 | |
535: m_type_hp.y+=1; index.js:7:32275 | |
536: m_type_hp.y=(m_type_hp.y%10); index.js:7:32275 | |
537: } index.js:7:32275 | |
538: ; index.js:7:32275 | |
539: } index.js:7:32275 | |
540: } index.js:7:32275 | |
541: ; index.js:7:32275 | |
542: } index.js:7:32275 | |
543: else index.js:7:32275 | |
544: { index.js:7:32275 | |
545: if ((m_real_index==1)) index.js:7:32275 | |
546: { index.js:7:32275 | |
547: { index.js:7:32275 | |
548: if (((m_iFrame%(13-int((6.0*min((length(m_vel)*20.0), 1.0)))))==0)) index.js:7:32275 | |
549: { index.js:7:32275 | |
550: { index.js:7:32275 | |
551: m_type_hp.y+=1; index.js:7:32275 | |
552: m_type_hp.y=(m_type_hp.y%15); index.js:7:32275 | |
553: } index.js:7:32275 | |
554: ; index.js:7:32275 | |
555: } index.js:7:32275 | |
556: } index.js:7:32275 | |
557: ; index.js:7:32275 | |
558: } index.js:7:32275 | |
559: else index.js:7:32275 | |
560: { index.js:7:32275 | |
561: if (((((m_real_index==40)||(m_real_index==41))||(m_real_index==42))||(m_real_index==43))) index.js:7:32275 | |
562: { index.js:7:32275 | |
563: { index.js:7:32275 | |
564: if (((m_iFrame%2)==0)) index.js:7:32275 | |
565: { index.js:7:32275 | |
566: { index.js:7:32275 | |
567: m_type_hp.y+=-1; index.js:7:32275 | |
568: m_type_hp.y=max(m_type_hp.y, 0); index.js:7:32275 | |
569: } index.js:7:32275 | |
570: ; index.js:7:32275 | |
571: } index.js:7:32275 | |
572: } index.js:7:32275 | |
573: ; index.js:7:32275 | |
574: } index.js:7:32275 | |
575: } index.js:7:32275 | |
576: } index.js:7:32275 | |
577: } index.js:7:32275 | |
578: } index.js:7:32275 | |
579: return m_type_hp; } index.js:7:32275 | |
580: index.js:7:32275 | |
581: void m_sim_step(out vec4 m_fragColor, vec2 m_fragCoord, vec2 m_iResolution) index.js:7:32275 | |
582: { index.js:7:32275 | |
583: vec2 m_uv=(m_fragCoord/m_iResolution); index.js:7:32275 | |
584: float m_BALL_SIZE=0.9; index.js:7:32275 | |
585: float m_BALL_D=(2.0*m_BALL_SIZE); index.js:7:32275 | |
586: float m_VEL_LIMIT=(0.2*m_BALL_SIZE); index.js:7:32275 | |
587: vec2 m_G=m_gravity; index.js:7:32275 | |
588: float m_E_FORCE=1.9; index.js:7:32275 | |
589: float m_M=(0.6*m_BALL_SIZE); index.js:7:32275 | |
590: float m_DAMP_K=0.98; index.js:7:32275 | |
591: float m_SQ_K=0.0; index.js:7:32275 | |
592: float m_player_F=0.025; index.js:7:32275 | |
593: float m_monster_F=0.15; index.js:7:32275 | |
594: float m_slow_down=0.925; index.js:7:32275 | |
595: vec2 m_middle=m_fragCoord; index.js:7:32275 | |
596: int m_self_id=0; index.js:7:32275 | |
597: if ((false||(m_iFrame<=10))) index.js:7:32275 | |
598: { index.js:7:32275 | |
599: { index.js:7:32275 | |
600: ivec2 m_iv=ivec2(m_fragCoord); index.js:7:32275 | |
601: if ((((((m_iv.x%2)==0)&&((m_iv.y%2)==0))&&!m_get_map(m_uv, m_iResolution))&&((((m_iv.x>0)&&(m_iv.y>0))&&(m_iv.x<(1280-1)))&&(m_iv.y<(720-1))))) index.js:7:32275 | |
602: { index.js:7:32275 | |
603: { index.js:7:32275 | |
604: int m_id=m_pack_type_hp((4+m_get_id_by_color(m_get_col_map(m_uv, m_iResolution))), 1); index.js:7:32275 | |
605: vec2 m_pos=(m_middle+((m_rand(m_fragCoord)-0.5)*0.25)); index.js:7:32275 | |
606: vec2 m_vel=vec2(0.0,0.0); index.js:7:32275 | |
607: m_fragColor=m_save_all(m_pos, m_vel, m_id); index.js:7:32275 | |
608: } index.js:7:32275 | |
609: ; index.js:7:32275 | |
610: } index.js:7:32275 | |
611: else index.js:7:32275 | |
612: { index.js:7:32275 | |
613: { index.js:7:32275 | |
614: m_fragColor=vec4(-1.0,0.0,0.0,0.0); index.js:7:32275 | |
615: } index.js:7:32275 | |
616: ; index.js:7:32275 | |
617: } index.js:7:32275 | |
618: } index.js:7:32275 | |
619: ; index.js:7:32275 | |
620: } index.js:7:32275 | |
621: else index.js:7:32275 | |
622: { index.js:7:32275 | |
623: { index.js:7:32275 | |
624: vec4 m_v=vec4(0.0,0.0,0.0,0.0); index.js:7:32275 | |
625: vec2 m_lp=vec2(-10.0,-10.0); index.js:7:32275 | |
626: bool m_br=false; index.js:7:32275 | |
627: for (int m_x=-1;(m_x<=1);m_x++) index.js:7:32275 | |
628: { index.js:7:32275 | |
629: { index.js:7:32275 | |
630: if (m_br) index.js:7:32275 | |
631: { index.js:7:32275 | |
632: break; } index.js:7:32275 | |
633: for (int m_y=-1;(m_y<=1);m_y++) index.js:7:32275 | |
634: { index.js:7:32275 | |
635: { index.js:7:32275 | |
636: vec2 m_np=(m_fragCoord+vec2(float(m_x), float(m_y))); index.js:7:32275 | |
637: vec4 m_p=m_getV(m_np); index.js:7:32275 | |
638: if ((trunc(m_middle)==trunc(m_p.xy))) index.js:7:32275 | |
639: { index.js:7:32275 | |
640: { index.js:7:32275 | |
641: m_v=m_p; index.js:7:32275 | |
642: m_lp=m_np; index.js:7:32275 | |
643: m_br=true; index.js:7:32275 | |
644: break; } index.js:7:32275 | |
645: ; index.js:7:32275 | |
646: } index.js:7:32275 | |
647: } index.js:7:32275 | |
648: ; index.js:7:32275 | |
649: } index.js:7:32275 | |
650: } index.js:7:32275 | |
651: ; index.js:7:32275 | |
652: } index.js:7:32275 | |
653: if (m_br) index.js:7:32275 | |
654: { index.js:7:32275 | |
655: { index.js:7:32275 | |
656: m_self_id=m_get_id(trunc(m_lp.xy)); index.js:7:32275 | |
657: ivec2 m_type_hp=m_unpack_type_hp(m_self_id); index.js:7:32275 | |
658: int m_real_index=m_type_hp.x; index.js:7:32275 | |
659: if (!m_is_alive(m_self_id)) index.js:7:32275 | |
660: { index.js:7:32275 | |
661: { index.js:7:32275 | |
662: m_fragColor=vec4(-1.0,0.0,0.0,0.0); index.js:7:32275 | |
663: return; } index.js:7:32275 | |
664: ; index.js:7:32275 | |
665: } index.js:7:32275 | |
666: vec2 m_dr=vec2(0.0,0.0); index.js:7:32275 | |
667: float m_stress=0.0; index.js:7:32275 | |
668: bool m_need_upd=false; index.js:7:32275 | |
669: for (int m_x=-2;(m_x<=2);m_x++) index.js:7:32275 | |
670: { index.js:7:32275 | |
671: { index.js:7:32275 | |
672: for (int m_y=-2;(m_y<=2);m_y++) index.js:7:32275 | |
673: { index.js:7:32275 | |
674: { index.js:7:32275 | |
675: if (((m_x!=0)||(m_y!=0))) index.js:7:32275 | |
676: { index.js:7:32275 | |
677: { index.js:7:32275 | |
678: vec4 m_p=m_getV((m_fragCoord+vec2(float(m_x), float(m_y)))); index.js:7:32275 | |
679: if ((m_p.x>0.0)) index.js:7:32275 | |
680: { index.js:7:32275 | |
681: { index.js:7:32275 | |
682: vec2 m_d2=(m_v.xy-m_p.xy); index.js:7:32275 | |
683: float m_l=length(m_d2); index.js:7:32275 | |
684: float m_f=(m_BALL_D-m_l); index.js:7:32275 | |
685: if (((m_l>=(0.001*m_BALL_SIZE))&&(m_f>0.0))) index.js:7:32275 | |
686: { index.js:7:32275 | |
687: { index.js:7:32275 | |
688: if ((((((m_real_index==40)||(m_real_index==41))||(m_real_index==42))||(m_real_index==43))&&(m_type_hp.y>22))) index.js:7:32275 | |
689: { index.js:7:32275 | |
690: { index.js:7:32275 | |
691: int m_h_id=m_get_id((m_fragCoord+vec2(float(m_x), float(m_y)))); index.js:7:32275 | |
692: ivec2 m_htype_hp=m_unpack_type_hp(m_h_id); index.js:7:32275 | |
693: int m_hreal_index=m_htype_hp.x; index.js:7:32275 | |
694: if (((((m_hreal_index!=40)&&(m_hreal_index!=41))&&(m_hreal_index!=42))&&(m_hreal_index!=43))) index.js:7:32275 | |
695: { index.js:7:32275 | |
696: m_type_hp.y=22; index.js:7:32275 | |
697: } index.js:7:32275 | |
698: } index.js:7:32275 | |
699: ; index.js:7:32275 | |
700: } index.js:7:32275 | |
701: else index.js:7:32275 | |
702: { index.js:7:32275 | |
703: { index.js:7:32275 | |
704: if (!m_need_upd) index.js:7:32275 | |
705: { index.js:7:32275 | |
706: { index.js:7:32275 | |
707: int m_h_id=m_get_id((m_fragCoord+vec2(float(m_x), float(m_y)))); index.js:7:32275 | |
708: ivec2 m_htype_hp=m_unpack_type_hp(m_h_id); index.js:7:32275 | |
709: int m_hreal_index=m_htype_hp.x; index.js:7:32275 | |
710: if ((((((m_hreal_index==40)||(m_hreal_index==41))||(m_hreal_index==42))||(m_hreal_index==43))&&(m_htype_hp.y>22))) index.js:7:32275 | |
711: { index.js:7:32275 | |
712: { index.js:7:32275 | |
713: m_need_upd=true; index.js:7:32275 | |
714: } index.js:7:32275 | |
715: ; index.js:7:32275 | |
716: } index.js:7:32275 | |
717: } index.js:7:32275 | |
718: ; index.js:7:32275 | |
719: } index.js:7:32275 | |
720: } index.js:7:32275 | |
721: ; index.js:7:32275 | |
722: } index.js:7:32275 | |
723: float m_f2=(m_f/m_BALL_D); index.js:7:32275 | |
724: m_f2+=((m_SQ_K*m_f2)*m_f2); index.js:7:32275 | |
725: m_f2*=m_BALL_D; index.js:7:32275 | |
726: vec2 m_force_part=((m_E_FORCE*normalize(m_d2))*m_f2); index.js:7:32275 | |
727: m_stress+=(abs(m_force_part.x)+abs(m_force_part.y)); index.js:7:32275 | |
728: m_dr+=m_force_part; index.js:7:32275 | |
729: } index.js:7:32275 | |
730: ; index.js:7:32275 | |
731: } index.js:7:32275 | |
732: } index.js:7:32275 | |
733: ; index.js:7:32275 | |
734: } index.js:7:32275 | |
735: } index.js:7:32275 | |
736: ; index.js:7:32275 | |
737: } index.js:7:32275 | |
738: } index.js:7:32275 | |
739: ; index.js:7:32275 | |
740: } index.js:7:32275 | |
741: } index.js:7:32275 | |
742: ; index.js:7:32275 | |
743: } index.js:7:32275 | |
744: vec2 m_nval=((m_player_F*max(m_stress, 1.0))*m_get_force(trunc(m_lp.xy))); index.js:7:32275 | |
745: if (((abs(m_nval.x)+abs(m_nval.y))>0.0)) index.js:7:32275 | |
746: { index.js:7:32275 | |
747: { index.js:7:32275 | |
748: if ((((((m_real_index>=4)&&(m_real_index!=40))&&(m_real_index!=41))&&(m_real_index!=42))&&(m_real_index!=43))) index.js:7:32275 | |
749: { index.js:7:32275 | |
750: { index.js:7:32275 | |
751: int m_tid=(m_real_index-4); index.js:7:32275 | |
752: if ((m_tid<20)) index.js:7:32275 | |
753: { index.js:7:32275 | |
754: { index.js:7:32275 | |
755: m_type_hp.x+=20; index.js:7:32275 | |
756: m_type_hp.y=255; index.js:7:32275 | |
757: } index.js:7:32275 | |
758: ; index.js:7:32275 | |
759: } index.js:7:32275 | |
760: m_dr+=m_nval; index.js:7:32275 | |
761: } index.js:7:32275 | |
762: ; index.js:7:32275 | |
763: } index.js:7:32275 | |
764: } index.js:7:32275 | |
765: ; index.js:7:32275 | |
766: } index.js:7:32275 | |
767: if ((m_need_upd&&(m_real_index<24))) index.js:7:32275 | |
768: { index.js:7:32275 | |
769: { index.js:7:32275 | |
770: if ((m_real_index>=4)) index.js:7:32275 | |
771: { index.js:7:32275 | |
772: { index.js:7:32275 | |
773: m_type_hp.x+=20; index.js:7:32275 | |
774: m_type_hp.y=255; index.js:7:32275 | |
775: } index.js:7:32275 | |
776: ; index.js:7:32275 | |
777: } index.js:7:32275 | |
778: else index.js:7:32275 | |
779: { index.js:7:32275 | |
780: if ((m_real_index==3)) index.js:7:32275 | |
781: { index.js:7:32275 | |
782: { index.js:7:32275 | |
783: m_type_hp.x=min(int((1.0+(3.0*m_rand(vec2((m_uv+m_iTime)))))), 2); index.js:7:32275 | |
784: m_type_hp.y=1; index.js:7:32275 | |
785: } index.js:7:32275 | |
786: ; index.js:7:32275 | |
787: } index.js:7:32275 | |
788: else index.js:7:32275 | |
789: { index.js:7:32275 | |
790: if ((m_real_index==2)) index.js:7:32275 | |
791: { index.js:7:32275 | |
792: { index.js:7:32275 | |
793: m_type_hp.x=0; index.js:7:32275 | |
794: m_type_hp.y=1; index.js:7:32275 | |
795: } index.js:7:32275 | |
796: ; index.js:7:32275 | |
797: } index.js:7:32275 | |
798: else index.js:7:32275 | |
799: { index.js:7:32275 | |
800: if ((m_real_index==1)) index.js:7:32275 | |
801: { index.js:7:32275 | |
802: { index.js:7:32275 | |
803: } index.js:7:32275 | |
804: ; index.js:7:32275 | |
805: } index.js:7:32275 | |
806: } index.js:7:32275 | |
807: } index.js:7:32275 | |
808: } index.js:7:32275 | |
809: } index.js:7:32275 | |
810: ; index.js:7:32275 | |
811: } index.js:7:32275 | |
812: if ((m_real_index<=3)) index.js:7:32275 | |
813: { index.js:7:32275 | |
814: { index.js:7:32275 | |
815: vec2 m_nval2=((m_monster_F*max(m_stress, 1.0))*m_get_force2(trunc(m_lp.xy))); index.js:7:32275 | |
816: if ((m_real_index==3)) index.js:7:32275 | |
817: { index.js:7:32275 | |
818: m_nval2*=0.46; index.js:7:32275 | |
819: } index.js:7:32275 | |
820: else index.js:7:32275 | |
821: { index.js:7:32275 | |
822: if ((m_real_index==2)) index.js:7:32275 | |
823: { index.js:7:32275 | |
824: m_nval2*=0.65; index.js:7:32275 | |
825: } index.js:7:32275 | |
826: else index.js:7:32275 | |
827: { index.js:7:32275 | |
828: if ((m_real_index==1)) index.js:7:32275 | |
829: { index.js:7:32275 | |
830: m_nval2*=1.25; index.js:7:32275 | |
831: } index.js:7:32275 | |
832: } index.js:7:32275 | |
833: } index.js:7:32275 | |
834: m_dr+=m_nval2; index.js:7:32275 | |
835: } index.js:7:32275 | |
836: ; index.js:7:32275 | |
837: } index.js:7:32275 | |
838: if (((((((m_real_index==40)||(m_real_index==41))||(m_real_index==42))||(m_real_index==43))&&(m_type_hp.y==0))||(m_type_hp.x<=0))) index.js:7:32275 | |
839: { index.js:7:32275 | |
840: { index.js:7:32275 | |
841: m_fragColor=vec4(-1.0,0.0,0.0,0.0); index.js:7:32275 | |
842: return; } index.js:7:32275 | |
843: ; index.js:7:32275 | |
844: } index.js:7:32275 | |
845: vec2 m_pos=m_v.xy; index.js:7:32275 | |
846: float m_damp_k=(length(m_dr)>0.001)?m_DAMP_K:1.0; index.js:7:32275 | |
847: if (((((m_real_index==40)||(m_real_index==41))||(m_real_index==42))||(m_real_index==43))) index.js:7:32275 | |
848: { index.js:7:32275 | |
849: m_M=100.0; index.js:7:32275 | |
850: } index.js:7:32275 | |
851: m_dr+=(m_G*m_M); index.js:7:32275 | |
852: vec2 m_vel=((m_damp_k*m_v.zw)+(m_dr/m_M)); index.js:7:32275 | |
853: m_vel=clamp(m_vel, vec2(-1.0,-1.0), vec2(1.0,1.0)); index.js:7:32275 | |
854: vec2 m_dpos=(m_vel*m_VEL_LIMIT); index.js:7:32275 | |
855: m_pos+=(m_dpos*m_speed_x); index.js:7:32275 | |
856: m_v.xy=m_pos; index.js:7:32275 | |
857: m_v.xy=clamp(m_v.xy, vec2((m_BALL_SIZE*(1.0+(sin(m_pos.y)*0.1))), m_BALL_SIZE), (m_iResolution.xy-vec2(m_BALL_SIZE))); index.js:7:32275 | |
858: m_type_hp=m_type_hp_logic(m_type_hp, m_vel); index.js:7:32275 | |
859: m_self_id=m_pack_type_hp(m_type_hp.x, m_type_hp.y); index.js:7:32275 | |
860: if (((((m_real_index!=40)&&(m_real_index!=41))&&(m_real_index!=42))&&(m_real_index!=43))) index.js:7:32275 | |
861: { index.js:7:32275 | |
862: m_vel*=m_slow_down; index.js:7:32275 | |
863: } index.js:7:32275 | |
864: m_v=m_save_all(m_v.xy, m_vel, m_self_id); index.js:7:32275 | |
865: m_fragColor=m_v; index.js:7:32275 | |
866: } index.js:7:32275 | |
867: ; index.js:7:32275 | |
868: } index.js:7:32275 | |
869: else index.js:7:32275 | |
870: { index.js:7:32275 | |
871: { index.js:7:32275 | |
872: if ((m_mousedl>0.0)) index.js:7:32275 | |
873: { index.js:7:32275 | |
874: { index.js:7:32275 | |
875: m_fragColor=m_spawner_bullets(m_uv, m_middle, m_iResolution); index.js:7:32275 | |
876: } index.js:7:32275 | |
877: ; index.js:7:32275 | |
878: } index.js:7:32275 | |
879: else index.js:7:32275 | |
880: { index.js:7:32275 | |
881: if (m_spwan_b_once) index.js:7:32275 | |
882: { index.js:7:32275 | |
883: { index.js:7:32275 | |
884: m_fragColor=m_spawner(m_uv, m_middle, m_iResolution); index.js:7:32275 | |
885: } index.js:7:32275 | |
886: ; index.js:7:32275 | |
887: } index.js:7:32275 | |
888: else index.js:7:32275 | |
889: { index.js:7:32275 | |
890: { index.js:7:32275 | |
891: m_fragColor=vec4(-1.0,0.0,0.0,0.0); index.js:7:32275 | |
892: } index.js:7:32275 | |
893: ; index.js:7:32275 | |
894: } index.js:7:32275 | |
895: } index.js:7:32275 | |
896: } index.js:7:32275 | |
897: ; index.js:7:32275 | |
898: } index.js:7:32275 | |
899: } index.js:7:32275 | |
900: ; index.js:7:32275 | |
901: } index.js:7:32275 | |
902: } index.js:7:32275 | |
903: index.js:7:32275 | |
904: void m_mainImage(out vec4 m_fragColor, vec2 m_fragCoord, vec2 m_iResolution) index.js:7:32275 | |
905: { index.js:7:32275 | |
906: m_sim_step(m_fragColor, m_fragCoord, m_iResolution); index.js:7:32275 | |
907: } index.js:7:32275 | |
908: index.js:7:32275 | |
909: index.js:7:32275 | |
910: /* clang-format on */ index.js:7:32275 | |
911: index.js:7:32275 | |
912: void light_compute( index.js:7:32275 | |
913: inout vec4 light, index.js:7:32275 | |
914: inout vec2 light_vec, index.js:7:32275 | |
915: inout float light_height, index.js:7:32275 | |
916: inout vec4 light_color, index.js:7:32275 | |
917: vec2 light_uv, index.js:7:32275 | |
918: inout vec4 shadow_color, index.js:7:32275 | |
919: vec3 normal, index.js:7:32275 | |
920: vec2 uv, index.js:7:32275 | |
921: #if defined(SCREEN_UV_USED) index.js:7:32275 | |
922: vec2 screen_uv, index.js:7:32275 | |
923: #endif index.js:7:32275 | |
924: vec4 color) { index.js:7:32275 | |
925: index.js:7:32275 | |
926: #if defined(USE_LIGHT_SHADER_CODE) index.js:7:32275 | |
927: index.js:7:32275 | |
928: /* clang-format off */ index.js:7:32275 | |
929: index.js:7:32275 | |
930: index.js:7:32275 | |
931: /* clang-format on */ index.js:7:32275 | |
932: index.js:7:32275 | |
933: #endif index.js:7:32275 | |
934: } index.js:7:32275 | |
935: index.js:7:32275 | |
936: #ifdef USE_TEXTURE_RECT index.js:7:32275 | |
937: index.js:7:32275 | |
938: uniform vec4 dst_rect; index.js:7:32275 | |
939: uniform vec4 src_rect; index.js:7:32275 | |
940: uniform bool clip_rect_uv; index.js:7:32275 | |
941: index.js:7:32275 | |
942: #ifdef USE_NINEPATCH index.js:7:32275 | |
943: index.js:7:32275 | |
944: in highp vec2 pixel_size_interp; index.js:7:32275 | |
945: index.js:7:32275 | |
946: uniform int np_repeat_v; index.js:7:32275 | |
947: uniform int np_repeat_h; index.js:7:32275 | |
948: uniform bool np_draw_center; index.js:7:32275 | |
949: // left top right bottom in pixel coordinates index.js:7:32275 | |
950: uniform vec4 np_margins; index.js:7:32275 | |
951: index.js:7:32275 | |
952: float map_ninepatch_axis(float pixel, float draw_size, float tex_pixel_size, float margin_begin, float margin_end, int np_repeat, inout int draw_center) { index.js:7:32275 | |
953: index.js:7:32275 | |
954: float tex_size = 1.0 / tex_pixel_size; index.js:7:32275 | |
955: index.js:7:32275 | |
956: if (pixel < margin_begin) { index.js:7:32275 | |
957: return pixel * tex_pixel_size; index.js:7:32275 | |
958: } else if (pixel >= draw_size - margin_end) { index.js:7:32275 | |
959: return (tex_size - (draw_size - pixel)) * tex_pixel_size; index.js:7:32275 | |
960: } else { index.js:7:32275 | |
961: if (!np_draw_center) { index.js:7:32275 | |
962: draw_center--; index.js:7:32275 | |
963: } index.js:7:32275 | |
964: index.js:7:32275 | |
965: if (np_repeat == 0) { //stretch index.js:7:32275 | |
966: //convert to ratio index.js:7:32275 | |
967: float ratio = (pixel - margin_begin) / (draw_size - margin_begin - margin_end); index.js:7:32275 | |
968: //scale to source texture index.js:7:32275 | |
969: return (margin_begin + ratio * (tex_size - margin_begin - margin_end)) * tex_pixel_size; index.js:7:32275 | |
970: } else if (np_repeat == 1) { //tile index.js:7:32275 | |
971: //convert to ratio index.js:7:32275 | |
972: float ofs = mod((pixel - margin_begin), tex_size - margin_begin - margin_end); index.js:7:32275 | |
973: //scale to source texture index.js:7:32275 | |
974: return (margin_begin + ofs) * tex_pixel_size; index.js:7:32275 | |
975: } else if (np_repeat == 2) { //tile fit index.js:7:32275 | |
976: //convert to ratio index.js:7:32275 | |
977: float src_area = draw_size - margin_begin - margin_end; index.js:7:32275 | |
978: float dst_area = tex_size - margin_begin - margin_end; index.js:7:32275 | |
979: float scale = max(1.0, floor(src_area / max(dst_area, 0.0000001) + 0.5)); index.js:7:32275 | |
980: index.js:7:32275 | |
981: //convert to ratio index.js:7:32275 | |
982: float ratio = (pixel - margin_begin) / src_area; index.js:7:32275 | |
983: ratio = mod(ratio * scale, 1.0); index.js:7:32275 | |
984: return (margin_begin + ratio * dst_area) * tex_pixel_size; index.js:7:32275 | |
985: } index.js:7:32275 | |
986: } index.js:7:32275 | |
987: } index.js:7:32275 | |
988: index.js:7:32275 | |
989: #endif index.js:7:32275 | |
990: #endif index.js:7:32275 | |
991: index.js:7:32275 | |
992: uniform bool use_default_normal; index.js:7:32275 | |
993: index.js:7:32275 | |
994: void main() { index.js:7:32275 | |
995: index.js:7:32275 | |
996: vec4 color = color_interp; index.js:7:32275 | |
997: vec2 uv = uv_interp; index.js:7:32275 | |
998: index.js:7:32275 | |
999: #ifdef USE_TEXTURE_RECT index.js:7:32275 | |
1000: index.js:7:32275 | |
1001: #ifdef USE_NINEPATCH index.js:7:32275 | |
1002: index.js:7:32275 | |
1003: int draw_center = 2; index.js:7:32275 | |
1004: uv = vec2( index.js:7:32275 | |
1005: map_ninepatch_axis(pixel_size_interp.x, abs(dst_rect.z), color_texpixel_size.x, np_margins.x, np_margins.z, np_repeat_h, draw_center), index.js:7:32275 | |
1006: map_ninepatch_axis(pixel_size_interp.y, abs(dst_rect.w), color_texpixel_size.y, np_margins.y, np_margins.w, np_repeat_v, draw_center)); index.js:7:32275 | |
1007: index.js:7:32275 | |
1008: if (draw_center == 0) { index.js:7:32275 | |
1009: color.a = 0.0; index.js:7:32275 | |
1010: } index.js:7:32275 | |
1011: index.js:7:32275 | |
1012: uv = uv * src_rect.zw + src_rect.xy; //apply region if needed index.js:7:32275 | |
1013: #endif index.js:7:32275 | |
1014: index.js:7:32275 | |
1015: if (clip_rect_uv) { index.js:7:32275 | |
1016: index.js:7:32275 | |
1017: uv = clamp(uv, src_rect.xy, src_rect.xy + abs(src_rect.zw)); index.js:7:32275 | |
1018: } index.js:7:32275 | |
1019: index.js:7:32275 | |
1020: #endif index.js:7:32275 | |
1021: index.js:7:32275 | |
1022: #if !defined(COLOR_USED) index.js:7:32275 | |
1023: //default behavior, texture by color index.js:7:32275 | |
1024: index.js:7:32275 | |
1025: #ifdef USE_DISTANCE_FIELD index.js:7:32275 | |
1026: const float smoothing = 1.0 / 32.0; index.js:7:32275 | |
1027: float distance = textureLod(color_texture, uv, 0.0).a; index.js:7:32275 | |
1028: color.a = smoothstep(0.5 - smoothing, 0.5 + smoothing, distance) * color.a; index.js:7:32275 | |
1029: #else index.js:7:32275 | |
1030: color *= texture(color_texture, uv); index.js:7:32275 | |
1031: index.js:7:32275 | |
1032: #endif index.js:7:32275 | |
1033: index.js:7:32275 | |
1034: #endif index.js:7:32275 | |
1035: index.js:7:32275 | |
1036: vec3 normal; index.js:7:32275 | |
1037: index.js:7:32275 | |
1038: #if defined(NORMAL_USED) index.js:7:32275 | |
1039: index.js:7:32275 | |
1040: bool normal_used = true; index.js:7:32275 | |
1041: #else index.js:7:32275 | |
1042: bool normal_used = false; index.js:7:32275 | |
1043: #endif index.js:7:32275 | |
1044: index.js:7:32275 | |
1045: if (use_default_normal) { index.js:7:32275 | |
1046: normal.xy = textureLod(normal_texture, uv, 0.0).xy * 2.0 - 1.0; index.js:7:32275 | |
1047: normal.z = sqrt(1.0 - dot(normal.xy, normal.xy)); index.js:7:32275 | |
1048: normal_used = true; index.js:7:32275 | |
1049: } else { index.js:7:32275 | |
1050: normal = vec3(0.0, 0.0, 1.0); index.js:7:32275 | |
1051: } index.js:7:32275 | |
1052: index.js:7:32275 | |
1053: #if defined(SCREEN_UV_USED) index.js:7:32275 | |
1054: vec2 screen_uv = gl_FragCoord.xy * screen_pixel_size; index.js:7:32275 | |
1055: #endif index.js:7:32275 | |
1056: index.js:7:32275 | |
1057: { index.js:7:32275 | |
1058: float normal_depth = 1.0; index.js:7:32275 | |
1059: index.js:7:32275 | |
1060: #if defined(NORMALMAP_USED) index.js:7:32275 | |
1061: vec3 normal_map = vec3(0.0, 0.0, 1.0); index.js:7:32275 | |
1062: normal_used = true; index.js:7:32275 | |
1063: #endif index.js:7:32275 | |
1064: index.js:7:32275 | |
1065: /* clang-format off */ index.js:7:32275 | |
1066: { index.js:7:32275 | |
1067: vec2 m_iResolution=floor((1.0/color_texpixel_size)); index.js:7:32275 | |
1068: m_mainImage(color, (uv*m_iResolution), m_iResolution); index.js:7:32275 | |
1069: } index.js:7:32275 | |
1070: index.js:7:32275 | |
1071: index.js:7:32275 | |
1072: /* clang-format on */ index.js:7:32275 | |
1073: index.js:7:32275 | |
1074: #if defined(NORMALMAP_USED) index.js:7:32275 | |
1075: normal = mix(vec3(0.0, 0.0, 1.0), normal_map * vec3(2.0, -2.0, 1.0) - vec3(1.0, -1.0, 0.0), normal_depth); index.js:7:32275 | |
1076: #endif index.js:7:32275 | |
1077: } index.js:7:32275 | |
1078: #ifdef DEBUG_ENCODED_32 index.js:7:32275 | |
1079: highp float enc32 = dot(color, highp vec4(1.0 / (256.0 * 256.0 * 256.0), 1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0)); index.js:7:32275 | |
1080: color = vec4(vec3(enc32), 1.0); index.js:7:32275 | |
1081: #endif index.js:7:32275 | |
1082: index.js:7:32275 | |
1083: color *= final_modulate; index.js:7:32275 | |
1084: index.js:7:32275 | |
1085: #ifdef USE_LIGHTING index.js:7:32275 | |
1086: index.js:7:32275 | |
1087: vec2 light_vec = transformed_light_uv; index.js:7:32275 | |
1088: index.js:7:32275 | |
1089: if (normal_used) { index.js:7:32275 | |
1090: normal.xy = mat2(local_rot.xy, local_rot.zw) * normal.xy; index.js:7:32275 | |
1091: } index.js:7:32275 | |
1092: index.js:7:32275 | |
1093: float att = 1.0; index.js:7:32275 | |
1094: index.js:7:32275 | |
1095: vec2 light_uv = light_uv_interp.xy; index.js:7:32275 | |
1096: vec4 light = texture(light_texture, light_uv); index.js:7:32275 | |
1097: index.js:7:32275 | |
1098: if (any(lessThan(light_uv_interp.xy, vec2(0.0, 0.0))) || any(greaterThanEqual(light_uv_interp.xy, vec2(1.0, 1.0)))) { index.js:7:32275 | |
1099: color.a *= light_outside_alpha; //invisible index.js:7:32275 | |
1100: index.js:7:32275 | |
1101: } else { index.js:7:32275 | |
1102: float real_light_height = light_height; index.js:7:32275 | |
1103: vec4 real_light_color = light_color; index.js:7:32275 | |
1104: vec4 real_light_shadow_color = light_shadow_color; index.js:7:32275 | |
1105: index.js:7:32275 | |
1106: #if defined(USE_LIGHT_SHADER_CODE) index.js:7:32275 | |
1107: //light is written by the light shader index.js:7:32275 | |
1108: light_compute( index.js:7:32275 | |
1109: light, index.js:7:32275 | |
1110: light_vec, index.js:7:32275 | |
1111: real_light_height, index.js:7:32275 | |
1112: real_light_color, index.js:7:32275 | |
1113: light_uv, index.js:7:32275 | |
1114: real_light_shadow_color, index.js:7:32275 | |
1115: normal, index.js:7:32275 | |
1116: uv, index.js:7:32275 | |
1117: #if defined(SCREEN_UV_USED) index.js:7:32275 | |
1118: screen_uv, index.js:7:32275 | |
1119: #endif index.js:7:32275 | |
1120: color); index.js:7:32275 | |
1121: #endif index.js:7:32275 | |
1122: index.js:7:32275 | |
1123: light *= real_light_color; index.js:7:32275 | |
1124: index.js:7:32275 | |
1125: if (normal_used) { index.js:7:32275 | |
1126: vec3 light_normal = normalize(vec3(light_vec, -real_light_height)); index.js:7:32275 | |
1127: light *= max(dot(-light_normal, normal), 0.0); index.js:7:32275 | |
1128: } index.js:7:32275 | |
1129: index.js:7:32275 | |
1130: color *= light; index.js:7:32275 | |
1131: index.js:7:32275 | |
1132: #ifdef USE_SHADOWS index.js:7:32275 | |
1133: // Reset light_vec to compute shadows, the shadow map is created from the light origin, so it only index.js:7:32275 | |
1134: // makes sense to compute shadows from there. index.js:7:32275 | |
1135: light_vec = light_uv_interp.zw; index.js:7:32275 | |
1136: index.js:7:32275 | |
1137: float angle_to_light = -atan(light_vec.x, light_vec.y); index.js:7:32275 | |
1138: float PI = 3.14159265358979323846264; index.js:7:32275 | |
1139: /*int i = int(mod(floor((angle_to_light+7.0*PI/6.0)/(4.0*PI/6.0))+1.0, 3.0)); // +1 pq os indices estao em ordem 2,0,1 nos arrays index.js:7:32275 | |
1140: float ang*/ index.js:7:32275 | |
1141: index.js:7:32275 | |
1142: float su, sz; index.js:7:32275 | |
1143: index.js:7:32275 | |
1144: float abs_angle = abs(angle_to_light); index.js:7:32275 | |
1145: vec2 point; index.js:7:32275 | |
1146: float sh; index.js:7:32275 | |
1147: if (abs_angle < 45.0 * PI / 180.0) { index.js:7:32275 | |
1148: point = light_vec; index.js:7:32275 | |
1149: sh = 0.0 + (1.0 / 8.0); index.js:7:32275 | |
1150: } else if (abs_angle > 135.0 * PI / 180.0) { index.js:7:32275 | |
1151: point = -light_vec; index.js:7:32275 | |
1152: sh = 0.5 + (1.0 / 8.0); index.js:7:32275 | |
1153: } else if (angle_to_light > 0.0) { index.js:7:32275 | |
1154: index.js:7:32275 | |
1155: point = vec2(light_vec.y, -light_vec.x); index.js:7:32275 | |
1156: sh = 0.25 + (1.0 / 8.0); index.js:7:32275 | |
1157: } else { index.js:7:32275 | |
1158: index.js:7:32275 | |
1159: point = vec2(-light_vec.y, light_vec.x); index.js:7:32275 | |
1160: sh = 0.75 + (1.0 / 8.0); index.js:7:32275 | |
1161: } index.js:7:32275 | |
1162: index.js:7:32275 | |
1163: highp vec4 s = shadow_matrix * vec4(point, 0.0, 1.0); index.js:7:32275 | |
1164: s.xyz /= s.w; index.js:7:32275 | |
1165: su = s.x * 0.5 + 0.5; index.js:7:32275 | |
1166: sz = s.z * 0.5 + 0.5; index.js:7:32275 | |
1167: //sz=lightlength(light_vec); index.js:7:32275 | |
1168: index.js:7:32275 | |
1169: highp float shadow_attenuation = 0.0; index.js:7:32275 | |
1170: index.js:7:32275 | |
1171: #ifdef USE_RGBA_SHADOWS index.js:7:32275 | |
1172: index.js:7:32275 | |
1173: #define SHADOW_DEPTH(m_tex, m_uv) dot(texture((m_tex), (m_uv)), vec4(1.0 / (256.0 * 256.0 * 256.0), 1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0)) index.js:7:32275 | |
1174: index.js:7:32275 | |
1175: #else index.js:7:32275 | |
1176: index.js:7:32275 | |
1177: #define SHADOW_DEPTH(m_tex, m_uv) (texture((m_tex), (m_uv)).r) index.js:7:32275 | |
1178: index.js:7:32275 | |
1179: #endif index.js:7:32275 | |
1180: index.js:7:32275 | |
1181: #ifdef SHADOW_USE_GRADIENT index.js:7:32275 | |
1182: index.js:7:32275 | |
1183: #define SHADOW_TEST(m_ofs) \ index.js:7:32275 | |
1184: { \ index.js:7:32275 | |
1185: highp float sd = SHADOW_DEPTH(shadow_texture, vec2(m_ofs, sh)); \ index.js:7:32275 | |
1186: shadow_attenuation += 1.0 - smoothstep(sd, sd + shadow_gradient, sz); \ index.js:7:32275 | |
1187: } index.js:7:32275 | |
1188: index.js:7:32275 | |
1189: #else index.js:7:32275 | |
1190: index.js:7:32275 | |
1191: #define SHADOW_TEST(m_ofs) \ index.js:7:32275 | |
1192: { \ index.js:7:32275 | |
1193: highp float sd = SHADOW_DEPTH(shadow_texture, vec2(m_ofs, sh)); \ index.js:7:32275 | |
1194: shadow_attenuation += step(sz, sd); \ index.js:7:32275 | |
1195: } index.js:7:32275 | |
1196: index.js:7:32275 | |
1197: #endif index.js:7:32275 | |
1198: index.js:7:32275 | |
1199: #ifdef SHADOW_FILTER_NEAREST index.js:7:32275 | |
1200: index.js:7:32275 | |
1201: SHADOW_TEST(su); index.js:7:32275 | |
1202: index.js:7:32275 | |
1203: #endif index.js:7:32275 | |
1204: index.js:7:32275 | |
1205: #ifdef SHADOW_FILTER_PCF3 index.js:7:32275 | |
1206: index.js:7:32275 | |
1207: SHADOW_TEST(su + shadowpixel_size); index.js:7:32275 | |
1208: SHADOW_TEST(su); index.js:7:32275 | |
1209: SHADOW_TEST(su - shadowpixel_size); index.js:7:32275 | |
1210: shadow_attenuation /= 3.0; index.js:7:32275 | |
1211: index.js:7:32275 | |
1212: #endif index.js:7:32275 | |
1213: index.js:7:32275 | |
1214: #ifdef SHADOW_FILTER_PCF5 index.js:7:32275 | |
1215: index.js:7:32275 | |
1216: SHADOW_TEST(su + shadowpixel_size * 2.0); index.js:7:32275 | |
1217: SHADOW_TEST(su + shadowpixel_size); index.js:7:32275 | |
1218: SHADOW_TEST(su); index.js:7:32275 | |
1219: SHADOW_TEST(su - shadowpixel_size); index.js:7:32275 | |
1220: SHADOW_TEST(su - shadowpixel_size * 2.0); index.js:7:32275 | |
1221: shadow_attenuation /= 5.0; index.js:7:32275 | |
1222: index.js:7:32275 | |
1223: #endif index.js:7:32275 | |
1224: index.js:7:32275 | |
1225: #ifdef SHADOW_FILTER_PCF7 index.js:7:32275 | |
1226: index.js:7:32275 | |
1227: SHADOW_TEST(su + shadowpixel_size * 3.0); index.js:7:32275 | |
1228: SHADOW_TEST(su + shadowpixel_size * 2.0); index.js:7:32275 | |
1229: SHADOW_TEST(su + shadowpixel_size); index.js:7:32275 | |
1230: SHADOW_TEST(su); index.js:7:32275 | |
1231: SHADOW_TEST(su - shadowpixel_size); index.js:7:32275 | |
1232: SHADOW_TEST(su - shadowpixel_size * 2.0); index.js:7:32275 | |
1233: SHADOW_TEST(su - shadowpixel_size * 3.0); index.js:7:32275 | |
1234: shadow_attenuation /= 7.0; index.js:7:32275 | |
1235: index.js:7:32275 | |
1236: #endif index.js:7:32275 | |
1237: index.js:7:32275 | |
1238: #ifdef SHADOW_FILTER_PCF9 index.js:7:32275 | |
1239: index.js:7:32275 | |
1240: SHADOW_TEST(su + shadowpixel_size * 4.0); index.js:7:32275 | |
1241: SHADOW_TEST(su + shadowpixel_size * 3.0); index.js:7:32275 | |
1242: SHADOW_TEST(su + shadowpixel_size * 2.0); index.js:7:32275 | |
1243: SHADOW_TEST(su + shadowpixel_size); index.js:7:32275 | |
1244: SHADOW_TEST(su); index.js:7:32275 | |
1245: SHADOW_TEST(su - shadowpixel_size); index.js:7:32275 | |
1246: SHADOW_TEST(su - shadowpixel_size * 2.0); index.js:7:32275 | |
1247: SHADOW_TEST(su - shadowpixel_size * 3.0); index.js:7:32275 | |
1248: SHADOW_TEST(su - shadowpixel_size * 4.0); index.js:7:32275 | |
1249: shadow_attenuation /= 9.0; index.js:7:32275 | |
1250: index.js:7:32275 | |
1251: #endif index.js:7:32275 | |
1252: index.js:7:32275 | |
1253: #ifdef SHADOW_FILTER_PCF13 index.js:7:32275 | |
1254: index.js:7:32275 | |
1255: SHADOW_TEST(su + shadowpixel_size * 6.0); index.js:7:32275 | |
1256: SHADOW_TEST(su + shadowpixel_size * 5.0); index.js:7:32275 | |
1257: SHADOW_TEST(su + shadowpixel_size * 4.0); index.js:7:32275 | |
1258: SHADOW_TEST(su + shadowpixel_size * 3.0); index.js:7:32275 | |
1259: SHADOW_TEST(su + shadowpixel_size * 2.0); index.js:7:32275 | |
1260: SHADOW_TEST(su + shadowpixel_size); index.js:7:32275 | |
1261: SHADOW_TEST(su); index.js:7:32275 | |
1262: SHADOW_TEST(su - shadowpixel_size); index.js:7:32275 | |
1263: SHADOW_TEST(su - shadowpixel_size * 2.0); index.js:7:32275 | |
1264: SHADOW_TEST(su - shadowpixel_size * 3.0); index.js:7:32275 | |
1265: SHADOW_TEST(su - shadowpixel_size * 4.0); index.js:7:32275 | |
1266: SHADOW_TEST(su - shadowpixel_size * 5.0); index.js:7:32275 | |
1267: SHADOW_TEST(su - shadowpixel_size * 6.0); index.js:7:32275 | |
1268: shadow_attenuation /= 13.0; index.js:7:32275 | |
1269: index.js:7:32275 | |
1270: #endif index.js:7:32275 | |
1271: index.js:7:32275 | |
1272: //color *= shadow_attenuation; index.js:7:32275 | |
1273: color = mix(real_light_shadow_color, color, shadow_attenuation); index.js:7:32275 | |
1274: //use shadows index.js:7:32275 | |
1275: #endif index.js:7:32275 | |
1276: } index.js:7:32275 | |
1277: index.js:7:32275 | |
1278: //use lighting index.js:7:32275 | |
1279: #endif index.js:7:32275 | |
1280: //color.rgb *= color.a; index.js:7:32275 | |
1281: frag_color = color; index.js:7:32275 | |
1282: } index.js:7:32275 | |
1283: index.js:7:32275 | |
**ERROR**: CanvasShaderGLES3: Program LINK FAILED: index.js:7:32544 | |
Programs with more than 16 samplers are disallowed on Mesa drivers to avoid crashing. index.js:7:32544 | |
At: drivers/gles3/shader_gles3.cpp:164:_display_error_with_code() - CanvasShaderGLES3: Program LINK FAILED: index.js:7:32544 | |
Programs with more than 16 samplers are disallowed on Mesa drivers to avoid crashing. index.js:7:32544 | |
**ERROR**: CanvasShaderGLES3: Program LINK FAILED: index.js:7:32544 | |
Programs with more than 16 samplers are disallowed on Mesa drivers to avoid crashing. index.js:7:32544 | |
At: drivers/gles3/shader_gles3.cpp:497:get_current_version() - CanvasShaderGLES3: Program LINK FAILED: index.js:7:32544 | |
Programs with more than 16 samplers are disallowed on Mesa drivers to avoid crashing. index.js:7:32544 | |
**ERROR**: Method/Function Failed, returning: 0L index.js:7:32544 | |
At: drivers/gles3/shader_gles3.cpp:504:get_current_version() - Method/Function Failed, returning: 0L index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: false index.js:7:32544 | |
At: drivers/gles3/shader_gles3.cpp:123:bind() - Condition ' !version ' is true. returned: false index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
1: #version 300 es index.js:7:32275 | |
2: #define USE_TEXTURE_RECT index.js:7:32275 | |
3: #define USE_RGBA_SHADOWS index.js:7:32275 | |
4: #define USE_MATERIAL index.js:7:32275 | |
5: #define COLOR_USED index.js:7:32275 | |
6: precision highp float; index.js:7:32275 | |
7: precision highp int; index.js:7:32275 | |
8: precision highp sampler2D; index.js:7:32275 | |
9: precision highp samplerCube; index.js:7:32275 | |
10: precision highp sampler2DArray; index.js:7:32275 | |
11: index.js:7:32275 | |
12: uniform highp sampler2D color_texture; // texunit:0 index.js:7:32275 | |
13: /* clang-format on */ index.js:7:32275 | |
14: uniform highp vec2 color_texpixel_size; index.js:7:32275 | |
15: uniform highp sampler2D normal_texture; // texunit:1 index.js:7:32275 | |
16: index.js:7:32275 | |
17: in highp vec2 uv_interp; index.js:7:32275 | |
18: in highp vec4 color_interp; index.js:7:32275 | |
19: index.js:7:32275 | |
20: #if defined(SCREEN_TEXTURE_USED) index.js:7:32275 | |
21: index.js:7:32275 | |
22: uniform sampler2D screen_texture; // texunit:-3 index.js:7:32275 | |
23: index.js:7:32275 | |
24: #endif index.js:7:32275 | |
25: index.js:7:32275 | |
26: #if defined(SCREEN_UV_USED) index.js:7:32275 | |
27: index.js:7:32275 | |
28: uniform vec2 screen_pixel_size; index.js:7:32275 | |
29: #endif index.js:7:32275 | |
30: index.js:7:32275 | |
31: layout(std140) uniform CanvasItemData { index.js:7:32275 | |
32: index.js:7:32275 | |
33: highp mat4 projection_matrix; index.js:7:32275 | |
34: highp float time; index.js:7:32275 | |
35: }; index.js:7:32275 | |
36: index.js:7:32275 | |
37: #ifdef USE_LIGHTING index.js:7:32275 | |
38: index.js:7:32275 | |
39: layout(std140) uniform LightData { index.js:7:32275 | |
40: index.js:7:32275 | |
41: highp mat4 light_matrix; index.js:7:32275 | |
42: highp mat4 light_local_matrix; index.js:7:32275 | |
43: highp mat4 shadow_matrix; index.js:7:32275 | |
44: highp vec4 light_color; index.js:7:32275 | |
45: highp vec4 light_shadow_color; index.js:7:32275 | |
46: highp vec2 light_pos; index.js:7:32275 | |
47: highp float shadowpixel_size; index.js:7:32275 | |
48: highp float shadow_gradient; index.js:7:32275 | |
49: highp float light_height; index.js:7:32275 | |
50: highp float light_outside_alpha; index.js:7:32275 | |
51: highp float shadow_distance_mult; index.js:7:32275 | |
52: }; index.js:7:32275 | |
53: index.js:7:32275 | |
54: uniform highp sampler2D light_texture; // texunit:-1 index.js:7:32275 | |
55: in vec4 light_uv_interp; index.js:7:32275 | |
56: in vec2 transformed_light_uv; index.js:7:32275 | |
57: index.js:7:32275 | |
58: in vec4 local_rot; index.js:7:32275 | |
59: index.js:7:32275 | |
60: #ifdef USE_SHADOWS index.js:7:32275 | |
61: index.js:7:32275 | |
62: uniform highp sampler2D shadow_texture; // texunit:-2 index.js:7:32275 | |
63: in highp vec2 pos; index.js:7:32275 | |
64: index.js:7:32275 | |
65: #endif index.js:7:32275 | |
66: index.js:7:32275 | |
67: const bool at_light_pass = true; index.js:7:32275 | |
68: #else index.js:7:32275 | |
69: const bool at_light_pass = false; index.js:7:32275 | |
70: #endif index.js:7:32275 | |
71: index.js:7:32275 | |
72: uniform highp vec4 final_modulate; index.js:7:32275 | |
73: index.js:7:32275 | |
74: layout(location = 0) out highp vec4 frag_color; index.js:7:32275 | |
75: index.js:7:32275 | |
76: #if defined(USE_MATERIAL) index.js:7:32275 | |
77: index.js:7:32275 | |
78: /* clang-format off */ index.js:7:32275 | |
79: layout(std140) uniform UniformData { index.js:7:32275 | |
80: float m_iTime; index.js:7:32275 | |
81: float m_txgrad; index.js:7:32275 | |
82: int m_iFrame; index.js:7:32275 | |
83: bool m_pa_once; index.js:7:32275 | |
84: vec2 m_screen_pos; index.js:7:32275 | |
85: float m_zoom; index.js:7:32275 | |
86: float m_mousedr; index.js:7:32275 | |
87: vec3 m_iMouse; index.js:7:32275 | |
88: index.js:7:32275 | |
89: index.js:7:32275 | |
90: }; index.js:7:32275 | |
91: /* clang-format on */ index.js:7:32275 | |
92: index.js:7:32275 | |
93: #endif index.js:7:32275 | |
94: index.js:7:32275 | |
95: /* clang-format off */ index.js:7:32275 | |
96: uniform sampler2D m_iChannel0; index.js:7:32275 | |
97: uniform sampler2D m_iChannel1; index.js:7:32275 | |
98: uniform sampler2D m_iChannel2; index.js:7:32275 | |
99: uniform sampler2D m_iChannel3; index.js:7:32275 | |
100: uniform sampler2D m_ground1; index.js:7:32275 | |
101: uniform sampler2D m_maze_map; index.js:7:32275 | |
102: uniform sampler2D m_ground2; index.js:7:32275 | |
103: uniform sampler2D m_ground2a; index.js:7:32275 | |
104: uniform sampler2D m_ground3; index.js:7:32275 | |
105: uniform sampler2D m_wla; index.js:7:32275 | |
106: uniform sampler2D m_wlb; index.js:7:32275 | |
107: uniform sampler2D m_ground2b; index.js:7:32275 | |
108: uniform sampler2D m_ground2c; index.js:7:32275 | |
109: uniform sampler2D m_ground2d; index.js:7:32275 | |
110: index.js:7:32275 | |
111: float m_circle2(vec2 m_uv, float m_r1, float m_r2, vec2 m_ab) index.js:7:32275 | |
112: { index.js:7:32275 | |
113: float m_t=(m_r1-m_r2); index.js:7:32275 | |
114: float m_r=m_r1; index.js:7:32275 | |
115: return smoothstep(m_ab.x, m_ab.y, ((length(m_uv)-m_r)-(m_t/10.0))); } index.js:7:32275 | |
116: index.js:7:32275 | |
117: float m_circle(vec2 m_uv, float m_r1, float m_r2, vec2 m_ab) index.js:7:32275 | |
118: { index.js:7:32275 | |
119: float m_t=(m_r1-m_r2); index.js:7:32275 | |
120: float m_r=m_r1; index.js:7:32275 | |
121: return smoothstep(m_ab.x, m_ab.y, (abs((length(m_uv)-m_r))-(m_t/10.0))); } index.js:7:32275 | |
122: index.js:7:32275 | |
123: vec3 m_color(vec2 m_p) index.js:7:32275 | |
124: { index.js:7:32275 | |
125: vec3 m_colx=vec3(0.72,0.25,0.08); index.js:7:32275 | |
126: float m_vx=min(smoothstep(0.1, 0.2, (1.2*m_circle((m_p*3.0), 1.0, 0.19, vec2(-0.25,0.8)))), (5.0*max(0.1, m_circle2((m_p*3.0), 0.3, 0.19, vec2(-0.24645,1.28))))); index.js:7:32275 | |
127: m_vx=max(m_vx, 0.015); index.js:7:32275 | |
128: m_colx*=(0.02/m_vx); index.js:7:32275 | |
129: return clamp((pow(m_colx, vec3(2.0,2.0,2.0))*(0.5-(0.52*m_vx))), vec3(0.0,0.0,0.0), vec3(5.0,5.0,5.0)); } index.js:7:32275 | |
130: index.js:7:32275 | |
131: vec3 m_glow_c(vec2 m_uv) index.js:7:32275 | |
132: { index.js:7:32275 | |
133: vec3 m_col=vec3(0.0,0.0,0.0); index.js:7:32275 | |
134: m_uv.y+=-0.05; index.js:7:32275 | |
135: float m_mdrx=max(0.001, (m_mousedr*5.0)); index.js:7:32275 | |
136: m_uv*=(1.0/m_mdrx); index.js:7:32275 | |
137: float m_a=smoothstep(0.45, 0.4, length(m_uv)); index.js:7:32275 | |
138: if ((m_a>0.0)) index.js:7:32275 | |
139: { index.js:7:32275 | |
140: { index.js:7:32275 | |
141: m_col=m_color(m_uv); index.js:7:32275 | |
142: m_col=clamp(abs(m_col), vec3(0.0,0.0,0.0), vec3(1.0,1.0,1.0)); index.js:7:32275 | |
143: m_col*=smoothstep(0.45, 0.4, length(m_uv)); index.js:7:32275 | |
144: m_col=(2.0*pow(m_col, vec3(0.24545,0.24545,0.24545))); index.js:7:32275 | |
145: m_col=(m_col+(m_col*m_col)); index.js:7:32275 | |
146: } index.js:7:32275 | |
147: ; index.js:7:32275 | |
148: } index.js:7:32275 | |
149: return m_col; } index.js:7:32275 | |
150: index.js:7:32275 | |
151: vec2 m_LightOrigin(int m_id) index.js:7:32275 | |
152: { index.js:7:32275 | |
153: return texelFetch(m_iChannel1, ivec2(0, m_id), 0).yz; } index.js:7:32275 | |
154: index.js:7:32275 | |
155: vec3 m_LightColor(int m_id) index.js:7:32275 | |
156: { index.js:7:32275 | |
157: return texelFetch(m_iChannel1, ivec2(1, m_id), 0).yzw; } index.js:7:32275 | |
158: index.js:7:32275 | |
159: float m_SampleShadow(int m_id, vec2 m_uv, vec2 m_iResolution) index.js:7:32275 | |
160: { index.js:7:32275 | |
161: float m_tau=(atan(1.0)*8.0); index.js:7:32275 | |
162: vec2 m_hpo=(0.5/m_iResolution.xy); index.js:7:32275 | |
163: float m_a=((atan(m_uv.y, m_uv.x)/m_tau)+0.5); index.js:7:32275 | |
164: float m_r=length(m_uv); index.js:7:32275 | |
165: float m_idn=(float(m_id)/m_iResolution.y); index.js:7:32275 | |
166: float m_s=texture(m_iChannel1, (vec2(m_a, m_idn)+m_hpo)).x; index.js:7:32275 | |
167: return (1.0-smoothstep(m_s, (m_s+0.02), length(m_uv))); } index.js:7:32275 | |
168: index.js:7:32275 | |
169: vec3 m_MixLights(vec2 m_uv, vec2 m_iResolution) index.js:7:32275 | |
170: { index.js:7:32275 | |
171: vec3 m_AMBIENT_LIGHT=vec3(0.1,0.01,0.01); index.js:7:32275 | |
172: int m_NUM_LIGHTS=1; index.js:7:32275 | |
173: vec3 m_b=m_AMBIENT_LIGHT; index.js:7:32275 | |
174: float m_min_zoom=0.015; index.js:7:32275 | |
175: for (int m_i=0;(m_i<m_NUM_LIGHTS);m_i++) index.js:7:32275 | |
176: { index.js:7:32275 | |
177: { index.js:7:32275 | |
178: vec2 m_o=m_LightOrigin(m_i); index.js:7:32275 | |
179: vec3 m_c=m_LightColor(m_i); index.js:7:32275 | |
180: float m_l=((2.25-min((1.0*length(vec3(((m_uv*(m_zoom/m_min_zoom))-m_o), 0.1))), 2.25))/2.0); index.js:7:32275 | |
181: m_l*=m_SampleShadow(m_i, (m_uv-(m_o/max(0.01, (m_zoom/m_min_zoom)))), m_iResolution); index.js:7:32275 | |
182: m_l=max(m_l, smoothstep((0.0+(m_mousedr*2.0)), (-0.2+(m_mousedr*2.0)), length(((m_uv*(m_zoom/m_min_zoom))-vec2(0.0,-0.05))))); index.js:7:32275 | |
183: m_b+=(m_c*m_l); index.js:7:32275 | |
184: } index.js:7:32275 | |
185: ; index.js:7:32275 | |
186: } index.js:7:32275 | |
187: return m_b; } index.js:7:32275 | |
188: index.js:7:32275 | |
189: vec2 m_tile_uv_f(vec2 m_uv, vec2 m_iResolution) index.js:7:32275 | |
190: { index.js:7:32275 | |
191: vec2 m_tuv=vec2((m_uv*vec2(320.0,180.0))); index.js:7:32275 | |
192: return fract(m_tuv); } index.js:7:32275 | |
193: index.js:7:32275 | |
194: float m_rand(vec2 m_co) index.js:7:32275 | |
195: { index.js:7:32275 | |
196: return fract((sin(dot(m_co.xy, vec2(12.9898,78.233)))*43758.5)); } index.js:7:32275 | |
197: index.js:7:32275 | |
198: vec2 m_tile_uv(vec2 m_uv, vec2 m_iResolution) index.js:7:32275 | |
199: { index.js:7:32275 | |
200: ivec2 m_tuv=ivec2((m_uv*vec2(320.0,180.0))); index.js:7:32275 | |
201: return (vec2(m_tuv)/vec2(320.0,180.0)); } index.js:7:32275 | |
202: index.js:7:32275 | |
203: bool m_get_map(vec2 m_uv, vec2 m_iResolution) index.js:7:32275 | |
204: { index.js:7:32275 | |
205: return (texture(m_maze_map, m_tile_uv(m_uv, m_iResolution)).r>0.5); } index.js:7:32275 | |
206: index.js:7:32275 | |
207: vec2 m_get_screen_pos() index.js:7:32275 | |
208: { index.js:7:32275 | |
209: return texelFetch(m_iChannel0, ivec2(0,0), 0).xy; } index.js:7:32275 | |
210: index.js:7:32275 | |
211: vec4 m_get_collision_hp() index.js:7:32275 | |
212: { index.js:7:32275 | |
213: return texelFetch(m_iChannel0, ivec2(1,0), 0).xyzw; } index.js:7:32275 | |
214: index.js:7:32275 | |
215: void m_mainImage(out vec4 m_fragColor, vec2 m_fragCoord, vec2 m_iResolution) index.js:7:32275 | |
216: { index.js:7:32275 | |
217: m_fragColor=vec4(0.0,0.0,0.0,0.0); index.js:7:32275 | |
218: vec2 m_uv=(m_fragCoord/m_iResolution); index.js:7:32275 | |
219: vec2 m_res=(m_iResolution/m_iResolution.y); index.js:7:32275 | |
220: vec2 m_zuv=m_uv; index.js:7:32275 | |
221: m_zuv+=-0.5; index.js:7:32275 | |
222: m_zuv*=max(0.01, m_zoom); index.js:7:32275 | |
223: if (!m_pa_once) index.js:7:32275 | |
224: { index.js:7:32275 | |
225: { index.js:7:32275 | |
226: m_zuv+=m_screen_pos; index.js:7:32275 | |
227: } index.js:7:32275 | |
228: ; index.js:7:32275 | |
229: } index.js:7:32275 | |
230: else index.js:7:32275 | |
231: { index.js:7:32275 | |
232: { index.js:7:32275 | |
233: m_zuv+=(m_get_screen_pos()/m_res); index.js:7:32275 | |
234: } index.js:7:32275 | |
235: ; index.js:7:32275 | |
236: } index.js:7:32275 | |
237: m_zuv+=0.5; index.js:7:32275 | |
238: vec2 m_tuvv=m_tile_uv_f(m_zuv, m_iResolution); index.js:7:32275 | |
239: if (m_get_map(m_zuv, m_iResolution)) index.js:7:32275 | |
240: { index.js:7:32275 | |
241: { index.js:7:32275 | |
242: vec4 m_tc=textureGrad(m_ground1, m_tuvv, dFdx((m_zuv*m_txgrad)), dFdy((m_zuv*m_txgrad))); index.js:7:32275 | |
243: bool m_atp=false; index.js:7:32275 | |
244: vec4 m_pc=vec4(0.0,0.0,0.0,0.0); index.js:7:32275 | |
245: vec2 m_res_step=(1.0/vec2(320.0,180.0)); index.js:7:32275 | |
246: if ((((m_zuv.x-0.5)-m_res_step.x)>-0.5)) index.js:7:32275 | |
247: { index.js:7:32275 | |
248: { index.js:7:32275 | |
249: m_atp=!m_get_map((m_zuv+(m_res_step*vec2(-1.0,0.0))), m_iResolution); index.js:7:32275 | |
250: } index.js:7:32275 | |
251: ; index.js:7:32275 | |
252: } index.js:7:32275 | |
253: if (m_atp) index.js:7:32275 | |
254: { index.js:7:32275 | |
255: { index.js:7:32275 | |
256: m_pc=textureGrad(m_ground2a, m_tuvv, dFdx((m_zuv*m_txgrad)), dFdy((m_zuv*m_txgrad))); index.js:7:32275 | |
257: } index.js:7:32275 | |
258: ; index.js:7:32275 | |
259: } index.js:7:32275 | |
260: m_atp=false; index.js:7:32275 | |
261: if ((((m_zuv.x-0.5)+m_res_step.x)<0.5)) index.js:7:32275 | |
262: { index.js:7:32275 | |
263: { index.js:7:32275 | |
264: m_atp=!m_get_map((m_zuv+(m_res_step*vec2(1.0,0.0))), m_iResolution); index.js:7:32275 | |
265: } index.js:7:32275 | |
266: ; index.js:7:32275 | |
267: } index.js:7:32275 | |
268: if (m_atp) index.js:7:32275 | |
269: { index.js:7:32275 | |
270: { index.js:7:32275 | |
271: m_pc=max(m_pc, textureGrad(m_ground2c, m_tuvv, dFdx((m_zuv*m_txgrad)), dFdy((m_zuv*m_txgrad)))); index.js:7:32275 | |
272: } index.js:7:32275 | |
273: ; index.js:7:32275 | |
274: } index.js:7:32275 | |
275: m_atp=false; index.js:7:32275 | |
276: if ((((m_zuv.y-0.5)+m_res_step.y)<0.5)) index.js:7:32275 | |
277: { index.js:7:32275 | |
278: { index.js:7:32275 | |
279: m_atp=!m_get_map((m_zuv+(m_res_step*vec2(0.0,1.0))), m_iResolution); index.js:7:32275 | |
280: } index.js:7:32275 | |
281: ; index.js:7:32275 | |
282: } index.js:7:32275 | |
283: if (m_atp) index.js:7:32275 | |
284: { index.js:7:32275 | |
285: { index.js:7:32275 | |
286: m_pc=max(m_pc, textureGrad(m_ground2b, m_tuvv, dFdx((m_zuv*m_txgrad)), dFdy((m_zuv*m_txgrad)))); index.js:7:32275 | |
287: } index.js:7:32275 | |
288: ; index.js:7:32275 | |
289: } index.js:7:32275 | |
290: m_atp=false; index.js:7:32275 | |
291: if ((((m_zuv.y-0.5)-m_res_step.y)>-0.5)) index.js:7:32275 | |
292: { index.js:7:32275 | |
293: { index.js:7:32275 | |
294: m_atp=!m_get_map((m_zuv+(m_res_step*vec2(0.0,-1.0))), m_iResolution); index.js:7:32275 | |
295: } index.js:7:32275 | |
296: ; index.js:7:32275 | |
297: } index.js:7:32275 | |
298: if (m_atp) index.js:7:32275 | |
299: { index.js:7:32275 | |
300: { index.js:7:32275 | |
301: m_pc=max(m_pc, textureGrad(m_ground2d, m_tuvv, dFdx((m_zuv*m_txgrad)), dFdy((m_zuv*m_txgrad)))); index.js:7:32275 | |
302: } index.js:7:32275 | |
303: ; index.js:7:32275 | |
304: } index.js:7:32275 | |
305: m_atp=false; index.js:7:32275 | |
306: float m_a=m_tc.a; index.js:7:32275 | |
307: m_fragColor.rgb=mix(m_tc.rgb, m_pc.rgb, m_pc.a); index.js:7:32275 | |
308: } index.js:7:32275 | |
309: ; index.js:7:32275 | |
310: } index.js:7:32275 | |
311: else index.js:7:32275 | |
312: { index.js:7:32275 | |
313: { index.js:7:32275 | |
314: vec4 m_tc=textureGrad(m_ground2, m_tuvv, dFdx((m_zuv*m_txgrad)), dFdy((m_zuv*m_txgrad))); index.js:7:32275 | |
315: float m_a=m_tc.a; index.js:7:32275 | |
316: m_fragColor.rgb=m_tc.rgb; index.js:7:32275 | |
317: } index.js:7:32275 | |
318: ; index.js:7:32275 | |
319: } index.js:7:32275 | |
320: if (((((m_zuv.x>(1260.0/m_iResolution.x))&&(m_zuv.y<(16.0/m_iResolution.y)))&&(m_zuv.x<(1280.0/m_iResolution.x)))&&(m_zuv.y>(0.0/m_iResolution.y)))) index.js:7:32275 | |
321: { index.js:7:32275 | |
322: { index.js:7:32275 | |
323: m_fragColor.rgb=((m_fragColor.rgb*0.2)+(1.5*m_fragColor.brg)); index.js:7:32275 | |
324: } index.js:7:32275 | |
325: ; index.js:7:32275 | |
326: } index.js:7:32275 | |
327: float m_min_zoom=0.015; index.js:7:32275 | |
328: float m_startup_zoom_timer_sec=6.0; index.js:7:32275 | |
329: vec4 m_adglowc=vec4(0.0,0.0,0.0,0.0); index.js:7:32275 | |
330: if ((m_mousedr>0.0)) index.js:7:32275 | |
331: { index.js:7:32275 | |
332: { index.js:7:32275 | |
333: vec3 m_ccx=m_glow_c((m_res*((m_uv-0.5)*max(0.01, (m_zoom/m_min_zoom))))); index.js:7:32275 | |
334: float m_a=(dot(clamp(m_ccx, 0.0, 1.0), vec3(1.0,1.0,1.0))/3.0); index.js:7:32275 | |
335: m_adglowc=vec4(m_ccx, min((m_a*2.0), 1.0)); index.js:7:32275 | |
336: } index.js:7:32275 | |
337: ; index.js:7:32275 | |
338: } index.js:7:32275 | |
339: vec3 m_oc=m_fragColor.rgb; index.js:7:32275 | |
340: vec4 m_parts=texture(m_iChannel2, m_uv); index.js:7:32275 | |
341: if ((m_parts.r<0.0)) index.js:7:32275 | |
342: { index.js:7:32275 | |
343: m_parts.r=(m_parts.r+(10.0*m_parts.a)); index.js:7:32275 | |
344: } index.js:7:32275 | |
345: float m_vignetteAmt=(1.0-dot(((m_uv-0.5)*0.85), ((m_uv-0.5)*0.85))); index.js:7:32275 | |
346: vec2 m_uvo=((m_fragCoord.xy/m_iResolution.y)-(m_res/2.0)); index.js:7:32275 | |
347: m_uvo=-m_uvo; index.js:7:32275 | |
348: m_fragColor.rgb=((pow(m_fragColor.rgb, vec3(2.0,2.0,2.0))*0.35)+((m_fragColor.rgb*0.95)*m_MixLights(m_uvo, m_iResolution))); index.js:7:32275 | |
349: m_fragColor.rgb=mix(m_fragColor.rgb, m_adglowc.rgb, (m_adglowc.a*smoothstep(0.0, 0.5, m_mousedr))); index.js:7:32275 | |
350: m_fragColor.rgb=clamp(m_fragColor.rgb, 0.0, 1.0); index.js:7:32275 | |
351: float m_shl=((1.5-min((1.0*length(vec3(((m_uvo*(m_zoom/m_min_zoom))-m_LightOrigin(0)), 0.1))), 1.5))*0.35); index.js:7:32275 | |
352: m_shl=(m_shl+(0.01/pow((0.25*length(vec3(((m_uvo*(m_zoom/m_min_zoom))-m_LightOrigin(0)), 0.1))), 2.0))); index.js:7:32275 | |
353: m_shl=(0.25+(0.75*m_shl)); index.js:7:32275 | |
354: m_shl=max(m_shl, smoothstep((0.0+(m_mousedr*2.0)), (-0.2+(m_mousedr*2.0)), length(((m_uvo*(m_zoom/m_min_zoom))-vec2(0.0,-0.05))))); index.js:7:32275 | |
355: m_fragColor.rgb=mix(m_fragColor.rgb, (m_parts.rgb*clamp(m_shl, 0.25, 1.0)), m_parts.a); index.js:7:32275 | |
356: m_fragColor.rgb*=(smoothstep(0.0, 0.5, m_iTime)*m_vignetteAmt); index.js:7:32275 | |
357: m_fragColor.rgb=((m_fragColor.rgb*0.5)+((0.5*m_fragColor.rgb)*m_fragColor.rgb)); index.js:7:32275 | |
358: m_fragColor.rgb=clamp(m_fragColor.rgb, 0.0, 1.0); index.js:7:32275 | |
359: m_fragColor.rgb=mix(m_oc, m_fragColor.rgb, smoothstep(5.5, m_startup_zoom_timer_sec, m_iTime)); index.js:7:32275 | |
360: m_fragColor.rgb+=(((m_rand(m_uv)-0.5)*0.07)*smoothstep(4.0, 1.0, (m_zoom/m_min_zoom))); index.js:7:32275 | |
361: vec2 m_state=m_get_collision_hp().yw; index.js:7:32275 | |
362: float m_lost_hp_timer=m_state.y; index.js:7:32275 | |
363: float m_player_hp=m_state.x; index.js:7:32275 | |
364: bool m_is_player_alive=(m_player_hp>=1.0); index.js:7:32275 | |
365: if ((m_player_hp<1000.0)) index.js:7:32275 | |
366: { index.js:7:32275 | |
367: { index.js:7:32275 | |
368: float m_mpl=1.0; index.js:7:32275 | |
369: if (!m_is_player_alive) index.js:7:32275 | |
370: { index.js:7:32275 | |
371: m_mpl=smoothstep(0.0, 0.5, m_lost_hp_timer); index.js:7:32275 | |
372: } index.js:7:32275 | |
373: m_fragColor.rgb=mix(m_fragColor.rgb, texture(m_wla, m_uv).rgb, (1.0-m_mpl)); index.js:7:32275 | |
374: } index.js:7:32275 | |
375: ; index.js:7:32275 | |
376: } index.js:7:32275 | |
377: else index.js:7:32275 | |
378: { index.js:7:32275 | |
379: { index.js:7:32275 | |
380: float m_mpl=smoothstep(0.0, 0.5, m_lost_hp_timer); index.js:7:32275 | |
381: m_fragColor.rgb=mix(m_fragColor.rgb, texture(m_wlb, m_uv).rgb, (1.0-m_mpl)); index.js:7:32275 | |
382: } index.js:7:32275 | |
383: ; index.js:7:32275 | |
384: } index.js:7:32275 | |
385: m_fragColor.rgb*=smoothstep(0.0, 0.5, m_iTime); index.js:7:32275 | |
386: m_fragColor.a=1.0; index.js:7:32275 | |
387: } index.js:7:32275 | |
388: index.js:7:32275 | |
389: index.js:7:32275 | |
390: /* clang-format on */ index.js:7:32275 | |
391: index.js:7:32275 | |
392: void light_compute( index.js:7:32275 | |
393: inout vec4 light, index.js:7:32275 | |
394: inout vec2 light_vec, index.js:7:32275 | |
395: inout float light_height, index.js:7:32275 | |
396: inout vec4 light_color, index.js:7:32275 | |
397: vec2 light_uv, index.js:7:32275 | |
398: inout vec4 shadow_color, index.js:7:32275 | |
399: vec3 normal, index.js:7:32275 | |
400: vec2 uv, index.js:7:32275 | |
401: #if defined(SCREEN_UV_USED) index.js:7:32275 | |
402: vec2 screen_uv, index.js:7:32275 | |
403: #endif index.js:7:32275 | |
404: vec4 color) { index.js:7:32275 | |
405: index.js:7:32275 | |
406: #if defined(USE_LIGHT_SHADER_CODE) index.js:7:32275 | |
407: index.js:7:32275 | |
408: /* clang-format off */ index.js:7:32275 | |
409: index.js:7:32275 | |
410: index.js:7:32275 | |
411: /* clang-format on */ index.js:7:32275 | |
412: index.js:7:32275 | |
413: #endif index.js:7:32275 | |
414: } index.js:7:32275 | |
415: index.js:7:32275 | |
416: #ifdef USE_TEXTURE_RECT index.js:7:32275 | |
417: index.js:7:32275 | |
418: uniform vec4 dst_rect; index.js:7:32275 | |
419: uniform vec4 src_rect; index.js:7:32275 | |
420: uniform bool clip_rect_uv; index.js:7:32275 | |
421: index.js:7:32275 | |
422: #ifdef USE_NINEPATCH index.js:7:32275 | |
423: index.js:7:32275 | |
424: in highp vec2 pixel_size_interp; index.js:7:32275 | |
425: index.js:7:32275 | |
426: uniform int np_repeat_v; index.js:7:32275 | |
427: uniform int np_repeat_h; index.js:7:32275 | |
428: uniform bool np_draw_center; index.js:7:32275 | |
429: // left top right bottom in pixel coordinates index.js:7:32275 | |
430: uniform vec4 np_margins; index.js:7:32275 | |
431: index.js:7:32275 | |
432: float map_ninepatch_axis(float pixel, float draw_size, float tex_pixel_size, float margin_begin, float margin_end, int np_repeat, inout int draw_center) { index.js:7:32275 | |
433: index.js:7:32275 | |
434: float tex_size = 1.0 / tex_pixel_size; index.js:7:32275 | |
435: index.js:7:32275 | |
436: if (pixel < margin_begin) { index.js:7:32275 | |
437: return pixel * tex_pixel_size; index.js:7:32275 | |
438: } else if (pixel >= draw_size - margin_end) { index.js:7:32275 | |
439: return (tex_size - (draw_size - pixel)) * tex_pixel_size; index.js:7:32275 | |
440: } else { index.js:7:32275 | |
441: if (!np_draw_center) { index.js:7:32275 | |
442: draw_center--; index.js:7:32275 | |
443: } index.js:7:32275 | |
444: index.js:7:32275 | |
445: if (np_repeat == 0) { //stretch index.js:7:32275 | |
446: //convert to ratio index.js:7:32275 | |
447: float ratio = (pixel - margin_begin) / (draw_size - margin_begin - margin_end); index.js:7:32275 | |
448: //scale to source texture index.js:7:32275 | |
449: return (margin_begin + ratio * (tex_size - margin_begin - margin_end)) * tex_pixel_size; index.js:7:32275 | |
450: } else if (np_repeat == 1) { //tile index.js:7:32275 | |
451: //convert to ratio index.js:7:32275 | |
452: float ofs = mod((pixel - margin_begin), tex_size - margin_begin - margin_end); index.js:7:32275 | |
453: //scale to source texture index.js:7:32275 | |
454: return (margin_begin + ofs) * tex_pixel_size; index.js:7:32275 | |
455: } else if (np_repeat == 2) { //tile fit index.js:7:32275 | |
456: //convert to ratio index.js:7:32275 | |
457: float src_area = draw_size - margin_begin - margin_end; index.js:7:32275 | |
458: float dst_area = tex_size - margin_begin - margin_end; index.js:7:32275 | |
459: float scale = max(1.0, floor(src_area / max(dst_area, 0.0000001) + 0.5)); index.js:7:32275 | |
460: index.js:7:32275 | |
461: //convert to ratio index.js:7:32275 | |
462: float ratio = (pixel - margin_begin) / src_area; index.js:7:32275 | |
463: ratio = mod(ratio * scale, 1.0); index.js:7:32275 | |
464: return (margin_begin + ratio * dst_area) * tex_pixel_size; index.js:7:32275 | |
465: } index.js:7:32275 | |
466: } index.js:7:32275 | |
467: } index.js:7:32275 | |
468: index.js:7:32275 | |
469: #endif index.js:7:32275 | |
470: #endif index.js:7:32275 | |
471: index.js:7:32275 | |
472: uniform bool use_default_normal; index.js:7:32275 | |
473: index.js:7:32275 | |
474: void main() { index.js:7:32275 | |
475: index.js:7:32275 | |
476: vec4 color = color_interp; index.js:7:32275 | |
477: vec2 uv = uv_interp; index.js:7:32275 | |
478: index.js:7:32275 | |
479: #ifdef USE_TEXTURE_RECT index.js:7:32275 | |
480: index.js:7:32275 | |
481: #ifdef USE_NINEPATCH index.js:7:32275 | |
482: index.js:7:32275 | |
483: int draw_center = 2; index.js:7:32275 | |
484: uv = vec2( index.js:7:32275 | |
485: map_ninepatch_axis(pixel_size_interp.x, abs(dst_rect.z), color_texpixel_size.x, np_margins.x, np_margins.z, np_repeat_h, draw_center), index.js:7:32275 | |
486: map_ninepatch_axis(pixel_size_interp.y, abs(dst_rect.w), color_texpixel_size.y, np_margins.y, np_margins.w, np_repeat_v, draw_center)); index.js:7:32275 | |
487: index.js:7:32275 | |
488: if (draw_center == 0) { index.js:7:32275 | |
489: color.a = 0.0; index.js:7:32275 | |
490: } index.js:7:32275 | |
491: index.js:7:32275 | |
492: uv = uv * src_rect.zw + src_rect.xy; //apply region if needed index.js:7:32275 | |
493: #endif index.js:7:32275 | |
494: index.js:7:32275 | |
495: if (clip_rect_uv) { index.js:7:32275 | |
496: index.js:7:32275 | |
497: uv = clamp(uv, src_rect.xy, src_rect.xy + abs(src_rect.zw)); index.js:7:32275 | |
498: } index.js:7:32275 | |
499: index.js:7:32275 | |
500: #endif index.js:7:32275 | |
501: index.js:7:32275 | |
502: #if !defined(COLOR_USED) index.js:7:32275 | |
503: //default behavior, texture by color index.js:7:32275 | |
504: index.js:7:32275 | |
505: #ifdef USE_DISTANCE_FIELD index.js:7:32275 | |
506: const float smoothing = 1.0 / 32.0; index.js:7:32275 | |
507: float distance = textureLod(color_texture, uv, 0.0).a; index.js:7:32275 | |
508: color.a = smoothstep(0.5 - smoothing, 0.5 + smoothing, distance) * color.a; index.js:7:32275 | |
509: #else index.js:7:32275 | |
510: color *= texture(color_texture, uv); index.js:7:32275 | |
511: index.js:7:32275 | |
512: #endif index.js:7:32275 | |
513: index.js:7:32275 | |
514: #endif index.js:7:32275 | |
515: index.js:7:32275 | |
516: vec3 normal; index.js:7:32275 | |
517: index.js:7:32275 | |
518: #if defined(NORMAL_USED) index.js:7:32275 | |
519: index.js:7:32275 | |
520: bool normal_used = true; index.js:7:32275 | |
521: #else index.js:7:32275 | |
522: bool normal_used = false; index.js:7:32275 | |
523: #endif index.js:7:32275 | |
524: index.js:7:32275 | |
525: if (use_default_normal) { index.js:7:32275 | |
526: normal.xy = textureLod(normal_texture, uv, 0.0).xy * 2.0 - 1.0; index.js:7:32275 | |
527: normal.z = sqrt(1.0 - dot(normal.xy, normal.xy)); index.js:7:32275 | |
528: normal_used = true; index.js:7:32275 | |
529: } else { index.js:7:32275 | |
530: normal = vec3(0.0, 0.0, 1.0); index.js:7:32275 | |
531: } index.js:7:32275 | |
532: index.js:7:32275 | |
533: #if defined(SCREEN_UV_USED) index.js:7:32275 | |
534: vec2 screen_uv = gl_FragCoord.xy * screen_pixel_size; index.js:7:32275 | |
535: #endif index.js:7:32275 | |
536: index.js:7:32275 | |
537: { index.js:7:32275 | |
538: float normal_depth = 1.0; index.js:7:32275 | |
539: index.js:7:32275 | |
540: #if defined(NORMALMAP_USED) index.js:7:32275 | |
541: vec3 normal_map = vec3(0.0, 0.0, 1.0); index.js:7:32275 | |
542: normal_used = true; index.js:7:32275 | |
543: #endif index.js:7:32275 | |
544: index.js:7:32275 | |
545: /* clang-format off */ index.js:7:32275 | |
546: { index.js:7:32275 | |
547: vec2 m_iResolution=floor((1.0/color_texpixel_size)); index.js:7:32275 | |
548: m_mainImage(color, (uv*m_iResolution), m_iResolution); index.js:7:32275 | |
549: } index.js:7:32275 | |
550: index.js:7:32275 | |
551: index.js:7:32275 | |
552: /* clang-format on */ index.js:7:32275 | |
553: index.js:7:32275 | |
554: #if defined(NORMALMAP_USED) index.js:7:32275 | |
555: normal = mix(vec3(0.0, 0.0, 1.0), normal_map * vec3(2.0, -2.0, 1.0) - vec3(1.0, -1.0, 0.0), normal_depth); index.js:7:32275 | |
556: #endif index.js:7:32275 | |
557: } index.js:7:32275 | |
558: #ifdef DEBUG_ENCODED_32 index.js:7:32275 | |
559: highp float enc32 = dot(color, highp vec4(1.0 / (256.0 * 256.0 * 256.0), 1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0)); index.js:7:32275 | |
560: color = vec4(vec3(enc32), 1.0); index.js:7:32275 | |
561: #endif index.js:7:32275 | |
562: index.js:7:32275 | |
563: color *= final_modulate; index.js:7:32275 | |
564: index.js:7:32275 | |
565: #ifdef USE_LIGHTING index.js:7:32275 | |
566: index.js:7:32275 | |
567: vec2 light_vec = transformed_light_uv; index.js:7:32275 | |
568: index.js:7:32275 | |
569: if (normal_used) { index.js:7:32275 | |
570: normal.xy = mat2(local_rot.xy, local_rot.zw) * normal.xy; index.js:7:32275 | |
571: } index.js:7:32275 | |
572: index.js:7:32275 | |
573: float att = 1.0; index.js:7:32275 | |
574: index.js:7:32275 | |
575: vec2 light_uv = light_uv_interp.xy; index.js:7:32275 | |
576: vec4 light = texture(light_texture, light_uv); index.js:7:32275 | |
577: index.js:7:32275 | |
578: if (any(lessThan(light_uv_interp.xy, vec2(0.0, 0.0))) || any(greaterThanEqual(light_uv_interp.xy, vec2(1.0, 1.0)))) { index.js:7:32275 | |
579: color.a *= light_outside_alpha; //invisible index.js:7:32275 | |
580: index.js:7:32275 | |
581: } else { index.js:7:32275 | |
582: float real_light_height = light_height; index.js:7:32275 | |
583: vec4 real_light_color = light_color; index.js:7:32275 | |
584: vec4 real_light_shadow_color = light_shadow_color; index.js:7:32275 | |
585: index.js:7:32275 | |
586: #if defined(USE_LIGHT_SHADER_CODE) index.js:7:32275 | |
587: //light is written by the light shader index.js:7:32275 | |
588: light_compute( index.js:7:32275 | |
589: light, index.js:7:32275 | |
590: light_vec, index.js:7:32275 | |
591: real_light_height, index.js:7:32275 | |
592: real_light_color, index.js:7:32275 | |
593: light_uv, index.js:7:32275 | |
594: real_light_shadow_color, index.js:7:32275 | |
595: normal, index.js:7:32275 | |
596: uv, index.js:7:32275 | |
597: #if defined(SCREEN_UV_USED) index.js:7:32275 | |
598: screen_uv, index.js:7:32275 | |
599: #endif index.js:7:32275 | |
600: color); index.js:7:32275 | |
601: #endif index.js:7:32275 | |
602: index.js:7:32275 | |
603: light *= real_light_color; index.js:7:32275 | |
604: index.js:7:32275 | |
605: if (normal_used) { index.js:7:32275 | |
606: vec3 light_normal = normalize(vec3(light_vec, -real_light_height)); index.js:7:32275 | |
607: light *= max(dot(-light_normal, normal), 0.0); index.js:7:32275 | |
608: } index.js:7:32275 | |
609: index.js:7:32275 | |
610: color *= light; index.js:7:32275 | |
611: index.js:7:32275 | |
612: #ifdef USE_SHADOWS index.js:7:32275 | |
613: // Reset light_vec to compute shadows, the shadow map is created from the light origin, so it only index.js:7:32275 | |
614: // makes sense to compute shadows from there. index.js:7:32275 | |
615: light_vec = light_uv_interp.zw; index.js:7:32275 | |
616: index.js:7:32275 | |
617: float angle_to_light = -atan(light_vec.x, light_vec.y); index.js:7:32275 | |
618: float PI = 3.14159265358979323846264; index.js:7:32275 | |
619: /*int i = int(mod(floor((angle_to_light+7.0*PI/6.0)/(4.0*PI/6.0))+1.0, 3.0)); // +1 pq os indices estao em ordem 2,0,1 nos arrays index.js:7:32275 | |
620: float ang*/ index.js:7:32275 | |
621: index.js:7:32275 | |
622: float su, sz; index.js:7:32275 | |
623: index.js:7:32275 | |
624: float abs_angle = abs(angle_to_light); index.js:7:32275 | |
625: vec2 point; index.js:7:32275 | |
626: float sh; index.js:7:32275 | |
627: if (abs_angle < 45.0 * PI / 180.0) { index.js:7:32275 | |
628: point = light_vec; index.js:7:32275 | |
629: sh = 0.0 + (1.0 / 8.0); index.js:7:32275 | |
630: } else if (abs_angle > 135.0 * PI / 180.0) { index.js:7:32275 | |
631: point = -light_vec; index.js:7:32275 | |
632: sh = 0.5 + (1.0 / 8.0); index.js:7:32275 | |
633: } else if (angle_to_light > 0.0) { index.js:7:32275 | |
634: index.js:7:32275 | |
635: point = vec2(light_vec.y, -light_vec.x); index.js:7:32275 | |
636: sh = 0.25 + (1.0 / 8.0); index.js:7:32275 | |
637: } else { index.js:7:32275 | |
638: index.js:7:32275 | |
639: point = vec2(-light_vec.y, light_vec.x); index.js:7:32275 | |
640: sh = 0.75 + (1.0 / 8.0); index.js:7:32275 | |
641: } index.js:7:32275 | |
642: index.js:7:32275 | |
643: highp vec4 s = shadow_matrix * vec4(point, 0.0, 1.0); index.js:7:32275 | |
644: s.xyz /= s.w; index.js:7:32275 | |
645: su = s.x * 0.5 + 0.5; index.js:7:32275 | |
646: sz = s.z * 0.5 + 0.5; index.js:7:32275 | |
647: //sz=lightlength(light_vec); index.js:7:32275 | |
648: index.js:7:32275 | |
649: highp float shadow_attenuation = 0.0; index.js:7:32275 | |
650: index.js:7:32275 | |
651: #ifdef USE_RGBA_SHADOWS index.js:7:32275 | |
652: index.js:7:32275 | |
653: #define SHADOW_DEPTH(m_tex, m_uv) dot(texture((m_tex), (m_uv)), vec4(1.0 / (256.0 * 256.0 * 256.0), 1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0)) index.js:7:32275 | |
654: index.js:7:32275 | |
655: #else index.js:7:32275 | |
656: index.js:7:32275 | |
657: #define SHADOW_DEPTH(m_tex, m_uv) (texture((m_tex), (m_uv)).r) index.js:7:32275 | |
658: index.js:7:32275 | |
659: #endif index.js:7:32275 | |
660: index.js:7:32275 | |
661: #ifdef SHADOW_USE_GRADIENT index.js:7:32275 | |
662: index.js:7:32275 | |
663: #define SHADOW_TEST(m_ofs) \ index.js:7:32275 | |
664: { \ index.js:7:32275 | |
665: highp float sd = SHADOW_DEPTH(shadow_texture, vec2(m_ofs, sh)); \ index.js:7:32275 | |
666: shadow_attenuation += 1.0 - smoothstep(sd, sd + shadow_gradient, sz); \ index.js:7:32275 | |
667: } index.js:7:32275 | |
668: index.js:7:32275 | |
669: #else index.js:7:32275 | |
670: index.js:7:32275 | |
671: #define SHADOW_TEST(m_ofs) \ index.js:7:32275 | |
672: { \ index.js:7:32275 | |
673: highp float sd = SHADOW_DEPTH(shadow_texture, vec2(m_ofs, sh)); \ index.js:7:32275 | |
674: shadow_attenuation += step(sz, sd); \ index.js:7:32275 | |
675: } index.js:7:32275 | |
676: index.js:7:32275 | |
677: #endif index.js:7:32275 | |
678: index.js:7:32275 | |
679: #ifdef SHADOW_FILTER_NEAREST index.js:7:32275 | |
680: index.js:7:32275 | |
681: SHADOW_TEST(su); index.js:7:32275 | |
682: index.js:7:32275 | |
683: #endif index.js:7:32275 | |
684: index.js:7:32275 | |
685: #ifdef SHADOW_FILTER_PCF3 index.js:7:32275 | |
686: index.js:7:32275 | |
687: SHADOW_TEST(su + shadowpixel_size); index.js:7:32275 | |
688: SHADOW_TEST(su); index.js:7:32275 | |
689: SHADOW_TEST(su - shadowpixel_size); index.js:7:32275 | |
690: shadow_attenuation /= 3.0; index.js:7:32275 | |
691: index.js:7:32275 | |
692: #endif index.js:7:32275 | |
693: index.js:7:32275 | |
694: #ifdef SHADOW_FILTER_PCF5 index.js:7:32275 | |
695: index.js:7:32275 | |
696: SHADOW_TEST(su + shadowpixel_size * 2.0); index.js:7:32275 | |
697: SHADOW_TEST(su + shadowpixel_size); index.js:7:32275 | |
698: SHADOW_TEST(su); index.js:7:32275 | |
699: SHADOW_TEST(su - shadowpixel_size); index.js:7:32275 | |
700: SHADOW_TEST(su - shadowpixel_size * 2.0); index.js:7:32275 | |
701: shadow_attenuation /= 5.0; index.js:7:32275 | |
702: index.js:7:32275 | |
703: #endif index.js:7:32275 | |
704: index.js:7:32275 | |
705: #ifdef SHADOW_FILTER_PCF7 index.js:7:32275 | |
706: index.js:7:32275 | |
707: SHADOW_TEST(su + shadowpixel_size * 3.0); index.js:7:32275 | |
708: SHADOW_TEST(su + shadowpixel_size * 2.0); index.js:7:32275 | |
709: SHADOW_TEST(su + shadowpixel_size); index.js:7:32275 | |
710: SHADOW_TEST(su); index.js:7:32275 | |
711: SHADOW_TEST(su - shadowpixel_size); index.js:7:32275 | |
712: SHADOW_TEST(su - shadowpixel_size * 2.0); index.js:7:32275 | |
713: SHADOW_TEST(su - shadowpixel_size * 3.0); index.js:7:32275 | |
714: shadow_attenuation /= 7.0; index.js:7:32275 | |
715: index.js:7:32275 | |
716: #endif index.js:7:32275 | |
717: index.js:7:32275 | |
718: #ifdef SHADOW_FILTER_PCF9 index.js:7:32275 | |
719: index.js:7:32275 | |
720: SHADOW_TEST(su + shadowpixel_size * 4.0); index.js:7:32275 | |
721: SHADOW_TEST(su + shadowpixel_size * 3.0); index.js:7:32275 | |
722: SHADOW_TEST(su + shadowpixel_size * 2.0); index.js:7:32275 | |
723: SHADOW_TEST(su + shadowpixel_size); index.js:7:32275 | |
724: SHADOW_TEST(su); index.js:7:32275 | |
725: SHADOW_TEST(su - shadowpixel_size); index.js:7:32275 | |
726: SHADOW_TEST(su - shadowpixel_size * 2.0); index.js:7:32275 | |
727: SHADOW_TEST(su - shadowpixel_size * 3.0); index.js:7:32275 | |
728: SHADOW_TEST(su - shadowpixel_size * 4.0); index.js:7:32275 | |
729: shadow_attenuation /= 9.0; index.js:7:32275 | |
730: index.js:7:32275 | |
731: #endif index.js:7:32275 | |
732: index.js:7:32275 | |
733: #ifdef SHADOW_FILTER_PCF13 index.js:7:32275 | |
734: index.js:7:32275 | |
735: SHADOW_TEST(su + shadowpixel_size * 6.0); index.js:7:32275 | |
736: SHADOW_TEST(su + shadowpixel_size * 5.0); index.js:7:32275 | |
737: SHADOW_TEST(su + shadowpixel_size * 4.0); index.js:7:32275 | |
738: SHADOW_TEST(su + shadowpixel_size * 3.0); index.js:7:32275 | |
739: SHADOW_TEST(su + shadowpixel_size * 2.0); index.js:7:32275 | |
740: SHADOW_TEST(su + shadowpixel_size); index.js:7:32275 | |
741: SHADOW_TEST(su); index.js:7:32275 | |
742: SHADOW_TEST(su - shadowpixel_size); index.js:7:32275 | |
743: SHADOW_TEST(su - shadowpixel_size * 2.0); index.js:7:32275 | |
744: SHADOW_TEST(su - shadowpixel_size * 3.0); index.js:7:32275 | |
745: SHADOW_TEST(su - shadowpixel_size * 4.0); index.js:7:32275 | |
746: SHADOW_TEST(su - shadowpixel_size * 5.0); index.js:7:32275 | |
747: SHADOW_TEST(su - shadowpixel_size * 6.0); index.js:7:32275 | |
748: shadow_attenuation /= 13.0; index.js:7:32275 | |
749: index.js:7:32275 | |
750: #endif index.js:7:32275 | |
751: index.js:7:32275 | |
752: //color *= shadow_attenuation; index.js:7:32275 | |
753: color = mix(real_light_shadow_color, color, shadow_attenuation); index.js:7:32275 | |
754: //use shadows index.js:7:32275 | |
755: #endif index.js:7:32275 | |
756: } index.js:7:32275 | |
757: index.js:7:32275 | |
758: //use lighting index.js:7:32275 | |
759: #endif index.js:7:32275 | |
760: //color.rgb *= color.a; index.js:7:32275 | |
761: frag_color = color; index.js:7:32275 | |
762: } index.js:7:32275 | |
763: index.js:7:32275 | |
**ERROR**: CanvasShaderGLES3: Program LINK FAILED: index.js:7:32544 | |
Programs with more than 16 samplers are disallowed on Mesa drivers to avoid crashing. index.js:7:32544 | |
At: drivers/gles3/shader_gles3.cpp:164:_display_error_with_code() - CanvasShaderGLES3: Program LINK FAILED: index.js:7:32544 | |
Programs with more than 16 samplers are disallowed on Mesa drivers to avoid crashing. index.js:7:32544 | |
**ERROR**: CanvasShaderGLES3: Program LINK FAILED: index.js:7:32544 | |
Programs with more than 16 samplers are disallowed on Mesa drivers to avoid crashing. index.js:7:32544 | |
At: drivers/gles3/shader_gles3.cpp:497:get_current_version() - CanvasShaderGLES3: Program LINK FAILED: index.js:7:32544 | |
Programs with more than 16 samplers are disallowed on Mesa drivers to avoid crashing. index.js:7:32544 | |
**ERROR**: Method/Function Failed, returning: 0L index.js:7:32544 | |
At: drivers/gles3/shader_gles3.cpp:504:get_current_version() - Method/Function Failed, returning: 0L index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: false index.js:7:32544 | |
At: drivers/gles3/shader_gles3.cpp:123:bind() - Condition ' !version ' is true. returned: false index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
1: #version 300 es index.js:7:32275 | |
2: #define USE_TEXTURE_RECT index.js:7:32275 | |
3: #define USE_RGBA_SHADOWS index.js:7:32275 | |
4: #define USE_MATERIAL index.js:7:32275 | |
5: #define COLOR_USED index.js:7:32275 | |
6: precision highp float; index.js:7:32275 | |
7: precision highp int; index.js:7:32275 | |
8: precision highp sampler2D; index.js:7:32275 | |
9: precision highp samplerCube; index.js:7:32275 | |
10: precision highp sampler2DArray; index.js:7:32275 | |
11: index.js:7:32275 | |
12: uniform highp sampler2D color_texture; // texunit:0 index.js:7:32275 | |
13: /* clang-format on */ index.js:7:32275 | |
14: uniform highp vec2 color_texpixel_size; index.js:7:32275 | |
15: uniform highp sampler2D normal_texture; // texunit:1 index.js:7:32275 | |
16: index.js:7:32275 | |
17: in highp vec2 uv_interp; index.js:7:32275 | |
18: in highp vec4 color_interp; index.js:7:32275 | |
19: index.js:7:32275 | |
20: #if defined(SCREEN_TEXTURE_USED) index.js:7:32275 | |
21: index.js:7:32275 | |
22: uniform sampler2D screen_texture; // texunit:-3 index.js:7:32275 | |
23: index.js:7:32275 | |
24: #endif index.js:7:32275 | |
25: index.js:7:32275 | |
26: #if defined(SCREEN_UV_USED) index.js:7:32275 | |
27: index.js:7:32275 | |
28: uniform vec2 screen_pixel_size; index.js:7:32275 | |
29: #endif index.js:7:32275 | |
30: index.js:7:32275 | |
31: layout(std140) uniform CanvasItemData { index.js:7:32275 | |
32: index.js:7:32275 | |
33: highp mat4 projection_matrix; index.js:7:32275 | |
34: highp float time; index.js:7:32275 | |
35: }; index.js:7:32275 | |
36: index.js:7:32275 | |
37: #ifdef USE_LIGHTING index.js:7:32275 | |
38: index.js:7:32275 | |
39: layout(std140) uniform LightData { index.js:7:32275 | |
40: index.js:7:32275 | |
41: highp mat4 light_matrix; index.js:7:32275 | |
42: highp mat4 light_local_matrix; index.js:7:32275 | |
43: highp mat4 shadow_matrix; index.js:7:32275 | |
44: highp vec4 light_color; index.js:7:32275 | |
45: highp vec4 light_shadow_color; index.js:7:32275 | |
46: highp vec2 light_pos; index.js:7:32275 | |
47: highp float shadowpixel_size; index.js:7:32275 | |
48: highp float shadow_gradient; index.js:7:32275 | |
49: highp float light_height; index.js:7:32275 | |
50: highp float light_outside_alpha; index.js:7:32275 | |
51: highp float shadow_distance_mult; index.js:7:32275 | |
52: }; index.js:7:32275 | |
53: index.js:7:32275 | |
54: uniform highp sampler2D light_texture; // texunit:-1 index.js:7:32275 | |
55: in vec4 light_uv_interp; index.js:7:32275 | |
56: in vec2 transformed_light_uv; index.js:7:32275 | |
57: index.js:7:32275 | |
58: in vec4 local_rot; index.js:7:32275 | |
59: index.js:7:32275 | |
60: #ifdef USE_SHADOWS index.js:7:32275 | |
61: index.js:7:32275 | |
62: uniform highp sampler2D shadow_texture; // texunit:-2 index.js:7:32275 | |
63: in highp vec2 pos; index.js:7:32275 | |
64: index.js:7:32275 | |
65: #endif index.js:7:32275 | |
66: index.js:7:32275 | |
67: const bool at_light_pass = true; index.js:7:32275 | |
68: #else index.js:7:32275 | |
69: const bool at_light_pass = false; index.js:7:32275 | |
70: #endif index.js:7:32275 | |
71: index.js:7:32275 | |
72: uniform highp vec4 final_modulate; index.js:7:32275 | |
73: index.js:7:32275 | |
74: layout(location = 0) out highp vec4 frag_color; index.js:7:32275 | |
75: index.js:7:32275 | |
76: #if defined(USE_MATERIAL) index.js:7:32275 | |
77: index.js:7:32275 | |
78: /* clang-format off */ index.js:7:32275 | |
79: layout(std140) uniform UniformData { index.js:7:32275 | |
80: float m_iTime; index.js:7:32275 | |
81: float m_rTime; index.js:7:32275 | |
82: int m_iFrame; index.js:7:32275 | |
83: int m_anim_state; index.js:7:32275 | |
84: float m_zoom; index.js:7:32275 | |
85: vec3 m_iMouse; index.js:7:32275 | |
86: index.js:7:32275 | |
87: index.js:7:32275 | |
88: }; index.js:7:32275 | |
89: /* clang-format on */ index.js:7:32275 | |
90: index.js:7:32275 | |
91: #endif index.js:7:32275 | |
92: index.js:7:32275 | |
93: /* clang-format off */ index.js:7:32275 | |
94: uniform sampler2D m_iChannel0; index.js:7:32275 | |
95: uniform sampler2D m_iChannel1; index.js:7:32275 | |
96: uniform sampler2D m_iChannel2; index.js:7:32275 | |
97: uniform sampler2D m_iChannel3; index.js:7:32275 | |
98: uniform sampler2D m_logic; index.js:7:32275 | |
99: uniform sampler2D m_iChannel4; index.js:7:32275 | |
100: uniform sampler2D m_iChannel5; index.js:7:32275 | |
101: uniform sampler2D m_iChannel6; index.js:7:32275 | |
102: index.js:7:32275 | |
103: vec4 m_tilesx3inx4(vec2 m_uv, sampler2D m_ismlp) index.js:7:32275 | |
104: { index.js:7:32275 | |
105: float m_fms=4.0; index.js:7:32275 | |
106: int m_max_frames=8; index.js:7:32275 | |
107: if (((m_anim_state==0)||(m_anim_state==4))) index.js:7:32275 | |
108: { index.js:7:32275 | |
109: { index.js:7:32275 | |
110: m_uv.x=(1.0-m_uv.x); index.js:7:32275 | |
111: } index.js:7:32275 | |
112: ; index.js:7:32275 | |
113: } index.js:7:32275 | |
114: m_uv*=(1.0/m_fms); index.js:7:32275 | |
115: int m_index=(int((m_iTime*float(m_max_frames)))%int(m_max_frames)); index.js:7:32275 | |
116: if ((m_index>=3)) index.js:7:32275 | |
117: { index.js:7:32275 | |
118: m_index+=1; index.js:7:32275 | |
119: } index.js:7:32275 | |
120: if ((m_index>6)) index.js:7:32275 | |
121: { index.js:7:32275 | |
122: m_index+=1; index.js:7:32275 | |
123: } index.js:7:32275 | |
124: float m_idx=float(m_index); index.js:7:32275 | |
125: m_uv+=((1.0/m_zoom)*((1.0/m_fms)*vec2(float((int(m_idx)%int(m_fms))), float((int(m_idx)/int(m_fms)))))); index.js:7:32275 | |
126: m_uv+=((-0.5*1.0)/m_fms); index.js:7:32275 | |
127: m_uv*=m_zoom; index.js:7:32275 | |
128: m_uv=clamp(m_uv, (((-1.0/m_fms)*0.5)+((1.0/m_fms)*vec2(float((int(m_idx)%int(m_fms))), float((int(m_idx)/int(m_fms)))))), (((1.0/m_fms)*0.5)+((1.0/m_fms)*vec2(float((int(m_idx)%int(m_fms))), float((int(m_idx)/int(m_fms))))))); index.js:7:32275 | |
129: m_uv+=((0.5*1.0)/m_fms); index.js:7:32275 | |
130: vec4 m_col=texture(m_ismlp, m_uv); index.js:7:32275 | |
131: return m_col; } index.js:7:32275 | |
132: index.js:7:32275 | |
133: vec4 m_get_collision_hp() index.js:7:32275 | |
134: { index.js:7:32275 | |
135: return texelFetch(m_logic, ivec2(1,0), 0).xyzw; } index.js:7:32275 | |
136: index.js:7:32275 | |
137: void m_mainImage(out vec4 m_fragColor, vec2 m_fragCoord, vec2 m_iResolution) index.js:7:32275 | |
138: { index.js:7:32275 | |
139: vec2 m_uv=(m_fragCoord/m_iResolution); index.js:7:32275 | |
140: vec4 m_col=vec4(0.0,0.0,0.0,0.0); index.js:7:32275 | |
141: if (((m_anim_state==0)||(m_anim_state==1))) index.js:7:32275 | |
142: { index.js:7:32275 | |
143: { index.js:7:32275 | |
144: m_col=m_tilesx3inx4(m_uv, m_iChannel0); index.js:7:32275 | |
145: } index.js:7:32275 | |
146: ; index.js:7:32275 | |
147: } index.js:7:32275 | |
148: else index.js:7:32275 | |
149: { index.js:7:32275 | |
150: if ((m_anim_state==2)) index.js:7:32275 | |
151: { index.js:7:32275 | |
152: { index.js:7:32275 | |
153: m_col=m_tilesx3inx4(m_uv, m_iChannel2); index.js:7:32275 | |
154: } index.js:7:32275 | |
155: ; index.js:7:32275 | |
156: } index.js:7:32275 | |
157: else index.js:7:32275 | |
158: { index.js:7:32275 | |
159: if ((m_anim_state==3)) index.js:7:32275 | |
160: { index.js:7:32275 | |
161: { index.js:7:32275 | |
162: m_col=m_tilesx3inx4(m_uv, m_iChannel1); index.js:7:32275 | |
163: } index.js:7:32275 | |
164: ; index.js:7:32275 | |
165: } index.js:7:32275 | |
166: else index.js:7:32275 | |
167: { index.js:7:32275 | |
168: if (((m_anim_state==4)||(m_anim_state==5))) index.js:7:32275 | |
169: { index.js:7:32275 | |
170: { index.js:7:32275 | |
171: m_col=m_tilesx3inx4(m_uv, m_iChannel3); index.js:7:32275 | |
172: } index.js:7:32275 | |
173: ; index.js:7:32275 | |
174: } index.js:7:32275 | |
175: else index.js:7:32275 | |
176: { index.js:7:32275 | |
177: if ((m_anim_state==6)) index.js:7:32275 | |
178: { index.js:7:32275 | |
179: { index.js:7:32275 | |
180: m_col=m_tilesx3inx4(m_uv, m_iChannel5); index.js:7:32275 | |
181: } index.js:7:32275 | |
182: ; index.js:7:32275 | |
183: } index.js:7:32275 | |
184: else index.js:7:32275 | |
185: { index.js:7:32275 | |
186: if ((m_anim_state==7)) index.js:7:32275 | |
187: { index.js:7:32275 | |
188: { index.js:7:32275 | |
189: m_col=m_tilesx3inx4(m_uv, m_iChannel4); index.js:7:32275 | |
190: } index.js:7:32275 | |
191: ; index.js:7:32275 | |
192: } index.js:7:32275 | |
193: } index.js:7:32275 | |
194: } index.js:7:32275 | |
195: } index.js:7:32275 | |
196: } index.js:7:32275 | |
197: } index.js:7:32275 | |
198: vec2 m_state=m_get_collision_hp().yw; index.js:7:32275 | |
199: float m_lost_hp_timer=m_state.y; index.js:7:32275 | |
200: float m_player_hp=m_state.x; index.js:7:32275 | |
201: bool m_is_player_alive=(m_player_hp>=1.0); index.js:7:32275 | |
202: bool m_is_player_win=(m_player_hp>=1000.0); index.js:7:32275 | |
203: m_fragColor=m_col; index.js:7:32275 | |
204: m_fragColor.rgb=((m_fragColor.rgb*0.25)+(m_fragColor.rgb*m_fragColor.rgb)); index.js:7:32275 | |
205: m_fragColor.rgb+=(vec3(1.8,0.2,0.1)*smoothstep(0.25, 0.5, m_lost_hp_timer)); index.js:7:32275 | |
206: if (!m_is_player_alive) index.js:7:32275 | |
207: { index.js:7:32275 | |
208: m_fragColor.rgb=vec3((dot(m_fragColor.rgb, vec3(1.0,1.0,1.0))/3.0)); index.js:7:32275 | |
209: } index.js:7:32275 | |
210: float m_startup_zoom_timer_sec=6.0; index.js:7:32275 | |
211: m_fragColor.a*=smoothstep(5.5, m_startup_zoom_timer_sec, m_rTime); index.js:7:32275 | |
212: if ((!m_is_player_alive||m_is_player_win)) index.js:7:32275 | |
213: { index.js:7:32275 | |
214: m_fragColor.a*=smoothstep(0.0, 0.5, m_lost_hp_timer); index.js:7:32275 | |
215: } index.js:7:32275 | |
216: } index.js:7:32275 | |
217: index.js:7:32275 | |
218: index.js:7:32275 | |
219: /* clang-format on */ index.js:7:32275 | |
220: index.js:7:32275 | |
221: void light_compute( index.js:7:32275 | |
222: inout vec4 light, index.js:7:32275 | |
223: inout vec2 light_vec, index.js:7:32275 | |
224: inout float light_height, index.js:7:32275 | |
225: inout vec4 light_color, index.js:7:32275 | |
226: vec2 light_uv, index.js:7:32275 | |
227: inout vec4 shadow_color, index.js:7:32275 | |
228: vec3 normal, index.js:7:32275 | |
229: vec2 uv, index.js:7:32275 | |
230: #if defined(SCREEN_UV_USED) index.js:7:32275 | |
231: vec2 screen_uv, index.js:7:32275 | |
232: #endif index.js:7:32275 | |
233: vec4 color) { index.js:7:32275 | |
234: index.js:7:32275 | |
235: #if defined(USE_LIGHT_SHADER_CODE) index.js:7:32275 | |
236: index.js:7:32275 | |
237: /* clang-format off */ index.js:7:32275 | |
238: index.js:7:32275 | |
239: index.js:7:32275 | |
240: /* clang-format on */ index.js:7:32275 | |
241: index.js:7:32275 | |
242: #endif index.js:7:32275 | |
243: } index.js:7:32275 | |
244: index.js:7:32275 | |
245: #ifdef USE_TEXTURE_RECT index.js:7:32275 | |
246: index.js:7:32275 | |
247: uniform vec4 dst_rect; index.js:7:32275 | |
248: uniform vec4 src_rect; index.js:7:32275 | |
249: uniform bool clip_rect_uv; index.js:7:32275 | |
250: index.js:7:32275 | |
251: #ifdef USE_NINEPATCH index.js:7:32275 | |
252: index.js:7:32275 | |
253: in highp vec2 pixel_size_interp; index.js:7:32275 | |
254: index.js:7:32275 | |
255: uniform int np_repeat_v; index.js:7:32275 | |
256: uniform int np_repeat_h; index.js:7:32275 | |
257: uniform bool np_draw_center; index.js:7:32275 | |
258: // left top right bottom in pixel coordinates index.js:7:32275 | |
259: uniform vec4 np_margins; index.js:7:32275 | |
260: index.js:7:32275 | |
261: float map_ninepatch_axis(float pixel, float draw_size, float tex_pixel_size, float margin_begin, float margin_end, int np_repeat, inout int draw_center) { index.js:7:32275 | |
262: index.js:7:32275 | |
263: float tex_size = 1.0 / tex_pixel_size; index.js:7:32275 | |
264: index.js:7:32275 | |
265: if (pixel < margin_begin) { index.js:7:32275 | |
266: return pixel * tex_pixel_size; index.js:7:32275 | |
267: } else if (pixel >= draw_size - margin_end) { index.js:7:32275 | |
268: return (tex_size - (draw_size - pixel)) * tex_pixel_size; index.js:7:32275 | |
269: } else { index.js:7:32275 | |
270: if (!np_draw_center) { index.js:7:32275 | |
271: draw_center--; index.js:7:32275 | |
272: } index.js:7:32275 | |
273: index.js:7:32275 | |
274: if (np_repeat == 0) { //stretch index.js:7:32275 | |
275: //convert to ratio index.js:7:32275 | |
276: float ratio = (pixel - margin_begin) / (draw_size - margin_begin - margin_end); index.js:7:32275 | |
277: //scale to source texture index.js:7:32275 | |
278: return (margin_begin + ratio * (tex_size - margin_begin - margin_end)) * tex_pixel_size; index.js:7:32275 | |
279: } else if (np_repeat == 1) { //tile index.js:7:32275 | |
280: //convert to ratio index.js:7:32275 | |
281: float ofs = mod((pixel - margin_begin), tex_size - margin_begin - margin_end); index.js:7:32275 | |
282: //scale to source texture index.js:7:32275 | |
283: return (margin_begin + ofs) * tex_pixel_size; index.js:7:32275 | |
284: } else if (np_repeat == 2) { //tile fit index.js:7:32275 | |
285: //convert to ratio index.js:7:32275 | |
286: float src_area = draw_size - margin_begin - margin_end; index.js:7:32275 | |
287: float dst_area = tex_size - margin_begin - margin_end; index.js:7:32275 | |
288: float scale = max(1.0, floor(src_area / max(dst_area, 0.0000001) + 0.5)); index.js:7:32275 | |
289: index.js:7:32275 | |
290: //convert to ratio index.js:7:32275 | |
291: float ratio = (pixel - margin_begin) / src_area; index.js:7:32275 | |
292: ratio = mod(ratio * scale, 1.0); index.js:7:32275 | |
293: return (margin_begin + ratio * dst_area) * tex_pixel_size; index.js:7:32275 | |
294: } index.js:7:32275 | |
295: } index.js:7:32275 | |
296: } index.js:7:32275 | |
297: index.js:7:32275 | |
298: #endif index.js:7:32275 | |
299: #endif index.js:7:32275 | |
300: index.js:7:32275 | |
301: uniform bool use_default_normal; index.js:7:32275 | |
302: index.js:7:32275 | |
303: void main() { index.js:7:32275 | |
304: index.js:7:32275 | |
305: vec4 color = color_interp; index.js:7:32275 | |
306: vec2 uv = uv_interp; index.js:7:32275 | |
307: index.js:7:32275 | |
308: #ifdef USE_TEXTURE_RECT index.js:7:32275 | |
309: index.js:7:32275 | |
310: #ifdef USE_NINEPATCH index.js:7:32275 | |
311: index.js:7:32275 | |
312: int draw_center = 2; index.js:7:32275 | |
313: uv = vec2( index.js:7:32275 | |
314: map_ninepatch_axis(pixel_size_interp.x, abs(dst_rect.z), color_texpixel_size.x, np_margins.x, np_margins.z, np_repeat_h, draw_center), index.js:7:32275 | |
315: map_ninepatch_axis(pixel_size_interp.y, abs(dst_rect.w), color_texpixel_size.y, np_margins.y, np_margins.w, np_repeat_v, draw_center)); index.js:7:32275 | |
316: index.js:7:32275 | |
317: if (draw_center == 0) { index.js:7:32275 | |
318: color.a = 0.0; index.js:7:32275 | |
319: } index.js:7:32275 | |
320: index.js:7:32275 | |
321: uv = uv * src_rect.zw + src_rect.xy; //apply region if needed index.js:7:32275 | |
322: #endif index.js:7:32275 | |
323: index.js:7:32275 | |
324: if (clip_rect_uv) { index.js:7:32275 | |
325: index.js:7:32275 | |
326: uv = clamp(uv, src_rect.xy, src_rect.xy + abs(src_rect.zw)); index.js:7:32275 | |
327: } index.js:7:32275 | |
328: index.js:7:32275 | |
329: #endif index.js:7:32275 | |
330: index.js:7:32275 | |
331: #if !defined(COLOR_USED) index.js:7:32275 | |
332: //default behavior, texture by color index.js:7:32275 | |
333: index.js:7:32275 | |
334: #ifdef USE_DISTANCE_FIELD index.js:7:32275 | |
335: const float smoothing = 1.0 / 32.0; index.js:7:32275 | |
336: float distance = textureLod(color_texture, uv, 0.0).a; index.js:7:32275 | |
337: color.a = smoothstep(0.5 - smoothing, 0.5 + smoothing, distance) * color.a; index.js:7:32275 | |
338: #else index.js:7:32275 | |
339: color *= texture(color_texture, uv); index.js:7:32275 | |
340: index.js:7:32275 | |
341: #endif index.js:7:32275 | |
342: index.js:7:32275 | |
343: #endif index.js:7:32275 | |
344: index.js:7:32275 | |
345: vec3 normal; index.js:7:32275 | |
346: index.js:7:32275 | |
347: #if defined(NORMAL_USED) index.js:7:32275 | |
348: index.js:7:32275 | |
349: bool normal_used = true; index.js:7:32275 | |
350: #else index.js:7:32275 | |
351: bool normal_used = false; index.js:7:32275 | |
352: #endif index.js:7:32275 | |
353: index.js:7:32275 | |
354: if (use_default_normal) { index.js:7:32275 | |
355: normal.xy = textureLod(normal_texture, uv, 0.0).xy * 2.0 - 1.0; index.js:7:32275 | |
356: normal.z = sqrt(1.0 - dot(normal.xy, normal.xy)); index.js:7:32275 | |
357: normal_used = true; index.js:7:32275 | |
358: } else { index.js:7:32275 | |
359: normal = vec3(0.0, 0.0, 1.0); index.js:7:32275 | |
360: } index.js:7:32275 | |
361: index.js:7:32275 | |
362: #if defined(SCREEN_UV_USED) index.js:7:32275 | |
363: vec2 screen_uv = gl_FragCoord.xy * screen_pixel_size; index.js:7:32275 | |
364: #endif index.js:7:32275 | |
365: index.js:7:32275 | |
366: { index.js:7:32275 | |
367: float normal_depth = 1.0; index.js:7:32275 | |
368: index.js:7:32275 | |
369: #if defined(NORMALMAP_USED) index.js:7:32275 | |
370: vec3 normal_map = vec3(0.0, 0.0, 1.0); index.js:7:32275 | |
371: normal_used = true; index.js:7:32275 | |
372: #endif index.js:7:32275 | |
373: index.js:7:32275 | |
374: /* clang-format off */ index.js:7:32275 | |
375: { index.js:7:32275 | |
376: vec2 m_iResolution=floor((1.0/color_texpixel_size)); index.js:7:32275 | |
377: m_mainImage(color, (uv*m_iResolution), m_iResolution); index.js:7:32275 | |
378: } index.js:7:32275 | |
379: index.js:7:32275 | |
380: index.js:7:32275 | |
381: /* clang-format on */ index.js:7:32275 | |
382: index.js:7:32275 | |
383: #if defined(NORMALMAP_USED) index.js:7:32275 | |
384: normal = mix(vec3(0.0, 0.0, 1.0), normal_map * vec3(2.0, -2.0, 1.0) - vec3(1.0, -1.0, 0.0), normal_depth); index.js:7:32275 | |
385: #endif index.js:7:32275 | |
386: } index.js:7:32275 | |
387: #ifdef DEBUG_ENCODED_32 index.js:7:32275 | |
388: highp float enc32 = dot(color, highp vec4(1.0 / (256.0 * 256.0 * 256.0), 1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0)); index.js:7:32275 | |
389: color = vec4(vec3(enc32), 1.0); index.js:7:32275 | |
390: #endif index.js:7:32275 | |
391: index.js:7:32275 | |
392: color *= final_modulate; index.js:7:32275 | |
393: index.js:7:32275 | |
394: #ifdef USE_LIGHTING index.js:7:32275 | |
395: index.js:7:32275 | |
396: vec2 light_vec = transformed_light_uv; index.js:7:32275 | |
397: index.js:7:32275 | |
398: if (normal_used) { index.js:7:32275 | |
399: normal.xy = mat2(local_rot.xy, local_rot.zw) * normal.xy; index.js:7:32275 | |
400: } index.js:7:32275 | |
401: index.js:7:32275 | |
402: float att = 1.0; index.js:7:32275 | |
403: index.js:7:32275 | |
404: vec2 light_uv = light_uv_interp.xy; index.js:7:32275 | |
405: vec4 light = texture(light_texture, light_uv); index.js:7:32275 | |
406: index.js:7:32275 | |
407: if (any(lessThan(light_uv_interp.xy, vec2(0.0, 0.0))) || any(greaterThanEqual(light_uv_interp.xy, vec2(1.0, 1.0)))) { index.js:7:32275 | |
408: color.a *= light_outside_alpha; //invisible index.js:7:32275 | |
409: index.js:7:32275 | |
410: } else { index.js:7:32275 | |
411: float real_light_height = light_height; index.js:7:32275 | |
412: vec4 real_light_color = light_color; index.js:7:32275 | |
413: vec4 real_light_shadow_color = light_shadow_color; index.js:7:32275 | |
414: index.js:7:32275 | |
415: #if defined(USE_LIGHT_SHADER_CODE) index.js:7:32275 | |
416: //light is written by the light shader index.js:7:32275 | |
417: light_compute( index.js:7:32275 | |
418: light, index.js:7:32275 | |
419: light_vec, index.js:7:32275 | |
420: real_light_height, index.js:7:32275 | |
421: real_light_color, index.js:7:32275 | |
422: light_uv, index.js:7:32275 | |
423: real_light_shadow_color, index.js:7:32275 | |
424: normal, index.js:7:32275 | |
425: uv, index.js:7:32275 | |
426: #if defined(SCREEN_UV_USED) index.js:7:32275 | |
427: screen_uv, index.js:7:32275 | |
428: #endif index.js:7:32275 | |
429: color); index.js:7:32275 | |
430: #endif index.js:7:32275 | |
431: index.js:7:32275 | |
432: light *= real_light_color; index.js:7:32275 | |
433: index.js:7:32275 | |
434: if (normal_used) { index.js:7:32275 | |
435: vec3 light_normal = normalize(vec3(light_vec, -real_light_height)); index.js:7:32275 | |
436: light *= max(dot(-light_normal, normal), 0.0); index.js:7:32275 | |
437: } index.js:7:32275 | |
438: index.js:7:32275 | |
439: color *= light; index.js:7:32275 | |
440: index.js:7:32275 | |
441: #ifdef USE_SHADOWS index.js:7:32275 | |
442: // Reset light_vec to compute shadows, the shadow map is created from the light origin, so it only index.js:7:32275 | |
443: // makes sense to compute shadows from there. index.js:7:32275 | |
444: light_vec = light_uv_interp.zw; index.js:7:32275 | |
445: index.js:7:32275 | |
446: float angle_to_light = -atan(light_vec.x, light_vec.y); index.js:7:32275 | |
447: float PI = 3.14159265358979323846264; index.js:7:32275 | |
448: /*int i = int(mod(floor((angle_to_light+7.0*PI/6.0)/(4.0*PI/6.0))+1.0, 3.0)); // +1 pq os indices estao em ordem 2,0,1 nos arrays index.js:7:32275 | |
449: float ang*/ index.js:7:32275 | |
450: index.js:7:32275 | |
451: float su, sz; index.js:7:32275 | |
452: index.js:7:32275 | |
453: float abs_angle = abs(angle_to_light); index.js:7:32275 | |
454: vec2 point; index.js:7:32275 | |
455: float sh; index.js:7:32275 | |
456: if (abs_angle < 45.0 * PI / 180.0) { index.js:7:32275 | |
457: point = light_vec; index.js:7:32275 | |
458: sh = 0.0 + (1.0 / 8.0); index.js:7:32275 | |
459: } else if (abs_angle > 135.0 * PI / 180.0) { index.js:7:32275 | |
460: point = -light_vec; index.js:7:32275 | |
461: sh = 0.5 + (1.0 / 8.0); index.js:7:32275 | |
462: } else if (angle_to_light > 0.0) { index.js:7:32275 | |
463: index.js:7:32275 | |
464: point = vec2(light_vec.y, -light_vec.x); index.js:7:32275 | |
465: sh = 0.25 + (1.0 / 8.0); index.js:7:32275 | |
466: } else { index.js:7:32275 | |
467: index.js:7:32275 | |
468: point = vec2(-light_vec.y, light_vec.x); index.js:7:32275 | |
469: sh = 0.75 + (1.0 / 8.0); index.js:7:32275 | |
470: } index.js:7:32275 | |
471: index.js:7:32275 | |
472: highp vec4 s = shadow_matrix * vec4(point, 0.0, 1.0); index.js:7:32275 | |
473: s.xyz /= s.w; index.js:7:32275 | |
474: su = s.x * 0.5 + 0.5; index.js:7:32275 | |
475: sz = s.z * 0.5 + 0.5; index.js:7:32275 | |
476: //sz=lightlength(light_vec); index.js:7:32275 | |
477: index.js:7:32275 | |
478: highp float shadow_attenuation = 0.0; index.js:7:32275 | |
479: index.js:7:32275 | |
480: #ifdef USE_RGBA_SHADOWS index.js:7:32275 | |
481: index.js:7:32275 | |
482: #define SHADOW_DEPTH(m_tex, m_uv) dot(texture((m_tex), (m_uv)), vec4(1.0 / (256.0 * 256.0 * 256.0), 1.0 / (256.0 * 256.0), 1.0 / 256.0, 1.0)) index.js:7:32275 | |
483: index.js:7:32275 | |
484: #else index.js:7:32275 | |
485: index.js:7:32275 | |
486: #define SHADOW_DEPTH(m_tex, m_uv) (texture((m_tex), (m_uv)).r) index.js:7:32275 | |
487: index.js:7:32275 | |
488: #endif index.js:7:32275 | |
489: index.js:7:32275 | |
490: #ifdef SHADOW_USE_GRADIENT index.js:7:32275 | |
491: index.js:7:32275 | |
492: #define SHADOW_TEST(m_ofs) \ index.js:7:32275 | |
493: { \ index.js:7:32275 | |
494: highp float sd = SHADOW_DEPTH(shadow_texture, vec2(m_ofs, sh)); \ index.js:7:32275 | |
495: shadow_attenuation += 1.0 - smoothstep(sd, sd + shadow_gradient, sz); \ index.js:7:32275 | |
496: } index.js:7:32275 | |
497: index.js:7:32275 | |
498: #else index.js:7:32275 | |
499: index.js:7:32275 | |
500: #define SHADOW_TEST(m_ofs) \ index.js:7:32275 | |
501: { \ index.js:7:32275 | |
502: highp float sd = SHADOW_DEPTH(shadow_texture, vec2(m_ofs, sh)); \ index.js:7:32275 | |
503: shadow_attenuation += step(sz, sd); \ index.js:7:32275 | |
504: } index.js:7:32275 | |
505: index.js:7:32275 | |
506: #endif index.js:7:32275 | |
507: index.js:7:32275 | |
508: #ifdef SHADOW_FILTER_NEAREST index.js:7:32275 | |
509: index.js:7:32275 | |
510: SHADOW_TEST(su); index.js:7:32275 | |
511: index.js:7:32275 | |
512: #endif index.js:7:32275 | |
513: index.js:7:32275 | |
514: #ifdef SHADOW_FILTER_PCF3 index.js:7:32275 | |
515: index.js:7:32275 | |
516: SHADOW_TEST(su + shadowpixel_size); index.js:7:32275 | |
517: SHADOW_TEST(su); index.js:7:32275 | |
518: SHADOW_TEST(su - shadowpixel_size); index.js:7:32275 | |
519: shadow_attenuation /= 3.0; index.js:7:32275 | |
520: index.js:7:32275 | |
521: #endif index.js:7:32275 | |
522: index.js:7:32275 | |
523: #ifdef SHADOW_FILTER_PCF5 index.js:7:32275 | |
524: index.js:7:32275 | |
525: SHADOW_TEST(su + shadowpixel_size * 2.0); index.js:7:32275 | |
526: SHADOW_TEST(su + shadowpixel_size); index.js:7:32275 | |
527: SHADOW_TEST(su); index.js:7:32275 | |
528: SHADOW_TEST(su - shadowpixel_size); index.js:7:32275 | |
529: SHADOW_TEST(su - shadowpixel_size * 2.0); index.js:7:32275 | |
530: shadow_attenuation /= 5.0; index.js:7:32275 | |
531: index.js:7:32275 | |
532: #endif index.js:7:32275 | |
533: index.js:7:32275 | |
534: #ifdef SHADOW_FILTER_PCF7 index.js:7:32275 | |
535: index.js:7:32275 | |
536: SHADOW_TEST(su + shadowpixel_size * 3.0); index.js:7:32275 | |
537: SHADOW_TEST(su + shadowpixel_size * 2.0); index.js:7:32275 | |
538: SHADOW_TEST(su + shadowpixel_size); index.js:7:32275 | |
539: SHADOW_TEST(su); index.js:7:32275 | |
540: SHADOW_TEST(su - shadowpixel_size); index.js:7:32275 | |
541: SHADOW_TEST(su - shadowpixel_size * 2.0); index.js:7:32275 | |
542: SHADOW_TEST(su - shadowpixel_size * 3.0); index.js:7:32275 | |
543: shadow_attenuation /= 7.0; index.js:7:32275 | |
544: index.js:7:32275 | |
545: #endif index.js:7:32275 | |
546: index.js:7:32275 | |
547: #ifdef SHADOW_FILTER_PCF9 index.js:7:32275 | |
548: index.js:7:32275 | |
549: SHADOW_TEST(su + shadowpixel_size * 4.0); index.js:7:32275 | |
550: SHADOW_TEST(su + shadowpixel_size * 3.0); index.js:7:32275 | |
551: SHADOW_TEST(su + shadowpixel_size * 2.0); index.js:7:32275 | |
552: SHADOW_TEST(su + shadowpixel_size); index.js:7:32275 | |
553: SHADOW_TEST(su); index.js:7:32275 | |
554: SHADOW_TEST(su - shadowpixel_size); index.js:7:32275 | |
555: SHADOW_TEST(su - shadowpixel_size * 2.0); index.js:7:32275 | |
556: SHADOW_TEST(su - shadowpixel_size * 3.0); index.js:7:32275 | |
557: SHADOW_TEST(su - shadowpixel_size * 4.0); index.js:7:32275 | |
558: shadow_attenuation /= 9.0; index.js:7:32275 | |
559: index.js:7:32275 | |
560: #endif index.js:7:32275 | |
561: index.js:7:32275 | |
562: #ifdef SHADOW_FILTER_PCF13 index.js:7:32275 | |
563: index.js:7:32275 | |
564: SHADOW_TEST(su + shadowpixel_size * 6.0); index.js:7:32275 | |
565: SHADOW_TEST(su + shadowpixel_size * 5.0); index.js:7:32275 | |
566: SHADOW_TEST(su + shadowpixel_size * 4.0); index.js:7:32275 | |
567: SHADOW_TEST(su + shadowpixel_size * 3.0); index.js:7:32275 | |
568: SHADOW_TEST(su + shadowpixel_size * 2.0); index.js:7:32275 | |
569: SHADOW_TEST(su + shadowpixel_size); index.js:7:32275 | |
570: SHADOW_TEST(su); index.js:7:32275 | |
571: SHADOW_TEST(su - shadowpixel_size); index.js:7:32275 | |
572: SHADOW_TEST(su - shadowpixel_size * 2.0); index.js:7:32275 | |
573: SHADOW_TEST(su - shadowpixel_size * 3.0); index.js:7:32275 | |
574: SHADOW_TEST(su - shadowpixel_size * 4.0); index.js:7:32275 | |
575: SHADOW_TEST(su - shadowpixel_size * 5.0); index.js:7:32275 | |
576: SHADOW_TEST(su - shadowpixel_size * 6.0); index.js:7:32275 | |
577: shadow_attenuation /= 13.0; index.js:7:32275 | |
578: index.js:7:32275 | |
579: #endif index.js:7:32275 | |
580: index.js:7:32275 | |
581: //color *= shadow_attenuation; index.js:7:32275 | |
582: color = mix(real_light_shadow_color, color, shadow_attenuation); index.js:7:32275 | |
583: //use shadows index.js:7:32275 | |
584: #endif index.js:7:32275 | |
585: } index.js:7:32275 | |
586: index.js:7:32275 | |
587: //use lighting index.js:7:32275 | |
588: #endif index.js:7:32275 | |
589: //color.rgb *= color.a; index.js:7:32275 | |
590: frag_color = color; index.js:7:32275 | |
591: } index.js:7:32275 | |
592: index.js:7:32275 | |
**ERROR**: CanvasShaderGLES3: Program LINK FAILED: index.js:7:32544 | |
Programs with more than 16 samplers are disallowed on Mesa drivers to avoid crashing. index.js:7:32544 | |
At: drivers/gles3/shader_gles3.cpp:164:_display_error_with_code() - CanvasShaderGLES3: Program LINK FAILED: index.js:7:32544 | |
Programs with more than 16 samplers are disallowed on Mesa drivers to avoid crashing. index.js:7:32544 | |
**ERROR**: CanvasShaderGLES3: Program LINK FAILED: index.js:7:32544 | |
Programs with more than 16 samplers are disallowed on Mesa drivers to avoid crashing. index.js:7:32544 | |
At: drivers/gles3/shader_gles3.cpp:497:get_current_version() - CanvasShaderGLES3: Program LINK FAILED: index.js:7:32544 | |
Programs with more than 16 samplers are disallowed on Mesa drivers to avoid crashing. index.js:7:32544 | |
**ERROR**: Method/Function Failed, returning: 0L index.js:7:32544 | |
At: drivers/gles3/shader_gles3.cpp:504:get_current_version() - Method/Function Failed, returning: 0L index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: false index.js:7:32544 | |
At: drivers/gles3/shader_gles3.cpp:123:bind() - Condition ' !version ' is true. returned: false index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
**ERROR**: Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1 index.js:7:32544 | |
Error: WebGL warning: linkProgram: Programs with more than 16 samplers are disallowed on Mesa drivers to avoid crashing. 3 index.js:7:267986 | |
Error: WebGL warning: drawArrays: The current program is not linked. 28 index.js:7:261188 | |
Error: WebGL: No further warnings will be reported for this WebGL context. (already reported 32 warnings) index.js:7:261188 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment