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-nullish-coalescing-operator',
'@babel/plugin-syntax-async-generators',
'@babel/plugin-transform-parameters',
[
'@babel/plugin-proposal-decorators',
{
@ -115,7 +116,7 @@ module.exports = api => {
// isCDNBundle ? 'inline-webgl-constants' : {},
],
ignore: [
'node_modules',
// 'node_modules',
// /node_modules\/(?![d3*])/,
...!isTest ? [
'**/*.test.tsx',

View File

@ -15,6 +15,7 @@
"@babel/plugin-proposal-object-rest-spread": "^7.7.4",
"@babel/plugin-proposal-optional-chaining": "^7.6.0",
"@babel/plugin-syntax-async-generators": "^7.7.4",
"@babel/plugin-transform-parameters": "^7.8.4",
"@babel/plugin-transform-runtime": "^7.7.6",
"@babel/preset-env": "^7.5.5",
"@babel/preset-react": "^7.0.0",
@ -105,7 +106,6 @@
"stylelint-config-styled-components": "^0.1.1",
"stylelint-processor-styled-components": "^1.3.2",
"svg-inline-loader": "^0.8.0",
"tapable": "^1.1.3",
"ts-jest": "^24.0.2",
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.15.0",

View File

@ -28,8 +28,7 @@
},
"homepage": "https://github.com/antvis/L7#readme",
"dependencies": {
"async": "^3.1.1",
"async-es": "^3.1.1"
"async": "^3.1.1"
},
"devDependencies": {
"@types/async": "^3.0.8"

View File

@ -1,5 +1,6 @@
// @ts-ignore
import { parallel } from 'async-es';
// tslint:disable-next-line:no-submodule-imports
import parallel from 'async/parallel';
import { CallBack } from './IHook';
export default class AsyncParallelHook {
private tasks: any[];

View File

@ -37,7 +37,6 @@
"merge-json-schemas": "^1.0.0",
"probe.gl": "^3.1.1",
"reflect-metadata": "^0.1.13",
"tapable": "^2.0.0-beta.8",
"viewport-mercator-project": "^6.2.1"
},
"devDependencies": {

View File

@ -16,15 +16,15 @@
#define SHIFT_LEFT23 8388608.0
#define SHIFT_LEFT24 16777216.0
vec2 unpack_float(const float packedValue) {
vec2 unpack_float(float packedValue) {
int packedIntValue = int(packedValue);
int v0 = packedIntValue / 256;
return vec2(v0, packedIntValue - v0 * 256);
}
vec4 decode_color(const vec2 encodedColor) {
vec4 decode_color(vec2 encodedColor) {
return vec4(
unpack_float(encodedColor[0]) / 255.0,
unpack_float(encodedColor[1]) / 255.0
);
}
}

View File

@ -59,8 +59,8 @@ vec3 calc_directional_light(DirectionalLight light, vec3 normal, vec3 viewDir) {
// float spec = pow(max(dot(viewDir, reflectDir), 0.0), SHININESS);
// // attenuation
// float distance = length(light.position - fragPos);
// float attenuation = 1.0 / (light.constant + light.linear * distance +
// light.quadratic * (distance * distance));
// float attenuation = 1.0 / (light.constant + light.linear * distance +
// light.quadratic * (distance * distance));
// vec3 ambient = light.ambient * u_Ambient;
// 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);
// }
return weight;
}
}

View File

@ -10,7 +10,7 @@ float sdCircle(vec2 p, float r) {
}
float sdEquilateralTriangle(vec2 p) {
const float k = sqrt(3.0);
float k = sqrt(3.0);
p.x = abs(p.x) - 1.0;
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;
@ -24,16 +24,16 @@ float sdBox(vec2 p, vec2 b) {
}
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 -= 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);
}
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 -= 2.0*min(dot(k.xy,p),0.0)*k.xy;
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) {
const vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 );
vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 );
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);
@ -50,7 +50,7 @@ float sdOctogon(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 -= 2.0*min(dot(k.xy,p),0.0)*k.xy;
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) {
p = abs(p);
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(-d,0.0))-r;
}
}

View File

@ -39,8 +39,7 @@
"inversify": "^5.0.1",
"lodash": "^4.17.15",
"merge-json-schemas": "1.0.0",
"reflect-metadata": "^0.1.13",
"tapable": "^2.0.0-beta.8"
"reflect-metadata": "^0.1.13"
},
"devDependencies": {
"@types/d3-array": "^2.0.0",

View File

@ -32,7 +32,7 @@ export default class ReglTexture2D implements ITexture2D {
premultiplyAlpha = false,
mag = gl.NEAREST,
min = gl.NEAREST,
colorSpace = gl.NONE,
colorSpace = gl.BROWSER_DEFAULT_WEBGL,
} = options;
const textureOptions: regl.Texture2DOptions = {

View File

@ -53,15 +53,15 @@ export default class ReglRendererService implements IRendererService {
// TODO: use extensions
extensions: [
'OES_element_index_uint',
'EXT_blend_minmax',
'OES_standard_derivatives', // wireframe
'WEBGL_depth_texture',
'angle_instanced_arrays', // VSM shadow map
],
optionalExtensions: [
'oes_texture_float_linear',
'OES_texture_float',
'EXT_texture_filter_anisotropic',
'EXT_blend_minmax',
'WEBGL_depth_texture',
],
profile: true,
onDone: (err: Error | null, r?: regl.Regl | undefined): void => {

View File

@ -37,8 +37,7 @@
"eventemitter3": "^4.0.0",
"inversify": "^5.0.1",
"lodash": "^4.17.15",
"supercluster": "^6.0.2",
"tapable": "^2.0.0-beta.8"
"supercluster": "^6.0.2"
},
"devDependencies": {
"@types/d3-dsv": "^1.0.36",

11327
yarn.lock

File diff suppressed because it is too large Load Diff