@luma.gl/engine 9.1.2 → 9.1.4
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.
|
@@ -13,7 +13,7 @@ export declare const picking: {
|
|
|
13
13
|
readonly fs: "precision highp float;\nprecision highp int;\n\nuniform pickingUniforms {\n int isActive;\n int indexMode;\n int batchIndex;\n\n int isHighlightActive;\n int highlightedBatchIndex;\n int highlightedObjectIndex;\n vec4 highlightColor;\n} picking;\n\n\nin vec4 picking_vRGBcolor_Avalid;\n\n/*\n * Returns highlight color if this item is selected.\n */\nvec4 picking_filterHighlightColor(vec4 color) {\n // If we are still picking, we don't highlight\n if (picking.isActive > 0.5) {\n return color;\n }\n\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n // Blend in highlight color based on its alpha value\n float highLightAlpha = picking.highlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking.highlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\n\n/*\n * Returns picking color if picking enabled else unmodified argument.\n */\nvec4 picking_filterPickingColor(vec4 color) {\n if (bool(picking.isActive)) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\n\n/*\n * Returns picking color if picking is enabled if not\n * highlight color if this item is selected, otherwise unmodified argument.\n */\nvec4 picking_filterColor(vec4 color) {\n vec4 highlightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highlightColor);\n}\n";
|
|
14
14
|
readonly props: PickingProps;
|
|
15
15
|
readonly uniforms: PickingUniforms;
|
|
16
|
-
readonly uniformTypes: Required<import("
|
|
16
|
+
readonly uniformTypes: Required<import("@luma.gl/shadertools").UniformTypes<PickingUniforms>>;
|
|
17
17
|
readonly defaultUniforms: {
|
|
18
18
|
readonly isActive: false;
|
|
19
19
|
readonly indexMode: 0;
|
|
@@ -17,7 +17,7 @@ export declare const picking: {
|
|
|
17
17
|
readonly fs: "precision highp float;\nprecision highp int;\n\nuniform pickingUniforms {\n int isActive;\n int indexMode;\n int batchIndex;\n\n int isHighlightActive;\n int highlightedBatchIndex;\n int highlightedObjectIndex;\n vec4 highlightColor;\n} picking;\n\n\nconst int INDEX_PICKING_INVALID_INDEX = -1; // 2^32 - 1\n\nflat in int picking_objectIndex;\n\n/**\n * Check if this vertex is highlighted (part of the selected batch and object)\n */ \nbool picking_isFragmentHighlighted() {\n return \n bool(picking.isHighlightActive) &&\n picking.highlightedBatchIndex == picking.batchIndex &&\n picking.highlightedObjectIndex == picking_objectIndex\n ;\n}\n\n/**\n * Returns highlight color if this item is selected.\n */\nvec4 picking_filterHighlightColor(vec4 color) {\n // If we are still picking, we don't highlight\n if (bool(picking.isActive)) {\n return color;\n }\n\n // If we are not highlighted, return color as is\n if (!picking_isFragmentHighlighted()) {\n return color;\n }\n \n // Blend in highlight color based on its alpha value\n float highLightAlpha = picking.highlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking.highlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n}\n\n/*\n * Returns picking color if picking enabled else unmodified argument.\n */\nivec4 picking_getPickingColor() {\n // Assumes that colorAttachment0 is rg32int\n // TODO? - we could render indices into a second color attachment and not mess with fragColor\n return ivec4(picking_objectIndex, picking.batchIndex, 0u, 0u); \n}\n\nvec4 picking_filterPickingColor(vec4 color) {\n if (bool(picking.isActive)) {\n if (picking_objectIndex == INDEX_PICKING_INVALID_INDEX) {\n discard;\n }\n }\n return color;\n}\n\n/*\n * Returns picking color if picking is enabled if not\n * highlight color if this item is selected, otherwise unmodified argument.\n */\nvec4 picking_filterColor(vec4 color) {\n vec4 outColor = color;\n outColor = picking_filterHighlightColor(outColor);\n outColor = picking_filterPickingColor(outColor);\n return outColor;\n}\n";
|
|
18
18
|
readonly props: PickingProps;
|
|
19
19
|
readonly uniforms: PickingUniforms;
|
|
20
|
-
readonly uniformTypes: Required<import("
|
|
20
|
+
readonly uniformTypes: Required<import("@luma.gl/shadertools").UniformTypes<PickingUniforms>>;
|
|
21
21
|
readonly defaultUniforms: {
|
|
22
22
|
readonly isActive: false;
|
|
23
23
|
readonly indexMode: 0;
|
|
@@ -63,7 +63,7 @@ export declare const pickingUniforms: {
|
|
|
63
63
|
readonly props: PickingProps;
|
|
64
64
|
readonly uniforms: PickingUniforms;
|
|
65
65
|
readonly name: "picking";
|
|
66
|
-
readonly uniformTypes: Required<import("
|
|
66
|
+
readonly uniformTypes: Required<import("@luma.gl/shadertools").UniformTypes<PickingUniforms>>;
|
|
67
67
|
readonly defaultUniforms: {
|
|
68
68
|
readonly isActive: false;
|
|
69
69
|
readonly indexMode: 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luma.gl/engine",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.4",
|
|
4
4
|
"description": "3D Engine Components for luma.gl",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"@probe.gl/log": "^4.0.8",
|
|
50
50
|
"@probe.gl/stats": "^4.0.8"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "553efa111ddb2709b2278d1e3f6c83cb66a36052"
|
|
53
53
|
}
|