@webviz/subsurface-viewer 1.8.6 → 1.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- declare const fsShader = "#version 300 es\n#define SHADER_NAME grid3d-cell-fragment-shader\n\nin vec3 cameraPosition;\nin vec4 position_commonspace;\n\nflat in vec3 normal;\nflat in int vertexIndex;\nflat in float property;\n\nout vec4 fragColor;\n\nuniform sampler2D colormap;\n\nuniform float valueRangeMin;\nuniform float valueRangeMax;\nuniform float colorMapRangeMin;\nuniform float colorMapRangeMax;\n\nuniform bool isColoringDiscrete;\nuniform float colorMapSize;\n\nuniform vec4 colorMapClampColor;\nuniform bool isClampColor;\nuniform vec3 undefinedPropertyColor;\n\n\n// Calculate color from propertyValue using discrete colormap.\nvec4 getDiscretePropertyColor (float propertyValue) {\n vec4 color = vec4(1.0, 1.0, 1.0, 1.0);\n // On some machines (like in docker container), float comparison and texture lookup may fail due to precision.\n // Use this tolerance for comparison and to shift the lookup position.\n float tolerance = (1.0 / colorMapSize) * 0.5;\n\n if (propertyValue < colorMapRangeMin - tolerance || propertyValue > colorMapRangeMax + tolerance) {\n // Out of range. Use clampcolor.\n if (isClampColor) {\n color = colorMapClampColor;\n if( color[3] == 0.0 ) {\n discard;\n }\n }\n else {\n // Use min/max color to clamp.\n float p = clamp (propertyValue, colorMapRangeMin, colorMapRangeMax);\n float x = p / colorMapSize;\n color = texture(colormap, vec2(x + tolerance, 0.5));\n }\n }\n else {\n float x = propertyValue / colorMapSize;\n color = texture(colormap, vec2(x + tolerance, 0.5));\n }\n \n return color;\n}\n\nvec4 getContinuousPropertyColor (float propertyValue) {\n vec4 color = vec4(1.0, 1.0, 1.0, 1.0);\n float normalizedValue = (propertyValue - colorMapRangeMin) / (colorMapRangeMax - colorMapRangeMin);\n if (normalizedValue < 0.0 || normalizedValue > 1.0) {\n // Out of range. Use clampcolor.\n if (isClampColor) {\n color = colorMapClampColor;\n if( color[3] == 0.0 ) {\n discard;\n }\n }\n else {\n // Use min/max color to clamp.\n normalizedValue = clamp (normalizedValue, 0.0, 1.0); \n color = texture(colormap, vec2(normalizedValue, 0.5));\n }\n }\n else {\n color = texture(colormap, vec2(normalizedValue, 0.5));\n }\n return color;\n}\n\n\n\nvoid main(void) {\n\n if (picking.isActive > 0.5 && !(picking.isAttribute > 0.5)) {\n fragColor = encodeVertexIndexToRGB(vertexIndex); \n return;\n }\n\n if (isnan(property)) {\n vec3 lightColor = getPhongLightColor(undefinedPropertyColor.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, 1.0); \n return;\n } \n\n // This may happen due to GPU interpolation precision causing color artifacts.\n float propertyValue = clamp(property, valueRangeMin, valueRangeMax);\n\n vec4 color = isColoringDiscrete ? getDiscretePropertyColor(round(propertyValue)) : getContinuousPropertyColor(propertyValue);\n\n // Use two sided phong lighting. This has no effect if \"material\" property is not set.\n vec3 lightColor = getPhongLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, 1.0);\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n";
1
+ declare const fsShader = "#version 300 es\n#define SHADER_NAME grid3d-cell-fragment-shader\n\nin vec3 cameraPosition;\nin vec4 position_commonspace;\n\nflat in vec3 normal;\nflat in int vertexIndex;\nflat in float property;\n\nout vec4 fragColor;\n\nuniform sampler2D colormap;\n\nuniform float valueRangeMin;\nuniform float valueRangeMax;\nuniform float colorMapRangeMin;\nuniform float colorMapRangeMax;\n\nuniform bool isColoringDiscrete;\nuniform float colorMapSize;\n\nuniform vec4 colorMapClampColor;\nuniform bool isClampColor;\nuniform vec3 undefinedPropertyColor;\n\n\n// Calculate color from propertyValue using discrete colormap.\nvec4 getDiscretePropertyColor (float propertyValue) {\n vec4 color = vec4(1.0, 1.0, 1.0, 1.0);\n // On some machines (like in docker container), float comparison and texture lookup may fail due to precision.\n // Use this tolerance for comparison and to shift the lookup position.\n float tolerance = (1.0 / colorMapSize) * 0.5;\n\n if (propertyValue < colorMapRangeMin - tolerance || propertyValue > colorMapRangeMax + tolerance) {\n // Out of range. Use clampcolor.\n if (isClampColor) {\n color = colorMapClampColor;\n if( color[3] == 0.0 ) {\n discard;\n }\n }\n else {\n // Use min/max color to clamp.\n float p = clamp (propertyValue, colorMapRangeMin, colorMapRangeMax);\n float x = p / colorMapSize;\n color = texture(colormap, vec2(x + tolerance, 0.5));\n }\n }\n else {\n float x = propertyValue / colorMapSize;\n color = texture(colormap, vec2(x + tolerance, 0.5));\n }\n \n return color;\n}\n\nvec4 getContinuousPropertyColor (float propertyValue) {\n vec4 color = vec4(1.0, 1.0, 1.0, 1.0);\n float normalizedValue = (propertyValue - colorMapRangeMin) / (colorMapRangeMax - colorMapRangeMin);\n if (normalizedValue < 0.0 || normalizedValue > 1.0) {\n // Out of range. Use clampcolor.\n if (isClampColor) {\n color = colorMapClampColor;\n if( color[3] == 0.0 ) {\n discard;\n }\n }\n else {\n // Use min/max color to clamp.\n normalizedValue = clamp (normalizedValue, 0.0, 1.0); \n color = texture(colormap, vec2(normalizedValue, 0.5));\n }\n }\n else {\n color = texture(colormap, vec2(normalizedValue, 0.5));\n }\n return color;\n}\n\nvoid main(void) {\n\n if (picking.isActive > 0.5 && !(picking.isAttribute > 0.5)) {\n fragColor = encodeVertexIndexToRGB(vertexIndex); \n return;\n }\n\n if (isnan(property)) {\n vec3 lightColor = getPhongLightColor(undefinedPropertyColor.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, 1.0);\n DECKGL_FILTER_COLOR(fragColor, geometry);\n return;\n } \n\n // This may happen due to GPU interpolation precision causing color artifacts.\n float propertyValue = clamp(property, valueRangeMin, valueRangeMax);\n\n vec4 color = isColoringDiscrete ? getDiscretePropertyColor(round(propertyValue)) : getContinuousPropertyColor(propertyValue);\n\n // Use two sided phong lighting. This has no effect if \"material\" property is not set.\n vec3 lightColor = getPhongLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, 1.0);\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n";
2
2
  export default fsShader;
@@ -79,8 +79,6 @@ vec4 getContinuousPropertyColor (float propertyValue) {
79
79
  return color;
80
80
  }
81
81
 
82
-
83
-
84
82
  void main(void) {
85
83
 
86
84
  if (picking.isActive > 0.5 && !(picking.isAttribute > 0.5)) {
@@ -90,7 +88,8 @@ void main(void) {
90
88
 
91
89
  if (isnan(property)) {
92
90
  vec3 lightColor = getPhongLightColor(undefinedPropertyColor.rgb, cameraPosition, position_commonspace.xyz, normal);
93
- fragColor = vec4(lightColor, 1.0);
91
+ fragColor = vec4(lightColor, 1.0);
92
+ DECKGL_FILTER_COLOR(fragColor, geometry);
94
93
  return;
95
94
  }
96
95
 
@@ -1 +1 @@
1
- {"version":3,"file":"cellProperty.fs.glsl.js","sourceRoot":"","sources":["../../../src/layers/grid3d/cellProperty.fs.glsl.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0GhB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"cellProperty.fs.glsl.js","sourceRoot":"","sources":["../../../src/layers/grid3d/cellProperty.fs.glsl.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyGhB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webviz/subsurface-viewer",
3
- "version": "1.8.6",
3
+ "version": "1.8.7",
4
4
  "description": "3D visualization component for subsurface reservoir data",
5
5
  "keywords": [
6
6
  "subsurface",