mirror of https://gitee.com/antv-l7/antv-l7
fix: regl 参数 for ie11
This commit is contained in:
parent
5049e9de17
commit
144db9149d
|
@ -70,6 +70,7 @@ module.exports = api => {
|
||||||
'@babel/plugin-proposal-optional-chaining',
|
'@babel/plugin-proposal-optional-chaining',
|
||||||
'@babel/plugin-proposal-nullish-coalescing-operator',
|
'@babel/plugin-proposal-nullish-coalescing-operator',
|
||||||
'@babel/plugin-syntax-async-generators',
|
'@babel/plugin-syntax-async-generators',
|
||||||
|
'@babel/plugin-transform-parameters',
|
||||||
[
|
[
|
||||||
'@babel/plugin-proposal-decorators',
|
'@babel/plugin-proposal-decorators',
|
||||||
{
|
{
|
||||||
|
@ -115,7 +116,7 @@ module.exports = api => {
|
||||||
// isCDNBundle ? 'inline-webgl-constants' : {},
|
// isCDNBundle ? 'inline-webgl-constants' : {},
|
||||||
],
|
],
|
||||||
ignore: [
|
ignore: [
|
||||||
'node_modules',
|
// 'node_modules',
|
||||||
// /node_modules\/(?![d3*])/,
|
// /node_modules\/(?![d3*])/,
|
||||||
...!isTest ? [
|
...!isTest ? [
|
||||||
'**/*.test.tsx',
|
'**/*.test.tsx',
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
"@babel/plugin-proposal-object-rest-spread": "^7.7.4",
|
"@babel/plugin-proposal-object-rest-spread": "^7.7.4",
|
||||||
"@babel/plugin-proposal-optional-chaining": "^7.6.0",
|
"@babel/plugin-proposal-optional-chaining": "^7.6.0",
|
||||||
"@babel/plugin-syntax-async-generators": "^7.7.4",
|
"@babel/plugin-syntax-async-generators": "^7.7.4",
|
||||||
|
"@babel/plugin-transform-parameters": "^7.8.4",
|
||||||
"@babel/plugin-transform-runtime": "^7.7.6",
|
"@babel/plugin-transform-runtime": "^7.7.6",
|
||||||
"@babel/preset-env": "^7.5.5",
|
"@babel/preset-env": "^7.5.5",
|
||||||
"@babel/preset-react": "^7.0.0",
|
"@babel/preset-react": "^7.0.0",
|
||||||
|
@ -105,7 +106,6 @@
|
||||||
"stylelint-config-styled-components": "^0.1.1",
|
"stylelint-config-styled-components": "^0.1.1",
|
||||||
"stylelint-processor-styled-components": "^1.3.2",
|
"stylelint-processor-styled-components": "^1.3.2",
|
||||||
"svg-inline-loader": "^0.8.0",
|
"svg-inline-loader": "^0.8.0",
|
||||||
"tapable": "^1.1.3",
|
|
||||||
"ts-jest": "^24.0.2",
|
"ts-jest": "^24.0.2",
|
||||||
"tslint": "^5.11.0",
|
"tslint": "^5.11.0",
|
||||||
"tslint-config-prettier": "^1.15.0",
|
"tslint-config-prettier": "^1.15.0",
|
||||||
|
|
|
@ -28,8 +28,7 @@
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/antvis/L7#readme",
|
"homepage": "https://github.com/antvis/L7#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"async": "^3.1.1",
|
"async": "^3.1.1"
|
||||||
"async-es": "^3.1.1"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/async": "^3.0.8"
|
"@types/async": "^3.0.8"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { parallel } from 'async-es';
|
// tslint:disable-next-line:no-submodule-imports
|
||||||
|
import parallel from 'async/parallel';
|
||||||
import { CallBack } from './IHook';
|
import { CallBack } from './IHook';
|
||||||
export default class AsyncParallelHook {
|
export default class AsyncParallelHook {
|
||||||
private tasks: any[];
|
private tasks: any[];
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
"merge-json-schemas": "^1.0.0",
|
"merge-json-schemas": "^1.0.0",
|
||||||
"probe.gl": "^3.1.1",
|
"probe.gl": "^3.1.1",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
"tapable": "^2.0.0-beta.8",
|
|
||||||
"viewport-mercator-project": "^6.2.1"
|
"viewport-mercator-project": "^6.2.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
@ -16,15 +16,15 @@
|
||||||
#define SHIFT_LEFT23 8388608.0
|
#define SHIFT_LEFT23 8388608.0
|
||||||
#define SHIFT_LEFT24 16777216.0
|
#define SHIFT_LEFT24 16777216.0
|
||||||
|
|
||||||
vec2 unpack_float(const float packedValue) {
|
vec2 unpack_float(float packedValue) {
|
||||||
int packedIntValue = int(packedValue);
|
int packedIntValue = int(packedValue);
|
||||||
int v0 = packedIntValue / 256;
|
int v0 = packedIntValue / 256;
|
||||||
return vec2(v0, packedIntValue - v0 * 256);
|
return vec2(v0, packedIntValue - v0 * 256);
|
||||||
}
|
}
|
||||||
|
|
||||||
vec4 decode_color(const vec2 encodedColor) {
|
vec4 decode_color(vec2 encodedColor) {
|
||||||
return vec4(
|
return vec4(
|
||||||
unpack_float(encodedColor[0]) / 255.0,
|
unpack_float(encodedColor[0]) / 255.0,
|
||||||
unpack_float(encodedColor[1]) / 255.0
|
unpack_float(encodedColor[1]) / 255.0
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,8 +59,8 @@ vec3 calc_directional_light(DirectionalLight light, vec3 normal, vec3 viewDir) {
|
||||||
// float spec = pow(max(dot(viewDir, reflectDir), 0.0), SHININESS);
|
// float spec = pow(max(dot(viewDir, reflectDir), 0.0), SHININESS);
|
||||||
// // attenuation
|
// // attenuation
|
||||||
// float distance = length(light.position - fragPos);
|
// float distance = length(light.position - fragPos);
|
||||||
// float attenuation = 1.0 / (light.constant + light.linear * distance +
|
// float attenuation = 1.0 / (light.constant + light.linear * distance +
|
||||||
// light.quadratic * (distance * distance));
|
// light.quadratic * (distance * distance));
|
||||||
|
|
||||||
// vec3 ambient = light.ambient * u_Ambient;
|
// vec3 ambient = light.ambient * u_Ambient;
|
||||||
// vec3 diffuse = light.diffuse * diff * u_Diffuse;
|
// vec3 diffuse = light.diffuse * diff * u_Diffuse;
|
||||||
|
@ -94,4 +94,4 @@ vec3 calc_lighting(vec3 position, vec3 normal, vec3 viewDir) {
|
||||||
// weight += calc_spot_light(u_SpotLights[i], normal, position, viewDir);
|
// weight += calc_spot_light(u_SpotLights[i], normal, position, viewDir);
|
||||||
// }
|
// }
|
||||||
return weight;
|
return weight;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ float sdCircle(vec2 p, float r) {
|
||||||
}
|
}
|
||||||
|
|
||||||
float sdEquilateralTriangle(vec2 p) {
|
float sdEquilateralTriangle(vec2 p) {
|
||||||
const float k = sqrt(3.0);
|
float k = sqrt(3.0);
|
||||||
p.x = abs(p.x) - 1.0;
|
p.x = abs(p.x) - 1.0;
|
||||||
p.y = p.y + 1.0/k;
|
p.y = p.y + 1.0/k;
|
||||||
if( p.x + k*p.y > 0.0 ) p = vec2(p.x-k*p.y,-k*p.x-p.y)/2.0;
|
if( p.x + k*p.y > 0.0 ) p = vec2(p.x-k*p.y,-k*p.x-p.y)/2.0;
|
||||||
|
@ -24,16 +24,16 @@ float sdBox(vec2 p, vec2 b) {
|
||||||
}
|
}
|
||||||
|
|
||||||
float sdPentagon(vec2 p, float r) {
|
float sdPentagon(vec2 p, float r) {
|
||||||
const vec3 k = vec3(0.809016994,0.587785252,0.726542528);
|
vec3 k = vec3(0.809016994,0.587785252,0.726542528);
|
||||||
p.x = abs(p.x);
|
p.x = abs(p.x);
|
||||||
p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);
|
p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);
|
||||||
p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);
|
p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);
|
||||||
p -= vec2(clamp(p.x,-r*k.z,r*k.z),r);
|
p -= vec2(clamp(p.x,-r*k.z,r*k.z),r);
|
||||||
return length(p)*sign(p.y);
|
return length(p)*sign(p.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
float sdHexagon(vec2 p, float r) {
|
float sdHexagon(vec2 p, float r) {
|
||||||
const vec3 k = vec3(-0.866025404,0.5,0.577350269);
|
vec3 k = vec3(-0.866025404,0.5,0.577350269);
|
||||||
p = abs(p);
|
p = abs(p);
|
||||||
p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;
|
p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;
|
||||||
p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);
|
p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);
|
||||||
|
@ -41,7 +41,7 @@ float sdHexagon(vec2 p, float r) {
|
||||||
}
|
}
|
||||||
|
|
||||||
float sdOctogon(vec2 p, float r) {
|
float sdOctogon(vec2 p, float r) {
|
||||||
const vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 );
|
vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 );
|
||||||
p = abs(p);
|
p = abs(p);
|
||||||
p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);
|
p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);
|
||||||
p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);
|
p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);
|
||||||
|
@ -50,7 +50,7 @@ float sdOctogon(vec2 p, float r) {
|
||||||
}
|
}
|
||||||
|
|
||||||
float sdHexagram(vec2 p, float r) {
|
float sdHexagram(vec2 p, float r) {
|
||||||
const vec4 k=vec4(-0.5,0.8660254038,0.5773502692,1.7320508076);
|
vec4 k=vec4(-0.5,0.8660254038,0.5773502692,1.7320508076);
|
||||||
p = abs(p);
|
p = abs(p);
|
||||||
p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;
|
p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;
|
||||||
p -= 2.0*min(dot(k.yx,p),0.0)*k.yx;
|
p -= 2.0*min(dot(k.yx,p),0.0)*k.yx;
|
||||||
|
@ -68,7 +68,7 @@ float sdRhombus(vec2 p, vec2 b) {
|
||||||
float sdVesica(vec2 p, float r, float d) {
|
float sdVesica(vec2 p, float r, float d) {
|
||||||
p = abs(p);
|
p = abs(p);
|
||||||
float b = sqrt(r*r-d*d); // can delay this sqrt
|
float b = sqrt(r*r-d*d); // can delay this sqrt
|
||||||
return ((p.y-b)*d>p.x*b)
|
return ((p.y-b)*d>p.x*b)
|
||||||
? length(p-vec2(0.0,b))
|
? length(p-vec2(0.0,b))
|
||||||
: length(p-vec2(-d,0.0))-r;
|
: length(p-vec2(-d,0.0))-r;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,8 +39,7 @@
|
||||||
"inversify": "^5.0.1",
|
"inversify": "^5.0.1",
|
||||||
"lodash": "^4.17.15",
|
"lodash": "^4.17.15",
|
||||||
"merge-json-schemas": "1.0.0",
|
"merge-json-schemas": "1.0.0",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13"
|
||||||
"tapable": "^2.0.0-beta.8"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/d3-array": "^2.0.0",
|
"@types/d3-array": "^2.0.0",
|
||||||
|
|
|
@ -32,7 +32,7 @@ export default class ReglTexture2D implements ITexture2D {
|
||||||
premultiplyAlpha = false,
|
premultiplyAlpha = false,
|
||||||
mag = gl.NEAREST,
|
mag = gl.NEAREST,
|
||||||
min = gl.NEAREST,
|
min = gl.NEAREST,
|
||||||
colorSpace = gl.NONE,
|
colorSpace = gl.BROWSER_DEFAULT_WEBGL,
|
||||||
} = options;
|
} = options;
|
||||||
|
|
||||||
const textureOptions: regl.Texture2DOptions = {
|
const textureOptions: regl.Texture2DOptions = {
|
||||||
|
|
|
@ -53,15 +53,15 @@ export default class ReglRendererService implements IRendererService {
|
||||||
// TODO: use extensions
|
// TODO: use extensions
|
||||||
extensions: [
|
extensions: [
|
||||||
'OES_element_index_uint',
|
'OES_element_index_uint',
|
||||||
'EXT_blend_minmax',
|
|
||||||
'OES_standard_derivatives', // wireframe
|
'OES_standard_derivatives', // wireframe
|
||||||
'WEBGL_depth_texture',
|
|
||||||
'angle_instanced_arrays', // VSM shadow map
|
'angle_instanced_arrays', // VSM shadow map
|
||||||
],
|
],
|
||||||
optionalExtensions: [
|
optionalExtensions: [
|
||||||
'oes_texture_float_linear',
|
'oes_texture_float_linear',
|
||||||
'OES_texture_float',
|
'OES_texture_float',
|
||||||
'EXT_texture_filter_anisotropic',
|
'EXT_texture_filter_anisotropic',
|
||||||
|
'EXT_blend_minmax',
|
||||||
|
'WEBGL_depth_texture',
|
||||||
],
|
],
|
||||||
profile: true,
|
profile: true,
|
||||||
onDone: (err: Error | null, r?: regl.Regl | undefined): void => {
|
onDone: (err: Error | null, r?: regl.Regl | undefined): void => {
|
||||||
|
|
|
@ -37,8 +37,7 @@
|
||||||
"eventemitter3": "^4.0.0",
|
"eventemitter3": "^4.0.0",
|
||||||
"inversify": "^5.0.1",
|
"inversify": "^5.0.1",
|
||||||
"lodash": "^4.17.15",
|
"lodash": "^4.17.15",
|
||||||
"supercluster": "^6.0.2",
|
"supercluster": "^6.0.2"
|
||||||
"tapable": "^2.0.0-beta.8"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/d3-dsv": "^1.0.36",
|
"@types/d3-dsv": "^1.0.36",
|
||||||
|
|
Loading…
Reference in New Issue