如果我将 Godot 3 项目导出到 HTML 并在本地服务器上运行我的 index.html,则会收到以下错误。任何想法为什么?如果我在网上测试其他 Godot 3 项目,我也会卡住。我尝试在 Ubuntu 中安装 emscripten,但没有成功。我在网络上尝试了 HTML 中的旧 Godot 2 项目,它们在 2D 中工作。但是,我想导出我的 Godot 3 项目,但我在 2D 或 3D 项目中都没有成功。
Output: Clear
167:
168: #endif
169:
170: uniform bool z_flip;
171:
172: #ifdef USE_SOURCE_PANORAMA
173:
174: vec4 texturePanorama(vec3 normal,sampler2D pano ) {
175:
176: vec2 st = vec2(
177: atan(normal.x, normal.z),
178: acos(normal.y)
179: );
180:
181: if(st.x < 0.0)
182: st.x += M_PI*2.0;
183:
184: st/=vec2(M_PI*2.0,M_PI);
185:
186: return textureLod(pano,st,0.0);
187:
188: }
189:
190: #endif
191:
192: #ifdef USE_SOURCE_DUAL_PARABOLOID_ARRAY
193:
194:
195: vec4 textureDualParaboloidArray(vec3 normal) {
196:
197: vec3 norm = normalize(normal);
198: norm.xy/=1.0+abs(norm.z);
199: norm.xy=norm.xy * vec2(0.5,0.25) + vec2(0.5,0.25);
200: if (norm.z<0.0) {
201: norm.y=0.5-norm.y+0.5;
202: }
203: return textureLod(source_dual_paraboloid_array, vec3(norm.xy, float(source_array_index) ), 0.0);
204:
205: }
206:
207: #endif
208:
209: void main() {
210:
211: #ifdef USE_DUAL_PARABOLOID
212:
213: vec3 N = vec3( uv_interp * 2.0 - 1.0, 0.0 );
214: N.z = 0.5 - 0.5*((N.x * N.x) + (N.y * N.y));
215: N = normalize(N);
216:
217: if (z_flip) {
218: N.y=-N.y; //y is flipped to improve blending between both sides
219: N.z=-N.z;
220: }
221:
222:
223: #else
224: vec2 uv = (uv_interp * 2.0) - 1.0;
225: vec3 N = texelCoordToVec(uv, face_id);
226: #endif
227: //vec4 color = color_interp;
228:
229: #ifdef USE_DIRECT_WRITE
230:
231: #ifdef USE_SOURCE_PANORAMA
232:
233: frag_color=vec4(texturePanorama(N,source_panorama).rgb,1.0);
234: #endif
235:
236: #ifdef USE_SOURCE_DUAL_PARABOLOID_ARRAY
237:
238: frag_color=vec4(textureDualParaboloidArray(N).rgb,1.0);
239: #endif
240:
241: #if !defined(USE_SOURCE_DUAL_PARABOLOID_ARRAY) && !defined(USE_SOURCE_PANORAMA)
242:
243: N.y=-N.y;
244: frag_color=vec4(texture(N,source_cube).rgb,1.0);
245: #endif
246:
247:
248:
249:
250: #else
251:
252: vec4 sum = vec4(0.0, 0.0, 0.0, 0.0);
253:
254: for(uint sampleNum = 0u; sampleNum < SAMPLE_COUNT; sampleNum++) {
255: vec2 xi = Hammersley(sampleNum, SAMPLE_COUNT);
256:
257: vec3 H = ImportanceSampleGGX( xi, roughness, N );
258: vec3 V = N;
259: vec3 L = normalize(2.0 * dot( V, H ) * H - V);
260:
261: float ndotl = clamp(dot(N, L),0.0,1.0);
262:
263: if (ndotl>0.0) {
264: #ifdef USE_SOURCE_PANORAMA
265: sum.rgb += texturePanorama(H,source_panorama).rgb *ndotl;
266: #endif
267:
268: #ifdef USE_SOURCE_DUAL_PARABOLOID_ARRAY
269:
270: sum.rgb += textureDualParaboloidArray(H).rgb *ndotl;
271: #endif
272:
273: #if !defined(USE_SOURCE_DUAL_PARABOLOID_ARRAY) && !defined(USE_SOURCE_PANORAMA)
274: H.y=-H.y;
275: sum.rgb += textureLod(source_cube, H, 0.0).rgb *ndotl;
276: #endif
277: sum.a += ndotl;
278: }
279: }
280: sum /= sum.a;
281:
282: frag_color = vec4(sum.rgb, 1.0);
283:
284: #endif
285:
286: }
287:
288:
**ERROR**: CubemapFilterShaderGLES3: Fragment Program Compilation Failed:
**ERROR**: ERROR: 0:24: '2863311530u' : integer overflow
**ERROR**: ERROR: 0:24: '&' : wrong operand types no operation '&' exists that takes a left-hand operand of type 'in highp uint' and a right operand of type 'const mediump int' (or there is no acceptable conversion)
**ERROR**: ERROR: 0:25: '3435973836u' : integer overflow
**ERROR**: ERROR: 0:25: '&' : wrong operand types no operation '&' exists that takes a left-hand operand of type 'in highp uint' and a right operand of type 'const mediump int' (or there is no acceptable conversion)
**ERROR**: ERROR: 0:26: '4042322160u' : integer overflow
**ERROR**: ERROR: 0:26: '&' : wrong operand types no operation '&' exists that takes a left-hand operand of type 'in highp uint' and a right operand of type 'const mediump int' (or there is no acceptable conversion)
**ERROR**: ERROR: 0:27: '4278255360u' : integer overflow
**ERROR**: ERROR: 0:27: '&' : wrong operand types no operation '&' exists that takes a left-hand operand of type 'in highp uint' and a right operand of type 'const mediump int' (or there is no acceptable conversion)
**ERROR**:
**ERROR**: At: drivers/gles3/shader_gles3.cpp:168:_display_error_with_code() - CubemapFilterShaderGLES3: Fragment Program Compilation Failed:
**ERROR**: ERROR: 0:24: '2863311530u' : integer overflow
**ERROR**: ERROR: 0:24: '&' : wrong operand types no operation '&' exists that takes a left-hand operand of type 'in highp uint' and a right operand of type 'const mediump int' (or there is no acceptable conversion)
**ERROR**: ERROR: 0:25: '3435973836u' : integer overflow
**ERROR**: ERROR: 0:25: '&' : wrong operand types no operation '&' exists that takes a left-hand operand of type 'in highp uint' and a right operand of type 'const mediump int' (or there is no acceptable conversion)
**ERROR**: ERROR: 0:26: '4042322160u' : integer overflow
**ERROR**: ERROR: 0:26: '&' : wrong operand types no operation '&' exists that takes a left-hand operand of type 'in highp uint' and a right operand of type 'const mediump int' (or there is no acceptable conversion)
**ERROR**: ERROR: 0:27: '4278255360u' : integer overflow
**ERROR**: ERROR: 0:27: '&' : wrong operand types no operation '&' exists that takes a left-hand operand of type 'in highp uint' and a right operand of type 'const mediump int' (or there is no acceptable conversion)
**ERROR**:
**ERROR**: CubemapFilterShaderGLES3: Fragment Program Compilation Failed:
**ERROR**: ERROR: 0:24: '2863311530u' : integer overflow
**ERROR**: ERROR: 0:24: '&' : wrong operand types no operation '&' exists that takes a left-hand operand of type 'in highp uint' and a right operand of type 'const mediump int' (or there is no acceptable conversion)
**ERROR**: ERROR: 0:25: '3435973836u' : integer overflow
**ERROR**: ERROR: 0:25: '&' : wrong operand types no operation '&' exists that takes a left-hand operand of type 'in highp uint' and a right operand of type 'const mediump int' (or there is no acceptable conversion)
**ERROR**: ERROR: 0:26: '4042322160u' : integer overflow
**ERROR**: ERROR: 0:26: '&' : wrong operand types no operation '&' exists that takes a left-hand operand of type 'in highp uint' and a right operand of type 'const mediump int' (or there is no acceptable conversion)
**ERROR**: ERROR: 0:27: '4278255360u' : integer overflow
**ERROR**: ERROR: 0:27: '&' : wrong operand types no operation '&' exists that takes a left-hand operand of type 'in highp uint' and a right operand of type 'const mediump int' (or there is no acceptable conversion)
**ERROR**:
**ERROR**: At: drivers/gles3/shader_gles3.cpp:441:get_current_version() - CubemapFilterShaderGLES3: Fragment Program Compilation Failed:
**ERROR**: ERROR: 0:24: '2863311530u' : integer overflow
**ERROR**: ERROR: 0:24: '&' : wrong operand types no operation '&' exists that takes a left-hand operand of type 'in highp uint' and a right operand of type 'const mediump int' (or there is no acceptable conversion)
**ERROR**: ERROR: 0:25: '3435973836u' : integer overflow
**ERROR**: ERROR: 0:25: '&' : wrong operand types no operation '&' exists that takes a left-hand operand of type 'in highp uint' and a right operand of type 'const mediump int' (or there is no acceptable conversion)
**ERROR**: ERROR: 0:26: '4042322160u' : integer overflow
**ERROR**: ERROR: 0:26: '&' : wrong operand types no operation '&' exists that takes a left-hand operand of type 'in highp uint' and a right operand of type 'const mediump int' (or there is no acceptable conversion)
**ERROR**: ERROR: 0:27: '4278255360u' : integer overflow
**ERROR**: ERROR: 0:27: '&' : wrong operand types no operation '&' exists that takes a left-hand operand of type 'in highp uint' and a right operand of type 'const mediump int' (or there is no acceptable conversion)
**ERROR**:
**ERROR**: Method/Function Failed, returning: 0L
**ERROR**: At: drivers/gles3/shader_gles3.cpp:449:get_current_version() - Method/Function Failed, returning: 0L
**ERROR**: Condition ' !version ' is true. returned: false
**ERROR**: At: drivers/gles3/shader_gles3.cpp:123:bind() - Condition ' !version ' is true. returned: false
**ERROR**: Condition ' !version ' is true. returned: -1
**ERROR**: At: drivers/gles3/shader_gles3.h:377:_get_uniform() - Condition ' !version ' is true. returned: -1
**ERROR**: Condition ' !version ' is true. returned: -1
**ERROR**: At: drivers/gles3/shader_gles3.h:377:_get_uniform() - Condition ' !version ' is true. returned: -1
**ERROR**: Condition ' !version ' is true. returned: -1
**ERROR**: At: drivers/gles3/shader_gles3.h:377:_get_uniform() - Condition ' !version ' is true. returned: -1
**ERROR**: Condition ' !version ' is true. returned: -1
**ERROR**: At: drivers/gles3/shader_gles3.h:377:_get_uniform() - Condition ' !version ' is true. returned: -1
**ERROR**: Condition ' !version ' is true. returned: -1
**ERROR**: At: drivers/gles3/shader_gles3.h:377:_get_uniform() - Condition ' !version ' is true. returned: -1
1: #version 300 es
2: #define USE_TEXTURE_RECT
3: #define USE_RGBA_SHADOWS
4: precision highp float;
5: precision highp int;
6: precision highp sampler2D;
7: precision highp samplerCube;
8: precision highp sampler2DArray;
9:
10:
11: layout(location=0) in highp vec2 vertex;
12: layout(location=3) in vec4 color_attrib;
13:
14: #ifdef USE_TEXTURE_RECT
15:
16: uniform vec4 dst_rect;
17: uniform vec4 src_rect;
18:
19: #else
20:
21: #ifdef USE_INSTANCING
22:
23: layout(location=8) in highp vec4 instance_xform0;
24: layout(location=9) in highp vec4 instance_xform1;
25: layout(location=10) in highp vec4 instance_xform2;
26: layout(location=11) in lowp vec4 instance_color;
27:
28: #ifdef USE_INSTANCE_CUSTOM
29: layout(location=12) in highp vec4 instance_custom_data;
30: #endif
31:
32: #endif
33:
34: layout(location=4) in highp vec2 uv_attrib;
35:
36: //skeletn
37: #endif
38:
39: uniform highp vec2 color_texpixel_size;
40:
41:
42: layout(std140) uniform CanvasItemData { //ubo:0
43:
44: highp mat4 projection_matrix;
45: highp float time;
46: };
47:
48: uniform highp mat4 modelview_matrix;
49: uniform highp mat4 extra_matrix;
50:
51:
52: out highp vec2 uv_interp;
53: out mediump vec4 color_interp;
54:
55: #ifdef USE_NINEPATCH
56:
57: out highp vec2 pixel_size_interp;
58: #endif
59:
60:
61: #ifdef USE_LIGHTING
62:
63: layout(std140) uniform LightData { //ubo:1
64:
65: //light matrices
66: highp mat4 light_matrix;
67: highp mat4 light_local_matrix;
68: highp mat4 shadow_matrix;
69: highp vec4 light_color;
70: highp vec4 light_shadow_color;
71: highp vec2 light_pos;
72: highp float shadowpixel_size;
73: highp float shadow_gradient;
74: highp float light_height;
75: highp float light_outside_alpha;
76: highp float shadow_distance_mult;
77: };
78:
79:
80: out vec4 light_uv_interp;
81:
82:
83: out vec4 local_rot;
84:
85:
86: #ifdef USE_SHADOWS
87: out highp vec2 pos;
88: #endif
89:
90: const bool at_light_pass = true;
91: #else
92: const bool at_light_pass = false;
93: #endif
94:
95: #ifdef USE_PARTICLES
96: uniform int h_frames;
97: uniform int v_frames;
98: #endif
99:
100:
101: #if defined(USE_MATERIAL)
102:
103: layout(std140) uniform UniformData { //ubo:2
104:
105:
106: };
107:
108: #endif
109:
110:
111: void main() {
112:
113: vec4 color = color_attrib;
114:
115: #ifdef USE_INSTANCING
116: mat4 extra_matrix2 = extra_matrix * transpose(mat4(instance_xform0,instance_xform1,instance_xform2,vec4(0.0,0.0,0.0,1.0)));
117: color*=instance_color;
118: vec4 instance_custom = instance_custom_data;
119:
120: #else
121: mat4 extra_matrix2 = extra_matrix;
122: vec4 instance_custom = vec4(0.0);
123: #endif
124:
125: #ifdef USE_TEXTURE_RECT
126:
127: if (dst_rect.z < 0.0) { // Transpose is encoded as negative dst_rect.z
128: uv_interp = src_rect.xy + abs(src_rect.zw) * vertex.yx;
129: } else {
130: uv_interp = src_rect.xy + abs(src_rect.zw) * vertex;
131: }
132: highp vec4 outvec = vec4(dst_rect.xy + abs(dst_rect.zw) * mix(vertex,vec2(1.0,1.0)-vertex,lessThan(src_rect.zw,vec2(0.0,0.0))),0.0,1.0);
133:
134: #else
135: uv_interp = uv_attrib;
136: highp vec4 outvec = vec4(vertex,0.0,1.0);
137: #endif
138:
139:
140: #ifdef USE_PARTICLES
141: //scale by texture size
142: outvec.xy/=color_texpixel_size;
143:
144: //compute h and v frames and adjust UV interp for animation
145: int total_frames = h_frames * v_frames;
146: int frame = min(int(float(total_frames) *instance_custom.z),total_frames-1);
147: float frame_w = 1.0/float(h_frames);
148: float frame_h = 1.0/float(v_frames);
149: uv_interp.x = uv_interp.x * frame_w + frame_w * float(frame % h_frames);
150: uv_interp.y = uv_interp.y * frame_h + frame_h * float(frame / h_frames);
151:
152: #endif
153:
154: #define extra_matrix extra_matrix2
155:
156: {
157:
158:
159: }
160:
161:
162: #ifdef USE_NINEPATCH
163:
164: pixel_size_interp=abs(dst_rect.zw) * vertex;
165: #endif
166:
167: #if !defined(SKIP_TRANSFORM_USED)
168: outvec = extra_matrix * outvec;
169: outvec = modelview_matrix * outvec;
170: #endif
171:
172: #undef extra_matrix
173:
174: color_interp = color;
175:
176: #ifdef USE_PIXEL_SNAP
177:
178: outvec.xy=floor(outvec+0.5).xy;
179: #endif
180:
181:
182: gl_Position = projection_matrix * outvec;
183:
184: #ifdef USE_LIGHTING
185:
186: light_uv_interp.xy = (light_matrix * outvec).xy;
187: light_uv_interp.zw =(light_local_matrix * outvec).xy;
188: #ifdef USE_SHADOWS
189: pos=outvec.xy;
190: #endif
191:
192:
193: local_rot.xy=normalize( (modelview_matrix * ( extra_matrix * vec4(1.0,0.0,0.0,0.0) )).xy );
194: local_rot.zw=normalize( (modelview_matrix * ( extra_matrix * vec4(0.0,1.0,0.0,0.0) )).xy );
195: #ifdef USE_TEXTURE_RECT
196: local_rot.xy*=sign(src_rect.z);
197: local_rot.zw*=sign(src_rect.w);
198: #endif
199:
200:
201:
202: #endif
203:
204: }
205:
206:
**ERROR**: CanvasShaderGLES3: Vertex Program Compilation Failed:
**ERROR**: ERROR: 0:29: 'mix' : no matching overloaded function found
**ERROR**:
**ERROR**: At: drivers/gles3/shader_gles3.cpp:168:_display_error_with_code() - CanvasShaderGLES3: Vertex Program Compilation Failed:
**ERROR**: ERROR: 0:29: 'mix' : no matching overloaded function found
**ERROR**:
**ERROR**: Method/Function Failed, returning: 0L
**ERROR**: At: drivers/gles3/shader_gles3.cpp:354:get_current_version() - Method/Function Failed, returning: 0L
**ERROR**: Condition ' !version ' is true. returned: false
**ERROR**: At: drivers/gles3/shader_gles3.cpp:123:bind() - Condition ' !version ' is true. returned: false
**ERROR**: Condition ' !version ' is true. returned: -1
**ERROR**: At: drivers/gles3/shader_gles3.h:377:_get_uniform() - Condition ' !version ' is true. returned: -1
**ERROR**: Condition ' !version ' is true. returned: -1
**ERROR**: At: drivers/gles3/shader_gles3.h:377:_get_uniform() - Condition ' !version ' is true. returned: -1
**ERROR**: Condition ' !version ' is true. returned: -1
**ERROR**: At: drivers/gles3/shader_gles3.h:377:_get_uniform() - Condition ' !version ' is true. returned: -1
**ERROR**: Condition ' !version ' is true. returned: -1
**ERROR**: At: drivers/gles3/shader_gles3.h:377:_get_uniform() - Condition ' !version ' is true. returned: -1