x_ite 4.7.5 → 4.7.9
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.
- package/.vscode/launch.json +15 -0
- package/.vscode/settings.json +2 -5
- package/Makefile +1 -0
- package/README.md +1 -1
- package/build/components/annotation.build.js +2 -2
- package/build/components/cad-geometry.build.js +2 -2
- package/build/components/cube-map-texturing.build.js +2 -2
- package/build/components/dis.build.js +2 -2
- package/build/components/event-utilities.build.js +2 -2
- package/build/components/geometry2d.build.js +2 -2
- package/build/components/geospatial.build.js +2 -2
- package/build/components/h-anim.build.js +2 -2
- package/build/components/key-device-sensor.build.js +2 -2
- package/build/components/layout.build.js +2 -2
- package/build/components/nurbs.build.js +2 -2
- package/build/components/particle-systems.build.js +2 -2
- package/build/components/picking.build.js +2 -2
- package/build/components/projective-texture-mapping.build.js +2 -2
- package/build/components/rigid-body-physics.build.js +2 -2
- package/build/components/scripting.build.js +2 -2
- package/build/components/texturing-3d.build.js +2 -2
- package/build/components/volume-rendering.build.js +2 -2
- package/build/components/x_ite.build.js +2 -2
- package/build/parts/default.end.frag.js +2 -0
- package/build/parts/default.start.frag.js +8 -0
- package/build/parts/{x_ite.end.frag → x_ite.end.frag.js} +4 -2
- package/build/parts/x_ite.start.frag.js +16 -0
- package/build/x_ite.build.js +2 -2
- package/dist/assets/components/annotation.js +9 -7
- package/dist/assets/components/annotation.min.js +1 -1
- package/dist/assets/components/cad-geometry.js +9 -7
- package/dist/assets/components/cad-geometry.min.js +1 -1
- package/dist/assets/components/cube-map-texturing.js +9 -7
- package/dist/assets/components/cube-map-texturing.min.js +1 -1
- package/dist/assets/components/dis.js +9 -7
- package/dist/assets/components/dis.min.js +1 -1
- package/dist/assets/components/event-utilities.js +9 -7
- package/dist/assets/components/event-utilities.min.js +1 -1
- package/dist/assets/components/geometry2d.js +9 -7
- package/dist/assets/components/geometry2d.min.js +1 -1
- package/dist/assets/components/geospatial.js +9 -7
- package/dist/assets/components/geospatial.min.js +2 -2
- package/dist/assets/components/h-anim.js +9 -7
- package/dist/assets/components/h-anim.min.js +1 -1
- package/dist/assets/components/key-device-sensor.js +9 -7
- package/dist/assets/components/key-device-sensor.min.js +1 -1
- package/dist/assets/components/layout.js +9 -7
- package/dist/assets/components/layout.min.js +1 -1
- package/dist/assets/components/nurbs.js +9 -7
- package/dist/assets/components/nurbs.min.js +2 -2
- package/dist/assets/components/particle-systems.js +9 -7
- package/dist/assets/components/particle-systems.min.js +2 -2
- package/dist/assets/components/picking.js +13 -11
- package/dist/assets/components/picking.min.js +1 -1
- package/dist/assets/components/projective-texture-mapping.js +9 -7
- package/dist/assets/components/projective-texture-mapping.min.js +1 -1
- package/dist/assets/components/rigid-body-physics.js +9 -7
- package/dist/assets/components/rigid-body-physics.min.js +17 -17
- package/dist/assets/components/scripting.js +16 -9
- package/dist/assets/components/scripting.min.js +1 -1
- package/dist/assets/components/texturing-3d.js +9 -7
- package/dist/assets/components/texturing-3d.min.js +3 -3
- package/dist/assets/components/volume-rendering.js +11 -9
- package/dist/assets/components/volume-rendering.min.js +3 -3
- package/dist/assets/components/x_ite.js +9 -7
- package/dist/assets/components/x_ite.min.js +1 -1
- package/dist/assets/shaders/webgl1/FallbackUnlit.fs +3 -4
- package/dist/assets/shaders/webgl1/Gouraud.vs +0 -1
- package/dist/assets/shaders/webgl1/Phong.fs +0 -1
- package/dist/assets/shaders/webgl1/Unlit.fs +0 -3
- package/dist/assets/shaders/webgl2/Gouraud.vs +0 -1
- package/dist/assets/shaders/webgl2/Phong.fs +0 -1
- package/dist/assets/shaders/webgl2/Unlit.fs +0 -3
- package/dist/example.html +2 -2
- package/dist/x_ite.css +4 -3
- package/dist/x_ite.js +28281 -27706
- package/dist/x_ite.min.js +41 -41
- package/dist/x_ite.zip +0 -0
- package/docs/Accessing-the-External-Browser.md +32 -3
- package/docs/Custom-Shaders.md +165 -174
- package/docs/What's-New.md +61 -6
- package/docs/_config.yml +1 -1
- package/docs/index.md +21 -14
- package/docs/reference/Browser-Services.md +36 -8
- package/docs/reference/Script-Node-Authoring-Interface.md +12 -4
- package/package.json +13 -6
- package/src/assets/components/picking.js +2 -2
- package/src/assets/components/volume-rendering.js +2 -2
- package/src/assets/shaders/webgl1/FallbackUnlit.fs +3 -4
- package/src/assets/shaders/webgl1/Gouraud.vs +0 -1
- package/src/assets/shaders/webgl1/Phong.fs +0 -1
- package/src/assets/shaders/webgl1/Unlit.fs +0 -3
- package/src/assets/shaders/webgl2/Gouraud.vs +0 -1
- package/src/assets/shaders/webgl2/Phong.fs +0 -1
- package/src/assets/shaders/webgl2/Unlit.fs +0 -3
- package/src/bookmarks.js +8 -11
- package/src/examples.js +1 -1
- package/src/locale/de.po +19 -75
- package/src/locale/fr.po +18 -75
- package/src/standard/Time/MicroTime.js +3 -1
- package/src/standard/Utility/DataStorage.js +7 -10
- package/src/tests.js +2 -1
- package/src/x_ite/Browser/Core/BrowserOptions.js +40 -28
- package/src/x_ite/Browser/Core/BrowserTimings.js +13 -24
- package/src/x_ite/Browser/Core/ContextMenu.js +26 -12
- package/src/x_ite/Browser/Core/X3DCoreContext.js +95 -42
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +3 -0
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +3 -0
- package/src/x_ite/Browser/Navigation/PlaneViewer.js +3 -0
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +3 -0
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +1 -3
- package/src/x_ite/Browser/Networking/urls.js +25 -0
- package/src/x_ite/Browser/Picking/VolumePicker.js +1 -1
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +4 -1
- package/src/x_ite/Browser/Shaders/ShaderTest.js +3 -3
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/X3DBrowser.js +70 -50
- package/src/x_ite/Components/Grouping/Switch.js +1 -1
- package/src/x_ite/Components/Lighting/DirectionalLight.js +1 -1
- package/src/x_ite/Components/Navigation/Collision.js +1 -1
- package/src/x_ite/Components/Navigation/LOD.js +1 -1
- package/src/x_ite/Components/Picking/PointPickSensor.js +1 -1
- package/src/x_ite/Components/Rendering/X3DGeometryNode.js +25 -11
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +35 -1
- package/src/x_ite/Components/Scripting/Script.js +7 -2
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +10 -12
- package/src/x_ite/Components/Shaders.js +9 -9
- package/src/x_ite/Execution/X3DExecutionContext.js +9 -11
- package/src/x_ite/Fields/SFColor.js +20 -7
- package/src/x_ite/Fields/SFColorRGBA.js +6 -6
- package/src/x_ite/Fields/SFDouble.js +2 -2
- package/src/x_ite/Fields/SFFloat.js +2 -2
- package/src/x_ite/Fields/SFImage.js +13 -13
- package/src/x_ite/Fields/SFMatrix3.js +5 -5
- package/src/x_ite/Fields/SFMatrix4.js +6 -6
- package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +14 -3
- package/src/x_ite/Fields/SFNode.js +23 -19
- package/src/x_ite/Fields/SFNodeCache.js +14 -10
- package/src/x_ite/Fields/SFRotation.js +10 -10
- package/src/x_ite/Fields/SFString.js +1 -1
- package/src/x_ite/Fields/SFTime.js +1 -1
- package/src/x_ite/Fields/SFVec2.js +6 -6
- package/src/x_ite/Fields/SFVec3.js +7 -7
- package/src/x_ite/Fields/SFVec4.js +8 -8
- package/src/x_ite/Fields/SFVecPrototypeTemplate.js +7 -6
- package/src/x_ite/InputOutput/Generator.js +85 -65
- package/src/x_ite/Parser/X3DParser.js +6 -0
- package/src/x_ite/Parser/XMLParser.js +1 -1
- package/src/x_ite/X3D.js +8 -2
- package/src/x_ite.config.js +0 -5
- package/src/x_ite.css +2 -1
- package/src/x_ite.html +3 -3
- package/src/x_ite.js +21 -12
- package/x_ite.min.html +3 -3
- package/build/parts/default.end.frag +0 -2
- package/build/parts/default.start.frag +0 -6
- package/build/parts/x_ite.start.frag +0 -8
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
(function ()
|
|
1
|
+
(function ()
|
|
2
|
+
{
|
|
3
|
+
// Undefine global variables.
|
|
4
|
+
var module = { }, exports, process;
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
module = { };
|
|
6
|
+
const
|
|
7
|
+
define = X3D .define,
|
|
8
|
+
require = X3D .require;
|
|
7
9
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
8
10
|
*******************************************************************************
|
|
9
11
|
*
|
|
@@ -3891,7 +3893,7 @@ function (Fields,
|
|
|
3891
3893
|
******************************************************************************/
|
|
3892
3894
|
|
|
3893
3895
|
|
|
3894
|
-
define ([
|
|
3896
|
+
define (require .getComponentUrl ("volume-rendering"), [
|
|
3895
3897
|
"x_ite/Components",
|
|
3896
3898
|
"x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext",
|
|
3897
3899
|
"x_ite/Components/VolumeRendering/BlendedVolumeStyle",
|
|
@@ -3910,8 +3912,8 @@ define ([
|
|
|
3910
3912
|
"x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode",
|
|
3911
3913
|
"x_ite/Components/VolumeRendering/X3DVolumeDataNode",
|
|
3912
3914
|
"x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode",
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
+
require .getComponentUrl ("cad-geometry"),
|
|
3916
|
+
require .getComponentUrl ("texturing-3d"),
|
|
3915
3917
|
],
|
|
3916
3918
|
function (Components,
|
|
3917
3919
|
X3DVolumeRenderingContext,
|
|
@@ -3963,4 +3965,4 @@ function (Components,
|
|
|
3963
3965
|
});
|
|
3964
3966
|
|
|
3965
3967
|
|
|
3966
|
-
}()
|
|
3968
|
+
})();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
!function(){var e=X3D.define;X3D.require;e("x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode",["x_ite/Components/Core/X3DNode","x_ite/Bits/X3DConstants"],function(e,t){"use strict";function n(n){e.call(this,n),this.addType(t.X3DVolumeRenderStyleNode),this.volumeDataNodes=new Set}return n.prototype=Object.assign(Object.create(e.prototype),{constructor:n,addShaderFields:function(e){},getUniformsText:function(){return""},getFunctionsText:function(){return""},getVolumeData:function(){return this.volumeDataNodes},addVolumeData:function(e){this.volumeDataNodes.add(e)},removeVolumeData:function(e){this.volumeDataNodes.delete(e)},getNormalText:function(e){var t="";return e?(t+="uniform sampler3D surfaceNormals_"+this.getId()+";\n",t+="\n",t+="vec4\n",t+="getNormal_"+this.getId()+" (in vec3 texCoord)\n",t+="{\n",t+="\tvec3 n = texture (surfaceNormals_"+this.getId()+", texCoord) .xyz * 2.0 - 1.0;\n",t+="\n",t+="\treturn vec4 (normalize (x3d_TextureNormalMatrix * n), length (n));\n",t+="}\n"):(t+="\n",t+="vec4\n",t+="getNormal_"+this.getId()+" (in vec3 texCoord)\n",t+="{\n",t+="\tvec4 offset = vec4 (1.0 / x3d_TextureSize, 0.0);\n",t+="\tfloat i0 = texture (x3d_Texture3D [0], texCoord + offset .xww) .r;\n",t+="\tfloat i1 = texture (x3d_Texture3D [0], texCoord - offset .xww) .r;\n",t+="\tfloat i2 = texture (x3d_Texture3D [0], texCoord + offset .wyw) .r;\n",t+="\tfloat i3 = texture (x3d_Texture3D [0], texCoord - offset .wyw) .r;\n",t+="\tfloat i4 = texture (x3d_Texture3D [0], texCoord + offset .wwz) .r;\n",t+="\tfloat i5 = texture (x3d_Texture3D [0], texCoord - offset .wwz) .r;\n",t+="\tvec3 n = vec3 (i1 - i0, i3 - i2, i5 - i4);\n",t+="\n",t+="\treturn vec4 (normalize (x3d_TextureNormalMatrix * n), length (n));\n",t+="}\n"),t}}),n}),e("x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode",["x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode","x_ite/Bits/X3DConstants"],function(e,t){"use strict";function n(n){e.call(this,n),this.addType(t.X3DComposableVolumeRenderStyleNode)}return n.prototype=Object.assign(Object.create(e.prototype),{constructor:n}),n}),e("x_ite/Components/VolumeRendering/OpacityMapVolumeStyle",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast"],function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.OpacityMapVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,fieldDefinitions:new n([new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"transferFunction",new e.SFNode)]),getTypeName:function(){return"OpacityMapVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this.transferFunction_.addInterest("set_transferFunction__",this),this.set_transferFunction__())},set_transferFunction__:function(){this.transferFunctionNode=r(i.X3DTexture2DNode,this.transferFunction_),this.transferFunctionNode||(this.transferFunctionNode=r(i.X3DTexture3DNode,this.transferFunction_)),this.transferFunctionNode||(this.transferFunctionNode=this.getBrowser().getDefaultTransferFunction())},addShaderFields:function(t){this.enabled_.getValue()&&t.addUserDefinedField(i.inputOutput,"transferFunction_"+this.getId(),new e.SFNode(this.transferFunctionNode))},getUniformsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="// OpacityMapVolumeStyle\n",e+="\n",this.transferFunctionNode.getType().indexOf(i.X3DTexture2DNode)!==-1?(e+="uniform sampler2D transferFunction_"+this.getId()+";\n",e+="\n",e+="vec4\n",e+="getOpacityMapStyle_"+this.getId()+" (in vec4 originalColor)\n",e+="{\n",e+="\treturn texture (transferFunction_"+this.getId()+", originalColor .rg);\n",e+="}\n"):(e+="uniform sampler3D transferFunction_"+this.getId()+";\n",e+="\n",e+="vec4\n",e+="getOpacityMapStyle_"+this.getId()+" (in vec4 originalColor)\n",e+="{\n",e+="\treturn texture (transferFunction_"+this.getId()+", originalColor .rgb);\n",e+="}\n"),e},getFunctionsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="\t// OpacityMapVolumeStyle\n",e+="\n",e+="\ttextureColor = getOpacityMapStyle_"+this.getId()+" (textureColor);\n"}}),s}),e("x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext",["x_ite/Components/Texturing/PixelTexture","x_ite/Components/Texturing/TextureProperties","x_ite/Components/VolumeRendering/OpacityMapVolumeStyle"],function(e,t,n){"use strict";function o(){}return o.prototype={getDefaultVolumeStyle:function(){return this.defaultVolumeStyle=new n(this.getPrivateScene()),this.defaultVolumeStyle.setup(),this.getDefaultVolumeStyle=function(){return this.defaultVolumeStyle},this.defaultVolumeStyle},getDefaultBlendedVolumeStyle:function(){return this.defaultBlendedVolumeStyle=new n(this.getPrivateScene()),this.defaultBlendedVolumeStyle.setup(),this.getDefaultBlendedVolumeStyle=function(){return this.defaultBlendedVolumeStyle},this.defaultBlendedVolumeStyle},getDefaultTransferFunction:function(){this.defaultTransferFunction=new e(this.getPrivateScene());var n=new t(this.getPrivateScene());n.generateMipMaps_=!0,n.boundaryModeS_="CLAMP_TO_EDGE",n.boundaryModeT_="REPEAT",this.defaultTransferFunction.textureProperties_=n,this.defaultTransferFunction.image_.width=256,this.defaultTransferFunction.image_.height=1,this.defaultTransferFunction.image_.comp=2;for(var o=this.defaultTransferFunction.image_.array,i=0;i<256;++i)o[i]=i<<8|i;return n.setup(),this.defaultTransferFunction.setup(),this.getDefaultTransferFunction=function(){return this.defaultTransferFunction},this.defaultTransferFunction}},o}),e("x_ite/Components/VolumeRendering/BlendedVolumeStyle",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast","x_ite/DEBUG"],function(e,t,n,o,i,r,s){"use strict";function a(e){o.call(this,e),this.addType(i.BlendedVolumeStyle)}return a.prototype=Object.assign(Object.create(o.prototype),{constructor:a,fieldDefinitions:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"weightConstant1",new e.SFFloat(.5)),new t(i.inputOutput,"weightConstant2",new e.SFFloat(.5)),new t(i.inputOutput,"weightFunction1",new e.SFString("CONSTANT")),new t(i.inputOutput,"weightFunction2",new e.SFString("CONSTANT")),new t(i.inputOutput,"weightTransferFunction1",new e.SFNode),new t(i.inputOutput,"weightTransferFunction2",new e.SFNode),new t(i.inputOutput,"renderStyle",new e.SFNode),new t(i.inputOutput,"voxels",new e.SFNode)]),getTypeName:function(){return"BlendedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this.weightTransferFunction1_.addInterest("set_weightTransferFunction1__",this),this.weightTransferFunction2_.addInterest("set_weightTransferFunction2__",this),this.renderStyle_.addInterest("set_renderStyle__",this),this.voxels_.addInterest("set_voxels__",this),this.set_weightTransferFunction1__(),this.set_weightTransferFunction2__(),this.set_renderStyle__(),this.set_voxels__())},addVolumeData:function(e){o.prototype.addVolumeData.call(this,e),this.renderStyleNode&&this.renderStyleNode.addVolumeData(e)},removeVolumeData:function(e){o.prototype.removeVolumeData.call(this,e),this.renderStyleNode&&this.renderStyleNode.removeVolumeData(e)},set_weightTransferFunction1__:function(){this.weightTransferFunction1Node=r(i.X3DTexture2DNode,this.weightTransferFunction1_)},set_weightTransferFunction2__:function(){this.weightTransferFunction2Node=r(i.X3DTexture2DNode,this.weightTransferFunction2_)},set_renderStyle__:function(){this.renderStyleNode&&(this.renderStyleNode.removeInterest("addNodeEvent",this),this.getVolumeData().forEach(function(e){this.renderStyleNode.removeVolumeData(e)}.bind(this))),this.renderStyleNode=r(i.X3DComposableVolumeRenderStyleNode,this.renderStyle_),this.renderStyleNode&&(this.renderStyleNode.addInterest("addNodeEvent",this),this.getVolumeData().forEach(function(e){this.renderStyleNode.addVolumeData(e)}.bind(this)))},set_voxels__:function(){this.voxelsNode&&this.voxelsNode.removeInterest("set_textureSize__",this),this.voxelsNode=r(i.X3DTexture3DNode,this.voxels_),this.voxelsNode&&(this.voxelsNode.addInterest("set_textureSize__",this),this.set_textureSize__())},set_textureSize__:function(){this.getVolumeData().forEach(function(e){try{var t=e.getShader().getField("textureSize_"+this.getId());t.x=this.voxelsNode.getWidth(),t.y=this.voxelsNode.getHeight(),t.z=this.voxelsNode.getDepth()}catch(e){s&&console.log(e)}}.bind(this))},addShaderFields:function(t){if(this.enabled_.getValue()){if(t.addUserDefinedField(i.inputOutput,"weightConstant1_"+this.getId(),this.weightConstant1_.copy()),t.addUserDefinedField(i.inputOutput,"weightConstant2_"+this.getId(),this.weightConstant2_.copy()),this.weightTransferFunction1Node&&t.addUserDefinedField(i.inputOutput,"weightTransferFunction1_"+this.getId(),new e.SFNode(this.weightTransferFunction1Node)),this.weightTransferFunction2Node&&t.addUserDefinedField(i.inputOutput,"weightTransferFunction2_"+this.getId(),new e.SFNode(this.weightTransferFunction2Node)),this.voxelsNode){var n=new e.SFVec3f(this.voxelsNode.getWidth(),this.voxelsNode.getHeight(),this.voxelsNode.getDepth());t.addUserDefinedField(i.inputOutput,"voxels_"+this.getId(),new e.SFNode(this.voxelsNode)),t.addUserDefinedField(i.inputOutput,"textureSize_"+this.getId(),n)}else t.addUserDefinedField(i.inputOutput,"textureSize_"+this.getId(),new e.SFVec3f);this.getBrowser().getDefaultBlendedVolumeStyle().addShaderFields(t),this.renderStyleNode&&this.renderStyleNode.addShaderFields(t)}},getUniformsText:function(){if(!this.enabled_.getValue())return"";if(!this.voxelsNode)return"";var e="";e+="\n",e+="// BlendedVolumeStyle\n",e+="\n",e+="uniform float weightConstant1_"+this.getId()+";\n",e+="uniform float weightConstant2_"+this.getId()+";\n",this.weightTransferFunction1Node&&(e+="uniform sampler2D weightTransferFunction1_"+this.getId()+";\n"),this.weightTransferFunction2Node&&(e+="uniform sampler2D weightTransferFunction2_"+this.getId()+";\n"),e+="uniform sampler3D voxels_"+this.getId()+";\n",e+="uniform vec3 textureSize_"+this.getId()+";\n";var t=this.getBrowser().getDefaultBlendedVolumeStyle().getUniformsText();this.renderStyleNode&&(t+=this.renderStyleNode.getUniformsText()),t=t.replace(/x3d_Texture3D \[0\]/g,"voxels_"+this.getId()),t=t.replace(/x3d_TextureSize/g,"textureSize_"+this.getId()),e+="\n",e+=t,e+="\n",e+="vec4\n",e+="getBlendedStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tvec4 blendColor_"+this.getId()+" = texture (voxels_"+this.getId()+", texCoord);";var n=this.getBrowser().getDefaultBlendedVolumeStyle().getFunctionsText();switch(this.renderStyleNode&&(n+=this.renderStyleNode.getFunctionsText()),n=n.replace(/textureColor/g,"blendColor_"+this.getId()),e+="\n",e+=n,this.weightFunction1_.getValue()){default:e+="\tfloat w1_"+this.getId()+" = weightConstant1_"+this.getId()+";\n";break;case"ALPHA0":e+="\tfloat w1_"+this.getId()+" = originalColor .a;\n";break;case"ALPHA1":e+="\tfloat w1_"+this.getId()+" = blendColor_ "+this.getId()+" .a;\n";break;case"ONE_MINUS_ALPHA0":e+="\tfloat w1_"+this.getId()+" = 1.0 - originalColor .a;\n";break;case"ONE_MINUS_ALPHA1":e+="\tfloat w1_"+this.getId()+" = 1.0 - blendColor_ "+this.getId()+" .a;\n";break;case"TABLE":e+=this.weightTransferFunction1Node?"\tfloat w1_"+this.getId()+" = texture (weightTransferFunction1_"+this.getId()+", vec2 (originalColor .a, blendColor_"+this.getId()+" .a)) .r;\n":"\tfloat w1_"+this.getId()+" = weightConstant1_"+this.getId()+";\n"}switch(this.weightFunction2_.getValue()){default:e+="\tfloat w2_"+this.getId()+" = weightConstant2_"+this.getId()+";\n";break;case"ALPHA0":e+="\tfloat w2_"+this.getId()+" = originalColor .a;\n";break;case"ALPHA1":e+="\tfloat w2_"+this.getId()+" = blendColor_ "+this.getId()+" .a;\n";break;case"ONE_MINUS_ALPHA0":e+="\tfloat w2_"+this.getId()+" = 1.0 - originalColor .a;\n";break;case"ONE_MINUS_ALPHA1":e+="\tfloat w2_"+this.getId()+" = 1.0 - blendColor_ "+this.getId()+" .a;\n";break;case"TABLE":e+=this.weightTransferFunction2Node?"\tfloat w2_"+this.getId()+" = texture (weightTransferFunction2_"+this.getId()+", vec2 (originalColor .a, blendColor_"+this.getId()+" .a)) .r;\n":"\tfloat w2_"+this.getId()+" = weightConstant2_"+this.getId()+";\n"}return e+="\n",e+="\treturn clamp (originalColor * w1_"+this.getId()+" + blendColor_"+this.getId()+" * w2_"+this.getId()+", 0.0, 1.0);\n",e+="}\n"},getFunctionsText:function(){if(!this.enabled_.getValue())return"";if(!this.voxelsNode)return"";var e="";return e+="\n",e+="\t// BlendedVolumeStyle\n",e+="\n",e+="\ttextureColor = getBlendedStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),a}),e("x_ite/Components/VolumeRendering/BoundaryEnhancementVolumeStyle",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Bits/X3DConstants"],function(e,t,n,o,i){"use strict";function r(e){o.call(this,e),this.addType(i.BoundaryEnhancementVolumeStyle)}return r.prototype=Object.assign(Object.create(o.prototype),{constructor:r,fieldDefinitions:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"retainedOpacity",new e.SFFloat(.2)),new t(i.inputOutput,"boundaryOpacity",new e.SFFloat(.9)),new t(i.inputOutput,"opacityFactor",new e.SFFloat(2))]),getTypeName:function(){return"BoundaryEnhancementVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},addShaderFields:function(e){this.enabled_.getValue()&&(e.addUserDefinedField(i.inputOutput,"retainedOpacity_"+this.getId(),this.retainedOpacity_.copy()),e.addUserDefinedField(i.inputOutput,"boundaryOpacity_"+this.getId(),this.boundaryOpacity_.copy()),e.addUserDefinedField(i.inputOutput,"opacityFactor_"+this.getId(),this.opacityFactor_.copy()))},getUniformsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="// BoundaryEnhancementVolumeStyle\n",e+="\n",e+="uniform float retainedOpacity_"+this.getId()+";\n",e+="uniform float boundaryOpacity_"+this.getId()+";\n",e+="uniform float opacityFactor_"+this.getId()+";\n",e+="\n",e+="vec4\n",e+="getBoundaryEnhancementStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tfloat f0 = texture (x3d_Texture3D [0], texCoord) .r;\n",e+="\tfloat f1 = texture (x3d_Texture3D [0], texCoord + vec3 (0.0, 0.0, 1.0 / x3d_TextureSize .z)) .r;\n",e+="\tfloat f = abs (f0 - f1);\n",e+="\n",e+="\tfloat retainedOpacity = retainedOpacity_"+this.getId()+";\n",e+="\tfloat boundaryOpacity = boundaryOpacity_"+this.getId()+";\n",e+="\tfloat opacityFactor = opacityFactor_"+this.getId()+";\n",e+="\n",e+="\treturn vec4 (originalColor .rgb, originalColor .a * (retainedOpacity + boundaryOpacity * pow (f, opacityFactor)));\n",e+="}\n"},getFunctionsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="\t// BoundaryEnhancementVolumeStyle\n",e+="\n",e+="\ttextureColor = getBoundaryEnhancementStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),r}),e("x_ite/Components/VolumeRendering/CartoonVolumeStyle",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast"],function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.CartoonVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,fieldDefinitions:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"colorSteps",new e.SFInt32(4)),new t(i.inputOutput,"orthogonalColor",new e.SFColorRGBA(1,1,1,1)),new t(i.inputOutput,"parallelColor",new e.SFColorRGBA(0,0,0,1)),new t(i.inputOutput,"surfaceNormals",new e.SFNode)]),getTypeName:function(){return"CartoonVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this.surfaceNormals_.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=r(i.X3DTexture3DNode,this.surfaceNormals_)},addShaderFields:function(t){this.enabled_.getValue()&&(t.addUserDefinedField(i.inputOutput,"colorSteps_"+this.getId(),this.colorSteps_.copy()),t.addUserDefinedField(i.inputOutput,"orthogonalColor_"+this.getId(),this.orthogonalColor_.copy()),t.addUserDefinedField(i.inputOutput,"parallelColor_"+this.getId(),this.parallelColor_.copy()),this.surfaceNormalsNode&&t.addUserDefinedField(i.inputOutput,"surfaceNormals_"+this.getId(),new e.SFNode(this.surfaceNormalsNode)))},getUniformsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="// CartoonVolumeStyle\n",e+="\n",e+="uniform int colorSteps_"+this.getId()+";\n",e+="uniform vec4 orthogonalColor_"+this.getId()+";\n",e+="uniform vec4 parallelColor_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="vec3\n",e+="rgb2hsv_"+this.getId()+" (in vec3 color)\n",e+="{\n",e+="\tfloat h = 0.0;\n",e+="\tfloat s = 0.0;\n",e+="\tfloat v = 0.0;\n",e+="\n",e+="\tfloat min = min (min (color .r, color .g), color .b);\n",e+="\tfloat max = max (max (color .r, color .g), color .b);\n",e+="\tv = max; // value\n",e+="\n",e+="\tfloat delta = max - min;\n",e+="\n",e+="\tif (max != 0.0 && delta != 0.0)\n",e+="\t{\n",e+="\t\ts = delta / max; // s\n",e+="\n",e+="\t\tif (color .r == max)\n",e+="\t\t\th = (color .g - color .b) / delta; // between yellow & magenta\n",e+="\t\telse if (color .g == max)\n",e+="\t\t\th = 2.0 + (color .b - color .r) / delta; // between cyan & yellow\n",e+="\t\telse\n",e+="\t\t\th = 4.0 + (color .r - color .g) / delta; // between magenta & cyan\n",e+="\n",e+="\t\th *= M_PI / 3.0; // radiants\n",e+="\t\tif (h < 0.0)\n",e+="\t\t\th += M_PI * 2.0;\n",e+="\t}\n",e+="\telse\n",e+="\t\ts = h = 0.0; // s = 0, h is undefined\n",e+="\n",e+="\treturn vec3 (h, s, v);\n",e+="}\n",e+="\n",e+="vec3\n",e+="hsv2rgb_"+this.getId()+" (in vec3 hsv)\n",e+="{\n",e+="\tfloat h = hsv [0];\n",e+="\tfloat s = clamp (hsv [1], 0.0, 1.0);\n",e+="\tfloat v = clamp (hsv [2], 0.0, 1.0);\n",e+="\n",e+="\t// H is given on [0, 2 * Pi]. S and V are given on [0, 1].\n",e+="\t// RGB are each returned on [0, 1].\n",e+="\n",e+="\tif (s == 0.0)\n",e+="\t{\n",e+="\t\t// achromatic (grey)\n",e+="\t\treturn vec3 (v, v, v);\n",e+="\t}\n",e+="\telse\n",e+="\t{\n",e+="\t\tfloat w = (h * (180.0 / M_PI)) / 60.0; // sector 0 to 5\n",e+="\n",e+="\t\tfloat i = floor (w);\n",e+="\t\tfloat f = w - i; // factorial part of h\n",e+="\t\tfloat p = v * ( 1.0 - s );\n",e+="\t\tfloat q = v * ( 1.0 - s * f );\n",e+="\t\tfloat t = v * ( 1.0 - s * ( 1.0 - f ) );\n",e+="\n",e+="\t\tswitch (int (i) % 6)\n",e+="\t\t{\n",e+="\t\t\tcase 0: return vec3 (v, t, p);\n",e+="\t\t\tcase 1: return vec3 (q, v, p);\n",e+="\t\t\tcase 2: return vec3 (p, v, t);\n",e+="\t\t\tcase 3: return vec3 (p, q, v);\n",e+="\t\t\tcase 4: return vec3 (t, p, v);\n",e+="\t\t\tdefault: return vec3 (v, p, q);\n",e+="\t\t}\n",e+="\t}\n",e+="\n",e+="\treturn vec3 (0.0);\n",e+="}\n",e+="\n",e+="vec3\n",e+="mix_hsv_"+this.getId()+" (in vec3 a, in vec3 b, in float t)\n",e+="{\n",e+="\t// Linearely interpolate in HSV space between source color @a a and destination color @a b by an amount of @a t.\n",e+="\t// Source and destination color must be in HSV space.\n",e+="\n",e+="\tfloat ha = a [0];\n",e+="\tfloat sa = a [1];\n",e+="\tfloat va = a [2];\n",e+="\n",e+="\tfloat hb = b [0];\n",e+="\tfloat sb = b [1];\n",e+="\tfloat vb = b [2];\n",e+="\n",e+="\tif (sa == 0.0)\n",e+="\t\tha = hb;\n",e+="\n",e+="\tif (sb == 0.0)\n",e+="\t\thb = ha;\n",e+="\n",e+="\tfloat range = abs (hb - ha);\n",e+="\n",e+="\tif (range <= M_PI)\n",e+="\t{\n",e+="\t\tfloat h = ha + t * (hb - ha);\n",e+="\t\tfloat s = sa + t * (sb - sa);\n",e+="\t\tfloat v = va + t * (vb - va);\n",e+="\t\treturn vec3 (h, s, v);\n",e+="\t}\n",e+="\n",e+="\tfloat PI2 = M_PI * 2.0;\n",e+="\tfloat step = (PI2 - range) * t;\n",e+="\tfloat h = ha < hb ? ha - step : ha + step;\n",e+="\n",e+="\tif (h < 0.0)\n",e+="\t\th += PI2;\n",e+="\n",e+="\telse if (h > PI2)\n",e+="\t\th -= PI2;\n",e+="\n",e+="\tfloat s = sa + t * (sb - sa);\n",e+="\tfloat v = va + t * (vb - va);\n",e+="\treturn vec3 (h, s, v);\n",e+="}\n",e+="\n",e+="vec4\n",e+="getCartoonStyle_"+this.getId()+" (in vec4 originalColor, vec3 texCoord)\n",e+="{\n",e+="\tvec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+="\tif (surfaceNormal .w == 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\n",e+="\tvec4 orthogonalColor = orthogonalColor_"+this.getId()+";\n",e+="\tvec4 parallelColor = parallelColor_"+this.getId()+";\n",e+="\tint colorSteps = colorSteps_"+this.getId()+";\n",e+="\n",e+="\tfloat steps = clamp (float (colorSteps), 1.0, 64.0);\n",e+="\tfloat step = M_PI / 2.0 / steps;\n",e+="\tfloat cosTheta = min (dot (surfaceNormal .xyz, normalize (vertex)), 1.0);\n",e+="\n",e+="\tif (cosTheta < 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\n",e+="\tfloat t = cos (min (floor (acos (cosTheta) / step) * (steps > 1.0 ? steps / (steps - 1.0) : 1.0), steps) * step);\n",e+="\tvec3 orthogonalHSV = rgb2hsv_"+this.getId()+" (orthogonalColor .rgb);\n",e+="\tvec3 parallelHSV = rgb2hsv_"+this.getId()+" (parallelColor .rgb);\n",e+="\n",e+="\treturn vec4 (hsv2rgb_"+this.getId()+" (mix_hsv_"+this.getId()+" (orthogonalHSV, parallelHSV, t)), originalColor .a);\n",e+="}\n"},getFunctionsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="\t// CartoonVolumeStyle\n",e+="\n",e+="\ttextureColor = getCartoonStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s}),e("x_ite/Components/VolumeRendering/ComposedVolumeStyle",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast"],function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.ComposedVolumeStyle),this.renderStyleNodes=[]}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,fieldDefinitions:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"renderStyle",new e.MFNode)]),getTypeName:function(){return"ComposedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this.renderStyle_.addInterest("set_renderStyle__",this),this.set_renderStyle__())},addVolumeData:function(e){o.prototype.addVolumeData.call(this,e);for(var t=this.renderStyleNodes,n=0,i=t.length;n<i;++n){t[n].addVolumeData(e)}},removeVolumeData:function(e){o.prototype.removeVolumeData.call(this,e);for(var t=0,n=renderStyleNodes.length;t<n;++t){renderStyleNodes[t].removeVolumeData(e)}},set_renderStyle__:function(){for(var e=this.renderStyleNodes,t=0,n=e.length;t<n;++t){var o=e[t];o.removeInterest("addNodeEvent",this),this.getVolumeData().forEach(function(e){o.removeVolumeData(e)})}e.length=0;for(var t=0,n=this.renderStyle_.length;t<n;++t){var o=r(i.X3DComposableVolumeRenderStyleNode,this.renderStyle_[t]);o&&e.push(o)}for(var t=0,n=e.length;t<n;++t){var o=e[t];o.addInterest("addNodeEvent",this),this.getVolumeData().forEach(function(e){o.addVolumeData(e)})}},addShaderFields:function(e){if(this.enabled_.getValue())for(var t=this.renderStyleNodes,n=0,o=t.length;n<o;++n)t[n].addShaderFields(e)},getUniformsText:function(){if(!this.enabled_.getValue())return"";for(var e=this.renderStyleNodes,t="",n=0,o=e.length;n<o;++n)t+=e[n].getUniformsText();t+="\n",t+="vec4\n",t+="getComposedStyle_"+this.getId()+" (in vec4 textureColor, in vec3 texCoord)\n",t+="{\n";for(var n=0,o=e.length;n<o;++n)t+=e[n].getFunctionsText();return t+="\n",t+="\treturn textureColor;\n",t+="}\n"},getFunctionsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="\t// ComposedVolumeStyle\n",e+="\n",e+="\ttextureColor = getComposedStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s}),e("x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast"],function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.EdgeEnhancementVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,fieldDefinitions:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"edgeColor",new e.SFColorRGBA(0,0,0,1)),new t(i.inputOutput,"gradientThreshold",new e.SFFloat(.4)),new t(i.inputOutput,"surfaceNormals",new e.SFNode)]),getTypeName:function(){return"EdgeEnhancementVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this.surfaceNormals_.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=r(i.X3DTexture3DNode,this.surfaceNormals_)},addShaderFields:function(t){this.enabled_.getValue()&&(t.addUserDefinedField(i.inputOutput,"edgeColor_"+this.getId(),this.edgeColor_.copy()),t.addUserDefinedField(i.inputOutput,"gradientThreshold_"+this.getId(),this.gradientThreshold_.copy()),this.surfaceNormalsNode&&t.addUserDefinedField(i.inputOutput,"surfaceNormals_"+this.getId(),new e.SFNode(this.surfaceNormalsNode)))},getUniformsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="// EdgeEnhancementVolumeStyle\n",e+="\n",e+="uniform vec4 edgeColor_"+this.getId()+";\n",e+="uniform float gradientThreshold_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="vec4\n",e+="getEdgeEnhacementStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tvec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+="\tif (surfaceNormal .w == 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\n",e+="\tvec4 edgeColor = edgeColor_"+this.getId()+";\n",e+="\tfloat gradientThreshold = gradientThreshold_"+this.getId()+";\n",e+="\n",e+="\tfloat angle = abs (dot (surfaceNormal .xyz, normalize (vertex)));\n",e+="\n",e+="\tif (angle >= cos (gradientThreshold))\n",e+="\t\treturn originalColor;\n",e+="\telse\n",e+="\t\treturn vec4 (mix (edgeColor .rgb, originalColor.rgb, angle), originalColor .a);\n",e+="}\n"},getFunctionsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="\t// EdgeEnhancementVolumeStyle\n",e+="\n",e+="\ttextureColor = getEdgeEnhacementStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s}),e("x_ite/Components/VolumeRendering/X3DVolumeDataNode",["x_ite/Fields","x_ite/Components/Core/X3DChildNode","x_ite/Components/Grouping/X3DBoundedObject","x_ite/Bits/X3DConstants","x_ite/Browser/Core/TextureQuality","standard/Math/Numbers/Vector3"],function(e,t,n,o,i,r){"use strict";function s(e){t.call(this,e),n.call(this,e),this.addType(o.X3DVolumeDataNode),this.proximitySensorNode=e.createNode("ProximitySensor",!1),this.transformNode=e.createNode("Transform",!1),this.shapeNode=e.createNode("Shape",!1),this.appearanceNode=e.createNode("Appearance",!1),this.textureTransformNode=e.createNode("TextureTransform3D",!1),this.geometryNode=e.createNode("QuadSet",!1),this.textureCoordinateNode=e.createNode("TextureCoordinate3D",!1),this.coordinateNode=e.createNode("Coordinate",!1),this.setCameraObject(!0)}return s.prototype=Object.assign(Object.create(t.prototype),n.prototype,{constructor:s,initialize:function(){t.prototype.initialize.call(this),n.prototype.initialize.call(this);var o=this.getBrowser(),i=o.getContext();o.getBrowserOptions().TextureQuality_.addInterest("set_dimensions__",this),i.getVersion()>=2&&(this.dimensions_.addInterest("set_dimensions__",this),this.set_dimensions__()),this.appearanceNode.setPrivate(!0),this.proximitySensorNode.size_=new e.SFVec3f(-1,-1,-1),this.transformNode.children_=new e.MFNode(this.shapeNode),this.shapeNode.appearance_=this.appearanceNode,this.shapeNode.geometry_=this.geometryNode,this.appearanceNode.alphaMode_="BLEND",this.appearanceNode.textureTransform_=this.textureTransformNode,this.textureTransformNode.translation_=new e.SFVec3f(.5,.5,.5),this.textureTransformNode.center_=new e.SFVec3f(-.5,-.5,-.5),this.geometryNode.texCoord_=this.textureCoordinateNode,this.geometryNode.coord_=this.coordinateNode,this.coordinateNode.setup(),this.textureCoordinateNode.setup(),this.geometryNode.setup(),this.textureTransformNode.setup(),this.appearanceNode.setup(),this.shapeNode.setup(),this.transformNode.setup(),this.proximitySensorNode.setup(),this.proximitySensorNode.orientation_changed_.addFieldInterest(this.transformNode.rotation_),this.proximitySensorNode.orientation_changed_.addFieldInterest(this.textureTransformNode.rotation_),this.textureTransformNode.addInterest("set_textureTransform__",this)},getBBox:function(e,t){return this.bboxSize_.getValue().equals(this.getDefaultBBoxSize())?e.set(this.dimensions_.getValue(),r.Zero):e.set(this.bboxSize_.getValue(),this.bboxCenter_.getValue())},getAppearance:function(){return this.appearanceNode},setShader:function(t){this.getAppearance().shaders_[0]=t,t.addUserDefinedField(o.inputOutput,"x3d_TextureNormalMatrix",new e.SFMatrix3f),t.setup(),this.set_textureTransform__()},getShader:function(){var e=this.appearanceNode.shaders_[0];return e?e.getValue():null},getNumPlanes:function(){switch(this.getBrowser().getBrowserOptions().getTextureQuality()){case i.LOW:return 200;case i.MEDIUM:return 400;case i.HIGH:return 600}return 200},set_dimensions__:function(){var t=this.getNumPlanes(),n=this.dimensions_.getValue().abs(),o=n/2,i=[];this.coordinateNode.point_.length=0;for(var r=0;r<t;++r){var s=r/(t-1)-.5;i.push(o,o,n*s,-o,o,n*s,-o,-o,n*s,o,-o,n*s)}this.coordinateNode.point_=i,this.textureCoordinateNode.point_=i,this.textureTransformNode.scale_=new e.SFVec3f(1/this.dimensions_.x,1/this.dimensions_.y,1/this.dimensions_.z)},set_textureTransform__:function(){var e=this.getShader();if(e){e.getField("x3d_TextureNormalMatrix").setValue(this.textureTransformNode.getMatrix().submatrix.inverse().transpose())}},traverse:function(e,t){this.proximitySensorNode.traverse(e,t),this.transformNode.traverse(e,t)}}),s}),e("text!x_ite/Browser/VolumeRendering/VolumeStyle.vs",[],function(){
|
|
2
|
-
return"#version 300 es\n\nprecision highp float;\nprecision highp int;\n\nuniform mat4 x3d_ProjectionMatrix;\nuniform mat4 x3d_ModelViewMatrix;\nuniform mat4 x3d_TextureMatrix [1];\n\nin float x3d_FogDepth;\nin vec4 x3d_TexCoord0;\nin vec4 x3d_Vertex;\n\nout float fogDepth;\nout vec3 vertex;\nout vec4 texCoord;\n\nvoid\nmain ()\n{\n\tvec4 position = x3d_ModelViewMatrix * x3d_Vertex;\n\n\tfogDepth = x3d_FogDepth;\n\tvertex = position .xyz;\n\ttexCoord = x3d_TextureMatrix [0] * x3d_TexCoord0;\n\n\tgl_Position = x3d_ProjectionMatrix * position;\n}\n"}),e("text!x_ite/Browser/VolumeRendering/VolumeStyle.fs",[],function(){return"#version 300 es\n\nprecision highp float;\nprecision highp int;\nprecision highp sampler3D;\n\nuniform int x3d_NumLights;\nuniform x3d_LightSourceParameters x3d_LightSource [x3d_MaxLights];\n\nuniform int x3d_NumTextures;\nuniform sampler3D x3d_Texture3D [1];\nuniform vec3 x3d_TextureSize;\n\nuniform mat3 x3d_TextureNormalMatrix;\n\nconst float M_PI = 3.14159265359;\n\nin float fogDepth;\nin vec3 vertex;\nin vec4 texCoord;\n\n\nuniform x3d_FogParameters x3d_Fog;\n\nfloat\ngetFogInterpolant ()\n{\n\t// Returns 0.0 for fog color and 1.0 for material color.\n\n\tif (x3d_Fog .type == x3d_None)\n\t\treturn 1.0;\n\n\tif (x3d_Fog .fogCoord)\n\t\treturn clamp (1.0 - fogDepth, 0.0, 1.0);\n\n\tfloat visibilityRange = x3d_Fog .visibilityRange;\n\n\tif (visibilityRange <= 0.0)\n\t\treturn 1.0;\n\n\tfloat dV = length (x3d_Fog .matrix * vertex);\n\n\tif (dV >= visibilityRange)\n\t\treturn 0.0;\n\n\tswitch (x3d_Fog .type)\n\t{\n\t\tcase x3d_LinearFog:\n\t\t{\n\t\t\treturn (visibilityRange - dV) / visibilityRange;\n\t\t}\n\t\tcase x3d_ExponentialFog:\n\t\t{\n\t\t\treturn exp (-dV / (visibilityRange - dV));\n\t\t}\n\t\tdefault:\n\t\t{\n\t\t\treturn 1.0;\n\t\t}\n\t}\n}\n\nvec3\ngetFogColor (const in vec3 color)\n{\n\treturn mix (x3d_Fog .color, color, getFogInterpolant ());\n}\n\n// VOLUME_STYLES_UNIFORMS\n\nout vec4 x3d_FragColor;\n\n\nuniform int x3d_NumClipPlanes;\nuniform vec4 x3d_ClipPlane [x3d_MaxClipPlanes];\n\nvoid\nclip ()\n{\n\tfor (int i = 0; i < x3d_MaxClipPlanes; ++ i)\n\t{\n\t\tif (i == x3d_NumClipPlanes)\n\t\t\tbreak;\n\n\t\tif (dot (vertex, x3d_ClipPlane [i] .xyz) - x3d_ClipPlane [i] .w < 0.0)\n\t\t\tdiscard;\n\t}\n}\n\nvec4\ngetTextureColor (in vec3 texCoord)\n{\n\tif (x3d_NumTextures == 0)\n\t\tdiscard;\n\n\tif (texCoord .s < 0.0 || texCoord .s > 1.0)\n\t\tdiscard;\n\n\tif (texCoord .t < 0.0 || texCoord .t > 1.0)\n\t\tdiscard;\n\n\tif (texCoord .p < 0.0 || texCoord .p > 1.0)\n\t\tdiscard;\n\n\tvec4 textureColor = texture (x3d_Texture3D [0], texCoord);\n\n\t// Apply volume styles.\n\n// VOLUME_STYLES_FUNCTIONS\n\n\treturn textureColor;\n}\n\nvoid\nmain ()\n{\n\tclip ();\n\n\tx3d_FragColor = getTextureColor (texCoord .stp / texCoord .q);\n}\n"}),e("x_ite/Components/VolumeRendering/IsoSurfaceVolumeData",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DVolumeDataNode","x_ite/Components/Shaders/ComposedShader","x_ite/Components/Shaders/ShaderPart","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast","text!x_ite/Browser/VolumeRendering/VolumeStyle.vs","text!x_ite/Browser/VolumeRendering/VolumeStyle.fs","x_ite/DEBUG"],function(e,t,n,o,i,r,s,a,d,l,u){"use strict";function h(e){o.call(this,e),this.addType(s.IsoSurfaceVolumeData),this.renderStyleNodes=[]}return h.prototype=Object.assign(Object.create(o.prototype),{constructor:h,fieldDefinitions:new n([new t(s.inputOutput,"metadata",new e.SFNode),new t(s.inputOutput,"dimensions",new e.SFVec3f(1,1,1)),new t(s.inputOutput,"contourStepSize",new e.SFFloat(0)),new t(s.inputOutput,"surfaceValues",new e.MFFloat),new t(s.inputOutput,"surfaceTolerance",new e.SFFloat(0)),new t(s.inputOutput,"visible",new e.SFBool(!0)),new t(s.inputOutput,"bboxDisplay",new e.SFBool),new t(s.initializeOnly,"bboxCenter",new e.SFVec3f(0,0,0)),new t(s.initializeOnly,"bboxSize",new e.SFVec3f(-1,-1,-1)),new t(s.inputOutput,"renderStyle",new e.MFNode),new t(s.inputOutput,"gradients",new e.SFNode),new t(s.inputOutput,"voxels",new e.SFNode)]),getTypeName:function(){return"IsoSurfaceVolumeData"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"children"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this.gradients_.addInterest("set_gradients__",this),this.renderStyle_.addInterest("set_renderStyle__",this),this.voxels_.addFieldInterest(this.getAppearance().texture_),this.contourStepSize_.addInterest("update",this),this.surfaceValues_.addInterest("update",this),this.surfaceTolerance_.addInterest("update",this),this.renderStyle_.addInterest("update",this),this.getAppearance().texture_=this.voxels_,this.set_gradients__(),this.set_renderStyle__(),this.set_voxels__(),this.update())},set_gradients__:function(){this.gradientsNode=a(s.X3DTexture3DNode,this.gradients_)},set_renderStyle__:function(){for(var e=this.renderStyleNodes,t=0,n=e.length;t<n;++t){var o=e[t];o.removeInterest("update",this),o.removeVolumeData(this)}e.length=0;for(var t=0,n=this.renderStyle_.length;t<n;++t){var o=a(s.X3DComposableVolumeRenderStyleNode,this.renderStyle_[t]);o&&e.push(o)}for(var t=0,n=e.length;t<n;++t){var o=e[t];o.addInterest("update",this),o.addVolumeData(this)}},set_voxels__:function(){this.voxelsNode&&this.voxelsNode.removeInterest("set_textureSize__",this),this.voxelsNode=a(s.X3DTexture3DNode,this.voxels_),this.voxelsNode&&(this.voxelsNode.addInterest("set_textureSize__",this),this.set_textureSize__())},set_textureSize__:function(){try{var e=this.getShader().getField("x3d_TextureSize");e.x=this.voxelsNode.getWidth(),e.y=this.voxelsNode.getHeight(),e.z=this.voxelsNode.getDepth()}catch(e){u&&console.log(e.message)}},update:function(){this.setShader(this.createShader(d,l))},createShader:function(t,n){var o=this.getBrowser().getDefaultVolumeStyle(),a=o.getUniformsText(),d=o.getFunctionsText();a+="\n",a+="uniform float surfaceValues ["+this.surfaceValues_.length+"];\n",a+="uniform float surfaceTolerance;\n";for(var l=0,u=this.renderStyleNodes.length;l<u;++l)a+=this.renderStyleNodes[l].getUniformsText();if(d+="\n",d+="\t// IsoSurfaceVolumeData\n",d+="\n",this.gradientsNode?(a+="\n",a+="uniform sampler3D gradients;\n",d+="\tif (length (texture (gradients, texCoord) .xyz * 2.0 - 1.0) < surfaceTolerance)\n",d+="\t\tdiscard;\n"):(a+="\n",a+="vec4\n",a+="getNormal (in vec3 texCoord)\n",a+="{\n",a+="\tvec4 offset = vec4 (1.0 / x3d_TextureSize, 0.0);\n",a+="\tfloat i0 = texture (x3d_Texture3D [0], texCoord + offset .xww) .r;\n",a+="\tfloat i1 = texture (x3d_Texture3D [0], texCoord - offset .xww) .r;\n",a+="\tfloat i2 = texture (x3d_Texture3D [0], texCoord + offset .wyw) .r;\n",a+="\tfloat i3 = texture (x3d_Texture3D [0], texCoord - offset .wyw) .r;\n",a+="\tfloat i4 = texture (x3d_Texture3D [0], texCoord + offset .wwz) .r;\n",a+="\tfloat i5 = texture (x3d_Texture3D [0], texCoord - offset .wwz) .r;\n",a+="\tvec3 n = vec3 (i1 - i0, i3 - i2, i5 - i4);\n",a+="\n",a+="\treturn vec4 (normalize (x3d_TextureNormalMatrix * n), length (n));\n",a+="}\n",d+="\tif (getNormal (texCoord) .w < surfaceTolerance)\n",d+="\t\tdiscard;\n"),d+="\n",d+="\tfloat intensity = textureColor .r;\n",d+="\n",1===this.surfaceValues_.length){var h=Math.abs(this.contourStepSize_.getValue());if(0===h)d+="\tif (intensity > surfaceValues [0])\n",d+="\t{\n",d+="\t\ttextureColor = vec4 (vec3 (surfaceValues [0]), 1.0);\n",this.renderStyleNodes.length&&(d+=this.renderStyleNodes[0].getFunctionsText()),d+="\t}\n",d+="\telse\n",d+="\t{\n",d+="\t\tdiscard;\n",d+="\t}\n",d+="\n";else{for(var c=[],f=this.surfaceValues_[0]-h;f>0;f-=h)c.unshift(f);c.push(this.surfaceValues_[0]);for(var f=this.surfaceValues_[0]+h;f<1;f+=h)c.push(f);d+="\tif (false)\n",d+="\t{ }\n";for(var l=surfaceValues_.length-1;l>=0;--l)d+="\telse if (intensity > "+c[l]+")\n",d+="\t{\n",d+="\t\ttextureColor = vec4 (vec3 ("+c[l]+"), 1.0);\n",this.renderStyleNodes.length&&(d+=this.renderStyleNodes[0].getFunctionsText()),d+="\t}\n";d+="\telse\n",d+="\t{\n",d+="\t\tdiscard;\n",d+="\t}\n",d+="\n"}}else{d+="\tif (false)\n",d+="\t{ }\n";for(var l=this.surfaceValues_.length-1;l>=0;--l){if(d+="\telse if (intensity > surfaceValues ["+l+"])\n",d+="\t{\n",d+="\t\ttextureColor = vec4 (vec3 (surfaceValues ["+l+"]), 1.0);\n",this.renderStyleNodes.length){var g=Math.min(l,this.renderStyleNodes.length-1);d+=this.renderStyleNodes[g].getFunctionsText()}d+="\t}\n"}d+="\telse\n",d+="\t{\n",d+="\t\tdiscard;\n",d+="\t}\n",d+="\n"}n=n.replace(/\/\/ VOLUME_STYLES_UNIFORMS\n/,a),n=n.replace(/\/\/ VOLUME_STYLES_FUNCTIONS\n/,d);var p=new r(this.getExecutionContext());p.setName("VolumeDataVertexShader"),p.url_.push("data:x-shader/x-vertex,"+t),p.setup();var m=new r(this.getExecutionContext());m.setName("VolumeDataFragmentShader"),m.type_="FRAGMENT",m.url_.push("data:x-shader/x-fragment,"+n),m.setup();var _=new i(this.getExecutionContext());if(_.setName("VolumeDataShader"),_.language_="GLSL",_.parts_.push(p),_.parts_.push(m),_.addUserDefinedField(s.inputOutput,"surfaceValues",this.surfaceValues_.copy()),_.addUserDefinedField(s.inputOutput,"surfaceTolerance",this.surfaceTolerance_.copy()),this.gradientsNode&&_.addUserDefinedField(s.inputOutput,"grandients",new e.SFNode(this.gradientsNode)),this.voxelsNode){var x=new e.SFVec3f(this.voxelsNode.getWidth(),this.voxelsNode.getHeight(),this.voxelsNode.getDepth());_.addUserDefinedField(s.inputOutput,"x3d_TextureSize",x)}else _.addUserDefinedField(s.inputOutput,"x3d_TextureSize",new e.SFVec3f);o.addShaderFields(_);for(var l=0,u=this.renderStyleNodes.length;l<u;++l)this.renderStyleNodes[l].addShaderFields(_);return _}}),h}),e("x_ite/Components/VolumeRendering/ProjectionVolumeStyle",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode","x_ite/Bits/X3DConstants"],function(e,t,n,o,i){"use strict";function r(e){o.call(this,e),this.addType(i.ProjectionVolumeStyle)}return r.prototype=Object.assign(Object.create(o.prototype),{constructor:r,fieldDefinitions:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"type",new e.SFString("MAX")),new t(i.inputOutput,"intensityThreshold",new e.SFFloat(0))]),getTypeName:function(){return"ProjectionVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},addShaderFields:function(e){this.enabled_.getValue()&&e.addUserDefinedField(i.inputOutput,"intensityThreshold_"+this.getId(),this.intensityThreshold_.copy())},getUniformsText:function(){if(!this.enabled_.getValue())return"";var e="";switch(e+="\n",e+="// ProjectionVolumeStyle\n",e+="\n",e+="uniform float intensityThreshold_"+this.getId()+";\n",e+="\n",e+="vec4\n",e+="getProjectionStyle_"+this.getId()+"(in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",this.type_.getValue()){default:case"MAX":e+="\tfloat projectionColor = 0.0;\n";break;case"MIN":e+="\tfloat projectionColor = 1.0;\n";break;case"AVERAGE":e+="\tfloat projectionColor = 0.0;\n"}switch(e+="\tconst int samples = 32;\n",e+="\tvec3 step = normalize (x3d_TextureNormalMatrix * vec3 (0.0, 0.0, 1.0)) / float (samples);\n",e+="\tvec3 ray = texCoord - step * float (samples) * 0.5;\n",e+="\tbool first = false;\n",e+="\n",e+="\tfor (int i = 0; i < samples; ++ i, ray += step)\n",e+="\t{\n",e+="\t\tif (ray .s < 0.0 || ray .s > 1.0)\n",e+="\t\t\tcontinue;\n",e+="\n",e+="\t\tif (ray .t < 0.0 || ray .t > 1.0)\n",e+="\t\t\tcontinue;\n",e+="\n",e+="\t\tif (ray .p < 0.0 || ray .p > 1.0)\n",e+="\t\t\tcontinue;\n",e+="\n",e+="\t\tfloat intensity = texture (x3d_Texture3D [0], ray) .r;\n",e+="\n",this.type_.getValue()){default:case"MAX":e+="\t\tif (intensity < intensityThreshold_"+this.getId()+")\n",e+="\t\t\tcontinue;\n",e+="\n",e+="\t\tif (intensityThreshold_"+this.getId()+" > 0.0 && first)\n",e+="\t\t\tbreak;\n",e+="\n",e+="\t\tif (intensity <= projectionColor)\n",e+="\t\t{\n",e+="\t\t\tfirst = true;\n",e+="\t\t\tcontinue;\n",e+="\t\t}\n",e+="\n",e+="\t\tprojectionColor = intensity;\n";break;case"MIN":e+="\t\tif (intensity < intensityThreshold_"+this.getId()+")\n",e+="\t\t\tcontinue;\n",e+="\n",e+="\t\tif (intensityThreshold_"+this.getId()+" > 0.0 && first)\n",e+="\t\t\tbreak;\n",e+="\n",e+="\t\tif (intensity >= projectionColor)\n",e+="\t\t{\n",e+="\t\t\tfirst = true;\n",e+="\t\t\tcontinue;\n",e+="\t\t}\n",e+="\n",e+="\t\tprojectionColor = intensity;\n";break;case"AVERAGE":e+="\t\tprojectionColor += intensity;\n"}return e+="\t}\n",e+="\n","AVERAGE"===this.type_.getValue()&&(e+="\tprojectionColor /= float (samples);\n"),e+="\treturn vec4 (vec3 (projectionColor), originalColor .a);\n",e+="}\n"},getFunctionsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="\t// ProjectionVolumeStyle\n",e+="\n",e+="\ttextureColor = getProjectionStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),r}),e("x_ite/Components/VolumeRendering/SegmentedVolumeData",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DVolumeDataNode","x_ite/Components/Shaders/ComposedShader","x_ite/Components/Shaders/ShaderPart","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast","text!x_ite/Browser/VolumeRendering/VolumeStyle.vs","text!x_ite/Browser/VolumeRendering/VolumeStyle.fs","x_ite/DEBUG"],function(e,t,n,o,i,r,s,a,d,l,u){"use strict";function h(e){o.call(this,e),this.addType(s.SegmentedVolumeData),this.segmentIdentifiersNode=null,this.renderStyleNodes=[]}return h.prototype=Object.assign(Object.create(o.prototype),{constructor:h,fieldDefinitions:new n([new t(s.inputOutput,"metadata",new e.SFNode),new t(s.inputOutput,"dimensions",new e.SFVec3f(1,1,1)),new t(s.inputOutput,"segmentEnabled",new e.MFBool),new t(s.inputOutput,"visible",new e.SFBool(!0)),new t(s.inputOutput,"bboxDisplay",new e.SFBool),new t(s.initializeOnly,"bboxCenter",new e.SFVec3f(0,0,0)),new t(s.initializeOnly,"bboxSize",new e.SFVec3f(-1,-1,-1)),new t(s.inputOutput,"segmentIdentifiers",new e.SFNode),new t(s.inputOutput,"renderStyle",new e.MFNode),new t(s.inputOutput,"voxels",new e.SFNode)]),getTypeName:function(){return"SegmentedVolumeData"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"children"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this.segmentIdentifiers_.addInterest("set_segmentIdentifiers__",this),this.renderStyle_.addInterest("set_renderStyle__",this),this.voxels_.addFieldInterest(this.getAppearance().texture_),this.segmentEnabled_.addInterest("update",this),this.segmentIdentifiers_.addInterest("update",this),this.renderStyle_.addInterest("update",this),this.getAppearance().texture_=this.voxels_,this.set_segmentIdentifiers__(),this.set_renderStyle__(),this.set_voxels__(),this.update())},getSegmentEnabled:function(e){return!(e<this.segmentEnabled_.length)||this.segmentEnabled_[e]},set_segmentIdentifiers__:function(){this.segmentIdentifiersNode=a(s.X3DTexture3DNode,this.segmentIdentifiers_)},set_renderStyle__:function(){for(var e=this.renderStyleNodes,t=0,n=e.length;t<n;++t){var o=e[t];o.removeInterest("update",this),o.removeVolumeData(this)}e.length=0;for(var t=0,n=this.renderStyle_.length;t<n;++t){var o=a(s.X3DComposableVolumeRenderStyleNode,this.renderStyle_[t]);o&&e.push(o)}for(var t=0,n=e.length;t<n;++t){var o=e[t];o.addInterest("update",this),o.addVolumeData(this)}},set_voxels__:function(){this.voxelsNode&&this.voxelsNode.removeInterest("set_textureSize__",this),this.voxelsNode=a(s.X3DTexture3DNode,this.voxels_),this.voxelsNode&&(this.voxelsNode.addInterest("set_textureSize__",this),this.set_textureSize__())},set_textureSize__:function(){try{var e=this.getShader().getField("x3d_TextureSize");e.x=this.voxelsNode.getWidth(),e.y=this.voxelsNode.getHeight(),e.z=this.voxelsNode.getDepth()}catch(e){u&&console.log(e.message)}},update:function(){this.setShader(this.createShader(d,l))},createShader:function(t,n){var o=this.getBrowser().getDefaultVolumeStyle(),a=o.getUniformsText(),d=o.getFunctionsText();if(this.segmentIdentifiersNode?(a+="\n",a+="uniform sampler3D segmentIdentifiers;\n",d+="\n",d+="\n",d+="\tint segment = int (texture (segmentIdentifiers, texCoord) .r * 255.0);\n"):d+="\tint segment = 0;\n",this.renderStyleNodes.length){d+="\n",d+="\tswitch (segment)\n",d+="\t{\n";for(var l=0,u=this.renderStyleNodes.length;l<u;++l)d+="\t\tcase "+l+":\n",d+="\t\t{\n",this.getSegmentEnabled(l)?(a+=this.renderStyleNodes[l].getUniformsText(),d+=this.renderStyleNodes[l].getFunctionsText(),d+="\t\t\tbreak;\n"):d+="\t\t\tdiscard;\n",d+="\t\t}\n";d+="\t}\n"}n=n.replace(/\/\/ VOLUME_STYLES_UNIFORMS\n/,a),n=n.replace(/\/\/ VOLUME_STYLES_FUNCTIONS\n/,d);var h=new r(this.getExecutionContext());h.setName("SegmentedVolumeDataVertexShader"),h.url_.push("data:x-shader/x-vertex,"+t),h.setup();var c=new r(this.getExecutionContext());c.setName("SegmentedVolumeDataFragmentShader"),c.type_="FRAGMENT",c.url_.push("data:x-shader/x-fragment,"+n),c.setup();var f=new i(this.getExecutionContext());if(f.setName("SegmentedVolumeDataShader"),f.language_="GLSL",f.parts_.push(h),f.parts_.push(c),this.voxelsNode){var g=new e.SFVec3f(this.voxelsNode.getWidth(),this.voxelsNode.getHeight(),this.voxelsNode.getDepth());f.addUserDefinedField(s.inputOutput,"x3d_TextureSize",g)}else f.addUserDefinedField(s.inputOutput,"x3d_TextureSize",new e.SFVec3f);this.segmentIdentifiersNode&&f.addUserDefinedField(s.inputOutput,"segmentIdentifiers",new e.SFNode(this.segmentIdentifiersNode)),o.addShaderFields(f);for(var l=0,u=this.renderStyleNodes.length;l<u;++l)this.getSegmentEnabled(l)&&this.renderStyleNodes[l].addShaderFields(f);return f}}),h}),e("x_ite/Components/VolumeRendering/ShadedVolumeStyle",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast"],function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.ShadedVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,fieldDefinitions:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"lighting",new e.SFBool),new t(i.inputOutput,"shadows",new e.SFBool),new t(i.initializeOnly,"phaseFunction",new e.SFString("Henyey-Greenstein")),new t(i.inputOutput,"material",new e.SFNode),new t(i.inputOutput,"surfaceNormals",new e.SFNode)]),getTypeName:function(){return"ShadedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this.material_.addInterest("set_material__",this),this.surfaceNormals_.addInterest("set_surfaceNormals__",this),this.set_material__(),this.set_surfaceNormals__())},set_material__:function(){this.materialNode&&this.materialNode.removeInterest("addNodeEvent",this),this.materialNode=r(i.X3DMaterialNode,this.material_),this.materialNode&&this.materialNode.addInterest("addNodeEvent",this)},set_surfaceNormals__:function(){this.surfaceNormalsNode=r(i.X3DTexture3DNode,this.surfaceNormals_)},addShaderFields:function(t){this.enabled_.getValue()&&(this.materialNode&&(t.addUserDefinedField(i.inputOutput,"ambientIntensity_"+this.getId(),this.materialNode.ambientIntensity_.copy()),t.addUserDefinedField(i.inputOutput,"diffuseColor_"+this.getId(),this.materialNode.diffuseColor_.copy()),t.addUserDefinedField(i.inputOutput,"specularColor_"+this.getId(),this.materialNode.specularColor_.copy()),t.addUserDefinedField(i.inputOutput,"emissiveColor_"+this.getId(),this.materialNode.emissiveColor_.copy()),t.addUserDefinedField(i.inputOutput,"shininess_"+this.getId(),this.materialNode.shininess_.copy()),t.addUserDefinedField(i.inputOutput,"transparency_"+this.getId(),this.materialNode.transparency_.copy())),this.surfaceNormalsNode&&t.addUserDefinedField(i.inputOutput,"surfaceNormals_"+this.getId(),new e.SFNode(this.surfaceNormalsNode)))},getUniformsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="// ShadedVolumeStyle\n",e+="\n",e+="uniform float ambientIntensity_"+this.getId()+";\n",e+="uniform vec3 diffuseColor_"+this.getId()+";\n",e+="uniform vec3 specularColor_"+this.getId()+";\n",e+="uniform vec3 emissiveColor_"+this.getId()+";\n",e+="uniform float shininess_"+this.getId()+";\n",e+="uniform float transparency_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="float\n",e+="getSpotFactor_"+this.getId()+" (const in float cutOffAngle, const in float beamWidth, const in vec3 L, const in vec3 d)\n",e+="{\n",e+="\tfloat spotAngle = acos (clamp (dot (-L, d), -1.0, 1.0));\n",e+="\n",e+="\tif (spotAngle >= cutOffAngle)\n",e+="\t\treturn 0.0;\n",e+="\telse if (spotAngle <= beamWidth)\n",e+="\t\treturn 1.0;\n",e+="\n",e+="\treturn (spotAngle - cutOffAngle) / (beamWidth - cutOffAngle);\n",e+="}\n",e+="\n",e+="vec4\n",e+="getShadedStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tvec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+="\tif (surfaceNormal .w == 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\n",e+="\tvec4 shadedColor = vec4 (0.0);\n",this.lighting_.getValue()?(this.materialNode?(e+="\tvec3 diffuseFactor = diffuseColor_"+this.getId()+";\n",e+="\tvec3 ambientTerm = diffuseFactor * ambientIntensity_"+this.getId()+";\n",e+="\n",e+="\tshadedColor .a = originalColor .a * (1.0 - transparency_"+this.getId()+");\n"):(e+="\tvec3 diffuseFactor = originalColor .rgb;\n",e+="\tvec3 ambientTerm = vec3 (0.0);\n",e+="\n",e+="\tshadedColor .a = originalColor .a;\n"),e+="\n",e+="\tvec3 N = surfaceNormal .xyz;\n",e+="\tvec3 V = normalize (-vertex); // normalized vector from point on geometry to viewer's position\n",e+="\n",e+="\tfor (int i = 0; i < x3d_MaxLights; ++ i)\n",e+="\t{\n",e+="\t\tif (i == x3d_NumLights)\n",e+="\t\t\tbreak;\n",e+="\n",e+="\t\tx3d_LightSourceParameters light = x3d_LightSource [i];\n",e+="\n",e+="\t\tvec3 vL = light .location - vertex; // Light to fragment\n",e+="\t\tfloat dL = length (light .matrix * vL);\n",e+="\t\tbool di = light .type == x3d_DirectionalLight;\n",e+="\n",e+="\t\tif (di || dL <= light .radius)\n",e+="\t\t{\n",e+="\t\t\tvec3 d = light .direction;\n",e+="\t\t\tvec3 c = light .attenuation;\n",e+="\t\t\tvec3 L = di ? -d : normalize (vL); // Normalized vector from point on geometry to light source i position.\n",e+="\t\t\tvec3 H = normalize (L + V); // Specular term\n",e+="\n",e+="\t\t\tfloat lightAngle = max (dot (N, L), 0.0); // Angle between normal and light ray.\n",e+="\t\t\tvec3 diffuseTerm = diffuseFactor * lightAngle;\n",e+="\t\t\tfloat specularFactor = shininess_"+this.getId()+" > 0.0 ? pow (max (dot (N, H), 0.0), shininess_"+this.getId()+" * 128.0) : 1.0;\n",e+="\t\t\tvec3 specularTerm = light .intensity * specularColor_"+this.getId()+" * specularFactor;\n",e+="\n",e+="\t\t\tfloat attenuationFactor = di ? 1.0 : 1.0 / max (c [0] + c [1] * dL + c [2] * (dL * dL), 1.0);\n",e+="\t\t\tfloat spotFactor = light .type == x3d_SpotLight ? getSpotFactor_"+this.getId()+" (light .cutOffAngle, light .beamWidth, L, d) : 1.0;\n",e+="\t\t\tfloat attenuationSpotFactor = attenuationFactor * spotFactor;\n",e+="\t\t\tvec3 ambientColor = light .ambientIntensity * ambientTerm;\n",e+="\t\t\tvec3 diffuseSpecularColor = light .intensity * (diffuseTerm + specularTerm);\n",e+="\n",e+="\t\t\tshadedColor .rgb += attenuationSpotFactor * light .color * (ambientColor + diffuseSpecularColor);\n",e+="\t\t}\n",e+="\n",e+="\t\tshadedColor .rgb += emissiveColor_"+this.getId()+";\n",e+="\t\tshadedColor .rgb = getFogColor (shadedColor .rgb);\n",e+="\t}\n"):this.materialNode?(e+="\tshadedColor .rgb = diffuseColor_"+this.getId()+";\n",e+="\tshadedColor .a = originalColor .a * (1.0 - transparency_"+this.getId()+");\n"):e+="\tshadedColor = originalColor;\n",e+="\n",e+="\treturn shadedColor;\n",e+="}\n"},getFunctionsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="\t// ShadedVolumeStyle\n",e+="\n",e+="\ttextureColor = getShadedStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s}),e("x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast"],function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.SilhouetteEnhancementVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,fieldDefinitions:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"silhouetteRetainedOpacity",new e.SFFloat(1)),new t(i.inputOutput,"silhouetteBoundaryOpacity",new e.SFFloat(0)),new t(i.inputOutput,"silhouetteSharpness",new e.SFFloat(.5)),new t(i.inputOutput,"surfaceNormals",new e.SFNode)]),getTypeName:function(){return"SilhouetteEnhancementVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this.surfaceNormals_.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=r(i.X3DTexture3DNode,this.surfaceNormals_)},addShaderFields:function(t){this.enabled_.getValue()&&(t.addUserDefinedField(i.inputOutput,"silhouetteRetainedOpacity_"+this.getId(),this.silhouetteRetainedOpacity_.copy()),t.addUserDefinedField(i.inputOutput,"silhouetteBoundaryOpacity_"+this.getId(),this.silhouetteBoundaryOpacity_.copy()),t.addUserDefinedField(i.inputOutput,"silhouetteSharpness_"+this.getId(),this.silhouetteSharpness_.copy()),this.surfaceNormalsNode&&t.addUserDefinedField(i.inputOutput,"surfaceNormals_"+this.getId(),new e.SFNode(this.surfaceNormalsNode)))},getUniformsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="// SilhouetteEnhancementVolumeStyle\n",e+="\n",e+="uniform float silhouetteRetainedOpacity_"+this.getId()+";\n",e+="uniform float silhouetteBoundaryOpacity_"+this.getId()+";\n",e+="uniform float silhouetteSharpness_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="vec4\n",e+="getSilhouetteEnhancementStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tvec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+="\tif (surfaceNormal .w == 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\t\n",e+="\tfloat silhouetteRetainedOpacity = silhouetteRetainedOpacity_"+this.getId()+";\n",e+="\tfloat silhouetteBoundaryOpacity = silhouetteBoundaryOpacity_"+this.getId()+";\n",e+="\tfloat silhouetteSharpness = silhouetteSharpness_"+this.getId()+";\n",e+="\n",e+="\treturn vec4 (originalColor .rgb, originalColor .a * (silhouetteRetainedOpacity + silhouetteBoundaryOpacity * pow (1.0 - abs (dot (surfaceNormal .xyz, normalize (vertex))), silhouetteSharpness)));\n",e+="}\n"},getFunctionsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="\t// SilhouetteEnhancementVolumeStyle\n",e+="\n",e+="\ttextureColor = getSilhouetteEnhancementStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s}),e("x_ite/Components/VolumeRendering/ToneMappedVolumeStyle",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast"],function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.ToneMappedVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,fieldDefinitions:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"coolColor",new e.SFColorRGBA(0,0,1,0)),new t(i.inputOutput,"warmColor",new e.SFColorRGBA(1,1,0,0)),new t(i.inputOutput,"surfaceNormals",new e.SFNode)]),getTypeName:function(){return"ToneMappedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this.surfaceNormals_.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=r(i.X3DTexture3DNode,this.surfaceNormals_)},addShaderFields:function(t){this.enabled_.getValue()&&(t.addUserDefinedField(i.inputOutput,"coolColor_"+this.getId(),this.coolColor_.copy()),t.addUserDefinedField(i.inputOutput,"warmColor_"+this.getId(),this.warmColor_.copy()),this.surfaceNormalsNode&&t.addUserDefinedField(i.inputOutput,"surfaceNormals_"+this.getId(),new e.SFNode(this.surfaceNormalsNode)))},getUniformsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="// ToneMappedVolumeStyle\n",e+="\n",e+="uniform vec4 coolColor_"+this.getId()+";\n",e+="uniform vec4 warmColor_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="vec4\n",e+="getToneMappedStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tvec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+="\tif (surfaceNormal .w == 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\n",e+="\tvec3 toneColor = vec3 (0.0);\n",e+="\tvec3 coolColor = coolColor_"+this.getId()+" .rgb;\n",e+="\tvec3 warmColor = warmColor_"+this.getId()+" .rgb;\n",e+="\n",e+="\tfor (int i = 0; i < x3d_MaxLights; ++ i)\n",e+="\t{\n",e+="\t\tif (i == x3d_NumLights)\n",e+="\t\t\tbreak;\n",e+="\n",e+="\t\tx3d_LightSourceParameters light = x3d_LightSource [i];\n",e+="\n",e+="\t\tvec3 L = light .type == x3d_DirectionalLight ? -light .direction : normalize (light .location - vertex);\n",e+="\t\tfloat colorFactor = (1.0 + dot (L, surfaceNormal .xyz)) * 0.5;\n",e+="\n",e+="\t\ttoneColor += mix (warmColor .rgb, coolColor .rgb, colorFactor);\n",e+="\t}\n",e+="\n",e+="\treturn vec4 (toneColor, originalColor .a);\n",e+="}\n"},getFunctionsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="\t// ToneMappedVolumeStyle\n",e+="\n",e+="\ttextureColor = getToneMappedStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s}),e("x_ite/Components/VolumeRendering/VolumeData",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DVolumeDataNode","x_ite/Components/Shaders/ComposedShader","x_ite/Components/Shaders/ShaderPart","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast","text!x_ite/Browser/VolumeRendering/VolumeStyle.vs","text!x_ite/Browser/VolumeRendering/VolumeStyle.fs","x_ite/DEBUG"],function(e,t,n,o,i,r,s,a,d,l,u){"use strict";function h(e){o.call(this,e),this.addType(s.VolumeData),this.renderStyleNode=null}return h.prototype=Object.assign(Object.create(o.prototype),{constructor:h,fieldDefinitions:new n([new t(s.inputOutput,"metadata",new e.SFNode),new t(s.inputOutput,"dimensions",new e.SFVec3f(1,1,1)),new t(s.inputOutput,"visible",new e.SFBool(!0)),new t(s.inputOutput,"bboxDisplay",new e.SFBool),new t(s.initializeOnly,"bboxCenter",new e.SFVec3f(0,0,0)),new t(s.initializeOnly,"bboxSize",new e.SFVec3f(-1,-1,-1)),new t(s.inputOutput,"renderStyle",new e.SFNode),new t(s.inputOutput,"voxels",new e.SFNode)]),getTypeName:function(){return"VolumeData"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"children"},initialize:function(){o.prototype.initialize.call(this),
|
|
3
|
-
this.getBrowser().getContext().getVersion()<2||(this.renderStyle_.addInterest("set_renderStyle__",this),this.voxels_.addInterest("set_voxels__",this),this.voxels_.addFieldInterest(this.getAppearance().texture_),this.renderStyle_.addInterest("update",this),this.getAppearance().texture_=this.voxels_,this.set_renderStyle__(),this.set_voxels__(),this.update())},set_renderStyle__:function(){this.renderStyleNode&&(this.renderStyleNode.removeInterest("update",this),this.renderStyleNode.removeVolumeData(this)),this.renderStyleNode=a(s.X3DVolumeRenderStyleNode,this.renderStyle_),this.renderStyleNode&&(this.renderStyleNode.addInterest("update",this),this.renderStyleNode.addVolumeData(this))},set_voxels__:function(){this.voxelsNode&&this.voxelsNode.removeInterest("set_textureSize__",this),this.voxelsNode=a(s.X3DTexture3DNode,this.voxels_),this.voxelsNode&&(this.voxelsNode.addInterest("set_textureSize__",this),this.set_textureSize__())},set_textureSize__:function(){try{var e=this.getShader().getField("x3d_TextureSize");e.x=this.voxelsNode.getWidth(),e.y=this.voxelsNode.getHeight(),e.z=this.voxelsNode.getDepth()}catch(e){u&&console.log(e.message)}},update:function(){this.setShader(this.createShader(d
|
|
1
|
+
!function(){const e=X3D.define,t=X3D.require;e("x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode",["x_ite/Components/Core/X3DNode","x_ite/Bits/X3DConstants"],function(e,t){"use strict";function n(n){e.call(this,n),this.addType(t.X3DVolumeRenderStyleNode),this.volumeDataNodes=new Set}return n.prototype=Object.assign(Object.create(e.prototype),{constructor:n,addShaderFields:function(e){},getUniformsText:function(){return""},getFunctionsText:function(){return""},getVolumeData:function(){return this.volumeDataNodes},addVolumeData:function(e){this.volumeDataNodes.add(e)},removeVolumeData:function(e){this.volumeDataNodes.delete(e)},getNormalText:function(e){var t="";return e?(t+="uniform sampler3D surfaceNormals_"+this.getId()+";\n",t+="\n",t+="vec4\n",t+="getNormal_"+this.getId()+" (in vec3 texCoord)\n",t+="{\n",t+="\tvec3 n = texture (surfaceNormals_"+this.getId()+", texCoord) .xyz * 2.0 - 1.0;\n",t+="\n",t+="\treturn vec4 (normalize (x3d_TextureNormalMatrix * n), length (n));\n",t+="}\n"):(t+="\n",t+="vec4\n",t+="getNormal_"+this.getId()+" (in vec3 texCoord)\n",t+="{\n",t+="\tvec4 offset = vec4 (1.0 / x3d_TextureSize, 0.0);\n",t+="\tfloat i0 = texture (x3d_Texture3D [0], texCoord + offset .xww) .r;\n",t+="\tfloat i1 = texture (x3d_Texture3D [0], texCoord - offset .xww) .r;\n",t+="\tfloat i2 = texture (x3d_Texture3D [0], texCoord + offset .wyw) .r;\n",t+="\tfloat i3 = texture (x3d_Texture3D [0], texCoord - offset .wyw) .r;\n",t+="\tfloat i4 = texture (x3d_Texture3D [0], texCoord + offset .wwz) .r;\n",t+="\tfloat i5 = texture (x3d_Texture3D [0], texCoord - offset .wwz) .r;\n",t+="\tvec3 n = vec3 (i1 - i0, i3 - i2, i5 - i4);\n",t+="\n",t+="\treturn vec4 (normalize (x3d_TextureNormalMatrix * n), length (n));\n",t+="}\n"),t}}),n}),e("x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode",["x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode","x_ite/Bits/X3DConstants"],function(e,t){"use strict";function n(n){e.call(this,n),this.addType(t.X3DComposableVolumeRenderStyleNode)}return n.prototype=Object.assign(Object.create(e.prototype),{constructor:n}),n}),e("x_ite/Components/VolumeRendering/OpacityMapVolumeStyle",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast"],function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.OpacityMapVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,fieldDefinitions:new n([new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"transferFunction",new e.SFNode)]),getTypeName:function(){return"OpacityMapVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this.transferFunction_.addInterest("set_transferFunction__",this),this.set_transferFunction__())},set_transferFunction__:function(){this.transferFunctionNode=r(i.X3DTexture2DNode,this.transferFunction_),this.transferFunctionNode||(this.transferFunctionNode=r(i.X3DTexture3DNode,this.transferFunction_)),this.transferFunctionNode||(this.transferFunctionNode=this.getBrowser().getDefaultTransferFunction())},addShaderFields:function(t){this.enabled_.getValue()&&t.addUserDefinedField(i.inputOutput,"transferFunction_"+this.getId(),new e.SFNode(this.transferFunctionNode))},getUniformsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="// OpacityMapVolumeStyle\n",e+="\n",this.transferFunctionNode.getType().indexOf(i.X3DTexture2DNode)!==-1?(e+="uniform sampler2D transferFunction_"+this.getId()+";\n",e+="\n",e+="vec4\n",e+="getOpacityMapStyle_"+this.getId()+" (in vec4 originalColor)\n",e+="{\n",e+="\treturn texture (transferFunction_"+this.getId()+", originalColor .rg);\n",e+="}\n"):(e+="uniform sampler3D transferFunction_"+this.getId()+";\n",e+="\n",e+="vec4\n",e+="getOpacityMapStyle_"+this.getId()+" (in vec4 originalColor)\n",e+="{\n",e+="\treturn texture (transferFunction_"+this.getId()+", originalColor .rgb);\n",e+="}\n"),e},getFunctionsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="\t// OpacityMapVolumeStyle\n",e+="\n",e+="\ttextureColor = getOpacityMapStyle_"+this.getId()+" (textureColor);\n"}}),s}),e("x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext",["x_ite/Components/Texturing/PixelTexture","x_ite/Components/Texturing/TextureProperties","x_ite/Components/VolumeRendering/OpacityMapVolumeStyle"],function(e,t,n){"use strict";function o(){}return o.prototype={getDefaultVolumeStyle:function(){return this.defaultVolumeStyle=new n(this.getPrivateScene()),this.defaultVolumeStyle.setup(),this.getDefaultVolumeStyle=function(){return this.defaultVolumeStyle},this.defaultVolumeStyle},getDefaultBlendedVolumeStyle:function(){return this.defaultBlendedVolumeStyle=new n(this.getPrivateScene()),this.defaultBlendedVolumeStyle.setup(),this.getDefaultBlendedVolumeStyle=function(){return this.defaultBlendedVolumeStyle},this.defaultBlendedVolumeStyle},getDefaultTransferFunction:function(){this.defaultTransferFunction=new e(this.getPrivateScene());var n=new t(this.getPrivateScene());n.generateMipMaps_=!0,n.boundaryModeS_="CLAMP_TO_EDGE",n.boundaryModeT_="REPEAT",this.defaultTransferFunction.textureProperties_=n,this.defaultTransferFunction.image_.width=256,this.defaultTransferFunction.image_.height=1,this.defaultTransferFunction.image_.comp=2;for(var o=this.defaultTransferFunction.image_.array,i=0;i<256;++i)o[i]=i<<8|i;return n.setup(),this.defaultTransferFunction.setup(),this.getDefaultTransferFunction=function(){return this.defaultTransferFunction},this.defaultTransferFunction}},o}),e("x_ite/Components/VolumeRendering/BlendedVolumeStyle",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast","x_ite/DEBUG"],function(e,t,n,o,i,r,s){"use strict";function a(e){o.call(this,e),this.addType(i.BlendedVolumeStyle)}return a.prototype=Object.assign(Object.create(o.prototype),{constructor:a,fieldDefinitions:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"weightConstant1",new e.SFFloat(.5)),new t(i.inputOutput,"weightConstant2",new e.SFFloat(.5)),new t(i.inputOutput,"weightFunction1",new e.SFString("CONSTANT")),new t(i.inputOutput,"weightFunction2",new e.SFString("CONSTANT")),new t(i.inputOutput,"weightTransferFunction1",new e.SFNode),new t(i.inputOutput,"weightTransferFunction2",new e.SFNode),new t(i.inputOutput,"renderStyle",new e.SFNode),new t(i.inputOutput,"voxels",new e.SFNode)]),getTypeName:function(){return"BlendedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this.weightTransferFunction1_.addInterest("set_weightTransferFunction1__",this),this.weightTransferFunction2_.addInterest("set_weightTransferFunction2__",this),this.renderStyle_.addInterest("set_renderStyle__",this),this.voxels_.addInterest("set_voxels__",this),this.set_weightTransferFunction1__(),this.set_weightTransferFunction2__(),this.set_renderStyle__(),this.set_voxels__())},addVolumeData:function(e){o.prototype.addVolumeData.call(this,e),this.renderStyleNode&&this.renderStyleNode.addVolumeData(e)},removeVolumeData:function(e){o.prototype.removeVolumeData.call(this,e),this.renderStyleNode&&this.renderStyleNode.removeVolumeData(e)},set_weightTransferFunction1__:function(){this.weightTransferFunction1Node=r(i.X3DTexture2DNode,this.weightTransferFunction1_)},set_weightTransferFunction2__:function(){this.weightTransferFunction2Node=r(i.X3DTexture2DNode,this.weightTransferFunction2_)},set_renderStyle__:function(){this.renderStyleNode&&(this.renderStyleNode.removeInterest("addNodeEvent",this),this.getVolumeData().forEach(function(e){this.renderStyleNode.removeVolumeData(e)}.bind(this))),this.renderStyleNode=r(i.X3DComposableVolumeRenderStyleNode,this.renderStyle_),this.renderStyleNode&&(this.renderStyleNode.addInterest("addNodeEvent",this),this.getVolumeData().forEach(function(e){this.renderStyleNode.addVolumeData(e)}.bind(this)))},set_voxels__:function(){this.voxelsNode&&this.voxelsNode.removeInterest("set_textureSize__",this),this.voxelsNode=r(i.X3DTexture3DNode,this.voxels_),this.voxelsNode&&(this.voxelsNode.addInterest("set_textureSize__",this),this.set_textureSize__())},set_textureSize__:function(){this.getVolumeData().forEach(function(e){try{var t=e.getShader().getField("textureSize_"+this.getId());t.x=this.voxelsNode.getWidth(),t.y=this.voxelsNode.getHeight(),t.z=this.voxelsNode.getDepth()}catch(e){s&&console.log(e)}}.bind(this))},addShaderFields:function(t){if(this.enabled_.getValue()){if(t.addUserDefinedField(i.inputOutput,"weightConstant1_"+this.getId(),this.weightConstant1_.copy()),t.addUserDefinedField(i.inputOutput,"weightConstant2_"+this.getId(),this.weightConstant2_.copy()),this.weightTransferFunction1Node&&t.addUserDefinedField(i.inputOutput,"weightTransferFunction1_"+this.getId(),new e.SFNode(this.weightTransferFunction1Node)),this.weightTransferFunction2Node&&t.addUserDefinedField(i.inputOutput,"weightTransferFunction2_"+this.getId(),new e.SFNode(this.weightTransferFunction2Node)),this.voxelsNode){var n=new e.SFVec3f(this.voxelsNode.getWidth(),this.voxelsNode.getHeight(),this.voxelsNode.getDepth());t.addUserDefinedField(i.inputOutput,"voxels_"+this.getId(),new e.SFNode(this.voxelsNode)),t.addUserDefinedField(i.inputOutput,"textureSize_"+this.getId(),n)}else t.addUserDefinedField(i.inputOutput,"textureSize_"+this.getId(),new e.SFVec3f);this.getBrowser().getDefaultBlendedVolumeStyle().addShaderFields(t),this.renderStyleNode&&this.renderStyleNode.addShaderFields(t)}},getUniformsText:function(){if(!this.enabled_.getValue())return"";if(!this.voxelsNode)return"";var e="";e+="\n",e+="// BlendedVolumeStyle\n",e+="\n",e+="uniform float weightConstant1_"+this.getId()+";\n",e+="uniform float weightConstant2_"+this.getId()+";\n",this.weightTransferFunction1Node&&(e+="uniform sampler2D weightTransferFunction1_"+this.getId()+";\n"),this.weightTransferFunction2Node&&(e+="uniform sampler2D weightTransferFunction2_"+this.getId()+";\n"),e+="uniform sampler3D voxels_"+this.getId()+";\n",e+="uniform vec3 textureSize_"+this.getId()+";\n";var t=this.getBrowser().getDefaultBlendedVolumeStyle().getUniformsText();this.renderStyleNode&&(t+=this.renderStyleNode.getUniformsText()),t=t.replace(/x3d_Texture3D \[0\]/g,"voxels_"+this.getId()),t=t.replace(/x3d_TextureSize/g,"textureSize_"+this.getId()),e+="\n",e+=t,e+="\n",e+="vec4\n",e+="getBlendedStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tvec4 blendColor_"+this.getId()+" = texture (voxels_"+this.getId()+", texCoord);";var n=this.getBrowser().getDefaultBlendedVolumeStyle().getFunctionsText();switch(this.renderStyleNode&&(n+=this.renderStyleNode.getFunctionsText()),n=n.replace(/textureColor/g,"blendColor_"+this.getId()),e+="\n",e+=n,this.weightFunction1_.getValue()){default:e+="\tfloat w1_"+this.getId()+" = weightConstant1_"+this.getId()+";\n";break;case"ALPHA0":e+="\tfloat w1_"+this.getId()+" = originalColor .a;\n";break;case"ALPHA1":e+="\tfloat w1_"+this.getId()+" = blendColor_ "+this.getId()+" .a;\n";break;case"ONE_MINUS_ALPHA0":e+="\tfloat w1_"+this.getId()+" = 1.0 - originalColor .a;\n";break;case"ONE_MINUS_ALPHA1":e+="\tfloat w1_"+this.getId()+" = 1.0 - blendColor_ "+this.getId()+" .a;\n";break;case"TABLE":e+=this.weightTransferFunction1Node?"\tfloat w1_"+this.getId()+" = texture (weightTransferFunction1_"+this.getId()+", vec2 (originalColor .a, blendColor_"+this.getId()+" .a)) .r;\n":"\tfloat w1_"+this.getId()+" = weightConstant1_"+this.getId()+";\n"}switch(this.weightFunction2_.getValue()){default:e+="\tfloat w2_"+this.getId()+" = weightConstant2_"+this.getId()+";\n";break;case"ALPHA0":e+="\tfloat w2_"+this.getId()+" = originalColor .a;\n";break;case"ALPHA1":e+="\tfloat w2_"+this.getId()+" = blendColor_ "+this.getId()+" .a;\n";break;case"ONE_MINUS_ALPHA0":e+="\tfloat w2_"+this.getId()+" = 1.0 - originalColor .a;\n";break;case"ONE_MINUS_ALPHA1":e+="\tfloat w2_"+this.getId()+" = 1.0 - blendColor_ "+this.getId()+" .a;\n";break;case"TABLE":e+=this.weightTransferFunction2Node?"\tfloat w2_"+this.getId()+" = texture (weightTransferFunction2_"+this.getId()+", vec2 (originalColor .a, blendColor_"+this.getId()+" .a)) .r;\n":"\tfloat w2_"+this.getId()+" = weightConstant2_"+this.getId()+";\n"}return e+="\n",e+="\treturn clamp (originalColor * w1_"+this.getId()+" + blendColor_"+this.getId()+" * w2_"+this.getId()+", 0.0, 1.0);\n",e+="}\n"},getFunctionsText:function(){if(!this.enabled_.getValue())return"";if(!this.voxelsNode)return"";var e="";return e+="\n",e+="\t// BlendedVolumeStyle\n",e+="\n",e+="\ttextureColor = getBlendedStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),a}),e("x_ite/Components/VolumeRendering/BoundaryEnhancementVolumeStyle",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Bits/X3DConstants"],function(e,t,n,o,i){"use strict";function r(e){o.call(this,e),this.addType(i.BoundaryEnhancementVolumeStyle)}return r.prototype=Object.assign(Object.create(o.prototype),{constructor:r,fieldDefinitions:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"retainedOpacity",new e.SFFloat(.2)),new t(i.inputOutput,"boundaryOpacity",new e.SFFloat(.9)),new t(i.inputOutput,"opacityFactor",new e.SFFloat(2))]),getTypeName:function(){return"BoundaryEnhancementVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},addShaderFields:function(e){this.enabled_.getValue()&&(e.addUserDefinedField(i.inputOutput,"retainedOpacity_"+this.getId(),this.retainedOpacity_.copy()),e.addUserDefinedField(i.inputOutput,"boundaryOpacity_"+this.getId(),this.boundaryOpacity_.copy()),e.addUserDefinedField(i.inputOutput,"opacityFactor_"+this.getId(),this.opacityFactor_.copy()))},getUniformsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="// BoundaryEnhancementVolumeStyle\n",e+="\n",e+="uniform float retainedOpacity_"+this.getId()+";\n",e+="uniform float boundaryOpacity_"+this.getId()+";\n",e+="uniform float opacityFactor_"+this.getId()+";\n",e+="\n",e+="vec4\n",e+="getBoundaryEnhancementStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tfloat f0 = texture (x3d_Texture3D [0], texCoord) .r;\n",e+="\tfloat f1 = texture (x3d_Texture3D [0], texCoord + vec3 (0.0, 0.0, 1.0 / x3d_TextureSize .z)) .r;\n",e+="\tfloat f = abs (f0 - f1);\n",e+="\n",e+="\tfloat retainedOpacity = retainedOpacity_"+this.getId()+";\n",e+="\tfloat boundaryOpacity = boundaryOpacity_"+this.getId()+";\n",e+="\tfloat opacityFactor = opacityFactor_"+this.getId()+";\n",e+="\n",e+="\treturn vec4 (originalColor .rgb, originalColor .a * (retainedOpacity + boundaryOpacity * pow (f, opacityFactor)));\n",e+="}\n"},getFunctionsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="\t// BoundaryEnhancementVolumeStyle\n",e+="\n",e+="\ttextureColor = getBoundaryEnhancementStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),r}),e("x_ite/Components/VolumeRendering/CartoonVolumeStyle",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast"],function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.CartoonVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,fieldDefinitions:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"colorSteps",new e.SFInt32(4)),new t(i.inputOutput,"orthogonalColor",new e.SFColorRGBA(1,1,1,1)),new t(i.inputOutput,"parallelColor",new e.SFColorRGBA(0,0,0,1)),new t(i.inputOutput,"surfaceNormals",new e.SFNode)]),getTypeName:function(){return"CartoonVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this.surfaceNormals_.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=r(i.X3DTexture3DNode,this.surfaceNormals_)},addShaderFields:function(t){this.enabled_.getValue()&&(t.addUserDefinedField(i.inputOutput,"colorSteps_"+this.getId(),this.colorSteps_.copy()),t.addUserDefinedField(i.inputOutput,"orthogonalColor_"+this.getId(),this.orthogonalColor_.copy()),t.addUserDefinedField(i.inputOutput,"parallelColor_"+this.getId(),this.parallelColor_.copy()),this.surfaceNormalsNode&&t.addUserDefinedField(i.inputOutput,"surfaceNormals_"+this.getId(),new e.SFNode(this.surfaceNormalsNode)))},getUniformsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="// CartoonVolumeStyle\n",e+="\n",e+="uniform int colorSteps_"+this.getId()+";\n",e+="uniform vec4 orthogonalColor_"+this.getId()+";\n",e+="uniform vec4 parallelColor_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="vec3\n",e+="rgb2hsv_"+this.getId()+" (in vec3 color)\n",e+="{\n",e+="\tfloat h = 0.0;\n",e+="\tfloat s = 0.0;\n",e+="\tfloat v = 0.0;\n",e+="\n",e+="\tfloat min = min (min (color .r, color .g), color .b);\n",e+="\tfloat max = max (max (color .r, color .g), color .b);\n",e+="\tv = max; // value\n",e+="\n",e+="\tfloat delta = max - min;\n",e+="\n",e+="\tif (max != 0.0 && delta != 0.0)\n",e+="\t{\n",e+="\t\ts = delta / max; // s\n",e+="\n",e+="\t\tif (color .r == max)\n",e+="\t\t\th = (color .g - color .b) / delta; // between yellow & magenta\n",e+="\t\telse if (color .g == max)\n",e+="\t\t\th = 2.0 + (color .b - color .r) / delta; // between cyan & yellow\n",e+="\t\telse\n",e+="\t\t\th = 4.0 + (color .r - color .g) / delta; // between magenta & cyan\n",e+="\n",e+="\t\th *= M_PI / 3.0; // radiants\n",e+="\t\tif (h < 0.0)\n",e+="\t\t\th += M_PI * 2.0;\n",e+="\t}\n",e+="\telse\n",e+="\t\ts = h = 0.0; // s = 0, h is undefined\n",e+="\n",e+="\treturn vec3 (h, s, v);\n",e+="}\n",e+="\n",e+="vec3\n",e+="hsv2rgb_"+this.getId()+" (in vec3 hsv)\n",e+="{\n",e+="\tfloat h = hsv [0];\n",e+="\tfloat s = clamp (hsv [1], 0.0, 1.0);\n",e+="\tfloat v = clamp (hsv [2], 0.0, 1.0);\n",e+="\n",e+="\t// H is given on [0, 2 * Pi]. S and V are given on [0, 1].\n",e+="\t// RGB are each returned on [0, 1].\n",e+="\n",e+="\tif (s == 0.0)\n",e+="\t{\n",e+="\t\t// achromatic (grey)\n",e+="\t\treturn vec3 (v, v, v);\n",e+="\t}\n",e+="\telse\n",e+="\t{\n",e+="\t\tfloat w = (h * (180.0 / M_PI)) / 60.0; // sector 0 to 5\n",e+="\n",e+="\t\tfloat i = floor (w);\n",e+="\t\tfloat f = w - i; // factorial part of h\n",e+="\t\tfloat p = v * ( 1.0 - s );\n",e+="\t\tfloat q = v * ( 1.0 - s * f );\n",e+="\t\tfloat t = v * ( 1.0 - s * ( 1.0 - f ) );\n",e+="\n",e+="\t\tswitch (int (i) % 6)\n",e+="\t\t{\n",e+="\t\t\tcase 0: return vec3 (v, t, p);\n",e+="\t\t\tcase 1: return vec3 (q, v, p);\n",e+="\t\t\tcase 2: return vec3 (p, v, t);\n",e+="\t\t\tcase 3: return vec3 (p, q, v);\n",e+="\t\t\tcase 4: return vec3 (t, p, v);\n",e+="\t\t\tdefault: return vec3 (v, p, q);\n",e+="\t\t}\n",e+="\t}\n",e+="\n",e+="\treturn vec3 (0.0);\n",e+="}\n",e+="\n",e+="vec3\n",e+="mix_hsv_"+this.getId()+" (in vec3 a, in vec3 b, in float t)\n",e+="{\n",e+="\t// Linearely interpolate in HSV space between source color @a a and destination color @a b by an amount of @a t.\n",e+="\t// Source and destination color must be in HSV space.\n",e+="\n",e+="\tfloat ha = a [0];\n",e+="\tfloat sa = a [1];\n",e+="\tfloat va = a [2];\n",e+="\n",e+="\tfloat hb = b [0];\n",e+="\tfloat sb = b [1];\n",e+="\tfloat vb = b [2];\n",e+="\n",e+="\tif (sa == 0.0)\n",e+="\t\tha = hb;\n",e+="\n",e+="\tif (sb == 0.0)\n",e+="\t\thb = ha;\n",e+="\n",e+="\tfloat range = abs (hb - ha);\n",e+="\n",e+="\tif (range <= M_PI)\n",e+="\t{\n",e+="\t\tfloat h = ha + t * (hb - ha);\n",e+="\t\tfloat s = sa + t * (sb - sa);\n",e+="\t\tfloat v = va + t * (vb - va);\n",e+="\t\treturn vec3 (h, s, v);\n",e+="\t}\n",e+="\n",e+="\tfloat PI2 = M_PI * 2.0;\n",e+="\tfloat step = (PI2 - range) * t;\n",e+="\tfloat h = ha < hb ? ha - step : ha + step;\n",e+="\n",e+="\tif (h < 0.0)\n",e+="\t\th += PI2;\n",e+="\n",e+="\telse if (h > PI2)\n",e+="\t\th -= PI2;\n",e+="\n",e+="\tfloat s = sa + t * (sb - sa);\n",e+="\tfloat v = va + t * (vb - va);\n",e+="\treturn vec3 (h, s, v);\n",e+="}\n",e+="\n",e+="vec4\n",e+="getCartoonStyle_"+this.getId()+" (in vec4 originalColor, vec3 texCoord)\n",e+="{\n",e+="\tvec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+="\tif (surfaceNormal .w == 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\n",e+="\tvec4 orthogonalColor = orthogonalColor_"+this.getId()+";\n",e+="\tvec4 parallelColor = parallelColor_"+this.getId()+";\n",e+="\tint colorSteps = colorSteps_"+this.getId()+";\n",e+="\n",e+="\tfloat steps = clamp (float (colorSteps), 1.0, 64.0);\n",e+="\tfloat step = M_PI / 2.0 / steps;\n",e+="\tfloat cosTheta = min (dot (surfaceNormal .xyz, normalize (vertex)), 1.0);\n",e+="\n",e+="\tif (cosTheta < 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\n",e+="\tfloat t = cos (min (floor (acos (cosTheta) / step) * (steps > 1.0 ? steps / (steps - 1.0) : 1.0), steps) * step);\n",e+="\tvec3 orthogonalHSV = rgb2hsv_"+this.getId()+" (orthogonalColor .rgb);\n",e+="\tvec3 parallelHSV = rgb2hsv_"+this.getId()+" (parallelColor .rgb);\n",e+="\n",e+="\treturn vec4 (hsv2rgb_"+this.getId()+" (mix_hsv_"+this.getId()+" (orthogonalHSV, parallelHSV, t)), originalColor .a);\n",e+="}\n"},getFunctionsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="\t// CartoonVolumeStyle\n",e+="\n",e+="\ttextureColor = getCartoonStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s}),e("x_ite/Components/VolumeRendering/ComposedVolumeStyle",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast"],function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.ComposedVolumeStyle),this.renderStyleNodes=[]}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,fieldDefinitions:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"renderStyle",new e.MFNode)]),getTypeName:function(){return"ComposedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this.renderStyle_.addInterest("set_renderStyle__",this),this.set_renderStyle__())},addVolumeData:function(e){o.prototype.addVolumeData.call(this,e);for(var t=this.renderStyleNodes,n=0,i=t.length;n<i;++n){t[n].addVolumeData(e)}},removeVolumeData:function(e){o.prototype.removeVolumeData.call(this,e);for(var t=0,n=renderStyleNodes.length;t<n;++t){renderStyleNodes[t].removeVolumeData(e)}},set_renderStyle__:function(){for(var e=this.renderStyleNodes,t=0,n=e.length;t<n;++t){var o=e[t];o.removeInterest("addNodeEvent",this),this.getVolumeData().forEach(function(e){o.removeVolumeData(e)})}e.length=0;for(var t=0,n=this.renderStyle_.length;t<n;++t){var o=r(i.X3DComposableVolumeRenderStyleNode,this.renderStyle_[t]);o&&e.push(o)}for(var t=0,n=e.length;t<n;++t){var o=e[t];o.addInterest("addNodeEvent",this),this.getVolumeData().forEach(function(e){o.addVolumeData(e)})}},addShaderFields:function(e){if(this.enabled_.getValue())for(var t=this.renderStyleNodes,n=0,o=t.length;n<o;++n)t[n].addShaderFields(e)},getUniformsText:function(){if(!this.enabled_.getValue())return"";for(var e=this.renderStyleNodes,t="",n=0,o=e.length;n<o;++n)t+=e[n].getUniformsText();t+="\n",t+="vec4\n",t+="getComposedStyle_"+this.getId()+" (in vec4 textureColor, in vec3 texCoord)\n",t+="{\n";for(var n=0,o=e.length;n<o;++n)t+=e[n].getFunctionsText();return t+="\n",t+="\treturn textureColor;\n",t+="}\n"},getFunctionsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="\t// ComposedVolumeStyle\n",e+="\n",e+="\ttextureColor = getComposedStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s}),e("x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast"],function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.EdgeEnhancementVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,fieldDefinitions:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"edgeColor",new e.SFColorRGBA(0,0,0,1)),new t(i.inputOutput,"gradientThreshold",new e.SFFloat(.4)),new t(i.inputOutput,"surfaceNormals",new e.SFNode)]),getTypeName:function(){return"EdgeEnhancementVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this.surfaceNormals_.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=r(i.X3DTexture3DNode,this.surfaceNormals_)},addShaderFields:function(t){this.enabled_.getValue()&&(t.addUserDefinedField(i.inputOutput,"edgeColor_"+this.getId(),this.edgeColor_.copy()),t.addUserDefinedField(i.inputOutput,"gradientThreshold_"+this.getId(),this.gradientThreshold_.copy()),this.surfaceNormalsNode&&t.addUserDefinedField(i.inputOutput,"surfaceNormals_"+this.getId(),new e.SFNode(this.surfaceNormalsNode)))},getUniformsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="// EdgeEnhancementVolumeStyle\n",e+="\n",e+="uniform vec4 edgeColor_"+this.getId()+";\n",e+="uniform float gradientThreshold_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="vec4\n",e+="getEdgeEnhacementStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tvec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+="\tif (surfaceNormal .w == 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\n",e+="\tvec4 edgeColor = edgeColor_"+this.getId()+";\n",e+="\tfloat gradientThreshold = gradientThreshold_"+this.getId()+";\n",e+="\n",e+="\tfloat angle = abs (dot (surfaceNormal .xyz, normalize (vertex)));\n",e+="\n",e+="\tif (angle >= cos (gradientThreshold))\n",e+="\t\treturn originalColor;\n",e+="\telse\n",e+="\t\treturn vec4 (mix (edgeColor .rgb, originalColor.rgb, angle), originalColor .a);\n",e+="}\n"},getFunctionsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="\t// EdgeEnhancementVolumeStyle\n",e+="\n",e+="\ttextureColor = getEdgeEnhacementStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s}),e("x_ite/Components/VolumeRendering/X3DVolumeDataNode",["x_ite/Fields","x_ite/Components/Core/X3DChildNode","x_ite/Components/Grouping/X3DBoundedObject","x_ite/Bits/X3DConstants","x_ite/Browser/Core/TextureQuality","standard/Math/Numbers/Vector3"],function(e,t,n,o,i,r){"use strict";function s(e){t.call(this,e),n.call(this,e),this.addType(o.X3DVolumeDataNode),this.proximitySensorNode=e.createNode("ProximitySensor",!1),this.transformNode=e.createNode("Transform",!1),this.shapeNode=e.createNode("Shape",!1),this.appearanceNode=e.createNode("Appearance",!1),this.textureTransformNode=e.createNode("TextureTransform3D",!1),this.geometryNode=e.createNode("QuadSet",!1),this.textureCoordinateNode=e.createNode("TextureCoordinate3D",!1),this.coordinateNode=e.createNode("Coordinate",!1),this.setCameraObject(!0)}return s.prototype=Object.assign(Object.create(t.prototype),n.prototype,{constructor:s,initialize:function(){t.prototype.initialize.call(this),n.prototype.initialize.call(this);var o=this.getBrowser(),i=o.getContext();o.getBrowserOptions().TextureQuality_.addInterest("set_dimensions__",this),i.getVersion()>=2&&(this.dimensions_.addInterest("set_dimensions__",this),this.set_dimensions__()),this.appearanceNode.setPrivate(!0),this.proximitySensorNode.size_=new e.SFVec3f(-1,-1,-1),this.transformNode.children_=new e.MFNode(this.shapeNode),this.shapeNode.appearance_=this.appearanceNode,this.shapeNode.geometry_=this.geometryNode,this.appearanceNode.alphaMode_="BLEND",this.appearanceNode.textureTransform_=this.textureTransformNode,this.textureTransformNode.translation_=new e.SFVec3f(.5,.5,.5),this.textureTransformNode.center_=new e.SFVec3f(-.5,-.5,-.5),this.geometryNode.texCoord_=this.textureCoordinateNode,this.geometryNode.coord_=this.coordinateNode,this.coordinateNode.setup(),this.textureCoordinateNode.setup(),this.geometryNode.setup(),this.textureTransformNode.setup(),this.appearanceNode.setup(),this.shapeNode.setup(),this.transformNode.setup(),this.proximitySensorNode.setup(),this.proximitySensorNode.orientation_changed_.addFieldInterest(this.transformNode.rotation_),this.proximitySensorNode.orientation_changed_.addFieldInterest(this.textureTransformNode.rotation_),this.textureTransformNode.addInterest("set_textureTransform__",this)},getBBox:function(e,t){return this.bboxSize_.getValue().equals(this.getDefaultBBoxSize())?e.set(this.dimensions_.getValue(),r.Zero):e.set(this.bboxSize_.getValue(),this.bboxCenter_.getValue())},getAppearance:function(){return this.appearanceNode},setShader:function(t){this.getAppearance().shaders_[0]=t,t.addUserDefinedField(o.inputOutput,"x3d_TextureNormalMatrix",new e.SFMatrix3f),t.setup(),this.set_textureTransform__()},getShader:function(){var e=this.appearanceNode.shaders_[0];return e?e.getValue():null},getNumPlanes:function(){switch(this.getBrowser().getBrowserOptions().getTextureQuality()){case i.LOW:return 200;case i.MEDIUM:return 400;case i.HIGH:return 600}return 200},set_dimensions__:function(){var t=this.getNumPlanes(),n=this.dimensions_.getValue().abs(),o=n/2,i=[];this.coordinateNode.point_.length=0;for(var r=0;r<t;++r){var s=r/(t-1)-.5;i.push(o,o,n*s,-o,o,n*s,-o,-o,n*s,o,-o,n*s)}this.coordinateNode.point_=i,this.textureCoordinateNode.point_=i,this.textureTransformNode.scale_=new e.SFVec3f(1/this.dimensions_.x,1/this.dimensions_.y,1/this.dimensions_.z)},set_textureTransform__:function(){var e=this.getShader();if(e){e.getField("x3d_TextureNormalMatrix").setValue(this.textureTransformNode.getMatrix().submatrix.inverse().transpose())}},traverse:function(e,t){this.proximitySensorNode.traverse(e,t),this.transformNode.traverse(e,t)}}),s}),e("text!x_ite/Browser/VolumeRendering/VolumeStyle.vs",[],function(){
|
|
2
|
+
return"#version 300 es\n\nprecision highp float;\nprecision highp int;\n\nuniform mat4 x3d_ProjectionMatrix;\nuniform mat4 x3d_ModelViewMatrix;\nuniform mat4 x3d_TextureMatrix [1];\n\nin float x3d_FogDepth;\nin vec4 x3d_TexCoord0;\nin vec4 x3d_Vertex;\n\nout float fogDepth;\nout vec3 vertex;\nout vec4 texCoord;\n\nvoid\nmain ()\n{\n\tvec4 position = x3d_ModelViewMatrix * x3d_Vertex;\n\n\tfogDepth = x3d_FogDepth;\n\tvertex = position .xyz;\n\ttexCoord = x3d_TextureMatrix [0] * x3d_TexCoord0;\n\n\tgl_Position = x3d_ProjectionMatrix * position;\n}\n"}),e("text!x_ite/Browser/VolumeRendering/VolumeStyle.fs",[],function(){return"#version 300 es\n\nprecision highp float;\nprecision highp int;\nprecision highp sampler3D;\n\nuniform int x3d_NumLights;\nuniform x3d_LightSourceParameters x3d_LightSource [x3d_MaxLights];\n\nuniform int x3d_NumTextures;\nuniform sampler3D x3d_Texture3D [1];\nuniform vec3 x3d_TextureSize;\n\nuniform mat3 x3d_TextureNormalMatrix;\n\nconst float M_PI = 3.14159265359;\n\nin float fogDepth;\nin vec3 vertex;\nin vec4 texCoord;\n\n\nuniform x3d_FogParameters x3d_Fog;\n\nfloat\ngetFogInterpolant ()\n{\n\t// Returns 0.0 for fog color and 1.0 for material color.\n\n\tif (x3d_Fog .type == x3d_None)\n\t\treturn 1.0;\n\n\tif (x3d_Fog .fogCoord)\n\t\treturn clamp (1.0 - fogDepth, 0.0, 1.0);\n\n\tfloat visibilityRange = x3d_Fog .visibilityRange;\n\n\tif (visibilityRange <= 0.0)\n\t\treturn 1.0;\n\n\tfloat dV = length (x3d_Fog .matrix * vertex);\n\n\tif (dV >= visibilityRange)\n\t\treturn 0.0;\n\n\tswitch (x3d_Fog .type)\n\t{\n\t\tcase x3d_LinearFog:\n\t\t{\n\t\t\treturn (visibilityRange - dV) / visibilityRange;\n\t\t}\n\t\tcase x3d_ExponentialFog:\n\t\t{\n\t\t\treturn exp (-dV / (visibilityRange - dV));\n\t\t}\n\t\tdefault:\n\t\t{\n\t\t\treturn 1.0;\n\t\t}\n\t}\n}\n\nvec3\ngetFogColor (const in vec3 color)\n{\n\treturn mix (x3d_Fog .color, color, getFogInterpolant ());\n}\n\n// VOLUME_STYLES_UNIFORMS\n\nout vec4 x3d_FragColor;\n\n\nuniform int x3d_NumClipPlanes;\nuniform vec4 x3d_ClipPlane [x3d_MaxClipPlanes];\n\nvoid\nclip ()\n{\n\tfor (int i = 0; i < x3d_MaxClipPlanes; ++ i)\n\t{\n\t\tif (i == x3d_NumClipPlanes)\n\t\t\tbreak;\n\n\t\tif (dot (vertex, x3d_ClipPlane [i] .xyz) - x3d_ClipPlane [i] .w < 0.0)\n\t\t\tdiscard;\n\t}\n}\n\nvec4\ngetTextureColor (in vec3 texCoord)\n{\n\tif (x3d_NumTextures == 0)\n\t\tdiscard;\n\n\tif (texCoord .s < 0.0 || texCoord .s > 1.0)\n\t\tdiscard;\n\n\tif (texCoord .t < 0.0 || texCoord .t > 1.0)\n\t\tdiscard;\n\n\tif (texCoord .p < 0.0 || texCoord .p > 1.0)\n\t\tdiscard;\n\n\tvec4 textureColor = texture (x3d_Texture3D [0], texCoord);\n\n\t// Apply volume styles.\n\n// VOLUME_STYLES_FUNCTIONS\n\n\treturn textureColor;\n}\n\nvoid\nmain ()\n{\n\tclip ();\n\n\tx3d_FragColor = getTextureColor (texCoord .stp / texCoord .q);\n}\n"}),e("x_ite/Components/VolumeRendering/IsoSurfaceVolumeData",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DVolumeDataNode","x_ite/Components/Shaders/ComposedShader","x_ite/Components/Shaders/ShaderPart","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast","text!x_ite/Browser/VolumeRendering/VolumeStyle.vs","text!x_ite/Browser/VolumeRendering/VolumeStyle.fs","x_ite/DEBUG"],function(e,t,n,o,i,r,s,a,l,d,u){"use strict";function h(e){o.call(this,e),this.addType(s.IsoSurfaceVolumeData),this.renderStyleNodes=[]}return h.prototype=Object.assign(Object.create(o.prototype),{constructor:h,fieldDefinitions:new n([new t(s.inputOutput,"metadata",new e.SFNode),new t(s.inputOutput,"dimensions",new e.SFVec3f(1,1,1)),new t(s.inputOutput,"contourStepSize",new e.SFFloat(0)),new t(s.inputOutput,"surfaceValues",new e.MFFloat),new t(s.inputOutput,"surfaceTolerance",new e.SFFloat(0)),new t(s.inputOutput,"visible",new e.SFBool(!0)),new t(s.inputOutput,"bboxDisplay",new e.SFBool),new t(s.initializeOnly,"bboxCenter",new e.SFVec3f(0,0,0)),new t(s.initializeOnly,"bboxSize",new e.SFVec3f(-1,-1,-1)),new t(s.inputOutput,"renderStyle",new e.MFNode),new t(s.inputOutput,"gradients",new e.SFNode),new t(s.inputOutput,"voxels",new e.SFNode)]),getTypeName:function(){return"IsoSurfaceVolumeData"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"children"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this.gradients_.addInterest("set_gradients__",this),this.renderStyle_.addInterest("set_renderStyle__",this),this.voxels_.addFieldInterest(this.getAppearance().texture_),this.contourStepSize_.addInterest("update",this),this.surfaceValues_.addInterest("update",this),this.surfaceTolerance_.addInterest("update",this),this.renderStyle_.addInterest("update",this),this.getAppearance().texture_=this.voxels_,this.set_gradients__(),this.set_renderStyle__(),this.set_voxels__(),this.update())},set_gradients__:function(){this.gradientsNode=a(s.X3DTexture3DNode,this.gradients_)},set_renderStyle__:function(){for(var e=this.renderStyleNodes,t=0,n=e.length;t<n;++t){var o=e[t];o.removeInterest("update",this),o.removeVolumeData(this)}e.length=0;for(var t=0,n=this.renderStyle_.length;t<n;++t){var o=a(s.X3DComposableVolumeRenderStyleNode,this.renderStyle_[t]);o&&e.push(o)}for(var t=0,n=e.length;t<n;++t){var o=e[t];o.addInterest("update",this),o.addVolumeData(this)}},set_voxels__:function(){this.voxelsNode&&this.voxelsNode.removeInterest("set_textureSize__",this),this.voxelsNode=a(s.X3DTexture3DNode,this.voxels_),this.voxelsNode&&(this.voxelsNode.addInterest("set_textureSize__",this),this.set_textureSize__())},set_textureSize__:function(){try{var e=this.getShader().getField("x3d_TextureSize");e.x=this.voxelsNode.getWidth(),e.y=this.voxelsNode.getHeight(),e.z=this.voxelsNode.getDepth()}catch(e){u&&console.log(e.message)}},update:function(){this.setShader(this.createShader(l,d))},createShader:function(t,n){var o=this.getBrowser().getDefaultVolumeStyle(),a=o.getUniformsText(),l=o.getFunctionsText();a+="\n",a+="uniform float surfaceValues ["+this.surfaceValues_.length+"];\n",a+="uniform float surfaceTolerance;\n";for(var d=0,u=this.renderStyleNodes.length;d<u;++d)a+=this.renderStyleNodes[d].getUniformsText();if(l+="\n",l+="\t// IsoSurfaceVolumeData\n",l+="\n",this.gradientsNode?(a+="\n",a+="uniform sampler3D gradients;\n",l+="\tif (length (texture (gradients, texCoord) .xyz * 2.0 - 1.0) < surfaceTolerance)\n",l+="\t\tdiscard;\n"):(a+="\n",a+="vec4\n",a+="getNormal (in vec3 texCoord)\n",a+="{\n",a+="\tvec4 offset = vec4 (1.0 / x3d_TextureSize, 0.0);\n",a+="\tfloat i0 = texture (x3d_Texture3D [0], texCoord + offset .xww) .r;\n",a+="\tfloat i1 = texture (x3d_Texture3D [0], texCoord - offset .xww) .r;\n",a+="\tfloat i2 = texture (x3d_Texture3D [0], texCoord + offset .wyw) .r;\n",a+="\tfloat i3 = texture (x3d_Texture3D [0], texCoord - offset .wyw) .r;\n",a+="\tfloat i4 = texture (x3d_Texture3D [0], texCoord + offset .wwz) .r;\n",a+="\tfloat i5 = texture (x3d_Texture3D [0], texCoord - offset .wwz) .r;\n",a+="\tvec3 n = vec3 (i1 - i0, i3 - i2, i5 - i4);\n",a+="\n",a+="\treturn vec4 (normalize (x3d_TextureNormalMatrix * n), length (n));\n",a+="}\n",l+="\tif (getNormal (texCoord) .w < surfaceTolerance)\n",l+="\t\tdiscard;\n"),l+="\n",l+="\tfloat intensity = textureColor .r;\n",l+="\n",1===this.surfaceValues_.length){var h=Math.abs(this.contourStepSize_.getValue());if(0===h)l+="\tif (intensity > surfaceValues [0])\n",l+="\t{\n",l+="\t\ttextureColor = vec4 (vec3 (surfaceValues [0]), 1.0);\n",this.renderStyleNodes.length&&(l+=this.renderStyleNodes[0].getFunctionsText()),l+="\t}\n",l+="\telse\n",l+="\t{\n",l+="\t\tdiscard;\n",l+="\t}\n",l+="\n";else{for(var c=[],g=this.surfaceValues_[0]-h;g>0;g-=h)c.unshift(g);c.push(this.surfaceValues_[0]);for(var g=this.surfaceValues_[0]+h;g<1;g+=h)c.push(g);l+="\tif (false)\n",l+="\t{ }\n";for(var d=surfaceValues_.length-1;d>=0;--d)l+="\telse if (intensity > "+c[d]+")\n",l+="\t{\n",l+="\t\ttextureColor = vec4 (vec3 ("+c[d]+"), 1.0);\n",this.renderStyleNodes.length&&(l+=this.renderStyleNodes[0].getFunctionsText()),l+="\t}\n";l+="\telse\n",l+="\t{\n",l+="\t\tdiscard;\n",l+="\t}\n",l+="\n"}}else{l+="\tif (false)\n",l+="\t{ }\n";for(var d=this.surfaceValues_.length-1;d>=0;--d){if(l+="\telse if (intensity > surfaceValues ["+d+"])\n",l+="\t{\n",l+="\t\ttextureColor = vec4 (vec3 (surfaceValues ["+d+"]), 1.0);\n",this.renderStyleNodes.length){var f=Math.min(d,this.renderStyleNodes.length-1);l+=this.renderStyleNodes[f].getFunctionsText()}l+="\t}\n"}l+="\telse\n",l+="\t{\n",l+="\t\tdiscard;\n",l+="\t}\n",l+="\n"}n=n.replace(/\/\/ VOLUME_STYLES_UNIFORMS\n/,a),n=n.replace(/\/\/ VOLUME_STYLES_FUNCTIONS\n/,l);var p=new r(this.getExecutionContext());p.setName("VolumeDataVertexShader"),p.url_.push("data:x-shader/x-vertex,"+t),p.setup();var m=new r(this.getExecutionContext());m.setName("VolumeDataFragmentShader"),m.type_="FRAGMENT",m.url_.push("data:x-shader/x-fragment,"+n),m.setup();var _=new i(this.getExecutionContext());if(_.setName("VolumeDataShader"),_.language_="GLSL",_.parts_.push(p),_.parts_.push(m),_.addUserDefinedField(s.inputOutput,"surfaceValues",this.surfaceValues_.copy()),_.addUserDefinedField(s.inputOutput,"surfaceTolerance",this.surfaceTolerance_.copy()),this.gradientsNode&&_.addUserDefinedField(s.inputOutput,"grandients",new e.SFNode(this.gradientsNode)),this.voxelsNode){var x=new e.SFVec3f(this.voxelsNode.getWidth(),this.voxelsNode.getHeight(),this.voxelsNode.getDepth());_.addUserDefinedField(s.inputOutput,"x3d_TextureSize",x)}else _.addUserDefinedField(s.inputOutput,"x3d_TextureSize",new e.SFVec3f);o.addShaderFields(_);for(var d=0,u=this.renderStyleNodes.length;d<u;++d)this.renderStyleNodes[d].addShaderFields(_);return _}}),h}),e("x_ite/Components/VolumeRendering/ProjectionVolumeStyle",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode","x_ite/Bits/X3DConstants"],function(e,t,n,o,i){"use strict";function r(e){o.call(this,e),this.addType(i.ProjectionVolumeStyle)}return r.prototype=Object.assign(Object.create(o.prototype),{constructor:r,fieldDefinitions:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"type",new e.SFString("MAX")),new t(i.inputOutput,"intensityThreshold",new e.SFFloat(0))]),getTypeName:function(){return"ProjectionVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},addShaderFields:function(e){this.enabled_.getValue()&&e.addUserDefinedField(i.inputOutput,"intensityThreshold_"+this.getId(),this.intensityThreshold_.copy())},getUniformsText:function(){if(!this.enabled_.getValue())return"";var e="";switch(e+="\n",e+="// ProjectionVolumeStyle\n",e+="\n",e+="uniform float intensityThreshold_"+this.getId()+";\n",e+="\n",e+="vec4\n",e+="getProjectionStyle_"+this.getId()+"(in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",this.type_.getValue()){default:case"MAX":e+="\tfloat projectionColor = 0.0;\n";break;case"MIN":e+="\tfloat projectionColor = 1.0;\n";break;case"AVERAGE":e+="\tfloat projectionColor = 0.0;\n"}switch(e+="\tconst int samples = 32;\n",e+="\tvec3 step = normalize (x3d_TextureNormalMatrix * vec3 (0.0, 0.0, 1.0)) / float (samples);\n",e+="\tvec3 ray = texCoord - step * float (samples) * 0.5;\n",e+="\tbool first = false;\n",e+="\n",e+="\tfor (int i = 0; i < samples; ++ i, ray += step)\n",e+="\t{\n",e+="\t\tif (ray .s < 0.0 || ray .s > 1.0)\n",e+="\t\t\tcontinue;\n",e+="\n",e+="\t\tif (ray .t < 0.0 || ray .t > 1.0)\n",e+="\t\t\tcontinue;\n",e+="\n",e+="\t\tif (ray .p < 0.0 || ray .p > 1.0)\n",e+="\t\t\tcontinue;\n",e+="\n",e+="\t\tfloat intensity = texture (x3d_Texture3D [0], ray) .r;\n",e+="\n",this.type_.getValue()){default:case"MAX":e+="\t\tif (intensity < intensityThreshold_"+this.getId()+")\n",e+="\t\t\tcontinue;\n",e+="\n",e+="\t\tif (intensityThreshold_"+this.getId()+" > 0.0 && first)\n",e+="\t\t\tbreak;\n",e+="\n",e+="\t\tif (intensity <= projectionColor)\n",e+="\t\t{\n",e+="\t\t\tfirst = true;\n",e+="\t\t\tcontinue;\n",e+="\t\t}\n",e+="\n",e+="\t\tprojectionColor = intensity;\n";break;case"MIN":e+="\t\tif (intensity < intensityThreshold_"+this.getId()+")\n",e+="\t\t\tcontinue;\n",e+="\n",e+="\t\tif (intensityThreshold_"+this.getId()+" > 0.0 && first)\n",e+="\t\t\tbreak;\n",e+="\n",e+="\t\tif (intensity >= projectionColor)\n",e+="\t\t{\n",e+="\t\t\tfirst = true;\n",e+="\t\t\tcontinue;\n",e+="\t\t}\n",e+="\n",e+="\t\tprojectionColor = intensity;\n";break;case"AVERAGE":e+="\t\tprojectionColor += intensity;\n"}return e+="\t}\n",e+="\n","AVERAGE"===this.type_.getValue()&&(e+="\tprojectionColor /= float (samples);\n"),e+="\treturn vec4 (vec3 (projectionColor), originalColor .a);\n",e+="}\n"},getFunctionsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="\t// ProjectionVolumeStyle\n",e+="\n",e+="\ttextureColor = getProjectionStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),r}),e("x_ite/Components/VolumeRendering/SegmentedVolumeData",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DVolumeDataNode","x_ite/Components/Shaders/ComposedShader","x_ite/Components/Shaders/ShaderPart","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast","text!x_ite/Browser/VolumeRendering/VolumeStyle.vs","text!x_ite/Browser/VolumeRendering/VolumeStyle.fs","x_ite/DEBUG"],function(e,t,n,o,i,r,s,a,l,d,u){"use strict";function h(e){o.call(this,e),this.addType(s.SegmentedVolumeData),this.segmentIdentifiersNode=null,this.renderStyleNodes=[]}return h.prototype=Object.assign(Object.create(o.prototype),{constructor:h,fieldDefinitions:new n([new t(s.inputOutput,"metadata",new e.SFNode),new t(s.inputOutput,"dimensions",new e.SFVec3f(1,1,1)),new t(s.inputOutput,"segmentEnabled",new e.MFBool),new t(s.inputOutput,"visible",new e.SFBool(!0)),new t(s.inputOutput,"bboxDisplay",new e.SFBool),new t(s.initializeOnly,"bboxCenter",new e.SFVec3f(0,0,0)),new t(s.initializeOnly,"bboxSize",new e.SFVec3f(-1,-1,-1)),new t(s.inputOutput,"segmentIdentifiers",new e.SFNode),new t(s.inputOutput,"renderStyle",new e.MFNode),new t(s.inputOutput,"voxels",new e.SFNode)]),getTypeName:function(){return"SegmentedVolumeData"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"children"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this.segmentIdentifiers_.addInterest("set_segmentIdentifiers__",this),this.renderStyle_.addInterest("set_renderStyle__",this),this.voxels_.addFieldInterest(this.getAppearance().texture_),this.segmentEnabled_.addInterest("update",this),this.segmentIdentifiers_.addInterest("update",this),this.renderStyle_.addInterest("update",this),this.getAppearance().texture_=this.voxels_,this.set_segmentIdentifiers__(),this.set_renderStyle__(),this.set_voxels__(),this.update())},getSegmentEnabled:function(e){return!(e<this.segmentEnabled_.length)||this.segmentEnabled_[e]},set_segmentIdentifiers__:function(){this.segmentIdentifiersNode=a(s.X3DTexture3DNode,this.segmentIdentifiers_)},set_renderStyle__:function(){for(var e=this.renderStyleNodes,t=0,n=e.length;t<n;++t){var o=e[t];o.removeInterest("update",this),o.removeVolumeData(this)}e.length=0;for(var t=0,n=this.renderStyle_.length;t<n;++t){var o=a(s.X3DComposableVolumeRenderStyleNode,this.renderStyle_[t]);o&&e.push(o)}for(var t=0,n=e.length;t<n;++t){var o=e[t];o.addInterest("update",this),o.addVolumeData(this)}},set_voxels__:function(){this.voxelsNode&&this.voxelsNode.removeInterest("set_textureSize__",this),this.voxelsNode=a(s.X3DTexture3DNode,this.voxels_),this.voxelsNode&&(this.voxelsNode.addInterest("set_textureSize__",this),this.set_textureSize__())},set_textureSize__:function(){try{var e=this.getShader().getField("x3d_TextureSize");e.x=this.voxelsNode.getWidth(),e.y=this.voxelsNode.getHeight(),e.z=this.voxelsNode.getDepth()}catch(e){u&&console.log(e.message)}},update:function(){this.setShader(this.createShader(l,d))},createShader:function(t,n){var o=this.getBrowser().getDefaultVolumeStyle(),a=o.getUniformsText(),l=o.getFunctionsText();if(this.segmentIdentifiersNode?(a+="\n",a+="uniform sampler3D segmentIdentifiers;\n",l+="\n",l+="\n",l+="\tint segment = int (texture (segmentIdentifiers, texCoord) .r * 255.0);\n"):l+="\tint segment = 0;\n",this.renderStyleNodes.length){l+="\n",l+="\tswitch (segment)\n",l+="\t{\n";for(var d=0,u=this.renderStyleNodes.length;d<u;++d)l+="\t\tcase "+d+":\n",l+="\t\t{\n",this.getSegmentEnabled(d)?(a+=this.renderStyleNodes[d].getUniformsText(),l+=this.renderStyleNodes[d].getFunctionsText(),l+="\t\t\tbreak;\n"):l+="\t\t\tdiscard;\n",l+="\t\t}\n";l+="\t}\n"}n=n.replace(/\/\/ VOLUME_STYLES_UNIFORMS\n/,a),n=n.replace(/\/\/ VOLUME_STYLES_FUNCTIONS\n/,l);var h=new r(this.getExecutionContext());h.setName("SegmentedVolumeDataVertexShader"),h.url_.push("data:x-shader/x-vertex,"+t),h.setup();var c=new r(this.getExecutionContext());c.setName("SegmentedVolumeDataFragmentShader"),c.type_="FRAGMENT",c.url_.push("data:x-shader/x-fragment,"+n),c.setup();var g=new i(this.getExecutionContext());if(g.setName("SegmentedVolumeDataShader"),g.language_="GLSL",g.parts_.push(h),g.parts_.push(c),this.voxelsNode){var f=new e.SFVec3f(this.voxelsNode.getWidth(),this.voxelsNode.getHeight(),this.voxelsNode.getDepth());g.addUserDefinedField(s.inputOutput,"x3d_TextureSize",f)}else g.addUserDefinedField(s.inputOutput,"x3d_TextureSize",new e.SFVec3f);this.segmentIdentifiersNode&&g.addUserDefinedField(s.inputOutput,"segmentIdentifiers",new e.SFNode(this.segmentIdentifiersNode)),o.addShaderFields(g);for(var d=0,u=this.renderStyleNodes.length;d<u;++d)this.getSegmentEnabled(d)&&this.renderStyleNodes[d].addShaderFields(g);return g}}),h}),e("x_ite/Components/VolumeRendering/ShadedVolumeStyle",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast"],function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.ShadedVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,fieldDefinitions:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"lighting",new e.SFBool),new t(i.inputOutput,"shadows",new e.SFBool),new t(i.initializeOnly,"phaseFunction",new e.SFString("Henyey-Greenstein")),new t(i.inputOutput,"material",new e.SFNode),new t(i.inputOutput,"surfaceNormals",new e.SFNode)]),getTypeName:function(){return"ShadedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this.material_.addInterest("set_material__",this),this.surfaceNormals_.addInterest("set_surfaceNormals__",this),this.set_material__(),this.set_surfaceNormals__())},set_material__:function(){this.materialNode&&this.materialNode.removeInterest("addNodeEvent",this),this.materialNode=r(i.X3DMaterialNode,this.material_),this.materialNode&&this.materialNode.addInterest("addNodeEvent",this)},set_surfaceNormals__:function(){this.surfaceNormalsNode=r(i.X3DTexture3DNode,this.surfaceNormals_)},addShaderFields:function(t){this.enabled_.getValue()&&(this.materialNode&&(t.addUserDefinedField(i.inputOutput,"ambientIntensity_"+this.getId(),this.materialNode.ambientIntensity_.copy()),t.addUserDefinedField(i.inputOutput,"diffuseColor_"+this.getId(),this.materialNode.diffuseColor_.copy()),t.addUserDefinedField(i.inputOutput,"specularColor_"+this.getId(),this.materialNode.specularColor_.copy()),t.addUserDefinedField(i.inputOutput,"emissiveColor_"+this.getId(),this.materialNode.emissiveColor_.copy()),t.addUserDefinedField(i.inputOutput,"shininess_"+this.getId(),this.materialNode.shininess_.copy()),t.addUserDefinedField(i.inputOutput,"transparency_"+this.getId(),this.materialNode.transparency_.copy())),this.surfaceNormalsNode&&t.addUserDefinedField(i.inputOutput,"surfaceNormals_"+this.getId(),new e.SFNode(this.surfaceNormalsNode)))},getUniformsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="// ShadedVolumeStyle\n",e+="\n",e+="uniform float ambientIntensity_"+this.getId()+";\n",e+="uniform vec3 diffuseColor_"+this.getId()+";\n",e+="uniform vec3 specularColor_"+this.getId()+";\n",e+="uniform vec3 emissiveColor_"+this.getId()+";\n",e+="uniform float shininess_"+this.getId()+";\n",e+="uniform float transparency_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="float\n",e+="getSpotFactor_"+this.getId()+" (const in float cutOffAngle, const in float beamWidth, const in vec3 L, const in vec3 d)\n",e+="{\n",e+="\tfloat spotAngle = acos (clamp (dot (-L, d), -1.0, 1.0));\n",e+="\n",e+="\tif (spotAngle >= cutOffAngle)\n",e+="\t\treturn 0.0;\n",e+="\telse if (spotAngle <= beamWidth)\n",e+="\t\treturn 1.0;\n",e+="\n",e+="\treturn (spotAngle - cutOffAngle) / (beamWidth - cutOffAngle);\n",e+="}\n",e+="\n",e+="vec4\n",e+="getShadedStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tvec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+="\tif (surfaceNormal .w == 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\n",e+="\tvec4 shadedColor = vec4 (0.0);\n",this.lighting_.getValue()?(this.materialNode?(e+="\tvec3 diffuseFactor = diffuseColor_"+this.getId()+";\n",e+="\tvec3 ambientTerm = diffuseFactor * ambientIntensity_"+this.getId()+";\n",e+="\n",e+="\tshadedColor .a = originalColor .a * (1.0 - transparency_"+this.getId()+");\n"):(e+="\tvec3 diffuseFactor = originalColor .rgb;\n",e+="\tvec3 ambientTerm = vec3 (0.0);\n",e+="\n",e+="\tshadedColor .a = originalColor .a;\n"),e+="\n",e+="\tvec3 N = surfaceNormal .xyz;\n",e+="\tvec3 V = normalize (-vertex); // normalized vector from point on geometry to viewer's position\n",e+="\n",e+="\tfor (int i = 0; i < x3d_MaxLights; ++ i)\n",e+="\t{\n",e+="\t\tif (i == x3d_NumLights)\n",e+="\t\t\tbreak;\n",e+="\n",e+="\t\tx3d_LightSourceParameters light = x3d_LightSource [i];\n",e+="\n",e+="\t\tvec3 vL = light .location - vertex; // Light to fragment\n",e+="\t\tfloat dL = length (light .matrix * vL);\n",e+="\t\tbool di = light .type == x3d_DirectionalLight;\n",e+="\n",e+="\t\tif (di || dL <= light .radius)\n",e+="\t\t{\n",e+="\t\t\tvec3 d = light .direction;\n",e+="\t\t\tvec3 c = light .attenuation;\n",e+="\t\t\tvec3 L = di ? -d : normalize (vL); // Normalized vector from point on geometry to light source i position.\n",e+="\t\t\tvec3 H = normalize (L + V); // Specular term\n",e+="\n",e+="\t\t\tfloat lightAngle = max (dot (N, L), 0.0); // Angle between normal and light ray.\n",e+="\t\t\tvec3 diffuseTerm = diffuseFactor * lightAngle;\n",e+="\t\t\tfloat specularFactor = shininess_"+this.getId()+" > 0.0 ? pow (max (dot (N, H), 0.0), shininess_"+this.getId()+" * 128.0) : 1.0;\n",e+="\t\t\tvec3 specularTerm = light .intensity * specularColor_"+this.getId()+" * specularFactor;\n",e+="\n",e+="\t\t\tfloat attenuationFactor = di ? 1.0 : 1.0 / max (c [0] + c [1] * dL + c [2] * (dL * dL), 1.0);\n",e+="\t\t\tfloat spotFactor = light .type == x3d_SpotLight ? getSpotFactor_"+this.getId()+" (light .cutOffAngle, light .beamWidth, L, d) : 1.0;\n",e+="\t\t\tfloat attenuationSpotFactor = attenuationFactor * spotFactor;\n",e+="\t\t\tvec3 ambientColor = light .ambientIntensity * ambientTerm;\n",e+="\t\t\tvec3 diffuseSpecularColor = light .intensity * (diffuseTerm + specularTerm);\n",e+="\n",e+="\t\t\tshadedColor .rgb += attenuationSpotFactor * light .color * (ambientColor + diffuseSpecularColor);\n",e+="\t\t}\n",e+="\n",e+="\t\tshadedColor .rgb += emissiveColor_"+this.getId()+";\n",e+="\t\tshadedColor .rgb = getFogColor (shadedColor .rgb);\n",e+="\t}\n"):this.materialNode?(e+="\tshadedColor .rgb = diffuseColor_"+this.getId()+";\n",e+="\tshadedColor .a = originalColor .a * (1.0 - transparency_"+this.getId()+");\n"):e+="\tshadedColor = originalColor;\n",e+="\n",e+="\treturn shadedColor;\n",e+="}\n"},getFunctionsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="\t// ShadedVolumeStyle\n",e+="\n",e+="\ttextureColor = getShadedStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s}),e("x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast"],function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.SilhouetteEnhancementVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,fieldDefinitions:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"silhouetteRetainedOpacity",new e.SFFloat(1)),new t(i.inputOutput,"silhouetteBoundaryOpacity",new e.SFFloat(0)),new t(i.inputOutput,"silhouetteSharpness",new e.SFFloat(.5)),new t(i.inputOutput,"surfaceNormals",new e.SFNode)]),getTypeName:function(){return"SilhouetteEnhancementVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this.surfaceNormals_.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=r(i.X3DTexture3DNode,this.surfaceNormals_)},addShaderFields:function(t){this.enabled_.getValue()&&(t.addUserDefinedField(i.inputOutput,"silhouetteRetainedOpacity_"+this.getId(),this.silhouetteRetainedOpacity_.copy()),t.addUserDefinedField(i.inputOutput,"silhouetteBoundaryOpacity_"+this.getId(),this.silhouetteBoundaryOpacity_.copy()),t.addUserDefinedField(i.inputOutput,"silhouetteSharpness_"+this.getId(),this.silhouetteSharpness_.copy()),this.surfaceNormalsNode&&t.addUserDefinedField(i.inputOutput,"surfaceNormals_"+this.getId(),new e.SFNode(this.surfaceNormalsNode)))},getUniformsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="// SilhouetteEnhancementVolumeStyle\n",e+="\n",e+="uniform float silhouetteRetainedOpacity_"+this.getId()+";\n",e+="uniform float silhouetteBoundaryOpacity_"+this.getId()+";\n",e+="uniform float silhouetteSharpness_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="vec4\n",e+="getSilhouetteEnhancementStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tvec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+="\tif (surfaceNormal .w == 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\t\n",e+="\tfloat silhouetteRetainedOpacity = silhouetteRetainedOpacity_"+this.getId()+";\n",e+="\tfloat silhouetteBoundaryOpacity = silhouetteBoundaryOpacity_"+this.getId()+";\n",e+="\tfloat silhouetteSharpness = silhouetteSharpness_"+this.getId()+";\n",e+="\n",e+="\treturn vec4 (originalColor .rgb, originalColor .a * (silhouetteRetainedOpacity + silhouetteBoundaryOpacity * pow (1.0 - abs (dot (surfaceNormal .xyz, normalize (vertex))), silhouetteSharpness)));\n",e+="}\n"},getFunctionsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="\t// SilhouetteEnhancementVolumeStyle\n",e+="\n",e+="\ttextureColor = getSilhouetteEnhancementStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s}),e("x_ite/Components/VolumeRendering/ToneMappedVolumeStyle",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast"],function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.ToneMappedVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,fieldDefinitions:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"coolColor",new e.SFColorRGBA(0,0,1,0)),new t(i.inputOutput,"warmColor",new e.SFColorRGBA(1,1,0,0)),new t(i.inputOutput,"surfaceNormals",new e.SFNode)]),getTypeName:function(){return"ToneMappedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this.surfaceNormals_.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=r(i.X3DTexture3DNode,this.surfaceNormals_)},addShaderFields:function(t){this.enabled_.getValue()&&(t.addUserDefinedField(i.inputOutput,"coolColor_"+this.getId(),this.coolColor_.copy()),t.addUserDefinedField(i.inputOutput,"warmColor_"+this.getId(),this.warmColor_.copy()),this.surfaceNormalsNode&&t.addUserDefinedField(i.inputOutput,"surfaceNormals_"+this.getId(),new e.SFNode(this.surfaceNormalsNode)))},getUniformsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="// ToneMappedVolumeStyle\n",e+="\n",e+="uniform vec4 coolColor_"+this.getId()+";\n",e+="uniform vec4 warmColor_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="vec4\n",e+="getToneMappedStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tvec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+="\tif (surfaceNormal .w == 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\n",e+="\tvec3 toneColor = vec3 (0.0);\n",e+="\tvec3 coolColor = coolColor_"+this.getId()+" .rgb;\n",e+="\tvec3 warmColor = warmColor_"+this.getId()+" .rgb;\n",e+="\n",e+="\tfor (int i = 0; i < x3d_MaxLights; ++ i)\n",e+="\t{\n",e+="\t\tif (i == x3d_NumLights)\n",e+="\t\t\tbreak;\n",e+="\n",e+="\t\tx3d_LightSourceParameters light = x3d_LightSource [i];\n",e+="\n",e+="\t\tvec3 L = light .type == x3d_DirectionalLight ? -light .direction : normalize (light .location - vertex);\n",e+="\t\tfloat colorFactor = (1.0 + dot (L, surfaceNormal .xyz)) * 0.5;\n",e+="\n",e+="\t\ttoneColor += mix (warmColor .rgb, coolColor .rgb, colorFactor);\n",e+="\t}\n",e+="\n",e+="\treturn vec4 (toneColor, originalColor .a);\n",e+="}\n"},getFunctionsText:function(){if(!this.enabled_.getValue())return"";var e="";return e+="\n",e+="\t// ToneMappedVolumeStyle\n",e+="\n",e+="\ttextureColor = getToneMappedStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s}),e("x_ite/Components/VolumeRendering/VolumeData",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DVolumeDataNode","x_ite/Components/Shaders/ComposedShader","x_ite/Components/Shaders/ShaderPart","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast","text!x_ite/Browser/VolumeRendering/VolumeStyle.vs","text!x_ite/Browser/VolumeRendering/VolumeStyle.fs","x_ite/DEBUG"],function(e,t,n,o,i,r,s,a,l,d,u){"use strict";function h(e){o.call(this,e),this.addType(s.VolumeData),this.renderStyleNode=null}return h.prototype=Object.assign(Object.create(o.prototype),{constructor:h,fieldDefinitions:new n([new t(s.inputOutput,"metadata",new e.SFNode),new t(s.inputOutput,"dimensions",new e.SFVec3f(1,1,1)),new t(s.inputOutput,"visible",new e.SFBool(!0)),new t(s.inputOutput,"bboxDisplay",new e.SFBool),new t(s.initializeOnly,"bboxCenter",new e.SFVec3f(0,0,0)),new t(s.initializeOnly,"bboxSize",new e.SFVec3f(-1,-1,-1)),new t(s.inputOutput,"renderStyle",new e.SFNode),new t(s.inputOutput,"voxels",new e.SFNode)]),getTypeName:function(){return"VolumeData"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"children"},initialize:function(){o.prototype.initialize.call(this),
|
|
3
|
+
this.getBrowser().getContext().getVersion()<2||(this.renderStyle_.addInterest("set_renderStyle__",this),this.voxels_.addInterest("set_voxels__",this),this.voxels_.addFieldInterest(this.getAppearance().texture_),this.renderStyle_.addInterest("update",this),this.getAppearance().texture_=this.voxels_,this.set_renderStyle__(),this.set_voxels__(),this.update())},set_renderStyle__:function(){this.renderStyleNode&&(this.renderStyleNode.removeInterest("update",this),this.renderStyleNode.removeVolumeData(this)),this.renderStyleNode=a(s.X3DVolumeRenderStyleNode,this.renderStyle_),this.renderStyleNode&&(this.renderStyleNode.addInterest("update",this),this.renderStyleNode.addVolumeData(this))},set_voxels__:function(){this.voxelsNode&&this.voxelsNode.removeInterest("set_textureSize__",this),this.voxelsNode=a(s.X3DTexture3DNode,this.voxels_),this.voxelsNode&&(this.voxelsNode.addInterest("set_textureSize__",this),this.set_textureSize__())},set_textureSize__:function(){try{var e=this.getShader().getField("x3d_TextureSize");e.x=this.voxelsNode.getWidth(),e.y=this.voxelsNode.getHeight(),e.z=this.voxelsNode.getDepth()}catch(e){u&&console.log(e.message)}},update:function(){this.setShader(this.createShader(l,d))},createShader:function(t,n){var o=this.getBrowser().getDefaultVolumeStyle(),a=o.getUniformsText(),l=o.getFunctionsText();this.renderStyleNode&&(a+=this.renderStyleNode.getUniformsText(),l+=this.renderStyleNode.getFunctionsText()),n=n.replace(/\/\/ VOLUME_STYLES_UNIFORMS\n/,a),n=n.replace(/\/\/ VOLUME_STYLES_FUNCTIONS\n/,l);var d=new r(this.getExecutionContext());d.setName("VolumeDataVertexShader"),d.url_.push("data:x-shader/x-vertex,"+t),d.setup();var u=new r(this.getExecutionContext());u.setName("VolumeDataFragmentShader"),u.type_="FRAGMENT",u.url_.push("data:x-shader/x-fragment,"+n),u.setup();var h=new i(this.getExecutionContext());if(h.setName("VolumeDataShader"),h.language_="GLSL",h.parts_.push(d),h.parts_.push(u),this.voxelsNode){var c=new e.SFVec3f(this.voxelsNode.getWidth(),this.voxelsNode.getHeight(),this.voxelsNode.getDepth());h.addUserDefinedField(s.inputOutput,"x3d_TextureSize",c)}else h.addUserDefinedField(s.inputOutput,"x3d_TextureSize",new e.SFVec3f);return o.addShaderFields(h),this.renderStyleNode&&this.renderStyleNode.addShaderFields(h),h}}),h}),e(t.getComponentUrl("volume-rendering"),["x_ite/Components","x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext","x_ite/Components/VolumeRendering/BlendedVolumeStyle","x_ite/Components/VolumeRendering/BoundaryEnhancementVolumeStyle","x_ite/Components/VolumeRendering/CartoonVolumeStyle","x_ite/Components/VolumeRendering/ComposedVolumeStyle","x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle","x_ite/Components/VolumeRendering/IsoSurfaceVolumeData","x_ite/Components/VolumeRendering/OpacityMapVolumeStyle","x_ite/Components/VolumeRendering/ProjectionVolumeStyle","x_ite/Components/VolumeRendering/SegmentedVolumeData","x_ite/Components/VolumeRendering/ShadedVolumeStyle","x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle","x_ite/Components/VolumeRendering/ToneMappedVolumeStyle","x_ite/Components/VolumeRendering/VolumeData","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Components/VolumeRendering/X3DVolumeDataNode","x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode",t.getComponentUrl("cad-geometry"),t.getComponentUrl("texturing-3d")],function(e,t,n,o,i,r,s,a,l,d,u,h,c,g,f,p,m,_){"use strict";e.addComponent({name:"VolumeRendering",types:{BlendedVolumeStyle:n,BoundaryEnhancementVolumeStyle:o,CartoonVolumeStyle:i,ComposedVolumeStyle:r,EdgeEnhancementVolumeStyle:s,IsoSurfaceVolumeData:a,OpacityMapVolumeStyle:l,ProjectionVolumeStyle:d,SegmentedVolumeData:u,ShadedVolumeStyle:h,SilhouetteEnhancementVolumeStyle:c,ToneMappedVolumeStyle:g,VolumeData:f},abstractTypes:{X3DComposableVolumeRenderStyleNode:p,X3DVolumeDataNode:m,X3DVolumeRenderStyleNode:_},browser:t})})}();
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
(function ()
|
|
1
|
+
(function ()
|
|
2
|
+
{
|
|
3
|
+
// Undefine global variables.
|
|
4
|
+
var module = { }, exports, process;
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
module = { };
|
|
6
|
+
const
|
|
7
|
+
define = X3D .define,
|
|
8
|
+
require = X3D .require;
|
|
7
9
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
8
10
|
*******************************************************************************
|
|
9
11
|
*
|
|
@@ -260,7 +262,7 @@ function (Fields,
|
|
|
260
262
|
******************************************************************************/
|
|
261
263
|
|
|
262
264
|
|
|
263
|
-
define ([
|
|
265
|
+
define (require .getComponentUrl ("x_ite"), [
|
|
264
266
|
"x_ite/Components",
|
|
265
267
|
"x_ite/Components/X_ITE/BlendMode",
|
|
266
268
|
],
|
|
@@ -282,4 +284,4 @@ function (Components,
|
|
|
282
284
|
});
|
|
283
285
|
|
|
284
286
|
|
|
285
|
-
}()
|
|
287
|
+
})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){
|
|
1
|
+
!function(){const t=X3D.define,e=X3D.require;t("x_ite/Components/X_ITE/BlendMode",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Shape/X3DAppearanceChildNode","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants"],function(t,e,o,i,s,a){"use strict";function n(t){i.call(this,t),this.addType(a.BlendMode),this.factorTypes=new Map,this.equationTypes=new Map}return n.prototype=Object.assign(Object.create(i.prototype),{constructor:n,fieldDefinitions:new o([new e(a.inputOutput,"metadata",new t.SFNode),new e(a.inputOutput,"blendColor",new t.SFColorRGBA),new e(a.inputOutput,"sourceColorFactor",new t.SFString("SRC_ALPHA")),new e(a.inputOutput,"sourceAlphaFactor",new t.SFString("ONE")),new e(a.inputOutput,"destinationColorFactor",new t.SFString("ONE_MINUS_SRC_ALPHA")),new e(a.inputOutput,"destinationAlphaFactor",new t.SFString("ONE_MINUS_SRC_ALPHA")),new e(a.inputOutput,"colorEquation",new t.SFString("FUNC_ADD")),new e(a.inputOutput,"alphaEquation",new t.SFString("FUNC_ADD"))]),getTypeName:function(){return"BlendMode"},getComponentName:function(){return"X_ITE"},getContainerField:function(){return"blendMode"},initialize:function(){i.prototype.initialize.call(this);var t=this.getBrowser().getContext(),e=t.getExtension("EXT_blend_minmax");this.factorTypes.set("ZERO",t.ZERO),this.factorTypes.set("ONE",t.ONE),this.factorTypes.set("SRC_COLOR",t.SRC_COLOR),this.factorTypes.set("ONE_MINUS_SRC_COLOR",t.ONE_MINUS_SRC_COLOR),this.factorTypes.set("DST_COLOR",t.DST_COLOR),this.factorTypes.set("ONE_MINUS_DST_COLOR",t.ONE_MINUS_DST_COLOR),this.factorTypes.set("SRC_ALPHA",t.SRC_ALPHA),this.factorTypes.set("ONE_MINUS_SRC_ALPHA",t.ONE_MINUS_SRC_ALPHA),this.factorTypes.set("DST_ALPHA",t.DST_ALPHA),this.factorTypes.set("ONE_MINUS_DST_ALPHA",t.ONE_MINUS_DST_ALPHA),this.factorTypes.set("SRC_ALPHA_SATURATE",t.SRC_ALPHA_SATURATE),this.factorTypes.set("CONSTANT_COLOR",t.CONSTANT_COLOR),this.factorTypes.set("ONE_MINUS_CONSTANT_COLOR",t.ONE_MINUS_CONSTANT_COLOR),this.factorTypes.set("CONSTANT_ALPHA",t.CONSTANT_ALPHA),this.factorTypes.set("ONE_MINUS_CONSTANT_ALPHA",t.ONE_MINUS_CONSTANT_ALPHA),this.equationTypes.set("FUNC_ADD",t.FUNC_ADD),this.equationTypes.set("FUNC_SUBTRACT",t.FUNC_SUBTRACT),this.equationTypes.set("FUNC_REVERSE_SUBTRACT",t.FUNC_REVERSE_SUBTRACT),this.equationTypes.set("MIN",t.MIN||e&&e.MIN_EXT),this.equationTypes.set("MAX",t.MAX||e&&e.MAX_EXT),this.sourceColorFactor_.addInterest("set_sourceColorFactor__",this),this.sourceAlphaFactor_.addInterest("set_sourceAlphaFactor__",this),this.destinationColorFactor_.addInterest("set_destinationColorFactor__",this),this.destinationAlphaFactor_.addInterest("set_destinationAlphaFactor__",this),this.colorEquation_.addInterest("set_colorEquation__",this),this.alphaEquation_.addInterest("set_alphaEquation__",this),this.set_sourceColorFactor__(),this.set_sourceAlphaFactor__(),this.set_destinationColorFactor__(),this.set_destinationAlphaFactor__(),this.set_colorEquation__(),this.set_alphaEquation__()},set_sourceColorFactor__:function(){this.sourceColorFactorType=this.factorTypes.get(this.sourceColorFactor_.getValue()),void 0===this.sourceColorFactorType&&(this.sourceColorFactorType=this.factorTypes.get("SRC_ALPHA"))},set_sourceAlphaFactor__:function(){this.sourceAlphaFactorType=this.factorTypes.get(this.sourceAlphaFactor_.getValue()),void 0===this.sourceAlphaFactorType&&(this.sourceAlphaFactorType=this.factorTypes.get("ONE"))},set_destinationColorFactor__:function(){this.destinationColorFactorType=this.factorTypes.get(this.destinationColorFactor_.getValue()),void 0===this.destinationColorFactorType&&(this.destinationColorFactorType=this.factorTypes.get("ONE_MINUS_SRC_ALPHA"))},set_destinationAlphaFactor__:function(){this.destinationAlphaFactorType=this.factorTypes.get(this.destinationAlphaFactor_.getValue()),void 0===this.destinationAlphaFactorType&&(this.destinationAlphaFactorType=this.factorTypes.get("ONE_MINUS_SRC_ALPHA"))},set_colorEquation__:function(){this.colorEquationType=this.equationTypes.get(this.colorEquation_.getValue()),void 0===this.colorEquationType&&(this.colorEquationType=this.equationTypes.get("FUNC_ADD"))},set_alphaEquation__:function(){this.alphaEquationType=this.equationTypes.get(this.alphaEquation_.getValue()),void 0===this.alphaEquationType&&(this.alphaEquationType=this.equationTypes.get("FUNC_ADD"))},enable:function(t){var e=this.blendColor_.getValue();t.blendColor(e.r,e.g,e.b,e.a),t.blendFuncSeparate(this.sourceColorFactorType,this.destinationColorFactorType,this.sourceAlphaFactorType,this.destinationAlphaFactorType),t.blendEquationSeparate(this.colorEquationType,this.alphaEquationType)},disable:function(t){t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD)}}),n}),t(e.getComponentUrl("x_ite"),["x_ite/Components","x_ite/Components/X_ITE/BlendMode"],function(t,e){"use strict";t.addComponent({name:"X_ITE",types:{BlendMode:e},abstractTypes:{}})})}();
|
|
@@ -8,9 +8,8 @@ varying vec4 color;
|
|
|
8
8
|
void
|
|
9
9
|
main ()
|
|
10
10
|
{
|
|
11
|
-
vec4
|
|
12
|
-
|
|
13
|
-
finalColor .
|
|
14
|
-
finalColor .a = textureColor .a * color .a * (1.0 - x3d_Material .transparency);
|
|
11
|
+
vec4 finalColor = x3d_NumTextures > 0 ? texture2D (x3d_Texture2D [0], texCoord .st) : vec4 (1.0);
|
|
12
|
+
finalColor .rgb *= x3d_Material .emissiveColor;
|
|
13
|
+
finalColor .a *= color .a * (1.0 - x3d_Material .transparency);
|
|
15
14
|
gl_FragColor = finalColor;
|
|
16
15
|
}
|
|
@@ -7,7 +7,6 @@ uniform mat4 x3d_ModelViewMatrix;
|
|
|
7
7
|
uniform bool x3d_ColorMaterial;
|
|
8
8
|
uniform int x3d_NumLights;
|
|
9
9
|
uniform x3d_LightSourceParameters x3d_LightSource [x3d_MaxLights];
|
|
10
|
-
uniform bool x3d_SeparateBackColor;
|
|
11
10
|
uniform x3d_MaterialParameters x3d_Material;
|
|
12
11
|
attribute float x3d_FogDepth;
|
|
13
12
|
attribute vec4 x3d_Color;
|
|
@@ -8,7 +8,6 @@ uniform bool x3d_ColorMaterial;
|
|
|
8
8
|
uniform float x3d_AlphaCutoff;
|
|
9
9
|
uniform int x3d_NumLights;
|
|
10
10
|
uniform x3d_LightSourceParameters x3d_LightSource [x3d_MaxLights];
|
|
11
|
-
uniform bool x3d_SeparateBackColor;
|
|
12
11
|
uniform x3d_MaterialParameters x3d_Material;
|
|
13
12
|
varying float fogDepth;
|
|
14
13
|
varying vec4 color;
|
|
@@ -6,9 +6,6 @@ precision highp int;
|
|
|
6
6
|
uniform int x3d_GeometryType;
|
|
7
7
|
uniform bool x3d_ColorMaterial;
|
|
8
8
|
uniform float x3d_AlphaCutoff;
|
|
9
|
-
uniform int x3d_NumLights;
|
|
10
|
-
uniform x3d_LightSourceParameters x3d_LightSource [x3d_MaxLights];
|
|
11
|
-
uniform bool x3d_SeparateBackColor;
|
|
12
9
|
uniform x3d_MaterialParameters x3d_Material;
|
|
13
10
|
varying float fogDepth;
|
|
14
11
|
varying vec4 color;
|
|
@@ -8,7 +8,6 @@ uniform mat4 x3d_ModelViewMatrix;
|
|
|
8
8
|
uniform bool x3d_ColorMaterial;
|
|
9
9
|
uniform int x3d_NumLights;
|
|
10
10
|
uniform x3d_LightSourceParameters x3d_LightSource [x3d_MaxLights];
|
|
11
|
-
uniform bool x3d_SeparateBackColor;
|
|
12
11
|
uniform x3d_MaterialParameters x3d_Material;
|
|
13
12
|
in float x3d_FogDepth;
|
|
14
13
|
in vec4 x3d_Color;
|
|
@@ -6,7 +6,6 @@ uniform bool x3d_ColorMaterial;
|
|
|
6
6
|
uniform float x3d_AlphaCutoff;
|
|
7
7
|
uniform int x3d_NumLights;
|
|
8
8
|
uniform x3d_LightSourceParameters x3d_LightSource [x3d_MaxLights];
|
|
9
|
-
uniform bool x3d_SeparateBackColor;
|
|
10
9
|
uniform x3d_MaterialParameters x3d_Material;
|
|
11
10
|
in float fogDepth;
|
|
12
11
|
in vec4 color;
|
|
@@ -4,9 +4,6 @@ precision highp int;
|
|
|
4
4
|
uniform int x3d_GeometryType;
|
|
5
5
|
uniform bool x3d_ColorMaterial;
|
|
6
6
|
uniform float x3d_AlphaCutoff;
|
|
7
|
-
uniform int x3d_NumLights;
|
|
8
|
-
uniform x3d_LightSourceParameters x3d_LightSource [x3d_MaxLights];
|
|
9
|
-
uniform bool x3d_SeparateBackColor;
|
|
10
7
|
uniform x3d_MaterialParameters x3d_Material;
|
|
11
8
|
in float fogDepth;
|
|
12
9
|
in vec4 color;
|
package/dist/example.html
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8"/>
|
|
5
|
-
<link rel="stylesheet" type="text/css" href="https://create3000.github.io/code/x_ite/4.7.
|
|
6
|
-
<script type="text/javascript" src="https://create3000.github.io/code/x_ite/4.7.
|
|
5
|
+
<link rel="stylesheet" type="text/css" href="https://create3000.github.io/code/x_ite/4.7.9/dist/x_ite.css"/>
|
|
6
|
+
<script type="text/javascript" src="https://create3000.github.io/code/x_ite/4.7.9/dist/x_ite.min.js"></script>
|
|
7
7
|
<style>
|
|
8
8
|
X3DCanvas {
|
|
9
9
|
width: 1000px;
|
package/dist/x_ite.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* X_ITE v4.7.
|
|
1
|
+
/* X_ITE v4.7.9-1135 */
|
|
2
2
|
@charset "utf-8";
|
|
3
3
|
@import url(https://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700,700italic);
|
|
4
4
|
X3DCanvas .x_ite-private-splash-screen {
|
|
@@ -143,7 +143,7 @@ X3DCanvas .x_ite-private-notification {
|
|
|
143
143
|
}
|
|
144
144
|
X3DCanvas .x_ite-private-notification span {
|
|
145
145
|
padding: 0px 24px 0px 20px;
|
|
146
|
-
background: url(assets/images/icon.bw.png) no-repeat 0px
|
|
146
|
+
background: url(assets/images/icon.bw.png) no-repeat 0px 2px;
|
|
147
147
|
}
|
|
148
148
|
X3DCanvas .x_ite-private-browser-timings {
|
|
149
149
|
display: none;
|
|
@@ -315,7 +315,7 @@ X3DCanvas #context-menu-layer {
|
|
|
315
315
|
z-index: 0 !important;
|
|
316
316
|
}
|
|
317
317
|
.x_ite-private-menu.x_ite-private-menu-title:before {
|
|
318
|
-
content: "X_ITE Browser v4.7.
|
|
318
|
+
content: "X_ITE Browser v4.7.9";
|
|
319
319
|
display: block;
|
|
320
320
|
padding: 4px 32px 4px 8px;
|
|
321
321
|
font-weight: bold;
|
|
@@ -359,6 +359,7 @@ X3DCanvas #context-menu-layer {
|
|
|
359
359
|
letter-spacing: unset;
|
|
360
360
|
}
|
|
361
361
|
.x_ite-private-menu .context-menu-separator {
|
|
362
|
+
padding-top: 0;
|
|
362
363
|
padding-bottom: 0;
|
|
363
364
|
border-bottom: 1px solid #111;
|
|
364
365
|
}
|