-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different look in Google Chrome and Mozilla Firefox #63
Comments
Hi @Mexikaner9, could you share the errors that you're getting with Chrome? |
`mapsjs-core.js:369 Tangram [error]: Style: error compiling program for style '0_dashes' (program key 'program') Object Error: Error: WebGL program error: // tangram-block-start: ShaderProgram, camera, 0
// tangram-block-end: ShaderProgram, camera, 0 // tangram-block-start: Material, material, 0 // tangram-block-start: ShaderProgram, camera, 0
// tangram-block-end: ShaderProgram, camera, 0 // tangram-block-start: Material, material, 0 // tangram-block-start: ShaderProgram, lighting, 0 // tangram-block-start: ShaderProgram, lighting, 1
// tangram-block-end: ShaderProgram, lighting, 1 // tangram-block-start: ShaderProgram, lighting, 2
// tangram-block-end: ShaderProgram, lighting, 2 // tangram-block-start: ShaderProgram, global, 0 // tangram-block-end: ShaderProgram, global, 0 // tangram-block-start: ShaderProgram, global, 1 // tangram-block-start: ShaderProgram, global, 2 #if defined(TANGRAM_FEATURE_SELECTION) && defined(TANGRAM_VERTEX_SHADER) // tangram-block-end: ShaderProgram, global, 2 void main(){ // tangram-block-start: ShaderProgram, setup, 0 #if defined(TANGRAM_FEATURE_SELECTION) && defined(TANGRAM_VERTEX_SHADER) // tangram-block-end: ShaderProgram, setup, 0 // tangram-block-start: ShaderProgram, setup, 1
// tangram-block-end: ShaderProgram, setup, 1 // tangram-block-start: Material, setup, 0 material = u_material; // tangram-block-end: Material, setup, 0 #ifdef TANGRAM_TEXTURE_COORDS extrude*=width; v_position=position;v_normal=normalize(u_normalMatrix*TANGRAM_NORMAL);v_color=a_color; v_lighting=calculateLighting(position.xyz-u_eye,normal,vec4(1.)); // tangram-block-start: ShaderProgram, camera, 0
// tangram-block-end: ShaderProgram, camera, 0 // tangram-block-start: Material, material, 0 // tangram-block-start: ShaderProgram, lighting, 0 // tangram-block-start: ShaderProgram, lighting, 1
// tangram-block-end: ShaderProgram, lighting, 1 // tangram-block-start: ShaderProgram, lighting, 2
// tangram-block-end: ShaderProgram, lighting, 2 // tangram-block-start: ShaderProgram, global, 0 // tangram-block-end: ShaderProgram, global, 0 // tangram-block-start: ShaderProgram, global, 1 // tangram-block-start: ShaderProgram, global, 2 #if defined(TANGRAM_FEATURE_SELECTION) && defined(TANGRAM_VERTEX_SHADER) // tangram-block-end: ShaderProgram, global, 2 // tangram-block-start: ShaderProgram, utils, 0 // tangram-block-end: ShaderProgram, utils, 0 void main(void){ // tangram-block-start: ShaderProgram, setup, 0 #if defined(TANGRAM_FEATURE_SELECTION) && defined(TANGRAM_VERTEX_SHADER) // tangram-block-end: ShaderProgram, setup, 0 // tangram-block-start: ShaderProgram, setup, 1
// tangram-block-end: ShaderProgram, setup, 1 // tangram-block-start: Material, setup, 0 material = u_material; // tangram-block-end: Material, setup, 0 vec4 color=v_color;vec3 normal=TANGRAM_NORMAL; #endif #if defined(TANGRAM_LIGHTING_FRAGMENT) gl_FragColor=color;} |
I also face this issue. Error: Error: WebGL program error: // tangram-block-start: ShaderProgram, camera, 0
// tangram-block-end: ShaderProgram, camera, 0 // tangram-block-start: Material, material, 0 // tangram-block-start: ShaderProgram, lighting, 0 // tangram-block-start: ShaderProgram, lighting, 1
// tangram-block-end: ShaderProgram, lighting, 1 // tangram-block-start: ShaderProgram, lighting, 2
// tangram-block-end: ShaderProgram, lighting, 2 // tangram-block-start: ShaderProgram, global, 0 // tangram-block-end: ShaderProgram, global, 0 // tangram-block-start: ShaderProgram, global, 1 // tangram-block-start: ShaderProgram, global, 2 #if defined(TANGRAM_FEATURE_SELECTION) && defined(TANGRAM_VERTEX_SHADER) // tangram-block-end: ShaderProgram, global, 2 // tangram-block-start: ShaderProgram, global, 3 const float PI=3.141592653589793;const float THETA=15.0PI/180.0;float cross(in vec2 v1,in vec2 v2){return v1.xv2.y-v1.yv2.x;}float signed_distance(in vec2 v1,in vec2 v2,in vec2 v3){return cross(v2-v1,v1-v3)/length(v2-v1);}void rotate(in vec2 v,in float angle,out vec2 result){float cosine=cos(angle);float sine=sin(angle);result=vec2(cosinev.x-sinev.y,sinev.x+cosine*v.y);}void main(){ // tangram-block-start: ShaderProgram, setup, 0 #if defined(TANGRAM_FEATURE_SELECTION) && defined(TANGRAM_VERTEX_SHADER) // tangram-block-end: ShaderProgram, setup, 0 // tangram-block-start: ShaderProgram, setup, 1
// tangram-block-end: ShaderProgram, setup, 1 // tangram-block-start: Material, setup, 0 material = u_material; // tangram-block-end: Material, setup, 0 #ifdef TANGRAM_MODEL_POSITION_BASE_ZOOM_VARYING v_position=position;v_normal=normalize(u_normalMatrix*TANGRAM_NORMAL); v_lighting=calculateLighting(position.xyz-u_eye,normal,vec4(1.)); // tangram-block-start: ShaderProgram, camera, 0
// tangram-block-end: ShaderProgram, camera, 0 // tangram-block-start: Material, material, 0 // tangram-block-start: ShaderProgram, lighting, 0 // tangram-block-start: ShaderProgram, lighting, 1
// tangram-block-end: ShaderProgram, lighting, 1 // tangram-block-start: ShaderProgram, lighting, 2
// tangram-block-end: ShaderProgram, lighting, 2 // tangram-block-start: ShaderProgram, global, 0 // tangram-block-end: ShaderProgram, global, 0 // tangram-block-start: ShaderProgram, global, 1 // tangram-block-start: ShaderProgram, global, 2 #if defined(TANGRAM_FEATURE_SELECTION) && defined(TANGRAM_VERTEX_SHADER) // tangram-block-end: ShaderProgram, global, 2 // tangram-block-start: ShaderProgram, global, 3 // tangram-block-start: ShaderProgram, utils, 0 // tangram-block-end: ShaderProgram, utils, 0 const float PI=3.141592653589793;const float HALF_PI=PI/2.0;const float THETA=15.0PI/180.0;/Compute distance to cap.@param{int}type The Type of the cap(see CAP_TYPE in pattern_lines)@param{float}dx The distance of the pixel from the beginning of the line(not straight distance,but along the legs)@param{float}dy The distance of the pixel from the midline(see v_distances in vertex shader,aka ±1half_line_width)@param{float}aa_radius The distance from the mid-line from where antialiasing starts.For example for a linewidth 10px width and 2px filter radius it is 10px/2-2px=3px.@return{float}distance/float cap(int type,float dx,float dy,float aa_radius){float dist=0.0;dx=abs(dx);dy=abs(dy);if(type==1)dist=sqrt(dxdx+dydy);else if(type==3)dist=(dx+abs(dy));else if(type==2)dist=max(abs(dy),(aa_radius+dx-abs(dy)));else if(type==4)dist=max(dx,dy);else if(type==5)dist=max(dx+aa_radius,dy);return dist;}/Compute distance to join.@param{int}type The type of the join(see JOIN_TYPE in pattern_lines)@param{vec2}segment Interpolated a_segment attribute from the vertex shader@param{vec2}texcoord Pair of u/v coordinates to identify the 4 different extruded points of the segment.@param{vec2}distances 2 component vector where:x is the distance of the pixel from the beginning of the line(along the legs)y is the distance of the pixel from the midline(see v_distances in vertex shader,±1half_line_width)@param{vec2}miter Miter point coordiante@param{float}miter_limit The miter limit*@param{float}linewidth The width of the line*@return{float}computed distance*/float join(in int type,in vec2 segment,in vec2 texcoord,in vec2 distances,in vec2 miter,in float miter_limit,in float linewidth){float dx=distances.x;float result=abs(distances.y);if((dx<segment.x)||(dx>segment.y)){if(type==1){float s=dx<segment.x ? segment.x : segment.y;result=max(result,length(distances-vec2(s,0.0)));}else{float m=abs(texcoord.x>=0.0 ? miter.x : miter.y);if(type==2){result=max(result,m);}else if(type==0){result=max(result,m-miter_limit*linewidth/2.0);}}}return result;}void main(void){ // tangram-block-start: ShaderProgram, setup, 0 #if defined(TANGRAM_FEATURE_SELECTION) && defined(TANGRAM_VERTEX_SHADER) // tangram-block-end: ShaderProgram, setup, 0 // tangram-block-start: ShaderProgram, setup, 1
// tangram-block-end: ShaderProgram, setup, 1 // tangram-block-start: Material, setup, 0 material = u_material; // tangram-block-end: Material, setup, 0 vec4 color=v_color;vec3 normal=TANGRAM_NORMAL; #endif #if defined(TANGRAM_LIGHTING_FRAGMENT) if(v_color.a<=0.0){discard;}bool solid=(u_dash_index==0.0);bool closed=v_linewidth_and_closed<0.0;float dx=v_distances.x;float dy=v_distances.y;float linewidth=abs(v_linewidth_and_closed);float aa_radius=linewidth/2.0-u_antialias;float dist=0.0;vec2 linecaps=u_linecaps;vec2 dash_caps=u_dash_caps;float line_start=0.0;float line_stop=v_length;if(solid){dist=abs(dy);bool potentialCap=!closed&&v_joinIndicator<0.0;if(potentialCap&&dx<line_start){dist=cap(int(u_linecaps.x),abs(dx),abs(dy),aa_radius);}else if(potentialCap&&dx>line_stop){dist=cap(int(u_linecaps.y),abs(dx)-line_stop,abs(dy),aa_radius);}else{dist=join(int(u_linejoin),v_segment,v_texcoord,v_distances,v_miter,u_miter_limit,linewidth);}}else{float segment_start=v_segment.x;float segment_stop=v_segment.y;float segment_center=(segment_start+segment_stop)/2.0;float freq=u_dash_periodlinewidth;float dash_phase=u_dash_phase-1e-5;float u=mod(dx+dash_phaselinewidth,freq);vec4 tex=texture2D(u_dash_atlas,vec2(u/freq,u_dash_index));float dash_center=float(tex.x)255.0linewidth;float dash_type=floor(float(tex.y)255.0+0.5);float _start=float(tex.z)255.0linewidth;float _stop=float(tex.a)255.0linewidth;float dash_start=dx-u+_start;float dash_stop=dx-u+_stop;if((dash_stop<segment_start)&&(dash_caps.x!=5.0)){float u=mod(segment_start+dash_phaselinewidth,freq);vec4 tex=texture2D(u_dash_atlas,vec2(u/freq,u_dash_index));dash_center=float(tex.x)255.0linewidth;float _start=float(tex.z)255.0linewidth;float _stop=float(tex.a)255.0linewidth;dash_start=segment_start-u+_start;dash_stop=segment_start-u+_stop;}else if((dash_start>segment_stop)&&(dash_caps.y!=5.0)){float u=mod(segment_stop+dash_phaselinewidth,freq);vec4 tex=texture2D(u_dash_atlas,vec2(u/freq,u_dash_index));dash_center=float(tex.x)255.0linewidth;float _start=float(tex.z)255.0linewidth;float _stop=float(tex.a)255.0linewidth;dash_start=segment_stop-u+_start;dash_stop=segment_stop-u+_stop;}bool discontinuous=((dx<segment_center)&&abs(v_angles.x)>THETA)||((dx>=segment_center)&&abs(v_angles.y)>THETA);float d_join=join(int(u_linejoin),v_segment,v_texcoord,v_distances,v_miter,u_miter_limit,linewidth);if(closed){line_start+=linewidth/2.0;line_stop-=linewidth/2.0;}if(dash_stop<=line_start){discard;}if(dash_start>=line_stop){discard;}if(discontinuous){if((dash_start>segment_stop)){discard;}if((dash_stop<segment_start)){discard;}if(dash_caps.x==1.0){if((u>_stop)&&(dash_stop>segment_stop)&&(abs(v_angles.y)<HALF_PI)){discard;}}if(dash_caps.y==1.0){if((u<_start)&&(dash_start<segment_start)&&(abs(v_angles.x)<HALF_PI)){discard;}}if((dash_caps.x!=1.0)&&(dash_caps.x!=5.0)){if((dash_start<segment_start)&&(abs(v_angles.x)<HALF_PI)){float a=v_angles.x/2.0;float cos_a=cos(a);float sin_a=sin(a);float x=(segment_start-dx)cos_a-dysin_a;float y=(segment_start-dx)sin_a+dycos_a;if(x>0.0){discard;}dash_caps.x=4.0;}}if((dash_caps.y!=1.0)&&(dash_caps.y!=5.0)){if((dash_stop>segment_stop)&&(abs(v_angles.y)<HALF_PI)){float a=v_angles.y/2.0;float cos_a=cos(a);float sin_a=sin(a);float x=(dx-segment_stop)cos_a-dysin_a;float y=(dx-segment_stop)sin_a+dycos_a;if(x>0.0){discard;}dash_caps.y=4.0;}}}if((dx<line_start)&&(dash_start<=line_start)&&(dash_stop>line_start)){dist=cap(int(linecaps.x),dx-line_start,dy,aa_radius);}else if((dx>line_stop)&&(dash_stop>line_stop)&&(dash_start<line_stop)){dist=cap(int(linecaps.y),dx-line_stop,dy,aa_radius);}else if(dash_type==1.0){dist=cap(int(dash_caps.x),abs(dash_center-u),dy,aa_radius);if((dx>line_start)&&(dx<line_stop)){dist=max(dist,d_join);}}else if(dash_type==0.0){dist=abs(dy);}else if(dash_type==2.0){dist=cap(int(dash_caps.y),abs(u-dash_center),dy,aa_radius);if((dx>line_start)&&(dx<line_stop)){dist=max(dist,d_join);}}if((dx>line_start)&&(dx<line_stop)){if((dx<=segment_start)&&(dash_start<=segment_start)&&(dash_stop>=segment_start)){dist=d_join;float angle=HALF_PI+v_angles.x;float f=abs((segment_start-dx)cos(angle)-dysin(angle));dist=max(f,dist);}else if((dx>segment_stop)&&(dash_start<=segment_stop)&&(dash_stop>=segment_stop)){dist=d_join;float angle=HALF_PI+v_angles.y;float f=abs((dx-segment_stop)cos(angle)-dysin(angle));dist=max(f,dist);}else if(dx<(segment_start-linewidth/2.)){discard;}else if(dx>(segment_stop+linewidth/2.)){discard;}}else if(dx<(segment_start-linewidth/2.)){discard;}else if(dx>(segment_stop+linewidth/2.)){discard;}}dist=dist-aa_radius;if(dist>=0.0){if(u_antialias==0.0){discard;}else{color=vec4(color.rgb,exp(-distdist)*color.a);}} |
Me pasa lo mismo, todo funcionaba bien hasta hace menos de 1 mes. No estoy seguro si el problema puede venir luego de alguna actualización. En la versión de chrome 86.0.4240.198 funciona correctamente y en la 87.0.4280.66 no. |
The issue is not reproducible with the latest stable Chrome - |
Hello,
my example http://nirvana.bplaced.net/21/ looks very nice in Mozilla Firefox, but in Google Chrome the map is really ugly.
Why does the map in Google Chrome not look like in Mozilla Firefox?
Why do the developer tools show so many errors?
Screenshot Google Chrome:
![Google Chrome](https://user-images.githubusercontent.com/14358354/64922786-799e4e80-d7d3-11e9-84e8-6d390386719a.png)
Screenshot Mozilla Firefox:
![Mozilla Firefox](https://user-images.githubusercontent.com/14358354/64922787-799e4e80-d7d3-11e9-97c1-f4d6ca2fbc3d.png)
The text was updated successfully, but these errors were encountered: