fix: regl 参数 for ie11

This commit is contained in:
thinkinggis 2020-02-22 15:10:46 +08:00
parent 5049e9de17
commit 144db9149d
13 changed files with 5713 additions and 5666 deletions

View File

@ -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',

View File

@ -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",

View File

@ -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"

View File

@ -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[];

View File

@ -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": {

View File

@ -16,13 +16,13 @@
#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

View File

@ -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,7 +24,7 @@ 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);
@ -33,7 +33,7 @@ float sdPentagon(vec2 p, float r) {
} }
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;

View File

@ -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",

View File

@ -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 = {

View File

@ -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 => {

View File

@ -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",

11327
yarn.lock

File diff suppressed because it is too large Load Diff