diff --git a/package-lock.json b/package-lock.json index bfdfeeb10f4..910a313a3e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4854,9 +4854,9 @@ } }, "gl-mesh3d": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/gl-mesh3d/-/gl-mesh3d-2.0.4.tgz", - "integrity": "sha512-Xl0Ty++c4LLkqBEl5Kjfu0Bn8l4wLt8+cK/OGD61XAgD04VOCdKdkpV5v+e8Iz9/iq3KSHs3aCjY8AAQb5ExBw==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/gl-mesh3d/-/gl-mesh3d-2.0.5.tgz", + "integrity": "sha512-RBTQ3xzzQV7VXPQsW7JYKgo31FbYYY5Jw2spwShxABbwKXc9/EnEIk5mUvdvO8Nu8FbOI0JGtSEYFOxHhpszBQ==", "requires": { "barycentric": "^1.0.1", "colormap": "^2.1.0", @@ -4865,7 +4865,6 @@ "gl-shader": "^4.2.1", "gl-texture2d": "^2.0.8", "gl-vao": "^1.1.3", - "glsl-face-normal": "^1.0.2", "glsl-out-of-range": "^1.0.4", "glsl-specular-cook-torrance": "^2.0.1", "glslify": "^7.0.0", @@ -5202,11 +5201,6 @@ "minimatch": "~3.0.2" } }, - "glsl-face-normal": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/glsl-face-normal/-/glsl-face-normal-1.0.2.tgz", - "integrity": "sha1-fud12Rmk8u6S9Xu2mOh8x12/Eog=" - }, "glsl-inject-defines": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/glsl-inject-defines/-/glsl-inject-defines-1.0.3.tgz", diff --git a/package.json b/package.json index 4b37043b639..e0c99934d8b 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "gl-heatmap2d": "^1.0.5", "gl-line3d": "^1.1.8", "gl-mat4": "^1.2.0", - "gl-mesh3d": "^2.0.4", + "gl-mesh3d": "^2.0.5", "gl-plot2d": "^1.4.1", "gl-plot3d": "^1.6.2", "gl-pointcloud2d": "^1.0.2", diff --git a/test/image/baselines/gl3d_mesh3d_surface3d_scatter3d_line3d_error3d_log_reversed_ranges.png b/test/image/baselines/gl3d_mesh3d_surface3d_scatter3d_line3d_error3d_log_reversed_ranges.png index 2be771f972f..f01bfc6c73d 100644 Binary files a/test/image/baselines/gl3d_mesh3d_surface3d_scatter3d_line3d_error3d_log_reversed_ranges.png and b/test/image/baselines/gl3d_mesh3d_surface3d_scatter3d_line3d_error3d_log_reversed_ranges.png differ diff --git a/test/image/baselines/gl3d_mesh3d_surface_lighting.png b/test/image/baselines/gl3d_mesh3d_surface_lighting.png new file mode 100644 index 00000000000..e475a233d12 Binary files /dev/null and b/test/image/baselines/gl3d_mesh3d_surface_lighting.png differ diff --git a/test/image/baselines/gl3d_reversescale.png b/test/image/baselines/gl3d_reversescale.png index 9cfb4378f6b..a6add6eadfa 100644 Binary files a/test/image/baselines/gl3d_reversescale.png and b/test/image/baselines/gl3d_reversescale.png differ diff --git a/test/image/baselines/gl3d_snowden.png b/test/image/baselines/gl3d_snowden.png index 61533980a19..b59d5fd9936 100644 Binary files a/test/image/baselines/gl3d_snowden.png and b/test/image/baselines/gl3d_snowden.png differ diff --git a/test/image/baselines/gl3d_snowden_altered.png b/test/image/baselines/gl3d_snowden_altered.png index c4a30fea97a..f24aa4b898f 100644 Binary files a/test/image/baselines/gl3d_snowden_altered.png and b/test/image/baselines/gl3d_snowden_altered.png differ diff --git a/test/image/baselines/gl3d_tetrahedra.png b/test/image/baselines/gl3d_tetrahedra.png index 6839d63bca4..78650b4d3b5 100644 Binary files a/test/image/baselines/gl3d_tetrahedra.png and b/test/image/baselines/gl3d_tetrahedra.png differ diff --git a/test/image/baselines/gl3d_world-cals.png b/test/image/baselines/gl3d_world-cals.png index f2d8cdf21ec..1d7014d80e6 100644 Binary files a/test/image/baselines/gl3d_world-cals.png and b/test/image/baselines/gl3d_world-cals.png differ diff --git a/test/image/mocks/gl3d_mesh3d_surface_lighting.json b/test/image/mocks/gl3d_mesh3d_surface_lighting.json new file mode 100644 index 00000000000..fe54aec2bb8 --- /dev/null +++ b/test/image/mocks/gl3d_mesh3d_surface_lighting.json @@ -0,0 +1,78 @@ +{ + "data": [ + { + "x": [0, 0, 0, 1, 1, 1, 2, 2, 2], + "y": [100, 101, 102, 100, 101, 102, 100, 101, 102], + "z": [1.5, 1.5, 1.5, 1.5, 2.5, 3.5, 1.5, 3.5, 5.5], + "type": "mesh3d", + "color": "grey", + "lighting": { "ambient": 0.5, "diffuse": 0.5, "specular": 0.5, "roughness": 0.5, "fresnel": 0.5 }, + "lightposition": { "x": 0, "y": 2000, "z": 1000 } + }, + { + "x": [0, 0, 0, 1, 1, 1, 2, 2, 2], + "y": [100, 99, 98, 100, 99, 98, 100, 99, 98], + "z": [1.5, 1.5, 1.5, 1.5, 2.5, 3.5, 1.5, 3.5, 5.5], + "type": "mesh3d", + "color": "grey", + "lighting": { "ambient": 0.5, "diffuse": 0.5, "specular": 0.5, "roughness": 0.5, "fresnel": 0.5 }, + "lightposition": { "x": 0, "y": 2000, "z": 1000 } + }, + { + "x": [0, 0, 0, -1, -1, -1, -2, -2, -2], + "y": [100, 99, 98, 100, 99, 98, 100, 99, 98], + "z": [1.5, 1.5, 1.5, 1.5, 2.5, 3.5, 1.5, 3.5, 5.5], + "type": "mesh3d", + "color": "grey", + "lighting": { "ambient": 0.5, "diffuse": 0.5, "specular": 0.5, "roughness": 0.5, "fresnel": 0.5 }, + "lightposition": { "x": 0, "y": 2000, "z": 1000 } + }, + { + "x": [0, 0, 0, -1, -1, -1, -2, -2, -2], + "y": [100, 101, 102, 100, 101, 102, 100, 101, 102], + "z": [1.5, 1.5, 1.5, 1.5, 2.5, 3.5, 1.5, 3.5, 5.5], + "type": "mesh3d", + "color": "grey", + "lighting": { "ambient": 0.5, "diffuse": 0.5, "specular": 0.5, "roughness": 0.5, "fresnel": 0.5 }, + "lightposition": { "x": 0, "y": 2000, "z": 1000 } + }, + { + "x": [-2, -1, 0, 1, 2], + "y": [98, 99, 100, 101, 102], + "z": [ + [4, 2, 0, 2, 4], + [2, 1, 0, 1, 2], + [0, 0, 0, 0, 0], + [2, 1, 0, 1, 2], + [4, 2, 0, 2, 4] + ], + "type": "surface", + "colorscale": [[0, "grey"], [1, "grey"]], + "showscale": false, + "lighting": { "ambient": 0.5, "diffuse": 0.5, "specular": 0.5, "roughness": 0.5, "fresnel": 0.5 }, + "lightposition": { "x": 0, "y": 2000, "z": 1000 } + } + ], + "layout": { + "height": 800, + "width": 800, + "title": { + "text": "Mesh3d and surface lighting" + }, + "scene": { + "xaxis": { + }, + "yaxis": { + }, + "zaxis": { + }, + "camera": { + "eye": { + "x": 2.0, + "y": -1.5, + "z": 0.5 + } + } + } + } +}