x_ite 9.7.0 → 10.0.0
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/README.md +5 -5
- package/dist/assets/components/Annotation.js +13 -13
- package/dist/assets/components/Annotation.min.js +1 -1
- package/dist/assets/components/CADGeometry.js +16 -14
- package/dist/assets/components/CADGeometry.min.js +1 -1
- package/dist/assets/components/CubeMapTexturing.js +61 -46
- package/dist/assets/components/CubeMapTexturing.min.js +1 -1
- package/dist/assets/components/DIS.js +13 -13
- package/dist/assets/components/DIS.min.js +1 -1
- package/dist/assets/components/EventUtilities.js +9 -9
- package/dist/assets/components/EventUtilities.min.js +1 -1
- package/dist/assets/components/Geometry2D.js +18 -18
- package/dist/assets/components/Geometry2D.min.js +1 -1
- package/dist/assets/components/Geospatial.js +42 -34
- package/dist/assets/components/Geospatial.min.js +1 -1
- package/dist/assets/components/HAnim.js +23 -23
- package/dist/assets/components/HAnim.min.js +1 -1
- package/dist/assets/components/KeyDeviceSensor.js +8 -8
- package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
- package/dist/assets/components/Layout.js +27 -31
- package/dist/assets/components/Layout.min.js +1 -1
- package/dist/assets/components/NURBS.js +23 -23
- package/dist/assets/components/NURBS.min.js +1 -1
- package/dist/assets/components/ParticleSystems.js +37 -40
- package/dist/assets/components/ParticleSystems.min.js +1 -1
- package/dist/assets/components/Picking.js +18 -18
- package/dist/assets/components/Picking.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysics.js +17 -17
- package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
- package/dist/assets/components/Scripting.js +38 -42
- package/dist/assets/components/Scripting.min.js +1 -1
- package/dist/assets/components/Text.js +24 -24
- package/dist/assets/components/Text.min.js +1 -1
- package/dist/assets/components/TextureProjection.js +15 -15
- package/dist/assets/components/TextureProjection.min.js +1 -1
- package/dist/assets/components/Texturing3D.js +30 -27
- package/dist/assets/components/Texturing3D.min.js +1 -1
- package/dist/assets/components/VolumeRendering.js +19 -19
- package/dist/assets/components/VolumeRendering.min.js +1 -1
- package/dist/assets/components/X_ITE.js +2394 -14
- package/dist/assets/components/X_ITE.min.js +1 -1
- package/dist/assets/lib/README.md +2 -0
- package/dist/assets/lib/draco_decoder_gltf.js +1 -1
- package/dist/assets/lib/libktx.js +1 -1
- package/dist/assets/lib/lut_charlie.png +0 -0
- package/dist/assets/lib/lut_sheen_E.png +0 -0
- package/dist/x_ite.css +1 -1
- package/dist/x_ite.d.ts +13 -0
- package/dist/x_ite.js +16251 -15275
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.min.mjs +1 -1
- package/dist/x_ite.mjs +16251 -15279
- package/dist/x_ite.zip +0 -0
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* X_ITE
|
|
1
|
+
/* X_ITE v10.0.0 */(() => { // webpackBootstrap
|
|
2
2
|
/******/ "use strict";
|
|
3
3
|
/******/ // The require scope
|
|
4
4
|
/******/ var __webpack_require__ = {};
|
|
@@ -39,25 +39,25 @@ var __webpack_exports__ = {};
|
|
|
39
39
|
// UNUSED EXPORTS: default
|
|
40
40
|
|
|
41
41
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components\")"
|
|
42
|
-
const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-
|
|
42
|
+
const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.0")] .require ("x_ite/Components");
|
|
43
43
|
var Components_default = /*#__PURE__*/__webpack_require__.n(Components_namespaceObject);
|
|
44
44
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Fields\")"
|
|
45
|
-
const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-
|
|
45
|
+
const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.0")] .require ("x_ite/Fields");
|
|
46
46
|
var Fields_default = /*#__PURE__*/__webpack_require__.n(Fields_namespaceObject);
|
|
47
47
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DFieldDefinition\")"
|
|
48
|
-
const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-
|
|
48
|
+
const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.0")] .require ("x_ite/Base/X3DFieldDefinition");
|
|
49
49
|
var X3DFieldDefinition_default = /*#__PURE__*/__webpack_require__.n(X3DFieldDefinition_namespaceObject);
|
|
50
50
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/FieldDefinitionArray\")"
|
|
51
|
-
const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-
|
|
51
|
+
const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.0")] .require ("x_ite/Base/FieldDefinitionArray");
|
|
52
52
|
var FieldDefinitionArray_default = /*#__PURE__*/__webpack_require__.n(FieldDefinitionArray_namespaceObject);
|
|
53
53
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Shape/X3DAppearanceChildNode\")"
|
|
54
|
-
const X3DAppearanceChildNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-
|
|
54
|
+
const X3DAppearanceChildNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.0")] .require ("x_ite/Components/Shape/X3DAppearanceChildNode");
|
|
55
55
|
var X3DAppearanceChildNode_default = /*#__PURE__*/__webpack_require__.n(X3DAppearanceChildNode_namespaceObject);
|
|
56
56
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DConstants\")"
|
|
57
|
-
const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-
|
|
57
|
+
const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.0")] .require ("x_ite/Base/X3DConstants");
|
|
58
58
|
var X3DConstants_default = /*#__PURE__*/__webpack_require__.n(X3DConstants_namespaceObject);
|
|
59
59
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Namespace\")"
|
|
60
|
-
const Namespace_namespaceObject = window [Symbol .for ("X_ITE.X3D-
|
|
60
|
+
const Namespace_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.0")] .require ("x_ite/Namespace");
|
|
61
61
|
var Namespace_default = /*#__PURE__*/__webpack_require__.n(Namespace_namespaceObject);
|
|
62
62
|
;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/BlendMode.js
|
|
63
63
|
/*******************************************************************************
|
|
@@ -436,22 +436,22 @@ const DepthMode_default_ = DepthMode;
|
|
|
436
436
|
Namespace_default().add ("DepthMode", "x_ite/Components/X_ITE/DepthMode", DepthMode_default_);
|
|
437
437
|
/* harmony default export */ const X_ITE_DepthMode = (DepthMode_default_);
|
|
438
438
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Shape/X3DShapeNode\")"
|
|
439
|
-
const X3DShapeNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-
|
|
439
|
+
const X3DShapeNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.0")] .require ("x_ite/Components/Shape/X3DShapeNode");
|
|
440
440
|
var X3DShapeNode_default = /*#__PURE__*/__webpack_require__.n(X3DShapeNode_namespaceObject);
|
|
441
441
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Rendering/TraverseType\")"
|
|
442
|
-
const TraverseType_namespaceObject = window [Symbol .for ("X_ITE.X3D-
|
|
442
|
+
const TraverseType_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.0")] .require ("x_ite/Rendering/TraverseType");
|
|
443
443
|
var TraverseType_default = /*#__PURE__*/__webpack_require__.n(TraverseType_namespaceObject);
|
|
444
444
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Rendering/VertexArray\")"
|
|
445
|
-
const VertexArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-
|
|
445
|
+
const VertexArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.0")] .require ("x_ite/Rendering/VertexArray");
|
|
446
446
|
var VertexArray_default = /*#__PURE__*/__webpack_require__.n(VertexArray_namespaceObject);
|
|
447
447
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Vector3\")"
|
|
448
|
-
const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-
|
|
448
|
+
const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.0")] .require ("standard/Math/Numbers/Vector3");
|
|
449
449
|
var Vector3_default = /*#__PURE__*/__webpack_require__.n(Vector3_namespaceObject);
|
|
450
450
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Matrix4\")"
|
|
451
|
-
const Matrix4_namespaceObject = window [Symbol .for ("X_ITE.X3D-
|
|
451
|
+
const Matrix4_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.0")] .require ("standard/Math/Numbers/Matrix4");
|
|
452
452
|
var Matrix4_default = /*#__PURE__*/__webpack_require__.n(Matrix4_namespaceObject);
|
|
453
453
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Geometry/Box3\")"
|
|
454
|
-
const Box3_namespaceObject = window [Symbol .for ("X_ITE.X3D-
|
|
454
|
+
const Box3_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.0")] .require ("standard/Math/Geometry/Box3");
|
|
455
455
|
var Box3_default = /*#__PURE__*/__webpack_require__.n(Box3_namespaceObject);
|
|
456
456
|
;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/InstancedShape.js
|
|
457
457
|
/*******************************************************************************
|
|
@@ -779,6 +779,2360 @@ const InstancedShape_default_ = InstancedShape;
|
|
|
779
779
|
|
|
780
780
|
Namespace_default().add ("InstancedShape", "x_ite/Components/X_ITE/InstancedShape", InstancedShape_default_);
|
|
781
781
|
/* harmony default export */ const X_ITE_InstancedShape = (InstancedShape_default_);
|
|
782
|
+
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Shape/X3DOneSidedMaterialNode\")"
|
|
783
|
+
const X3DOneSidedMaterialNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.0")] .require ("x_ite/Components/Shape/X3DOneSidedMaterialNode");
|
|
784
|
+
var X3DOneSidedMaterialNode_default = /*#__PURE__*/__webpack_require__.n(X3DOneSidedMaterialNode_namespaceObject);
|
|
785
|
+
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DCast\")"
|
|
786
|
+
const X3DCast_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.0")] .require ("x_ite/Base/X3DCast");
|
|
787
|
+
var X3DCast_default = /*#__PURE__*/__webpack_require__.n(X3DCast_namespaceObject);
|
|
788
|
+
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Algorithm\")"
|
|
789
|
+
const Algorithm_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.0")] .require ("standard/Math/Algorithm");
|
|
790
|
+
var Algorithm_default = /*#__PURE__*/__webpack_require__.n(Algorithm_namespaceObject);
|
|
791
|
+
;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/SpecularGlossinessMaterial.js
|
|
792
|
+
/*******************************************************************************
|
|
793
|
+
*
|
|
794
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
795
|
+
*
|
|
796
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
|
|
797
|
+
*
|
|
798
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
799
|
+
*
|
|
800
|
+
* The copyright notice above does not evidence any actual of intended
|
|
801
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
802
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
803
|
+
* create3000.
|
|
804
|
+
*
|
|
805
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
806
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
807
|
+
* permission of create3000.
|
|
808
|
+
*
|
|
809
|
+
* NON-MILITARY USE ONLY
|
|
810
|
+
*
|
|
811
|
+
* All create3000 software are effectively free software with a non-military use
|
|
812
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
813
|
+
* source in any way you please with the exception anything that uses it must be
|
|
814
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
815
|
+
*
|
|
816
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
817
|
+
*
|
|
818
|
+
* Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
|
|
819
|
+
*
|
|
820
|
+
* This file is part of the X_ITE Project.
|
|
821
|
+
*
|
|
822
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
823
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
824
|
+
* Free Software Foundation.
|
|
825
|
+
*
|
|
826
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
827
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
828
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
829
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
830
|
+
*
|
|
831
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
832
|
+
* along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
|
|
833
|
+
* copy of the GPLv3 License.
|
|
834
|
+
*
|
|
835
|
+
* For Silvio, Joy and Adi.
|
|
836
|
+
*
|
|
837
|
+
******************************************************************************/
|
|
838
|
+
|
|
839
|
+
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
|
|
847
|
+
function SpecularGlossinessMaterial (executionContext)
|
|
848
|
+
{
|
|
849
|
+
X3DOneSidedMaterialNode_default().call (this, executionContext);
|
|
850
|
+
|
|
851
|
+
this .addType ((X3DConstants_default()).SpecularGlossinessMaterial);
|
|
852
|
+
|
|
853
|
+
this .materialKey = "4/";
|
|
854
|
+
this .diffuseColorArray = new Float32Array (3);
|
|
855
|
+
this .specularColorArray = new Float32Array (3);
|
|
856
|
+
this .extensionNodes = [ ];
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
Object .assign (Object .setPrototypeOf (SpecularGlossinessMaterial .prototype, (X3DOneSidedMaterialNode_default()).prototype),
|
|
860
|
+
{
|
|
861
|
+
initialize ()
|
|
862
|
+
{
|
|
863
|
+
X3DOneSidedMaterialNode_default().prototype .initialize .call (this);
|
|
864
|
+
|
|
865
|
+
this ._diffuseColor .addInterest ("set_diffuseColor__", this);
|
|
866
|
+
this ._diffuseTexture .addInterest ("set_diffuseTexture__", this);
|
|
867
|
+
this ._diffuseTexture .addInterest ("set_transparent__", this);
|
|
868
|
+
this ._specularColor .addInterest ("set_specularColor__", this);
|
|
869
|
+
this ._glossiness .addInterest ("set_glossiness__", this);
|
|
870
|
+
this ._specularGlossinessTexture .addInterest ("set_specularGlossinessTexture__", this);
|
|
871
|
+
this ._occlusionStrength .addInterest ("set_occlusionStrength__", this);
|
|
872
|
+
this ._occlusionTexture .addInterest ("set_occlusionTexture__", this);
|
|
873
|
+
this ._extensions .addInterest ("set_extensions__", this);
|
|
874
|
+
|
|
875
|
+
this .set_diffuseColor__ ();
|
|
876
|
+
this .set_diffuseTexture__ ();
|
|
877
|
+
this .set_specularColor__ ();
|
|
878
|
+
this .set_glossiness__ ();
|
|
879
|
+
this .set_specularGlossinessTexture__ ();
|
|
880
|
+
this .set_occlusionStrength__ ();
|
|
881
|
+
this .set_occlusionTexture__ ();
|
|
882
|
+
this .set_extensions__ ();
|
|
883
|
+
this .set_transparent__ ();
|
|
884
|
+
},
|
|
885
|
+
getMaterialKey ()
|
|
886
|
+
{
|
|
887
|
+
return this .materialKey;
|
|
888
|
+
},
|
|
889
|
+
getTextureIndices: (() =>
|
|
890
|
+
{
|
|
891
|
+
let i = 0;
|
|
892
|
+
|
|
893
|
+
const textureIndices = {
|
|
894
|
+
DIFFUSE_TEXTURE: i ++,
|
|
895
|
+
SPECULAR_GLOSSINESS_TEXTURE: i ++,
|
|
896
|
+
EMISSIVE_TEXTURE: i ++,
|
|
897
|
+
OCCLUSION_TEXTURE: i ++,
|
|
898
|
+
NORMAL_TEXTURE: i ++,
|
|
899
|
+
};
|
|
900
|
+
|
|
901
|
+
return function ()
|
|
902
|
+
{
|
|
903
|
+
return textureIndices;
|
|
904
|
+
};
|
|
905
|
+
})(),
|
|
906
|
+
getBaseTexture ()
|
|
907
|
+
{
|
|
908
|
+
return this .diffuseTextureNode;
|
|
909
|
+
},
|
|
910
|
+
set_diffuseColor__ ()
|
|
911
|
+
{
|
|
912
|
+
//We cannot use this in Windows Edge:
|
|
913
|
+
//this .diffuseColorArray .set (this ._diffuseColor .getValue ());
|
|
914
|
+
|
|
915
|
+
const
|
|
916
|
+
diffuseColorArray = this .diffuseColorArray,
|
|
917
|
+
diffuseColor = this ._diffuseColor .getValue ();
|
|
918
|
+
|
|
919
|
+
diffuseColorArray [0] = diffuseColor .r;
|
|
920
|
+
diffuseColorArray [1] = diffuseColor .g;
|
|
921
|
+
diffuseColorArray [2] = diffuseColor .b;
|
|
922
|
+
},
|
|
923
|
+
set_diffuseTexture__ ()
|
|
924
|
+
{
|
|
925
|
+
const index = this .getTextureIndices () .DIFFUSE_TEXTURE;
|
|
926
|
+
|
|
927
|
+
if (this .diffuseTextureNode)
|
|
928
|
+
{
|
|
929
|
+
this .diffuseTextureNode ._transparent .removeInterest ("set_transparent__", this);
|
|
930
|
+
this .diffuseTextureNode ._linear .removeInterest (`setTexture${index}`, this);
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
this .diffuseTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._diffuseTexture);
|
|
934
|
+
|
|
935
|
+
if (this .diffuseTextureNode)
|
|
936
|
+
{
|
|
937
|
+
this .diffuseTextureNode ._transparent .addInterest ("set_transparent__", this);
|
|
938
|
+
this .diffuseTextureNode ._linear .addInterest (`setTexture${index}`, this, index, this .diffuseTextureNode);
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
this .setTexture (index, this .diffuseTextureNode);
|
|
942
|
+
},
|
|
943
|
+
set_specularColor__ ()
|
|
944
|
+
{
|
|
945
|
+
//We cannot use this in Windows Edge:
|
|
946
|
+
//this .specularColorArray .set (this ._specularColor .getValue ());
|
|
947
|
+
|
|
948
|
+
const
|
|
949
|
+
specularColorArray = this .specularColorArray,
|
|
950
|
+
specularColor = this ._specularColor .getValue ();
|
|
951
|
+
|
|
952
|
+
specularColorArray [0] = specularColor .r;
|
|
953
|
+
specularColorArray [1] = specularColor .g;
|
|
954
|
+
specularColorArray [2] = specularColor .b;
|
|
955
|
+
},
|
|
956
|
+
set_glossiness__ ()
|
|
957
|
+
{
|
|
958
|
+
this .glossiness = Algorithm_default().clamp (this ._glossiness .getValue (), 0, 1);
|
|
959
|
+
},
|
|
960
|
+
set_specularGlossinessTexture__ ()
|
|
961
|
+
{
|
|
962
|
+
this .specularGlossinessTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._specularGlossinessTexture);
|
|
963
|
+
|
|
964
|
+
this .setTexture (this .getTextureIndices () .SPECULAR_GLOSSINESS_TEXTURE, this .specularGlossinessTextureNode);
|
|
965
|
+
},
|
|
966
|
+
set_occlusionStrength__ ()
|
|
967
|
+
{
|
|
968
|
+
this .occlusionStrength = Algorithm_default().clamp (this ._occlusionStrength .getValue (), 0, 1);
|
|
969
|
+
},
|
|
970
|
+
set_occlusionTexture__ ()
|
|
971
|
+
{
|
|
972
|
+
this .occlusionTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._occlusionTexture);
|
|
973
|
+
|
|
974
|
+
this .setTexture (this .getTextureIndices () .OCCLUSION_TEXTURE, this .occlusionTextureNode);
|
|
975
|
+
},
|
|
976
|
+
set_transparent__ ()
|
|
977
|
+
{
|
|
978
|
+
this .setTransparent (this .getTransparency () ||
|
|
979
|
+
this .diffuseTextureNode ?.isTransparent () ||
|
|
980
|
+
this .isTransmission ());
|
|
981
|
+
},
|
|
982
|
+
set_extensions__ ()
|
|
983
|
+
{
|
|
984
|
+
const extensionNodes = this .extensionNodes;
|
|
985
|
+
|
|
986
|
+
for (const extensionNode of extensionNodes)
|
|
987
|
+
extensionNode .removeInterest ("set_extensionsKey__", this);
|
|
988
|
+
|
|
989
|
+
extensionNodes .length = 0;
|
|
990
|
+
|
|
991
|
+
for (const node of this ._extensions)
|
|
992
|
+
{
|
|
993
|
+
const extensionNode = X3DCast_default() ((X3DConstants_default()).X3DMaterialExtensionNode, node);
|
|
994
|
+
|
|
995
|
+
if (extensionNode)
|
|
996
|
+
extensionNodes .push (extensionNode);
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
extensionNodes .sort ((a, b) => a .getExtensionKey () - b .getExtensionKey ());
|
|
1000
|
+
|
|
1001
|
+
for (const extensionNode of extensionNodes)
|
|
1002
|
+
extensionNode .addInterest ("set_extensionsKey__", this);
|
|
1003
|
+
|
|
1004
|
+
this .setTransmission (extensionNodes .some (extensionNode => extensionNode .getType () .includes ((X3DConstants_default()).TransmissionMaterialExtension)));
|
|
1005
|
+
|
|
1006
|
+
this .set_transparent__ ();
|
|
1007
|
+
this .set_extensionsKey__ ();
|
|
1008
|
+
},
|
|
1009
|
+
set_extensionsKey__ ()
|
|
1010
|
+
{
|
|
1011
|
+
const extensionsKey = this .extensionNodes
|
|
1012
|
+
.map (extensionNode => `${extensionNode .getExtensionKey () .toString (16)}${extensionNode .getTextureBits () .toString (16)}`)
|
|
1013
|
+
.join ("");
|
|
1014
|
+
|
|
1015
|
+
this .materialKey = `[4.${extensionsKey}]`;
|
|
1016
|
+
},
|
|
1017
|
+
createShader (key, geometryContext, renderContext)
|
|
1018
|
+
{
|
|
1019
|
+
const
|
|
1020
|
+
browser = this .getBrowser (),
|
|
1021
|
+
options = this .getShaderOptions (geometryContext, renderContext);
|
|
1022
|
+
|
|
1023
|
+
for (const extensionNode of this .extensionNodes)
|
|
1024
|
+
extensionNode .getShaderOptions (options);
|
|
1025
|
+
|
|
1026
|
+
options .push ("X3D_PHYSICAL_MATERIAL", "X3D_MATERIAL_SPECULAR_GLOSSINESS");
|
|
1027
|
+
|
|
1028
|
+
switch (browser .getBrowserOption ("ToneMapping"))
|
|
1029
|
+
{
|
|
1030
|
+
default: // NONE
|
|
1031
|
+
break;
|
|
1032
|
+
case "ACES_NARKOWICZ":
|
|
1033
|
+
case "ACES_HILL":
|
|
1034
|
+
case "ACES_HILL_EXPOSURE_BOOST":
|
|
1035
|
+
case "KHR_PBR_NEUTRAL":
|
|
1036
|
+
options .push (`X3D_TONEMAP_${browser .getBrowserOption ("ToneMapping")}`);
|
|
1037
|
+
break;
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
if (+this .getTextureBits ())
|
|
1041
|
+
{
|
|
1042
|
+
this .diffuseTextureNode ?.getShaderOptions (options, "DIFFUSE");
|
|
1043
|
+
this .specularGlossinessTextureNode ?.getShaderOptions (options, "SPECULAR_GLOSSINESS");
|
|
1044
|
+
this .occlusionTextureNode ?.getShaderOptions (options, "OCCLUSION");
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
const shaderNode = browser .createShader ("PBR", "Default", "PBR", options);
|
|
1048
|
+
|
|
1049
|
+
browser .getShaders () .set (key, shaderNode);
|
|
1050
|
+
|
|
1051
|
+
return shaderNode;
|
|
1052
|
+
},
|
|
1053
|
+
setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
|
|
1054
|
+
{
|
|
1055
|
+
X3DOneSidedMaterialNode_default().prototype .setShaderUniforms .call (this, gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping);
|
|
1056
|
+
|
|
1057
|
+
for (const extensionNode of this .extensionNodes)
|
|
1058
|
+
extensionNode .setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping);
|
|
1059
|
+
|
|
1060
|
+
gl .uniform3fv (shaderObject .x3d_DiffuseColor, this .diffuseColorArray);
|
|
1061
|
+
gl .uniform3fv (shaderObject .x3d_SpecularColor, this .specularColorArray);
|
|
1062
|
+
gl .uniform1f (shaderObject .x3d_Glossiness, this .glossiness);
|
|
1063
|
+
|
|
1064
|
+
if (!+this .getTextureBits ())
|
|
1065
|
+
return;
|
|
1066
|
+
|
|
1067
|
+
this .diffuseTextureNode ?.setNamedShaderUniforms (gl,
|
|
1068
|
+
shaderObject,
|
|
1069
|
+
renderObject,
|
|
1070
|
+
shaderObject .x3d_DiffuseTexture,
|
|
1071
|
+
this ._diffuseTextureMapping .getValue (),
|
|
1072
|
+
textureTransformMapping,
|
|
1073
|
+
textureCoordinateMapping);
|
|
1074
|
+
|
|
1075
|
+
this .specularGlossinessTextureNode ?.setNamedShaderUniforms (gl,
|
|
1076
|
+
shaderObject,
|
|
1077
|
+
renderObject,
|
|
1078
|
+
shaderObject .x3d_SpecularGlossinessTexture,
|
|
1079
|
+
this ._specularGlossinessTextureMapping .getValue (),
|
|
1080
|
+
textureTransformMapping,
|
|
1081
|
+
textureCoordinateMapping);
|
|
1082
|
+
|
|
1083
|
+
if (this .occlusionTextureNode)
|
|
1084
|
+
gl .uniform1f (shaderObject .x3d_OcclusionStrength, this .occlusionStrength);
|
|
1085
|
+
|
|
1086
|
+
this .occlusionTextureNode ?.setNamedShaderUniforms (gl,
|
|
1087
|
+
shaderObject,
|
|
1088
|
+
renderObject,
|
|
1089
|
+
shaderObject .x3d_OcclusionTexture,
|
|
1090
|
+
this ._occlusionTextureMapping .getValue (),
|
|
1091
|
+
textureTransformMapping,
|
|
1092
|
+
textureCoordinateMapping);
|
|
1093
|
+
},
|
|
1094
|
+
});
|
|
1095
|
+
|
|
1096
|
+
Object .defineProperties (SpecularGlossinessMaterial,
|
|
1097
|
+
{
|
|
1098
|
+
typeName:
|
|
1099
|
+
{
|
|
1100
|
+
value: "SpecularGlossinessMaterial",
|
|
1101
|
+
enumerable: true,
|
|
1102
|
+
},
|
|
1103
|
+
componentInfo:
|
|
1104
|
+
{
|
|
1105
|
+
value: Object .freeze ({ name: "X_ITE", level: 1 }),
|
|
1106
|
+
enumerable: true,
|
|
1107
|
+
},
|
|
1108
|
+
containerField:
|
|
1109
|
+
{
|
|
1110
|
+
value: "material",
|
|
1111
|
+
enumerable: true,
|
|
1112
|
+
},
|
|
1113
|
+
specificationRange:
|
|
1114
|
+
{
|
|
1115
|
+
value: Object .freeze ({ from: "4.0", to: "Infinity" }),
|
|
1116
|
+
enumerable: true,
|
|
1117
|
+
},
|
|
1118
|
+
fieldDefinitions:
|
|
1119
|
+
{
|
|
1120
|
+
value: new (FieldDefinitionArray_default()) ([
|
|
1121
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
|
|
1122
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "diffuseColor", new (Fields_default()).SFColor (1, 1, 1)),
|
|
1123
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "diffuseTextureMapping", new (Fields_default()).SFString ()),
|
|
1124
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "diffuseTexture", new (Fields_default()).SFNode ()),
|
|
1125
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "specularColor", new (Fields_default()).SFColor (1, 1, 1)),
|
|
1126
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "glossiness", new (Fields_default()).SFFloat (1)),
|
|
1127
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "specularGlossinessTextureMapping", new (Fields_default()).SFString ()),
|
|
1128
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "specularGlossinessTexture", new (Fields_default()).SFNode ()),
|
|
1129
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "emissiveColor", new (Fields_default()).SFColor ()),
|
|
1130
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "emissiveTextureMapping", new (Fields_default()).SFString ()),
|
|
1131
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "emissiveTexture", new (Fields_default()).SFNode ()),
|
|
1132
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "occlusionStrength", new (Fields_default()).SFFloat (1)),
|
|
1133
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "occlusionTextureMapping", new (Fields_default()).SFString ()),
|
|
1134
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "occlusionTexture", new (Fields_default()).SFNode ()),
|
|
1135
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "normalScale", new (Fields_default()).SFFloat (1)),
|
|
1136
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "normalTextureMapping", new (Fields_default()).SFString ()),
|
|
1137
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "normalTexture", new (Fields_default()).SFNode ()),
|
|
1138
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "transparency", new (Fields_default()).SFFloat ()),
|
|
1139
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "extensions", new (Fields_default()).MFNode ()), // experimental
|
|
1140
|
+
]),
|
|
1141
|
+
enumerable: true,
|
|
1142
|
+
},
|
|
1143
|
+
});
|
|
1144
|
+
|
|
1145
|
+
for (const index of Object .values (SpecularGlossinessMaterial .prototype .getTextureIndices ()))
|
|
1146
|
+
{
|
|
1147
|
+
SpecularGlossinessMaterial .prototype [`setTexture${index}`] = function (index, textureNode)
|
|
1148
|
+
{
|
|
1149
|
+
this .setTexture (index, textureNode);
|
|
1150
|
+
};
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
const SpecularGlossinessMaterial_default_ = SpecularGlossinessMaterial;
|
|
1154
|
+
;
|
|
1155
|
+
|
|
1156
|
+
Namespace_default().add ("SpecularGlossinessMaterial", "x_ite/Components/X_ITE/SpecularGlossinessMaterial", SpecularGlossinessMaterial_default_);
|
|
1157
|
+
/* harmony default export */ const X_ITE_SpecularGlossinessMaterial = (SpecularGlossinessMaterial_default_);
|
|
1158
|
+
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Core/X3DNode\")"
|
|
1159
|
+
const X3DNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.0")] .require ("x_ite/Components/Core/X3DNode");
|
|
1160
|
+
var X3DNode_default = /*#__PURE__*/__webpack_require__.n(X3DNode_namespaceObject);
|
|
1161
|
+
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Utility/BitSet\")"
|
|
1162
|
+
const BitSet_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0.0")] .require ("standard/Utility/BitSet");
|
|
1163
|
+
var BitSet_default = /*#__PURE__*/__webpack_require__.n(BitSet_namespaceObject);
|
|
1164
|
+
;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/X3DMaterialExtensionNode.js
|
|
1165
|
+
/*******************************************************************************
|
|
1166
|
+
*
|
|
1167
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1168
|
+
*
|
|
1169
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
|
|
1170
|
+
*
|
|
1171
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
1172
|
+
*
|
|
1173
|
+
* The copyright notice above does not evidence any actual of intended
|
|
1174
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
1175
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
1176
|
+
* create3000.
|
|
1177
|
+
*
|
|
1178
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
1179
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
1180
|
+
* permission of create3000.
|
|
1181
|
+
*
|
|
1182
|
+
* NON-MILITARY USE ONLY
|
|
1183
|
+
*
|
|
1184
|
+
* All create3000 software are effectively free software with a non-military use
|
|
1185
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
1186
|
+
* source in any way you please with the exception anything that uses it must be
|
|
1187
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
1188
|
+
*
|
|
1189
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1190
|
+
*
|
|
1191
|
+
* Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
|
|
1192
|
+
*
|
|
1193
|
+
* This file is part of the X_ITE Project.
|
|
1194
|
+
*
|
|
1195
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
1196
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
1197
|
+
* Free Software Foundation.
|
|
1198
|
+
*
|
|
1199
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
1200
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
1201
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
1202
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
1203
|
+
*
|
|
1204
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
1205
|
+
* along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
|
|
1206
|
+
* copy of the GPLv3 License.
|
|
1207
|
+
*
|
|
1208
|
+
* For Silvio, Joy and Adi.
|
|
1209
|
+
*
|
|
1210
|
+
******************************************************************************/
|
|
1211
|
+
|
|
1212
|
+
|
|
1213
|
+
|
|
1214
|
+
|
|
1215
|
+
|
|
1216
|
+
function X3DMaterialExtensionNode (executionContext)
|
|
1217
|
+
{
|
|
1218
|
+
X3DNode_default().call (this, executionContext);
|
|
1219
|
+
|
|
1220
|
+
this .addType ((X3DConstants_default()).X3DMaterialExtensionNode);
|
|
1221
|
+
|
|
1222
|
+
this .textureBits = new (BitSet_default()) ();
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
Object .assign (Object .setPrototypeOf (X3DMaterialExtensionNode .prototype, (X3DNode_default()).prototype),
|
|
1226
|
+
{
|
|
1227
|
+
setTexture (index, textureNode)
|
|
1228
|
+
{
|
|
1229
|
+
index *= 4;
|
|
1230
|
+
|
|
1231
|
+
this .textureBits .remove (index, 0xf);
|
|
1232
|
+
this .textureBits .add (index, textureNode ?.getTextureBits () ?? 0);
|
|
1233
|
+
},
|
|
1234
|
+
getTextureBits ()
|
|
1235
|
+
{
|
|
1236
|
+
return this .textureBits;
|
|
1237
|
+
},
|
|
1238
|
+
});
|
|
1239
|
+
|
|
1240
|
+
Object .defineProperties (X3DMaterialExtensionNode,
|
|
1241
|
+
{
|
|
1242
|
+
typeName:
|
|
1243
|
+
{
|
|
1244
|
+
value: "X3DMaterialExtensionNode",
|
|
1245
|
+
enumerable: true,
|
|
1246
|
+
},
|
|
1247
|
+
componentInfo:
|
|
1248
|
+
{
|
|
1249
|
+
value: Object .freeze ({ name: "X_ITE", level: 1 }),
|
|
1250
|
+
enumerable: true,
|
|
1251
|
+
},
|
|
1252
|
+
});
|
|
1253
|
+
|
|
1254
|
+
const X3DMaterialExtensionNode_default_ = X3DMaterialExtensionNode;
|
|
1255
|
+
;
|
|
1256
|
+
|
|
1257
|
+
Namespace_default().add ("X3DMaterialExtensionNode", "x_ite/Components/X_ITE/X3DMaterialExtensionNode", X3DMaterialExtensionNode_default_);
|
|
1258
|
+
/* harmony default export */ const X_ITE_X3DMaterialExtensionNode = (X3DMaterialExtensionNode_default_);
|
|
1259
|
+
;// CONCATENATED MODULE: ./src/x_ite/Browser/X_ITE/ExtensionKeys.js
|
|
1260
|
+
/*******************************************************************************
|
|
1261
|
+
*
|
|
1262
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1263
|
+
*
|
|
1264
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
|
|
1265
|
+
*
|
|
1266
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
1267
|
+
*
|
|
1268
|
+
* The copyright notice above does not evidence any actual of intended
|
|
1269
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
1270
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
1271
|
+
* create3000.
|
|
1272
|
+
*
|
|
1273
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
1274
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
1275
|
+
* permission of create3000.
|
|
1276
|
+
*
|
|
1277
|
+
* NON-MILITARY USE ONLY
|
|
1278
|
+
*
|
|
1279
|
+
* All create3000 software are effectively free software with a non-military use
|
|
1280
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
1281
|
+
* source in any way you please with the exception anything that uses it must be
|
|
1282
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
1283
|
+
*
|
|
1284
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1285
|
+
*
|
|
1286
|
+
* Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
|
|
1287
|
+
*
|
|
1288
|
+
* This file is part of the X_ITE Project.
|
|
1289
|
+
*
|
|
1290
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
1291
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
1292
|
+
* Free Software Foundation.
|
|
1293
|
+
*
|
|
1294
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
1295
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
1296
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
1297
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
1298
|
+
*
|
|
1299
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
1300
|
+
* along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
|
|
1301
|
+
* copy of the GPLv3 License.
|
|
1302
|
+
*
|
|
1303
|
+
* For Silvio, Joy and Adi.
|
|
1304
|
+
*
|
|
1305
|
+
******************************************************************************/
|
|
1306
|
+
|
|
1307
|
+
let i = 0;
|
|
1308
|
+
|
|
1309
|
+
const ExtensionKeys =
|
|
1310
|
+
{
|
|
1311
|
+
ANISOTROPY_MATERIAL_EXTENSION: i ++,
|
|
1312
|
+
CLEARCOAT_MATERIAL_EXTENSION: i ++,
|
|
1313
|
+
DISPERSION_MATERIAL_EXTENSION: i ++,
|
|
1314
|
+
EMISSIVE_STRENGTH_MATERIAL_EXTENSION: i ++,
|
|
1315
|
+
IOR_MATERIAL_EXTENSION: i ++,
|
|
1316
|
+
IRIDESCENCE_MATERIAL_EXTENSION: i ++,
|
|
1317
|
+
SHEEN_MATERIAL_EXTENSION: i ++,
|
|
1318
|
+
SPECULAR_MATERIAL_EXTENSION: i ++,
|
|
1319
|
+
TRANSMISSION_MATERIAL_EXTENSION: i ++,
|
|
1320
|
+
UNLIT_MATERIAL_EXTENSION: i ++,
|
|
1321
|
+
VOLUME_MATERIAL_EXTENSION: i ++,
|
|
1322
|
+
};
|
|
1323
|
+
|
|
1324
|
+
const ExtensionKeys_default_ = ExtensionKeys;
|
|
1325
|
+
;
|
|
1326
|
+
|
|
1327
|
+
Namespace_default().add ("ExtensionKeys", "x_ite/Browser/X_ITE/ExtensionKeys", ExtensionKeys_default_);
|
|
1328
|
+
/* harmony default export */ const X_ITE_ExtensionKeys = (ExtensionKeys_default_);
|
|
1329
|
+
;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/AnisotropyMaterialExtension.js
|
|
1330
|
+
/*******************************************************************************
|
|
1331
|
+
*
|
|
1332
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1333
|
+
*
|
|
1334
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
|
|
1335
|
+
*
|
|
1336
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
1337
|
+
*
|
|
1338
|
+
* The copyright notice above does not evidence any actual of intended
|
|
1339
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
1340
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
1341
|
+
* create3000.
|
|
1342
|
+
*
|
|
1343
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
1344
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
1345
|
+
* permission of create3000.
|
|
1346
|
+
*
|
|
1347
|
+
* NON-MILITARY USE ONLY
|
|
1348
|
+
*
|
|
1349
|
+
* All create3000 software are effectively free software with a non-military use
|
|
1350
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
1351
|
+
* source in any way you please with the exception anything that uses it must be
|
|
1352
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
1353
|
+
*
|
|
1354
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1355
|
+
*
|
|
1356
|
+
* Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
|
|
1357
|
+
*
|
|
1358
|
+
* This file is part of the X_ITE Project.
|
|
1359
|
+
*
|
|
1360
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
1361
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
1362
|
+
* Free Software Foundation.
|
|
1363
|
+
*
|
|
1364
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
1365
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
1366
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
1367
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
1368
|
+
*
|
|
1369
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
1370
|
+
* along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
|
|
1371
|
+
* copy of the GPLv3 License.
|
|
1372
|
+
*
|
|
1373
|
+
* For Silvio, Joy and Adi.
|
|
1374
|
+
*
|
|
1375
|
+
******************************************************************************/
|
|
1376
|
+
|
|
1377
|
+
|
|
1378
|
+
|
|
1379
|
+
|
|
1380
|
+
|
|
1381
|
+
|
|
1382
|
+
|
|
1383
|
+
|
|
1384
|
+
|
|
1385
|
+
function AnisotropyMaterialExtension (executionContext)
|
|
1386
|
+
{
|
|
1387
|
+
X_ITE_X3DMaterialExtensionNode .call (this, executionContext);
|
|
1388
|
+
|
|
1389
|
+
this .addType ((X3DConstants_default()).AnisotropyMaterialExtension);
|
|
1390
|
+
|
|
1391
|
+
this .anisotropyArray = new Float32Array (3);
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
Object .assign (Object .setPrototypeOf (AnisotropyMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
|
|
1395
|
+
{
|
|
1396
|
+
initialize ()
|
|
1397
|
+
{
|
|
1398
|
+
X_ITE_X3DMaterialExtensionNode .prototype .initialize .call (this);
|
|
1399
|
+
|
|
1400
|
+
this ._anisotropyStrength .addInterest ("set_anisotropyStrength__", this);
|
|
1401
|
+
this ._anisotropyRotation .addInterest ("set_anisotropyRotation__", this);
|
|
1402
|
+
this ._anisotropyTexture .addInterest ("set_anisotropyTexture__", this);
|
|
1403
|
+
|
|
1404
|
+
this .set_anisotropyStrength__ ();
|
|
1405
|
+
this .set_anisotropyRotation__ ();
|
|
1406
|
+
this .set_anisotropyTexture__ ();
|
|
1407
|
+
},
|
|
1408
|
+
set_anisotropyStrength__ ()
|
|
1409
|
+
{
|
|
1410
|
+
this .anisotropyArray [2] = Math .max (this ._anisotropyStrength .getValue (), 0);
|
|
1411
|
+
},
|
|
1412
|
+
set_anisotropyRotation__ ()
|
|
1413
|
+
{
|
|
1414
|
+
const anisotropyRotation = this ._anisotropyRotation .getValue ();
|
|
1415
|
+
|
|
1416
|
+
this .anisotropyArray [0] = Math .cos (anisotropyRotation);
|
|
1417
|
+
this .anisotropyArray [1] = Math .sin (anisotropyRotation);
|
|
1418
|
+
},
|
|
1419
|
+
set_anisotropyTexture__ ()
|
|
1420
|
+
{
|
|
1421
|
+
this .anisotropyTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._anisotropyTexture);
|
|
1422
|
+
|
|
1423
|
+
this .setTexture (0, this .anisotropyTextureNode);
|
|
1424
|
+
},
|
|
1425
|
+
getExtensionKey ()
|
|
1426
|
+
{
|
|
1427
|
+
return X_ITE_ExtensionKeys .ANISOTROPY_MATERIAL_EXTENSION;
|
|
1428
|
+
},
|
|
1429
|
+
getShaderOptions (options)
|
|
1430
|
+
{
|
|
1431
|
+
options .push ("X3D_ANISOTROPY_MATERIAL_EXT");
|
|
1432
|
+
|
|
1433
|
+
if (!+this .getTextureBits ())
|
|
1434
|
+
return;
|
|
1435
|
+
|
|
1436
|
+
options .push ("X3D_MATERIAL_TEXTURES");
|
|
1437
|
+
|
|
1438
|
+
this .anisotropyTextureNode ?.getShaderOptions (options, "ANISOTROPY", true);
|
|
1439
|
+
},
|
|
1440
|
+
setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
|
|
1441
|
+
{
|
|
1442
|
+
gl .uniform3fv (shaderObject .x3d_AnisotropyEXT, this .anisotropyArray);
|
|
1443
|
+
|
|
1444
|
+
this .anisotropyTextureNode ?.setNamedShaderUniforms (gl,
|
|
1445
|
+
shaderObject,
|
|
1446
|
+
renderObject,
|
|
1447
|
+
shaderObject .x3d_AnisotropyTextureEXT,
|
|
1448
|
+
this ._anisotropyTextureMapping .getValue (),
|
|
1449
|
+
textureTransformMapping,
|
|
1450
|
+
textureCoordinateMapping);
|
|
1451
|
+
},
|
|
1452
|
+
});
|
|
1453
|
+
|
|
1454
|
+
Object .defineProperties (AnisotropyMaterialExtension,
|
|
1455
|
+
{
|
|
1456
|
+
typeName:
|
|
1457
|
+
{
|
|
1458
|
+
value: "AnisotropyMaterialExtension",
|
|
1459
|
+
enumerable: true,
|
|
1460
|
+
},
|
|
1461
|
+
componentInfo:
|
|
1462
|
+
{
|
|
1463
|
+
value: Object .freeze ({ name: "X_ITE", level: 1 }),
|
|
1464
|
+
enumerable: true,
|
|
1465
|
+
},
|
|
1466
|
+
containerField:
|
|
1467
|
+
{
|
|
1468
|
+
value: "extensions",
|
|
1469
|
+
enumerable: true,
|
|
1470
|
+
},
|
|
1471
|
+
specificationRange:
|
|
1472
|
+
{
|
|
1473
|
+
value: Object .freeze ({ from: "4.0", to: "Infinity" }),
|
|
1474
|
+
enumerable: true,
|
|
1475
|
+
},
|
|
1476
|
+
fieldDefinitions:
|
|
1477
|
+
{
|
|
1478
|
+
value: new (FieldDefinitionArray_default()) ([
|
|
1479
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
|
|
1480
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "anisotropyStrength", new (Fields_default()).SFFloat ()),
|
|
1481
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "anisotropyRotation", new (Fields_default()).SFFloat ()),
|
|
1482
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "anisotropyTextureMapping", new (Fields_default()).SFString ()),
|
|
1483
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "anisotropyTexture", new (Fields_default()).SFNode ()),
|
|
1484
|
+
]),
|
|
1485
|
+
enumerable: true,
|
|
1486
|
+
},
|
|
1487
|
+
});
|
|
1488
|
+
|
|
1489
|
+
const AnisotropyMaterialExtension_default_ = AnisotropyMaterialExtension;
|
|
1490
|
+
;
|
|
1491
|
+
|
|
1492
|
+
Namespace_default().add ("AnisotropyMaterialExtension", "x_ite/Components/X_ITE/AnisotropyMaterialExtension", AnisotropyMaterialExtension_default_);
|
|
1493
|
+
/* harmony default export */ const X_ITE_AnisotropyMaterialExtension = (AnisotropyMaterialExtension_default_);
|
|
1494
|
+
;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/ClearcoatMaterialExtension.js
|
|
1495
|
+
/*******************************************************************************
|
|
1496
|
+
*
|
|
1497
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1498
|
+
*
|
|
1499
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
|
|
1500
|
+
*
|
|
1501
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
1502
|
+
*
|
|
1503
|
+
* The copyright notice above does not evidence any actual of intended
|
|
1504
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
1505
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
1506
|
+
* create3000.
|
|
1507
|
+
*
|
|
1508
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
1509
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
1510
|
+
* permission of create3000.
|
|
1511
|
+
*
|
|
1512
|
+
* NON-MILITARY USE ONLY
|
|
1513
|
+
*
|
|
1514
|
+
* All create3000 software are effectively free software with a non-military use
|
|
1515
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
1516
|
+
* source in any way you please with the exception anything that uses it must be
|
|
1517
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
1518
|
+
*
|
|
1519
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1520
|
+
*
|
|
1521
|
+
* Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
|
|
1522
|
+
*
|
|
1523
|
+
* This file is part of the X_ITE Project.
|
|
1524
|
+
*
|
|
1525
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
1526
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
1527
|
+
* Free Software Foundation.
|
|
1528
|
+
*
|
|
1529
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
1530
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
1531
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
1532
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
1533
|
+
*
|
|
1534
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
1535
|
+
* along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
|
|
1536
|
+
* copy of the GPLv3 License.
|
|
1537
|
+
*
|
|
1538
|
+
* For Silvio, Joy and Adi.
|
|
1539
|
+
*
|
|
1540
|
+
******************************************************************************/
|
|
1541
|
+
|
|
1542
|
+
|
|
1543
|
+
|
|
1544
|
+
|
|
1545
|
+
|
|
1546
|
+
|
|
1547
|
+
|
|
1548
|
+
|
|
1549
|
+
|
|
1550
|
+
|
|
1551
|
+
function ClearcoatMaterialExtension (executionContext)
|
|
1552
|
+
{
|
|
1553
|
+
X_ITE_X3DMaterialExtensionNode .call (this, executionContext);
|
|
1554
|
+
|
|
1555
|
+
this .addType ((X3DConstants_default()).ClearcoatMaterialExtension);
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
Object .assign (Object .setPrototypeOf (ClearcoatMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
|
|
1559
|
+
{
|
|
1560
|
+
initialize ()
|
|
1561
|
+
{
|
|
1562
|
+
X_ITE_X3DMaterialExtensionNode .prototype .initialize .call (this);
|
|
1563
|
+
|
|
1564
|
+
this ._clearcoat .addInterest ("set_clearcoat__", this);
|
|
1565
|
+
this ._clearcoatTexture .addInterest ("set_clearcoatTexture__", this);
|
|
1566
|
+
this ._clearcoatRoughness .addInterest ("set_clearcoatRoughness__", this);
|
|
1567
|
+
this ._clearcoatRoughnessTexture .addInterest ("set_clearcoatRoughnessTexture__", this);
|
|
1568
|
+
this ._clearcoatNormalTexture .addInterest ("set_clearcoatNormalTexture__", this);
|
|
1569
|
+
|
|
1570
|
+
this .set_clearcoat__ ();
|
|
1571
|
+
this .set_clearcoatTexture__ ();
|
|
1572
|
+
this .set_clearcoatRoughness__ ();
|
|
1573
|
+
this .set_clearcoatRoughnessTexture__ ();
|
|
1574
|
+
this .set_clearcoatNormalTexture__ ();
|
|
1575
|
+
},
|
|
1576
|
+
set_clearcoat__ ()
|
|
1577
|
+
{
|
|
1578
|
+
this .clearcoat = Math .max (this ._clearcoat .getValue (), 0);
|
|
1579
|
+
},
|
|
1580
|
+
set_clearcoatTexture__ ()
|
|
1581
|
+
{
|
|
1582
|
+
this .clearcoatTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._clearcoatTexture);
|
|
1583
|
+
|
|
1584
|
+
this .setTexture (0, this .clearcoatTextureNode);
|
|
1585
|
+
},
|
|
1586
|
+
set_clearcoatRoughness__ ()
|
|
1587
|
+
{
|
|
1588
|
+
this .clearcoatRoughness = Algorithm_default().clamp (this ._clearcoatRoughness .getValue (), 0, 1);
|
|
1589
|
+
},
|
|
1590
|
+
set_clearcoatRoughnessTexture__ ()
|
|
1591
|
+
{
|
|
1592
|
+
this .clearcoatRoughnessTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._clearcoatRoughnessTexture);
|
|
1593
|
+
|
|
1594
|
+
this .setTexture (1, this .clearcoatRoughnessTextureNode);
|
|
1595
|
+
},
|
|
1596
|
+
set_clearcoatNormalTexture__ ()
|
|
1597
|
+
{
|
|
1598
|
+
this .clearcoatNormalTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._clearcoatNormalTexture);
|
|
1599
|
+
|
|
1600
|
+
this .setTexture (2, this .clearcoatNormalTextureNode);
|
|
1601
|
+
},
|
|
1602
|
+
getExtensionKey ()
|
|
1603
|
+
{
|
|
1604
|
+
return X_ITE_ExtensionKeys .CLEARCOAT_MATERIAL_EXTENSION;
|
|
1605
|
+
},
|
|
1606
|
+
getShaderOptions (options)
|
|
1607
|
+
{
|
|
1608
|
+
options .push ("X3D_CLEARCOAT_MATERIAL_EXT");
|
|
1609
|
+
|
|
1610
|
+
if (!+this .getTextureBits ())
|
|
1611
|
+
return;
|
|
1612
|
+
|
|
1613
|
+
options .push ("X3D_MATERIAL_TEXTURES");
|
|
1614
|
+
|
|
1615
|
+
this .clearcoatTextureNode ?.getShaderOptions (options, "CLEARCOAT", true);
|
|
1616
|
+
this .clearcoatRoughnessTextureNode ?.getShaderOptions (options, "CLEARCOAT_ROUGHNESS", true);
|
|
1617
|
+
this .clearcoatNormalTextureNode ?.getShaderOptions (options, "CLEARCOAT_NORMAL", true);
|
|
1618
|
+
},
|
|
1619
|
+
setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
|
|
1620
|
+
{
|
|
1621
|
+
gl .uniform1f (shaderObject .x3d_ClearcoatEXT, this .clearcoat);
|
|
1622
|
+
gl .uniform1f (shaderObject .x3d_ClearcoatRoughnessEXT, this .clearcoatRoughness);
|
|
1623
|
+
|
|
1624
|
+
if (!+this .getTextureBits ())
|
|
1625
|
+
return;
|
|
1626
|
+
|
|
1627
|
+
this .clearcoatTextureNode ?.setNamedShaderUniforms (gl,
|
|
1628
|
+
shaderObject,
|
|
1629
|
+
renderObject,
|
|
1630
|
+
shaderObject .x3d_ClearcoatTextureEXT,
|
|
1631
|
+
this ._clearcoatTextureMapping .getValue (),
|
|
1632
|
+
textureTransformMapping,
|
|
1633
|
+
textureCoordinateMapping);
|
|
1634
|
+
|
|
1635
|
+
this .clearcoatRoughnessTextureNode ?.setNamedShaderUniforms (gl,
|
|
1636
|
+
shaderObject,
|
|
1637
|
+
renderObject,
|
|
1638
|
+
shaderObject .x3d_ClearcoatRoughnessTextureEXT,
|
|
1639
|
+
this ._clearcoatRoughnessTextureMapping .getValue (),
|
|
1640
|
+
textureTransformMapping,
|
|
1641
|
+
textureCoordinateMapping);
|
|
1642
|
+
|
|
1643
|
+
this .clearcoatNormalTextureNode ?.setNamedShaderUniforms (gl,
|
|
1644
|
+
shaderObject,
|
|
1645
|
+
renderObject,
|
|
1646
|
+
shaderObject .x3d_ClearcoatNormalTextureEXT,
|
|
1647
|
+
this ._clearcoatNormalTextureMapping .getValue (),
|
|
1648
|
+
textureTransformMapping,
|
|
1649
|
+
textureCoordinateMapping);
|
|
1650
|
+
},
|
|
1651
|
+
});
|
|
1652
|
+
|
|
1653
|
+
Object .defineProperties (ClearcoatMaterialExtension,
|
|
1654
|
+
{
|
|
1655
|
+
typeName:
|
|
1656
|
+
{
|
|
1657
|
+
value: "ClearcoatMaterialExtension",
|
|
1658
|
+
enumerable: true,
|
|
1659
|
+
},
|
|
1660
|
+
componentInfo:
|
|
1661
|
+
{
|
|
1662
|
+
value: Object .freeze ({ name: "X_ITE", level: 1 }),
|
|
1663
|
+
enumerable: true,
|
|
1664
|
+
},
|
|
1665
|
+
containerField:
|
|
1666
|
+
{
|
|
1667
|
+
value: "extensions",
|
|
1668
|
+
enumerable: true,
|
|
1669
|
+
},
|
|
1670
|
+
specificationRange:
|
|
1671
|
+
{
|
|
1672
|
+
value: Object .freeze ({ from: "4.0", to: "Infinity" }),
|
|
1673
|
+
enumerable: true,
|
|
1674
|
+
},
|
|
1675
|
+
fieldDefinitions:
|
|
1676
|
+
{
|
|
1677
|
+
value: new (FieldDefinitionArray_default()) ([
|
|
1678
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
|
|
1679
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoat", new (Fields_default()).SFFloat ()),
|
|
1680
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoatTextureMapping", new (Fields_default()).SFString ()),
|
|
1681
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoatTexture", new (Fields_default()).SFNode ()),
|
|
1682
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoatRoughness", new (Fields_default()).SFFloat ()),
|
|
1683
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoatRoughnessTextureMapping", new (Fields_default()).SFString ()),
|
|
1684
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoatRoughnessTexture", new (Fields_default()).SFNode ()),
|
|
1685
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoatNormalTextureMapping", new (Fields_default()).SFString ()),
|
|
1686
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "clearcoatNormalTexture", new (Fields_default()).SFNode ()),
|
|
1687
|
+
]),
|
|
1688
|
+
enumerable: true,
|
|
1689
|
+
},
|
|
1690
|
+
});
|
|
1691
|
+
|
|
1692
|
+
const ClearcoatMaterialExtension_default_ = ClearcoatMaterialExtension;
|
|
1693
|
+
;
|
|
1694
|
+
|
|
1695
|
+
Namespace_default().add ("ClearcoatMaterialExtension", "x_ite/Components/X_ITE/ClearcoatMaterialExtension", ClearcoatMaterialExtension_default_);
|
|
1696
|
+
/* harmony default export */ const X_ITE_ClearcoatMaterialExtension = (ClearcoatMaterialExtension_default_);
|
|
1697
|
+
;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/DispersionMaterialExtension.js
|
|
1698
|
+
/*******************************************************************************
|
|
1699
|
+
*
|
|
1700
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1701
|
+
*
|
|
1702
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
|
|
1703
|
+
*
|
|
1704
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
1705
|
+
*
|
|
1706
|
+
* The copyright notice above does not evidence any actual of intended
|
|
1707
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
1708
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
1709
|
+
* create3000.
|
|
1710
|
+
*
|
|
1711
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
1712
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
1713
|
+
* permission of create3000.
|
|
1714
|
+
*
|
|
1715
|
+
* NON-MILITARY USE ONLY
|
|
1716
|
+
*
|
|
1717
|
+
* All create3000 software are effectively free software with a non-military use
|
|
1718
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
1719
|
+
* source in any way you please with the exception anything that uses it must be
|
|
1720
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
1721
|
+
*
|
|
1722
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1723
|
+
*
|
|
1724
|
+
* Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
|
|
1725
|
+
*
|
|
1726
|
+
* This file is part of the X_ITE Project.
|
|
1727
|
+
*
|
|
1728
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
1729
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
1730
|
+
* Free Software Foundation.
|
|
1731
|
+
*
|
|
1732
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
1733
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
1734
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
1735
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
1736
|
+
*
|
|
1737
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
1738
|
+
* along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
|
|
1739
|
+
* copy of the GPLv3 License.
|
|
1740
|
+
*
|
|
1741
|
+
* For Silvio, Joy and Adi.
|
|
1742
|
+
*
|
|
1743
|
+
******************************************************************************/
|
|
1744
|
+
|
|
1745
|
+
|
|
1746
|
+
|
|
1747
|
+
|
|
1748
|
+
|
|
1749
|
+
|
|
1750
|
+
|
|
1751
|
+
|
|
1752
|
+
function DispersionMaterialExtension (executionContext)
|
|
1753
|
+
{
|
|
1754
|
+
X_ITE_X3DMaterialExtensionNode .call (this, executionContext);
|
|
1755
|
+
|
|
1756
|
+
this .addType ((X3DConstants_default()).DispersionMaterialExtension);
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
Object .assign (Object .setPrototypeOf (DispersionMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
|
|
1760
|
+
{
|
|
1761
|
+
initialize ()
|
|
1762
|
+
{
|
|
1763
|
+
X_ITE_X3DMaterialExtensionNode .prototype .initialize .call (this);
|
|
1764
|
+
|
|
1765
|
+
this ._dispersion .addInterest ("set_dispersion__", this);
|
|
1766
|
+
|
|
1767
|
+
this .set_dispersion__ ();
|
|
1768
|
+
},
|
|
1769
|
+
set_dispersion__ ()
|
|
1770
|
+
{
|
|
1771
|
+
this .dispersion = Math .max (this ._dispersion .getValue (), 0);
|
|
1772
|
+
},
|
|
1773
|
+
getExtensionKey ()
|
|
1774
|
+
{
|
|
1775
|
+
return X_ITE_ExtensionKeys .DISPERSION_MATERIAL_EXTENSION;
|
|
1776
|
+
},
|
|
1777
|
+
getShaderOptions (options)
|
|
1778
|
+
{
|
|
1779
|
+
options .push ("X3D_DISPERSION_MATERIAL_EXT");
|
|
1780
|
+
},
|
|
1781
|
+
setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
|
|
1782
|
+
{
|
|
1783
|
+
gl .uniform1f (shaderObject .x3d_DispersionEXT, this .dispersion);
|
|
1784
|
+
},
|
|
1785
|
+
});
|
|
1786
|
+
|
|
1787
|
+
Object .defineProperties (DispersionMaterialExtension,
|
|
1788
|
+
{
|
|
1789
|
+
typeName:
|
|
1790
|
+
{
|
|
1791
|
+
value: "DispersionMaterialExtension",
|
|
1792
|
+
enumerable: true,
|
|
1793
|
+
},
|
|
1794
|
+
componentInfo:
|
|
1795
|
+
{
|
|
1796
|
+
value: Object .freeze ({ name: "X_ITE", level: 1 }),
|
|
1797
|
+
enumerable: true,
|
|
1798
|
+
},
|
|
1799
|
+
containerField:
|
|
1800
|
+
{
|
|
1801
|
+
value: "extensions",
|
|
1802
|
+
enumerable: true,
|
|
1803
|
+
},
|
|
1804
|
+
specificationRange:
|
|
1805
|
+
{
|
|
1806
|
+
value: Object .freeze ({ from: "4.0", to: "Infinity" }),
|
|
1807
|
+
enumerable: true,
|
|
1808
|
+
},
|
|
1809
|
+
fieldDefinitions:
|
|
1810
|
+
{
|
|
1811
|
+
value: new (FieldDefinitionArray_default()) ([
|
|
1812
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
|
|
1813
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "dispersion", new (Fields_default()).SFFloat ()),
|
|
1814
|
+
]),
|
|
1815
|
+
enumerable: true,
|
|
1816
|
+
},
|
|
1817
|
+
});
|
|
1818
|
+
|
|
1819
|
+
const DispersionMaterialExtension_default_ = DispersionMaterialExtension;
|
|
1820
|
+
;
|
|
1821
|
+
|
|
1822
|
+
Namespace_default().add ("DispersionMaterialExtension", "x_ite/Components/X_ITE/DispersionMaterialExtension", DispersionMaterialExtension_default_);
|
|
1823
|
+
/* harmony default export */ const X_ITE_DispersionMaterialExtension = (DispersionMaterialExtension_default_);
|
|
1824
|
+
;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/EmissiveStrengthMaterialExtension.js
|
|
1825
|
+
/*******************************************************************************
|
|
1826
|
+
*
|
|
1827
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1828
|
+
*
|
|
1829
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
|
|
1830
|
+
*
|
|
1831
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
1832
|
+
*
|
|
1833
|
+
* The copyright notice above does not evidence any actual of intended
|
|
1834
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
1835
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
1836
|
+
* create3000.
|
|
1837
|
+
*
|
|
1838
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
1839
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
1840
|
+
* permission of create3000.
|
|
1841
|
+
*
|
|
1842
|
+
* NON-MILITARY USE ONLY
|
|
1843
|
+
*
|
|
1844
|
+
* All create3000 software are effectively free software with a non-military use
|
|
1845
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
1846
|
+
* source in any way you please with the exception anything that uses it must be
|
|
1847
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
1848
|
+
*
|
|
1849
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1850
|
+
*
|
|
1851
|
+
* Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
|
|
1852
|
+
*
|
|
1853
|
+
* This file is part of the X_ITE Project.
|
|
1854
|
+
*
|
|
1855
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
1856
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
1857
|
+
* Free Software Foundation.
|
|
1858
|
+
*
|
|
1859
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
1860
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
1861
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
1862
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
1863
|
+
*
|
|
1864
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
1865
|
+
* along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
|
|
1866
|
+
* copy of the GPLv3 License.
|
|
1867
|
+
*
|
|
1868
|
+
* For Silvio, Joy and Adi.
|
|
1869
|
+
*
|
|
1870
|
+
******************************************************************************/
|
|
1871
|
+
|
|
1872
|
+
|
|
1873
|
+
|
|
1874
|
+
|
|
1875
|
+
|
|
1876
|
+
|
|
1877
|
+
|
|
1878
|
+
|
|
1879
|
+
function EmissiveStrengthMaterialExtension (executionContext)
|
|
1880
|
+
{
|
|
1881
|
+
X_ITE_X3DMaterialExtensionNode .call (this, executionContext);
|
|
1882
|
+
|
|
1883
|
+
this .addType ((X3DConstants_default()).EmissiveStrengthMaterialExtension);
|
|
1884
|
+
}
|
|
1885
|
+
|
|
1886
|
+
Object .assign (Object .setPrototypeOf (EmissiveStrengthMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
|
|
1887
|
+
{
|
|
1888
|
+
initialize ()
|
|
1889
|
+
{
|
|
1890
|
+
X_ITE_X3DMaterialExtensionNode .prototype .initialize .call (this);
|
|
1891
|
+
|
|
1892
|
+
this ._emissiveStrength .addInterest ("set_emissiveStrength__", this);
|
|
1893
|
+
|
|
1894
|
+
this .set_emissiveStrength__ ();
|
|
1895
|
+
},
|
|
1896
|
+
set_emissiveStrength__ ()
|
|
1897
|
+
{
|
|
1898
|
+
this .emissiveStrength = Math .max (this ._emissiveStrength .getValue (), 0);
|
|
1899
|
+
},
|
|
1900
|
+
getExtensionKey ()
|
|
1901
|
+
{
|
|
1902
|
+
return X_ITE_ExtensionKeys .EMISSIVE_STRENGTH_MATERIAL_EXTENSION;
|
|
1903
|
+
},
|
|
1904
|
+
getShaderOptions (options)
|
|
1905
|
+
{
|
|
1906
|
+
options .push ("X3D_EMISSIVE_STRENGTH_MATERIAL_EXT");
|
|
1907
|
+
},
|
|
1908
|
+
setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
|
|
1909
|
+
{
|
|
1910
|
+
gl .uniform1f (shaderObject .x3d_EmissiveStrengthEXT, this .emissiveStrength);
|
|
1911
|
+
},
|
|
1912
|
+
});
|
|
1913
|
+
|
|
1914
|
+
Object .defineProperties (EmissiveStrengthMaterialExtension,
|
|
1915
|
+
{
|
|
1916
|
+
typeName:
|
|
1917
|
+
{
|
|
1918
|
+
value: "EmissiveStrengthMaterialExtension",
|
|
1919
|
+
enumerable: true,
|
|
1920
|
+
},
|
|
1921
|
+
componentInfo:
|
|
1922
|
+
{
|
|
1923
|
+
value: Object .freeze ({ name: "X_ITE", level: 1 }),
|
|
1924
|
+
enumerable: true,
|
|
1925
|
+
},
|
|
1926
|
+
containerField:
|
|
1927
|
+
{
|
|
1928
|
+
value: "extensions",
|
|
1929
|
+
enumerable: true,
|
|
1930
|
+
},
|
|
1931
|
+
specificationRange:
|
|
1932
|
+
{
|
|
1933
|
+
value: Object .freeze ({ from: "4.0", to: "Infinity" }),
|
|
1934
|
+
enumerable: true,
|
|
1935
|
+
},
|
|
1936
|
+
fieldDefinitions:
|
|
1937
|
+
{
|
|
1938
|
+
value: new (FieldDefinitionArray_default()) ([
|
|
1939
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
|
|
1940
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "emissiveStrength", new (Fields_default()).SFFloat (1)),
|
|
1941
|
+
]),
|
|
1942
|
+
enumerable: true,
|
|
1943
|
+
},
|
|
1944
|
+
});
|
|
1945
|
+
|
|
1946
|
+
const EmissiveStrengthMaterialExtension_default_ = EmissiveStrengthMaterialExtension;
|
|
1947
|
+
;
|
|
1948
|
+
|
|
1949
|
+
Namespace_default().add ("EmissiveStrengthMaterialExtension", "x_ite/Components/X_ITE/EmissiveStrengthMaterialExtension", EmissiveStrengthMaterialExtension_default_);
|
|
1950
|
+
/* harmony default export */ const X_ITE_EmissiveStrengthMaterialExtension = (EmissiveStrengthMaterialExtension_default_);
|
|
1951
|
+
;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/IORMaterialExtension.js
|
|
1952
|
+
/*******************************************************************************
|
|
1953
|
+
*
|
|
1954
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1955
|
+
*
|
|
1956
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
|
|
1957
|
+
*
|
|
1958
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
1959
|
+
*
|
|
1960
|
+
* The copyright notice above does not evidence any actual of intended
|
|
1961
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
1962
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
1963
|
+
* create3000.
|
|
1964
|
+
*
|
|
1965
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
1966
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
1967
|
+
* permission of create3000.
|
|
1968
|
+
*
|
|
1969
|
+
* NON-MILITARY USE ONLY
|
|
1970
|
+
*
|
|
1971
|
+
* All create3000 software are effectively free software with a non-military use
|
|
1972
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
1973
|
+
* source in any way you please with the exception anything that uses it must be
|
|
1974
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
1975
|
+
*
|
|
1976
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1977
|
+
*
|
|
1978
|
+
* Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
|
|
1979
|
+
*
|
|
1980
|
+
* This file is part of the X_ITE Project.
|
|
1981
|
+
*
|
|
1982
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
1983
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
1984
|
+
* Free Software Foundation.
|
|
1985
|
+
*
|
|
1986
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
1987
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
1988
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
1989
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
1990
|
+
*
|
|
1991
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
1992
|
+
* along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
|
|
1993
|
+
* copy of the GPLv3 License.
|
|
1994
|
+
*
|
|
1995
|
+
* For Silvio, Joy and Adi.
|
|
1996
|
+
*
|
|
1997
|
+
******************************************************************************/
|
|
1998
|
+
|
|
1999
|
+
|
|
2000
|
+
|
|
2001
|
+
|
|
2002
|
+
|
|
2003
|
+
|
|
2004
|
+
|
|
2005
|
+
|
|
2006
|
+
function IORMaterialExtension (executionContext)
|
|
2007
|
+
{
|
|
2008
|
+
X_ITE_X3DMaterialExtensionNode .call (this, executionContext);
|
|
2009
|
+
|
|
2010
|
+
this .addType ((X3DConstants_default()).IORMaterialExtension);
|
|
2011
|
+
}
|
|
2012
|
+
|
|
2013
|
+
Object .assign (Object .setPrototypeOf (IORMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
|
|
2014
|
+
{
|
|
2015
|
+
initialize ()
|
|
2016
|
+
{
|
|
2017
|
+
X_ITE_X3DMaterialExtensionNode .prototype .initialize .call (this);
|
|
2018
|
+
|
|
2019
|
+
this ._indexOfRefraction .addInterest ("set_indexOfRefraction__", this);
|
|
2020
|
+
|
|
2021
|
+
this .set_indexOfRefraction__ ();
|
|
2022
|
+
},
|
|
2023
|
+
set_indexOfRefraction__ ()
|
|
2024
|
+
{
|
|
2025
|
+
this .indexOfRefraction = Math .max (this ._indexOfRefraction .getValue (), 0);
|
|
2026
|
+
},
|
|
2027
|
+
getExtensionKey ()
|
|
2028
|
+
{
|
|
2029
|
+
return X_ITE_ExtensionKeys .IOR_MATERIAL_EXTENSION;
|
|
2030
|
+
},
|
|
2031
|
+
getShaderOptions (options)
|
|
2032
|
+
{
|
|
2033
|
+
options .push ("X3D_IOR_MATERIAL_EXT");
|
|
2034
|
+
},
|
|
2035
|
+
setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
|
|
2036
|
+
{
|
|
2037
|
+
gl .uniform1f (shaderObject .x3d_IorEXT, this .indexOfRefraction);
|
|
2038
|
+
},
|
|
2039
|
+
});
|
|
2040
|
+
|
|
2041
|
+
Object .defineProperties (IORMaterialExtension,
|
|
2042
|
+
{
|
|
2043
|
+
typeName:
|
|
2044
|
+
{
|
|
2045
|
+
value: "IORMaterialExtension",
|
|
2046
|
+
enumerable: true,
|
|
2047
|
+
},
|
|
2048
|
+
componentInfo:
|
|
2049
|
+
{
|
|
2050
|
+
value: Object .freeze ({ name: "X_ITE", level: 1 }),
|
|
2051
|
+
enumerable: true,
|
|
2052
|
+
},
|
|
2053
|
+
containerField:
|
|
2054
|
+
{
|
|
2055
|
+
value: "extensions",
|
|
2056
|
+
enumerable: true,
|
|
2057
|
+
},
|
|
2058
|
+
specificationRange:
|
|
2059
|
+
{
|
|
2060
|
+
value: Object .freeze ({ from: "4.0", to: "Infinity" }),
|
|
2061
|
+
enumerable: true,
|
|
2062
|
+
},
|
|
2063
|
+
fieldDefinitions:
|
|
2064
|
+
{
|
|
2065
|
+
value: new (FieldDefinitionArray_default()) ([
|
|
2066
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
|
|
2067
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "indexOfRefraction", new (Fields_default()).SFFloat (1.5)),
|
|
2068
|
+
]),
|
|
2069
|
+
enumerable: true,
|
|
2070
|
+
},
|
|
2071
|
+
});
|
|
2072
|
+
|
|
2073
|
+
const IORMaterialExtension_default_ = IORMaterialExtension;
|
|
2074
|
+
;
|
|
2075
|
+
|
|
2076
|
+
Namespace_default().add ("IORMaterialExtension", "x_ite/Components/X_ITE/IORMaterialExtension", IORMaterialExtension_default_);
|
|
2077
|
+
/* harmony default export */ const X_ITE_IORMaterialExtension = (IORMaterialExtension_default_);
|
|
2078
|
+
;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/IridescenceMaterialExtension.js
|
|
2079
|
+
/*******************************************************************************
|
|
2080
|
+
*
|
|
2081
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2082
|
+
*
|
|
2083
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
|
|
2084
|
+
*
|
|
2085
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
2086
|
+
*
|
|
2087
|
+
* The copyright notice above does not evidence any actual of intended
|
|
2088
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
2089
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
2090
|
+
* create3000.
|
|
2091
|
+
*
|
|
2092
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
2093
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
2094
|
+
* permission of create3000.
|
|
2095
|
+
*
|
|
2096
|
+
* NON-MILITARY USE ONLY
|
|
2097
|
+
*
|
|
2098
|
+
* All create3000 software are effectively free software with a non-military use
|
|
2099
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
2100
|
+
* source in any way you please with the exception anything that uses it must be
|
|
2101
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
2102
|
+
*
|
|
2103
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2104
|
+
*
|
|
2105
|
+
* Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
|
|
2106
|
+
*
|
|
2107
|
+
* This file is part of the X_ITE Project.
|
|
2108
|
+
*
|
|
2109
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
2110
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
2111
|
+
* Free Software Foundation.
|
|
2112
|
+
*
|
|
2113
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
2114
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
2115
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
2116
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
2117
|
+
*
|
|
2118
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
2119
|
+
* along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
|
|
2120
|
+
* copy of the GPLv3 License.
|
|
2121
|
+
*
|
|
2122
|
+
* For Silvio, Joy and Adi.
|
|
2123
|
+
*
|
|
2124
|
+
******************************************************************************/
|
|
2125
|
+
|
|
2126
|
+
|
|
2127
|
+
|
|
2128
|
+
|
|
2129
|
+
|
|
2130
|
+
|
|
2131
|
+
|
|
2132
|
+
|
|
2133
|
+
|
|
2134
|
+
function IridescenceMaterialExtension (executionContext)
|
|
2135
|
+
{
|
|
2136
|
+
X_ITE_X3DMaterialExtensionNode .call (this, executionContext);
|
|
2137
|
+
|
|
2138
|
+
this .addType ((X3DConstants_default()).IridescenceMaterialExtension);
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
Object .assign (Object .setPrototypeOf (IridescenceMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
|
|
2142
|
+
{
|
|
2143
|
+
initialize ()
|
|
2144
|
+
{
|
|
2145
|
+
X_ITE_X3DMaterialExtensionNode .prototype .initialize .call (this);
|
|
2146
|
+
|
|
2147
|
+
this ._iridescence .addInterest ("set_iridescence__", this);
|
|
2148
|
+
this ._iridescenceTexture .addInterest ("set_iridescenceTexture__", this);
|
|
2149
|
+
this ._iridescenceIndexOfRefraction .addInterest ("set_iridescenceIndexOfRefraction__", this);
|
|
2150
|
+
this ._iridescenceThicknessMinimum .addInterest ("set_iridescenceThicknessMinimum__", this);
|
|
2151
|
+
this ._iridescenceThicknessMaximum .addInterest ("set_iridescenceThicknessMaximum__", this);
|
|
2152
|
+
this ._iridescenceThicknessTexture .addInterest ("set_iridescenceThicknessTexture__", this);
|
|
2153
|
+
|
|
2154
|
+
this .set_iridescence__ ();
|
|
2155
|
+
this .set_iridescenceTexture__ ();
|
|
2156
|
+
this .set_iridescenceIndexOfRefraction__ ();
|
|
2157
|
+
this .set_iridescenceThicknessMinimum__ ();
|
|
2158
|
+
this .set_iridescenceThicknessMaximum__ ();
|
|
2159
|
+
this .set_iridescenceThicknessTexture__ ();
|
|
2160
|
+
},
|
|
2161
|
+
set_iridescence__ ()
|
|
2162
|
+
{
|
|
2163
|
+
this .iridescence = Math .max (this ._iridescence .getValue (), 0);
|
|
2164
|
+
},
|
|
2165
|
+
set_iridescenceTexture__ ()
|
|
2166
|
+
{
|
|
2167
|
+
this .iridescenceTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._iridescenceTexture);
|
|
2168
|
+
|
|
2169
|
+
this .setTexture (0, this .iridescenceTextureNode);
|
|
2170
|
+
},
|
|
2171
|
+
set_iridescenceIndexOfRefraction__ ()
|
|
2172
|
+
{
|
|
2173
|
+
this .iridescenceIndexOfRefraction = Math .max (this ._iridescenceIndexOfRefraction .getValue (), 0);
|
|
2174
|
+
},
|
|
2175
|
+
set_iridescenceThicknessMinimum__ ()
|
|
2176
|
+
{
|
|
2177
|
+
this .iridescenceThicknessMinimum = Math .max (this ._iridescenceThicknessMinimum .getValue (), 0);
|
|
2178
|
+
},
|
|
2179
|
+
set_iridescenceThicknessMaximum__ ()
|
|
2180
|
+
{
|
|
2181
|
+
this .iridescenceThicknessMaximum = Math .max (this ._iridescenceThicknessMaximum .getValue (), 0);
|
|
2182
|
+
},
|
|
2183
|
+
set_iridescenceThicknessTexture__ ()
|
|
2184
|
+
{
|
|
2185
|
+
this .iridescenceThicknessTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._iridescenceThicknessTexture);
|
|
2186
|
+
|
|
2187
|
+
this .setTexture (1, this .iridescenceThicknessTextureNode);
|
|
2188
|
+
},
|
|
2189
|
+
getExtensionKey ()
|
|
2190
|
+
{
|
|
2191
|
+
return X_ITE_ExtensionKeys .IRIDESCENCE_MATERIAL_EXTENSION;
|
|
2192
|
+
},
|
|
2193
|
+
getShaderOptions (options)
|
|
2194
|
+
{
|
|
2195
|
+
options .push ("X3D_IRIDESCENCE_MATERIAL_EXT");
|
|
2196
|
+
|
|
2197
|
+
if (!+this .getTextureBits ())
|
|
2198
|
+
return;
|
|
2199
|
+
|
|
2200
|
+
options .push ("X3D_MATERIAL_TEXTURES");
|
|
2201
|
+
|
|
2202
|
+
this .iridescenceTextureNode ?.getShaderOptions (options, "IRIDESCENCE", true);
|
|
2203
|
+
this .iridescenceThicknessTextureNode ?.getShaderOptions (options, "IRIDESCENCE_THICKNESS", true);
|
|
2204
|
+
},
|
|
2205
|
+
setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
|
|
2206
|
+
{
|
|
2207
|
+
gl .uniform1f (shaderObject .x3d_IridescenceEXT, this .iridescence);
|
|
2208
|
+
gl .uniform1f (shaderObject .x3d_IridescenceIndexOfRefractionEXT, this .iridescenceIndexOfRefraction);
|
|
2209
|
+
gl .uniform1f (shaderObject .x3d_IridescenceThicknessMinimumEXT, this .iridescenceThicknessMinimum);
|
|
2210
|
+
gl .uniform1f (shaderObject .x3d_IridescenceThicknessMaximumEXT, this .iridescenceThicknessMaximum);
|
|
2211
|
+
|
|
2212
|
+
if (!+this .getTextureBits ())
|
|
2213
|
+
return;
|
|
2214
|
+
|
|
2215
|
+
this .iridescenceTextureNode ?.setNamedShaderUniforms (gl,
|
|
2216
|
+
shaderObject,
|
|
2217
|
+
renderObject,
|
|
2218
|
+
shaderObject .x3d_IridescenceTextureEXT,
|
|
2219
|
+
this ._iridescenceTextureMapping .getValue (),
|
|
2220
|
+
textureTransformMapping,
|
|
2221
|
+
textureCoordinateMapping);
|
|
2222
|
+
|
|
2223
|
+
this .iridescenceThicknessTextureNode ?.setNamedShaderUniforms (gl,
|
|
2224
|
+
shaderObject,
|
|
2225
|
+
renderObject,
|
|
2226
|
+
shaderObject .x3d_IridescenceThicknessTextureEXT,
|
|
2227
|
+
this ._iridescenceThicknessTextureMapping .getValue (),
|
|
2228
|
+
textureTransformMapping,
|
|
2229
|
+
textureCoordinateMapping);
|
|
2230
|
+
},
|
|
2231
|
+
});
|
|
2232
|
+
|
|
2233
|
+
Object .defineProperties (IridescenceMaterialExtension,
|
|
2234
|
+
{
|
|
2235
|
+
typeName:
|
|
2236
|
+
{
|
|
2237
|
+
value: "IridescenceMaterialExtension",
|
|
2238
|
+
enumerable: true,
|
|
2239
|
+
},
|
|
2240
|
+
componentInfo:
|
|
2241
|
+
{
|
|
2242
|
+
value: Object .freeze ({ name: "X_ITE", level: 1 }),
|
|
2243
|
+
enumerable: true,
|
|
2244
|
+
},
|
|
2245
|
+
containerField:
|
|
2246
|
+
{
|
|
2247
|
+
value: "extensions",
|
|
2248
|
+
enumerable: true,
|
|
2249
|
+
},
|
|
2250
|
+
specificationRange:
|
|
2251
|
+
{
|
|
2252
|
+
value: Object .freeze ({ from: "4.0", to: "Infinity" }),
|
|
2253
|
+
enumerable: true,
|
|
2254
|
+
},
|
|
2255
|
+
fieldDefinitions:
|
|
2256
|
+
{
|
|
2257
|
+
value: new (FieldDefinitionArray_default()) ([
|
|
2258
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
|
|
2259
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescence", new (Fields_default()).SFFloat ()),
|
|
2260
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescenceTextureMapping", new (Fields_default()).SFString ()),
|
|
2261
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescenceTexture", new (Fields_default()).SFNode ()),
|
|
2262
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescenceIndexOfRefraction", new (Fields_default()).SFFloat (1.3)),
|
|
2263
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescenceThicknessMinimum", new (Fields_default()).SFFloat (100)),
|
|
2264
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescenceThicknessMaximum", new (Fields_default()).SFFloat (400)),
|
|
2265
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescenceThicknessTextureMapping", new (Fields_default()).SFString ()),
|
|
2266
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "iridescenceThicknessTexture", new (Fields_default()).SFNode ()),
|
|
2267
|
+
]),
|
|
2268
|
+
enumerable: true,
|
|
2269
|
+
},
|
|
2270
|
+
});
|
|
2271
|
+
|
|
2272
|
+
const IridescenceMaterialExtension_default_ = IridescenceMaterialExtension;
|
|
2273
|
+
;
|
|
2274
|
+
|
|
2275
|
+
Namespace_default().add ("IridescenceMaterialExtension", "x_ite/Components/X_ITE/IridescenceMaterialExtension", IridescenceMaterialExtension_default_);
|
|
2276
|
+
/* harmony default export */ const X_ITE_IridescenceMaterialExtension = (IridescenceMaterialExtension_default_);
|
|
2277
|
+
;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/SheenMaterialExtension.js
|
|
2278
|
+
/*******************************************************************************
|
|
2279
|
+
*
|
|
2280
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2281
|
+
*
|
|
2282
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
|
|
2283
|
+
*
|
|
2284
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
2285
|
+
*
|
|
2286
|
+
* The copyright notice above does not evidence any actual of intended
|
|
2287
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
2288
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
2289
|
+
* create3000.
|
|
2290
|
+
*
|
|
2291
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
2292
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
2293
|
+
* permission of create3000.
|
|
2294
|
+
*
|
|
2295
|
+
* NON-MILITARY USE ONLY
|
|
2296
|
+
*
|
|
2297
|
+
* All create3000 software are effectively free software with a non-military use
|
|
2298
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
2299
|
+
* source in any way you please with the exception anything that uses it must be
|
|
2300
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
2301
|
+
*
|
|
2302
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2303
|
+
*
|
|
2304
|
+
* Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
|
|
2305
|
+
*
|
|
2306
|
+
* This file is part of the X_ITE Project.
|
|
2307
|
+
*
|
|
2308
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
2309
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
2310
|
+
* Free Software Foundation.
|
|
2311
|
+
*
|
|
2312
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
2313
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
2314
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
2315
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
2316
|
+
*
|
|
2317
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
2318
|
+
* along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
|
|
2319
|
+
* copy of the GPLv3 License.
|
|
2320
|
+
*
|
|
2321
|
+
* For Silvio, Joy and Adi.
|
|
2322
|
+
*
|
|
2323
|
+
******************************************************************************/
|
|
2324
|
+
|
|
2325
|
+
|
|
2326
|
+
|
|
2327
|
+
|
|
2328
|
+
|
|
2329
|
+
|
|
2330
|
+
|
|
2331
|
+
|
|
2332
|
+
|
|
2333
|
+
|
|
2334
|
+
function SheenMaterialExtension (executionContext)
|
|
2335
|
+
{
|
|
2336
|
+
X_ITE_X3DMaterialExtensionNode .call (this, executionContext);
|
|
2337
|
+
|
|
2338
|
+
this .addType ((X3DConstants_default()).SheenMaterialExtension);
|
|
2339
|
+
|
|
2340
|
+
this .sheenColorArray = new Float32Array (3);
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
Object .assign (Object .setPrototypeOf (SheenMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
|
|
2344
|
+
{
|
|
2345
|
+
initialize ()
|
|
2346
|
+
{
|
|
2347
|
+
X_ITE_X3DMaterialExtensionNode .prototype .initialize .call (this);
|
|
2348
|
+
|
|
2349
|
+
this ._sheenColor .addInterest ("set_sheenColor__", this);
|
|
2350
|
+
this ._sheenColorTexture .addInterest ("set_sheenColorTexture__", this);
|
|
2351
|
+
this ._sheenRoughness .addInterest ("set_sheenRoughness__", this);
|
|
2352
|
+
this ._sheenRoughnessTexture .addInterest ("set_sheenRoughnessTexture__", this);
|
|
2353
|
+
|
|
2354
|
+
this .set_sheenColor__ ();
|
|
2355
|
+
this .set_sheenColorTexture__ ();
|
|
2356
|
+
this .set_sheenRoughness__ ();
|
|
2357
|
+
this .set_sheenRoughnessTexture__ ();
|
|
2358
|
+
},
|
|
2359
|
+
set_sheenColor__ ()
|
|
2360
|
+
{
|
|
2361
|
+
//We cannot use this in Windows Edge:
|
|
2362
|
+
//this .sheenColorArray .set (this ._sheenColor .getValue ());
|
|
2363
|
+
|
|
2364
|
+
const
|
|
2365
|
+
sheenColorArray = this .sheenColorArray,
|
|
2366
|
+
sheenColor = this ._sheenColor .getValue ();
|
|
2367
|
+
|
|
2368
|
+
sheenColorArray [0] = sheenColor .r;
|
|
2369
|
+
sheenColorArray [1] = sheenColor .g;
|
|
2370
|
+
sheenColorArray [2] = sheenColor .b;
|
|
2371
|
+
},
|
|
2372
|
+
set_sheenColorTexture__ ()
|
|
2373
|
+
{
|
|
2374
|
+
this .sheenColorTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._sheenColorTexture);
|
|
2375
|
+
|
|
2376
|
+
this .setTexture (0, this .sheenColorTextureNode);
|
|
2377
|
+
},
|
|
2378
|
+
set_sheenRoughness__ ()
|
|
2379
|
+
{
|
|
2380
|
+
this .sheenRoughness = Algorithm_default().clamp (this ._sheenRoughness .getValue (), 0, 1);
|
|
2381
|
+
},
|
|
2382
|
+
set_sheenRoughnessTexture__ ()
|
|
2383
|
+
{
|
|
2384
|
+
this .sheenRoughnessTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._sheenRoughnessTexture);
|
|
2385
|
+
|
|
2386
|
+
this .setTexture (1, this .sheenRoughnessTextureNode);
|
|
2387
|
+
},
|
|
2388
|
+
getExtensionKey ()
|
|
2389
|
+
{
|
|
2390
|
+
return X_ITE_ExtensionKeys .SHEEN_MATERIAL_EXTENSION;
|
|
2391
|
+
},
|
|
2392
|
+
getShaderOptions (options)
|
|
2393
|
+
{
|
|
2394
|
+
options .push ("X3D_SHEEN_MATERIAL_EXT");
|
|
2395
|
+
|
|
2396
|
+
if (!+this .getTextureBits ())
|
|
2397
|
+
return;
|
|
2398
|
+
|
|
2399
|
+
options .push ("X3D_MATERIAL_TEXTURES");
|
|
2400
|
+
|
|
2401
|
+
this .sheenColorTextureNode ?.getShaderOptions (options, "SHEEN_COLOR", true);
|
|
2402
|
+
this .sheenRoughnessTextureNode ?.getShaderOptions (options, "SHEEN_ROUGHNESS", true);
|
|
2403
|
+
},
|
|
2404
|
+
setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
|
|
2405
|
+
{
|
|
2406
|
+
gl .uniform3fv (shaderObject .x3d_SheenColorEXT, this .sheenColorArray);
|
|
2407
|
+
gl .uniform1f (shaderObject .x3d_SheenRoughnessEXT, this .sheenRoughness);
|
|
2408
|
+
|
|
2409
|
+
const
|
|
2410
|
+
browser = this .getBrowser (),
|
|
2411
|
+
SheenELUTTexture = browser .getLibraryTexture ("lut_sheen_E.png"),
|
|
2412
|
+
SheenELUTTextureUnit = browser .getTexture2DUnit ();
|
|
2413
|
+
|
|
2414
|
+
gl .activeTexture (gl .TEXTURE0 + SheenELUTTextureUnit);
|
|
2415
|
+
gl .bindTexture (gl .TEXTURE_2D, SheenELUTTexture .getTexture ());
|
|
2416
|
+
gl .uniform1i (shaderObject .x3d_SheenELUTTextureEXT, SheenELUTTextureUnit);
|
|
2417
|
+
|
|
2418
|
+
if (!+this .getTextureBits ())
|
|
2419
|
+
return;
|
|
2420
|
+
|
|
2421
|
+
this .sheenColorTextureNode ?.setNamedShaderUniforms (gl,
|
|
2422
|
+
shaderObject,
|
|
2423
|
+
renderObject,
|
|
2424
|
+
shaderObject .x3d_SheenColorTextureEXT,
|
|
2425
|
+
this ._sheenColorTextureMapping .getValue (),
|
|
2426
|
+
textureTransformMapping,
|
|
2427
|
+
textureCoordinateMapping);
|
|
2428
|
+
|
|
2429
|
+
this .sheenRoughnessTextureNode ?.setNamedShaderUniforms (gl,
|
|
2430
|
+
shaderObject,
|
|
2431
|
+
renderObject,
|
|
2432
|
+
shaderObject .x3d_SheenRoughnessTextureEXT,
|
|
2433
|
+
this ._sheenRoughnessTextureMapping .getValue (),
|
|
2434
|
+
textureTransformMapping,
|
|
2435
|
+
textureCoordinateMapping);
|
|
2436
|
+
},
|
|
2437
|
+
});
|
|
2438
|
+
|
|
2439
|
+
Object .defineProperties (SheenMaterialExtension,
|
|
2440
|
+
{
|
|
2441
|
+
typeName:
|
|
2442
|
+
{
|
|
2443
|
+
value: "SheenMaterialExtension",
|
|
2444
|
+
enumerable: true,
|
|
2445
|
+
},
|
|
2446
|
+
componentInfo:
|
|
2447
|
+
{
|
|
2448
|
+
value: Object .freeze ({ name: "X_ITE", level: 1 }),
|
|
2449
|
+
enumerable: true,
|
|
2450
|
+
},
|
|
2451
|
+
containerField:
|
|
2452
|
+
{
|
|
2453
|
+
value: "extensions",
|
|
2454
|
+
enumerable: true,
|
|
2455
|
+
},
|
|
2456
|
+
specificationRange:
|
|
2457
|
+
{
|
|
2458
|
+
value: Object .freeze ({ from: "4.0", to: "Infinity" }),
|
|
2459
|
+
enumerable: true,
|
|
2460
|
+
},
|
|
2461
|
+
fieldDefinitions:
|
|
2462
|
+
{
|
|
2463
|
+
value: new (FieldDefinitionArray_default()) ([
|
|
2464
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
|
|
2465
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "sheenColor", new (Fields_default()).SFColor ()),
|
|
2466
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "sheenColorTextureMapping", new (Fields_default()).SFString ()),
|
|
2467
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "sheenColorTexture", new (Fields_default()).SFNode ()),
|
|
2468
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "sheenRoughness", new (Fields_default()).SFFloat ()),
|
|
2469
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "sheenRoughnessTextureMapping", new (Fields_default()).SFString ()),
|
|
2470
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "sheenRoughnessTexture", new (Fields_default()).SFNode ()),
|
|
2471
|
+
]),
|
|
2472
|
+
enumerable: true,
|
|
2473
|
+
},
|
|
2474
|
+
});
|
|
2475
|
+
|
|
2476
|
+
const SheenMaterialExtension_default_ = SheenMaterialExtension;
|
|
2477
|
+
;
|
|
2478
|
+
|
|
2479
|
+
Namespace_default().add ("SheenMaterialExtension", "x_ite/Components/X_ITE/SheenMaterialExtension", SheenMaterialExtension_default_);
|
|
2480
|
+
/* harmony default export */ const X_ITE_SheenMaterialExtension = (SheenMaterialExtension_default_);
|
|
2481
|
+
;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/SpecularMaterialExtension.js
|
|
2482
|
+
/*******************************************************************************
|
|
2483
|
+
*
|
|
2484
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2485
|
+
*
|
|
2486
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
|
|
2487
|
+
*
|
|
2488
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
2489
|
+
*
|
|
2490
|
+
* The copyright notice above does not evidence any actual of intended
|
|
2491
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
2492
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
2493
|
+
* create3000.
|
|
2494
|
+
*
|
|
2495
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
2496
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
2497
|
+
* permission of create3000.
|
|
2498
|
+
*
|
|
2499
|
+
* NON-MILITARY USE ONLY
|
|
2500
|
+
*
|
|
2501
|
+
* All create3000 software are effectively free software with a non-military use
|
|
2502
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
2503
|
+
* source in any way you please with the exception anything that uses it must be
|
|
2504
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
2505
|
+
*
|
|
2506
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2507
|
+
*
|
|
2508
|
+
* Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
|
|
2509
|
+
*
|
|
2510
|
+
* This file is part of the X_ITE Project.
|
|
2511
|
+
*
|
|
2512
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
2513
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
2514
|
+
* Free Software Foundation.
|
|
2515
|
+
*
|
|
2516
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
2517
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
2518
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
2519
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
2520
|
+
*
|
|
2521
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
2522
|
+
* along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
|
|
2523
|
+
* copy of the GPLv3 License.
|
|
2524
|
+
*
|
|
2525
|
+
* For Silvio, Joy and Adi.
|
|
2526
|
+
*
|
|
2527
|
+
******************************************************************************/
|
|
2528
|
+
|
|
2529
|
+
|
|
2530
|
+
|
|
2531
|
+
|
|
2532
|
+
|
|
2533
|
+
|
|
2534
|
+
|
|
2535
|
+
|
|
2536
|
+
|
|
2537
|
+
function SpecularMaterialExtension (executionContext)
|
|
2538
|
+
{
|
|
2539
|
+
X_ITE_X3DMaterialExtensionNode .call (this, executionContext);
|
|
2540
|
+
|
|
2541
|
+
this .addType ((X3DConstants_default()).SpecularMaterialExtension);
|
|
2542
|
+
|
|
2543
|
+
this .specularColorArray = new Float32Array (3);
|
|
2544
|
+
}
|
|
2545
|
+
|
|
2546
|
+
Object .assign (Object .setPrototypeOf (SpecularMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
|
|
2547
|
+
{
|
|
2548
|
+
initialize ()
|
|
2549
|
+
{
|
|
2550
|
+
X_ITE_X3DMaterialExtensionNode .prototype .initialize .call (this);
|
|
2551
|
+
|
|
2552
|
+
this ._specular .addInterest ("set_specular__", this);
|
|
2553
|
+
this ._specularTexture .addInterest ("set_specularTexture__", this);
|
|
2554
|
+
this ._specularColor .addInterest ("set_specularColor__", this);
|
|
2555
|
+
this ._specularColorTexture .addInterest ("set_specularColorTexture__", this);
|
|
2556
|
+
|
|
2557
|
+
this .set_specular__ ();
|
|
2558
|
+
this .set_specularTexture__ ();
|
|
2559
|
+
this .set_specularColor__ ();
|
|
2560
|
+
this .set_specularColorTexture__ ();
|
|
2561
|
+
},
|
|
2562
|
+
set_specular__ ()
|
|
2563
|
+
{
|
|
2564
|
+
this .specular = Math .max (this ._specular .getValue (), 0);
|
|
2565
|
+
},
|
|
2566
|
+
set_specularTexture__ ()
|
|
2567
|
+
{
|
|
2568
|
+
this .specularTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._specularTexture);
|
|
2569
|
+
|
|
2570
|
+
this .setTexture (0, this .specularTextureNode);
|
|
2571
|
+
},
|
|
2572
|
+
set_specularColor__ ()
|
|
2573
|
+
{
|
|
2574
|
+
//We cannot use this in Windows Edge:
|
|
2575
|
+
//this .specularColorArray .set (this ._specularColor .getValue ());
|
|
2576
|
+
|
|
2577
|
+
const
|
|
2578
|
+
specularColorArray = this .specularColorArray,
|
|
2579
|
+
specularColor = this ._specularColor .getValue ();
|
|
2580
|
+
|
|
2581
|
+
specularColorArray [0] = specularColor .r;
|
|
2582
|
+
specularColorArray [1] = specularColor .g;
|
|
2583
|
+
specularColorArray [2] = specularColor .b;
|
|
2584
|
+
},
|
|
2585
|
+
set_specularColorTexture__ ()
|
|
2586
|
+
{
|
|
2587
|
+
this .specularColorTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._specularColorTexture);
|
|
2588
|
+
|
|
2589
|
+
this .setTexture (1, this .specularColorTextureNode);
|
|
2590
|
+
},
|
|
2591
|
+
getExtensionKey ()
|
|
2592
|
+
{
|
|
2593
|
+
return X_ITE_ExtensionKeys .SPECULAR_MATERIAL_EXTENSION;
|
|
2594
|
+
},
|
|
2595
|
+
getShaderOptions (options)
|
|
2596
|
+
{
|
|
2597
|
+
options .push ("X3D_SPECULAR_MATERIAL_EXT");
|
|
2598
|
+
|
|
2599
|
+
if (!+this .getTextureBits ())
|
|
2600
|
+
return;
|
|
2601
|
+
|
|
2602
|
+
options .push ("X3D_MATERIAL_TEXTURES");
|
|
2603
|
+
|
|
2604
|
+
this .specularTextureNode ?.getShaderOptions (options, "SPECULAR", true);
|
|
2605
|
+
this .specularColorTextureNode ?.getShaderOptions (options, "SPECULAR_COLOR", true);
|
|
2606
|
+
},
|
|
2607
|
+
setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
|
|
2608
|
+
{
|
|
2609
|
+
gl .uniform1f (shaderObject .x3d_SpecularEXT, this .specular);
|
|
2610
|
+
gl .uniform3fv (shaderObject .x3d_SpecularColorEXT, this .specularColorArray);
|
|
2611
|
+
|
|
2612
|
+
if (!+this .getTextureBits ())
|
|
2613
|
+
return;
|
|
2614
|
+
|
|
2615
|
+
this .specularTextureNode ?.setNamedShaderUniforms (gl,
|
|
2616
|
+
shaderObject,
|
|
2617
|
+
renderObject,
|
|
2618
|
+
shaderObject .x3d_SpecularTextureEXT,
|
|
2619
|
+
this ._specularTextureMapping .getValue (),
|
|
2620
|
+
textureTransformMapping,
|
|
2621
|
+
textureCoordinateMapping);
|
|
2622
|
+
|
|
2623
|
+
this .specularColorTextureNode ?.setNamedShaderUniforms (gl,
|
|
2624
|
+
shaderObject,
|
|
2625
|
+
renderObject,
|
|
2626
|
+
shaderObject .x3d_SpecularColorTextureEXT,
|
|
2627
|
+
this ._specularColorTextureMapping .getValue (),
|
|
2628
|
+
textureTransformMapping,
|
|
2629
|
+
textureCoordinateMapping);
|
|
2630
|
+
},
|
|
2631
|
+
});
|
|
2632
|
+
|
|
2633
|
+
Object .defineProperties (SpecularMaterialExtension,
|
|
2634
|
+
{
|
|
2635
|
+
typeName:
|
|
2636
|
+
{
|
|
2637
|
+
value: "SpecularMaterialExtension",
|
|
2638
|
+
enumerable: true,
|
|
2639
|
+
},
|
|
2640
|
+
componentInfo:
|
|
2641
|
+
{
|
|
2642
|
+
value: Object .freeze ({ name: "X_ITE", level: 1 }),
|
|
2643
|
+
enumerable: true,
|
|
2644
|
+
},
|
|
2645
|
+
containerField:
|
|
2646
|
+
{
|
|
2647
|
+
value: "extensions",
|
|
2648
|
+
enumerable: true,
|
|
2649
|
+
},
|
|
2650
|
+
specificationRange:
|
|
2651
|
+
{
|
|
2652
|
+
value: Object .freeze ({ from: "4.0", to: "Infinity" }),
|
|
2653
|
+
enumerable: true,
|
|
2654
|
+
},
|
|
2655
|
+
fieldDefinitions:
|
|
2656
|
+
{
|
|
2657
|
+
value: new (FieldDefinitionArray_default()) ([
|
|
2658
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
|
|
2659
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "specular", new (Fields_default()).SFFloat (1)),
|
|
2660
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "specularTextureMapping", new (Fields_default()).SFString ()),
|
|
2661
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "specularTexture", new (Fields_default()).SFNode ()),
|
|
2662
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "specularColor", new (Fields_default()).SFColor (1, 1, 1)),
|
|
2663
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "specularColorTextureMapping", new (Fields_default()).SFString ()),
|
|
2664
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "specularColorTexture", new (Fields_default()).SFNode ()),
|
|
2665
|
+
]),
|
|
2666
|
+
enumerable: true,
|
|
2667
|
+
},
|
|
2668
|
+
});
|
|
2669
|
+
|
|
2670
|
+
const SpecularMaterialExtension_default_ = SpecularMaterialExtension;
|
|
2671
|
+
;
|
|
2672
|
+
|
|
2673
|
+
Namespace_default().add ("SpecularMaterialExtension", "x_ite/Components/X_ITE/SpecularMaterialExtension", SpecularMaterialExtension_default_);
|
|
2674
|
+
/* harmony default export */ const X_ITE_SpecularMaterialExtension = (SpecularMaterialExtension_default_);
|
|
2675
|
+
;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/TransmissionMaterialExtension.js
|
|
2676
|
+
/*******************************************************************************
|
|
2677
|
+
*
|
|
2678
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2679
|
+
*
|
|
2680
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
|
|
2681
|
+
*
|
|
2682
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
2683
|
+
*
|
|
2684
|
+
* The copyright notice above does not evidence any actual of intended
|
|
2685
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
2686
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
2687
|
+
* create3000.
|
|
2688
|
+
*
|
|
2689
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
2690
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
2691
|
+
* permission of create3000.
|
|
2692
|
+
*
|
|
2693
|
+
* NON-MILITARY USE ONLY
|
|
2694
|
+
*
|
|
2695
|
+
* All create3000 software are effectively free software with a non-military use
|
|
2696
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
2697
|
+
* source in any way you please with the exception anything that uses it must be
|
|
2698
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
2699
|
+
*
|
|
2700
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2701
|
+
*
|
|
2702
|
+
* Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
|
|
2703
|
+
*
|
|
2704
|
+
* This file is part of the X_ITE Project.
|
|
2705
|
+
*
|
|
2706
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
2707
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
2708
|
+
* Free Software Foundation.
|
|
2709
|
+
*
|
|
2710
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
2711
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
2712
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
2713
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
2714
|
+
*
|
|
2715
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
2716
|
+
* along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
|
|
2717
|
+
* copy of the GPLv3 License.
|
|
2718
|
+
*
|
|
2719
|
+
* For Silvio, Joy and Adi.
|
|
2720
|
+
*
|
|
2721
|
+
******************************************************************************/
|
|
2722
|
+
|
|
2723
|
+
|
|
2724
|
+
|
|
2725
|
+
|
|
2726
|
+
|
|
2727
|
+
|
|
2728
|
+
|
|
2729
|
+
|
|
2730
|
+
|
|
2731
|
+
function TransmissionMaterialExtension (executionContext)
|
|
2732
|
+
{
|
|
2733
|
+
X_ITE_X3DMaterialExtensionNode .call (this, executionContext);
|
|
2734
|
+
|
|
2735
|
+
this .addType ((X3DConstants_default()).TransmissionMaterialExtension);
|
|
2736
|
+
}
|
|
2737
|
+
|
|
2738
|
+
Object .assign (Object .setPrototypeOf (TransmissionMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
|
|
2739
|
+
{
|
|
2740
|
+
initialize ()
|
|
2741
|
+
{
|
|
2742
|
+
X_ITE_X3DMaterialExtensionNode .prototype .initialize .call (this);
|
|
2743
|
+
|
|
2744
|
+
this ._transmission .addInterest ("set_transmission__", this);
|
|
2745
|
+
this ._transmissionTexture .addInterest ("set_transmissionTexture__", this);
|
|
2746
|
+
|
|
2747
|
+
this .set_transmission__ ();
|
|
2748
|
+
this .set_transmissionTexture__ ();
|
|
2749
|
+
},
|
|
2750
|
+
set_transmission__ ()
|
|
2751
|
+
{
|
|
2752
|
+
this .transmission = Math .max (this ._transmission .getValue (), 0);
|
|
2753
|
+
},
|
|
2754
|
+
set_transmissionTexture__ ()
|
|
2755
|
+
{
|
|
2756
|
+
this .transmissionTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._transmissionTexture);
|
|
2757
|
+
|
|
2758
|
+
this .setTexture (0, this .transmissionTextureNode);
|
|
2759
|
+
},
|
|
2760
|
+
getExtensionKey ()
|
|
2761
|
+
{
|
|
2762
|
+
return X_ITE_ExtensionKeys .TRANSMISSION_MATERIAL_EXTENSION;
|
|
2763
|
+
},
|
|
2764
|
+
getShaderOptions (options)
|
|
2765
|
+
{
|
|
2766
|
+
options .push ("X3D_TRANSMISSION_MATERIAL_EXT");
|
|
2767
|
+
|
|
2768
|
+
if (!+this .getTextureBits ())
|
|
2769
|
+
return;
|
|
2770
|
+
|
|
2771
|
+
options .push ("X3D_MATERIAL_TEXTURES");
|
|
2772
|
+
|
|
2773
|
+
this .transmissionTextureNode ?.getShaderOptions (options, "TRANSMISSION", true);
|
|
2774
|
+
},
|
|
2775
|
+
setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
|
|
2776
|
+
{
|
|
2777
|
+
const
|
|
2778
|
+
browser = this .getBrowser (),
|
|
2779
|
+
transmissionBuffer = browser .getTransmissionBuffer (),
|
|
2780
|
+
transmissionUnit = browser .getTexture2DUnit ();
|
|
2781
|
+
|
|
2782
|
+
gl .uniform1f (shaderObject .x3d_TransmissionEXT, this .transmission);
|
|
2783
|
+
|
|
2784
|
+
gl .activeTexture (gl .TEXTURE0 + transmissionUnit);
|
|
2785
|
+
gl .bindTexture (gl .TEXTURE_2D, transmissionBuffer .getColorTexture ());
|
|
2786
|
+
gl .uniform1i (shaderObject .x3d_TransmissionFramebufferSamplerEXT, transmissionUnit);
|
|
2787
|
+
gl .uniform2i (shaderObject .x3d_TransmissionFramebufferSizeEXT, transmissionBuffer .getWidth (), transmissionBuffer .getHeight ());
|
|
2788
|
+
|
|
2789
|
+
if (!+this .getTextureBits ())
|
|
2790
|
+
return;
|
|
2791
|
+
|
|
2792
|
+
this .transmissionTextureNode ?.setNamedShaderUniforms (gl,
|
|
2793
|
+
shaderObject,
|
|
2794
|
+
renderObject,
|
|
2795
|
+
shaderObject .x3d_TransmissionTextureEXT,
|
|
2796
|
+
this ._transmissionTextureMapping .getValue (),
|
|
2797
|
+
textureTransformMapping,
|
|
2798
|
+
textureCoordinateMapping);
|
|
2799
|
+
},
|
|
2800
|
+
});
|
|
2801
|
+
|
|
2802
|
+
Object .defineProperties (TransmissionMaterialExtension,
|
|
2803
|
+
{
|
|
2804
|
+
typeName:
|
|
2805
|
+
{
|
|
2806
|
+
value: "TransmissionMaterialExtension",
|
|
2807
|
+
enumerable: true,
|
|
2808
|
+
},
|
|
2809
|
+
componentInfo:
|
|
2810
|
+
{
|
|
2811
|
+
value: Object .freeze ({ name: "X_ITE", level: 1 }),
|
|
2812
|
+
enumerable: true,
|
|
2813
|
+
},
|
|
2814
|
+
containerField:
|
|
2815
|
+
{
|
|
2816
|
+
value: "extensions",
|
|
2817
|
+
enumerable: true,
|
|
2818
|
+
},
|
|
2819
|
+
specificationRange:
|
|
2820
|
+
{
|
|
2821
|
+
value: Object .freeze ({ from: "4.0", to: "Infinity" }),
|
|
2822
|
+
enumerable: true,
|
|
2823
|
+
},
|
|
2824
|
+
fieldDefinitions:
|
|
2825
|
+
{
|
|
2826
|
+
value: new (FieldDefinitionArray_default()) ([
|
|
2827
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
|
|
2828
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "transmission", new (Fields_default()).SFFloat ()),
|
|
2829
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "transmissionTextureMapping", new (Fields_default()).SFString ()),
|
|
2830
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "transmissionTexture", new (Fields_default()).SFNode ()),
|
|
2831
|
+
]),
|
|
2832
|
+
enumerable: true,
|
|
2833
|
+
},
|
|
2834
|
+
});
|
|
2835
|
+
|
|
2836
|
+
const TransmissionMaterialExtension_default_ = TransmissionMaterialExtension;
|
|
2837
|
+
;
|
|
2838
|
+
|
|
2839
|
+
Namespace_default().add ("TransmissionMaterialExtension", "x_ite/Components/X_ITE/TransmissionMaterialExtension", TransmissionMaterialExtension_default_);
|
|
2840
|
+
/* harmony default export */ const X_ITE_TransmissionMaterialExtension = (TransmissionMaterialExtension_default_);
|
|
2841
|
+
;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/UnlitMaterialExtension.js
|
|
2842
|
+
/*******************************************************************************
|
|
2843
|
+
*
|
|
2844
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2845
|
+
*
|
|
2846
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
|
|
2847
|
+
*
|
|
2848
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
2849
|
+
*
|
|
2850
|
+
* The copyright notice above does not evidence any actual of intended
|
|
2851
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
2852
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
2853
|
+
* create3000.
|
|
2854
|
+
*
|
|
2855
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
2856
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
2857
|
+
* permission of create3000.
|
|
2858
|
+
*
|
|
2859
|
+
* NON-MILITARY USE ONLY
|
|
2860
|
+
*
|
|
2861
|
+
* All create3000 software are effectively free software with a non-military use
|
|
2862
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
2863
|
+
* source in any way you please with the exception anything that uses it must be
|
|
2864
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
2865
|
+
*
|
|
2866
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2867
|
+
*
|
|
2868
|
+
* Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
|
|
2869
|
+
*
|
|
2870
|
+
* This file is part of the X_ITE Project.
|
|
2871
|
+
*
|
|
2872
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
2873
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
2874
|
+
* Free Software Foundation.
|
|
2875
|
+
*
|
|
2876
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
2877
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
2878
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
2879
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
2880
|
+
*
|
|
2881
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
2882
|
+
* along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
|
|
2883
|
+
* copy of the GPLv3 License.
|
|
2884
|
+
*
|
|
2885
|
+
* For Silvio, Joy and Adi.
|
|
2886
|
+
*
|
|
2887
|
+
******************************************************************************/
|
|
2888
|
+
|
|
2889
|
+
|
|
2890
|
+
|
|
2891
|
+
|
|
2892
|
+
|
|
2893
|
+
|
|
2894
|
+
|
|
2895
|
+
|
|
2896
|
+
function UnlitMaterialExtension (executionContext)
|
|
2897
|
+
{
|
|
2898
|
+
X_ITE_X3DMaterialExtensionNode .call (this, executionContext);
|
|
2899
|
+
|
|
2900
|
+
this .addType ((X3DConstants_default()).UnlitMaterialExtension);
|
|
2901
|
+
}
|
|
2902
|
+
|
|
2903
|
+
Object .assign (Object .setPrototypeOf (UnlitMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
|
|
2904
|
+
{
|
|
2905
|
+
getExtensionKey ()
|
|
2906
|
+
{
|
|
2907
|
+
return X_ITE_ExtensionKeys .UNLIT_MATERIAL_EXTENSION;
|
|
2908
|
+
},
|
|
2909
|
+
getShaderOptions (options)
|
|
2910
|
+
{
|
|
2911
|
+
options .push ("X3D_UNLIT_MATERIAL_EXT");
|
|
2912
|
+
},
|
|
2913
|
+
setShaderUniforms ()
|
|
2914
|
+
{ },
|
|
2915
|
+
});
|
|
2916
|
+
|
|
2917
|
+
Object .defineProperties (UnlitMaterialExtension,
|
|
2918
|
+
{
|
|
2919
|
+
typeName:
|
|
2920
|
+
{
|
|
2921
|
+
value: "UnlitMaterialExtension",
|
|
2922
|
+
enumerable: true,
|
|
2923
|
+
},
|
|
2924
|
+
componentInfo:
|
|
2925
|
+
{
|
|
2926
|
+
value: Object .freeze ({ name: "X_ITE", level: 1 }),
|
|
2927
|
+
enumerable: true,
|
|
2928
|
+
},
|
|
2929
|
+
containerField:
|
|
2930
|
+
{
|
|
2931
|
+
value: "extensions",
|
|
2932
|
+
enumerable: true,
|
|
2933
|
+
},
|
|
2934
|
+
specificationRange:
|
|
2935
|
+
{
|
|
2936
|
+
value: Object .freeze ({ from: "4.0", to: "Infinity" }),
|
|
2937
|
+
enumerable: true,
|
|
2938
|
+
},
|
|
2939
|
+
fieldDefinitions:
|
|
2940
|
+
{
|
|
2941
|
+
value: new (FieldDefinitionArray_default()) ([
|
|
2942
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
|
|
2943
|
+
]),
|
|
2944
|
+
enumerable: true,
|
|
2945
|
+
},
|
|
2946
|
+
});
|
|
2947
|
+
|
|
2948
|
+
const UnlitMaterialExtension_default_ = UnlitMaterialExtension;
|
|
2949
|
+
;
|
|
2950
|
+
|
|
2951
|
+
Namespace_default().add ("UnlitMaterialExtension", "x_ite/Components/X_ITE/UnlitMaterialExtension", UnlitMaterialExtension_default_);
|
|
2952
|
+
/* harmony default export */ const X_ITE_UnlitMaterialExtension = (UnlitMaterialExtension_default_);
|
|
2953
|
+
;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/VolumeMaterialExtension.js
|
|
2954
|
+
/*******************************************************************************
|
|
2955
|
+
*
|
|
2956
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2957
|
+
*
|
|
2958
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
|
|
2959
|
+
*
|
|
2960
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
2961
|
+
*
|
|
2962
|
+
* The copyright notice above does not evidence any actual of intended
|
|
2963
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
2964
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
2965
|
+
* create3000.
|
|
2966
|
+
*
|
|
2967
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
2968
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
2969
|
+
* permission of create3000.
|
|
2970
|
+
*
|
|
2971
|
+
* NON-MILITARY USE ONLY
|
|
2972
|
+
*
|
|
2973
|
+
* All create3000 software are effectively free software with a non-military use
|
|
2974
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
2975
|
+
* source in any way you please with the exception anything that uses it must be
|
|
2976
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
2977
|
+
*
|
|
2978
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2979
|
+
*
|
|
2980
|
+
* Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
|
|
2981
|
+
*
|
|
2982
|
+
* This file is part of the X_ITE Project.
|
|
2983
|
+
*
|
|
2984
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
2985
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
2986
|
+
* Free Software Foundation.
|
|
2987
|
+
*
|
|
2988
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
2989
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
2990
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
2991
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
2992
|
+
*
|
|
2993
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
2994
|
+
* along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
|
|
2995
|
+
* copy of the GPLv3 License.
|
|
2996
|
+
*
|
|
2997
|
+
* For Silvio, Joy and Adi.
|
|
2998
|
+
*
|
|
2999
|
+
******************************************************************************/
|
|
3000
|
+
|
|
3001
|
+
|
|
3002
|
+
|
|
3003
|
+
|
|
3004
|
+
|
|
3005
|
+
|
|
3006
|
+
|
|
3007
|
+
|
|
3008
|
+
|
|
3009
|
+
function VolumeMaterialExtension (executionContext)
|
|
3010
|
+
{
|
|
3011
|
+
X_ITE_X3DMaterialExtensionNode .call (this, executionContext);
|
|
3012
|
+
|
|
3013
|
+
this .addType ((X3DConstants_default()).VolumeMaterialExtension);
|
|
3014
|
+
|
|
3015
|
+
this .attenuationColorArray = new Float32Array (3);
|
|
3016
|
+
}
|
|
3017
|
+
|
|
3018
|
+
Object .assign (Object .setPrototypeOf (VolumeMaterialExtension .prototype, X_ITE_X3DMaterialExtensionNode .prototype),
|
|
3019
|
+
{
|
|
3020
|
+
initialize ()
|
|
3021
|
+
{
|
|
3022
|
+
X_ITE_X3DMaterialExtensionNode .prototype .initialize .call (this);
|
|
3023
|
+
|
|
3024
|
+
this ._thickness .addInterest ("set_thickness__", this);
|
|
3025
|
+
this ._thicknessTexture .addInterest ("set_thicknessTexture__", this);
|
|
3026
|
+
this ._attenuationDistance .addInterest ("set_attenuationDistance__", this);
|
|
3027
|
+
this ._attenuationColor .addInterest ("set_attenuationColor__", this);
|
|
3028
|
+
|
|
3029
|
+
this .set_thickness__ ();
|
|
3030
|
+
this .set_thicknessTexture__ ();
|
|
3031
|
+
this .set_attenuationDistance__ ();
|
|
3032
|
+
this .set_attenuationColor__ ();
|
|
3033
|
+
},
|
|
3034
|
+
set_thickness__ ()
|
|
3035
|
+
{
|
|
3036
|
+
this .thickness = Math .max (this ._thickness .getValue (), 0);
|
|
3037
|
+
},
|
|
3038
|
+
set_thicknessTexture__ ()
|
|
3039
|
+
{
|
|
3040
|
+
this .thicknessTextureNode = X3DCast_default() ((X3DConstants_default()).X3DSingleTextureNode, this ._thicknessTexture);
|
|
3041
|
+
|
|
3042
|
+
this .setTexture (0, this .thicknessTextureNode);
|
|
3043
|
+
},
|
|
3044
|
+
set_attenuationDistance__ ()
|
|
3045
|
+
{
|
|
3046
|
+
this .attenuationDistance = Math .max (this ._attenuationDistance .getValue (), 0);
|
|
3047
|
+
},
|
|
3048
|
+
set_attenuationColor__ ()
|
|
3049
|
+
{
|
|
3050
|
+
//We cannot use this in Windows Edge:
|
|
3051
|
+
//this .attenuationColorArray .set (this ._attenuationColor .getValue ());
|
|
3052
|
+
|
|
3053
|
+
const
|
|
3054
|
+
attenuationColorArray = this .attenuationColorArray,
|
|
3055
|
+
attenuationColor = this ._attenuationColor .getValue ();
|
|
3056
|
+
|
|
3057
|
+
attenuationColorArray [0] = attenuationColor .r;
|
|
3058
|
+
attenuationColorArray [1] = attenuationColor .g;
|
|
3059
|
+
attenuationColorArray [2] = attenuationColor .b;
|
|
3060
|
+
},
|
|
3061
|
+
getExtensionKey ()
|
|
3062
|
+
{
|
|
3063
|
+
return X_ITE_ExtensionKeys .VOLUME_MATERIAL_EXTENSION;
|
|
3064
|
+
},
|
|
3065
|
+
getShaderOptions (options)
|
|
3066
|
+
{
|
|
3067
|
+
options .push ("X3D_VOLUME_MATERIAL_EXT");
|
|
3068
|
+
|
|
3069
|
+
if (!+this .getTextureBits ())
|
|
3070
|
+
return;
|
|
3071
|
+
|
|
3072
|
+
options .push ("X3D_MATERIAL_TEXTURES");
|
|
3073
|
+
|
|
3074
|
+
this .thicknessTextureNode ?.getShaderOptions (options, "THICKNESS", true);
|
|
3075
|
+
},
|
|
3076
|
+
setShaderUniforms (gl, shaderObject, renderObject, textureTransformMapping, textureCoordinateMapping)
|
|
3077
|
+
{
|
|
3078
|
+
gl .uniform1f (shaderObject .x3d_ThicknessEXT, this .thickness);
|
|
3079
|
+
gl .uniform1f (shaderObject .x3d_AttenuationDistanceEXT, this .attenuationDistance);
|
|
3080
|
+
gl .uniform3fv (shaderObject .x3d_AttenuationColoEXT, this .attenuationColorArray);
|
|
3081
|
+
|
|
3082
|
+
if (!+this .getTextureBits ())
|
|
3083
|
+
return;
|
|
3084
|
+
|
|
3085
|
+
this .thicknessTextureNode ?.setNamedShaderUniforms (gl,
|
|
3086
|
+
shaderObject,
|
|
3087
|
+
renderObject,
|
|
3088
|
+
shaderObject .x3d_ThicknessTextureEXT,
|
|
3089
|
+
this ._thicknessTextureMapping .getValue (),
|
|
3090
|
+
textureTransformMapping,
|
|
3091
|
+
textureCoordinateMapping);
|
|
3092
|
+
},
|
|
3093
|
+
});
|
|
3094
|
+
|
|
3095
|
+
Object .defineProperties (VolumeMaterialExtension,
|
|
3096
|
+
{
|
|
3097
|
+
typeName:
|
|
3098
|
+
{
|
|
3099
|
+
value: "VolumeMaterialExtension",
|
|
3100
|
+
enumerable: true,
|
|
3101
|
+
},
|
|
3102
|
+
componentInfo:
|
|
3103
|
+
{
|
|
3104
|
+
value: Object .freeze ({ name: "X_ITE", level: 1 }),
|
|
3105
|
+
enumerable: true,
|
|
3106
|
+
},
|
|
3107
|
+
containerField:
|
|
3108
|
+
{
|
|
3109
|
+
value: "extensions",
|
|
3110
|
+
enumerable: true,
|
|
3111
|
+
},
|
|
3112
|
+
specificationRange:
|
|
3113
|
+
{
|
|
3114
|
+
value: Object .freeze ({ from: "4.0", to: "Infinity" }),
|
|
3115
|
+
enumerable: true,
|
|
3116
|
+
},
|
|
3117
|
+
fieldDefinitions:
|
|
3118
|
+
{
|
|
3119
|
+
value: new (FieldDefinitionArray_default()) ([
|
|
3120
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
|
|
3121
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "thickness", new (Fields_default()).SFFloat ()),
|
|
3122
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "thicknessTextureMapping", new (Fields_default()).SFString ()),
|
|
3123
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "thicknessTexture", new (Fields_default()).SFNode ()),
|
|
3124
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "attenuationDistance", new (Fields_default()).SFFloat (1_000_000)),
|
|
3125
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "attenuationColor", new (Fields_default()).SFColor (1, 1, 1)),
|
|
3126
|
+
]),
|
|
3127
|
+
enumerable: true,
|
|
3128
|
+
},
|
|
3129
|
+
});
|
|
3130
|
+
|
|
3131
|
+
const VolumeMaterialExtension_default_ = VolumeMaterialExtension;
|
|
3132
|
+
;
|
|
3133
|
+
|
|
3134
|
+
Namespace_default().add ("VolumeMaterialExtension", "x_ite/Components/X_ITE/VolumeMaterialExtension", VolumeMaterialExtension_default_);
|
|
3135
|
+
/* harmony default export */ const X_ITE_VolumeMaterialExtension = (VolumeMaterialExtension_default_);
|
|
782
3136
|
;// CONCATENATED MODULE: ./src/assets/components/X_ITE.js
|
|
783
3137
|
/*******************************************************************************
|
|
784
3138
|
*
|
|
@@ -832,6 +3186,19 @@ Namespace_default().add ("InstancedShape", "x_ite/Components/X_ITE/InstancedShap
|
|
|
832
3186
|
|
|
833
3187
|
|
|
834
3188
|
|
|
3189
|
+
|
|
3190
|
+
|
|
3191
|
+
|
|
3192
|
+
|
|
3193
|
+
|
|
3194
|
+
|
|
3195
|
+
|
|
3196
|
+
|
|
3197
|
+
|
|
3198
|
+
|
|
3199
|
+
|
|
3200
|
+
|
|
3201
|
+
|
|
835
3202
|
Components_default().add ({
|
|
836
3203
|
name: "X_ITE",
|
|
837
3204
|
concreteNodes:
|
|
@@ -839,9 +3206,22 @@ Components_default().add ({
|
|
|
839
3206
|
X_ITE_BlendMode,
|
|
840
3207
|
X_ITE_DepthMode,
|
|
841
3208
|
X_ITE_InstancedShape,
|
|
3209
|
+
X_ITE_SpecularGlossinessMaterial,
|
|
3210
|
+
X_ITE_AnisotropyMaterialExtension,
|
|
3211
|
+
X_ITE_ClearcoatMaterialExtension,
|
|
3212
|
+
X_ITE_DispersionMaterialExtension,
|
|
3213
|
+
X_ITE_EmissiveStrengthMaterialExtension,
|
|
3214
|
+
X_ITE_IORMaterialExtension,
|
|
3215
|
+
X_ITE_IridescenceMaterialExtension,
|
|
3216
|
+
X_ITE_SheenMaterialExtension,
|
|
3217
|
+
X_ITE_SpecularMaterialExtension,
|
|
3218
|
+
X_ITE_TransmissionMaterialExtension,
|
|
3219
|
+
X_ITE_UnlitMaterialExtension,
|
|
3220
|
+
X_ITE_VolumeMaterialExtension,
|
|
842
3221
|
],
|
|
843
3222
|
abstractNodes:
|
|
844
3223
|
[
|
|
3224
|
+
X_ITE_X3DMaterialExtensionNode,
|
|
845
3225
|
],
|
|
846
3226
|
});
|
|
847
3227
|
|