x_ite 4.2.17 → 4.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- package/.vscode/launch.json +15 -0
- package/.vscode/settings.json +12 -0
- package/.vscode/tasks.json +25 -0
- package/Makefile +27 -10
- package/README.md +13 -145
- package/build/bin/dist.pl +65 -8
- package/build/bin/version-number.pl +25 -0
- package/build/bin/version.pl +54 -14
- package/build/components/annotation.build.js +15 -0
- package/build/components/cad-geometry.build.js +15 -0
- package/build/components/cube-map-texturing.build.js +15 -0
- package/build/components/dis.build.js +15 -0
- package/build/components/event-utilities.build.js +15 -0
- package/build/components/geometry2d.build.js +15 -0
- package/build/components/geospatial.build.js +15 -0
- package/build/components/h-anim.build.js +15 -0
- package/build/components/key-device-sensor.build.js +15 -0
- package/build/components/layout.build.js +15 -0
- package/build/components/nurbs.build.js +15 -0
- package/build/components/particle-systems.build.js +15 -0
- package/build/components/picking.build.js +15 -0
- package/build/components/projective-texture-mapping.build.js +15 -0
- package/build/components/rigid-body-physics.build.js +15 -0
- package/build/components/scripting.build.js +15 -0
- package/build/components/texturing-3d.build.js +15 -0
- package/build/components/volume-rendering.build.js +15 -0
- package/build/components/x_ite.build.js +15 -0
- package/build/parts/default.end.frag.js +3 -0
- package/build/parts/default.start.frag.js +15 -0
- package/build/parts/x_ite.end.frag.js +25 -0
- package/build/parts/x_ite.start.frag.js +16 -0
- package/build/x_ite.build.js +5 -2
- package/dist/{components/texturing-3d.js → assets/components/annotation.js} +341 -263
- package/dist/assets/components/annotation.min.js +1 -0
- package/dist/{components → assets/components}/cad-geometry.js +180 -76
- package/dist/assets/components/cad-geometry.min.js +1 -0
- package/dist/assets/components/cube-map-texturing.js +1222 -0
- package/dist/assets/components/cube-map-texturing.min.js +1 -0
- package/dist/assets/components/dis.js +918 -0
- package/dist/assets/components/dis.min.js +1 -0
- package/dist/assets/components/event-utilities.js +1124 -0
- package/dist/assets/components/event-utilities.min.js +1 -0
- package/dist/assets/components/geometry2d.js +2200 -0
- package/dist/assets/components/geometry2d.min.js +1 -0
- package/dist/{components → assets/components}/geospatial.js +364 -269
- package/dist/assets/components/geospatial.min.js +2 -0
- package/dist/{components → assets/components}/h-anim.js +224 -62
- package/dist/assets/components/h-anim.min.js +1 -0
- package/dist/assets/components/key-device-sensor.js +860 -0
- package/dist/assets/components/key-device-sensor.min.js +1 -0
- package/dist/assets/components/layout.js +2018 -0
- package/dist/assets/components/layout.min.js +1 -0
- package/dist/{components → assets/components}/nurbs.js +632 -348
- package/dist/assets/components/nurbs.min.js +2 -0
- package/dist/{components → assets/components}/particle-systems.js +514 -476
- package/dist/assets/components/particle-systems.min.js +2 -0
- package/dist/assets/components/picking.js +2491 -0
- package/dist/assets/components/picking.min.js +1 -0
- package/dist/assets/components/projective-texture-mapping.js +823 -0
- package/dist/assets/components/projective-texture-mapping.min.js +1 -0
- package/dist/assets/components/rigid-body-physics.js +4579 -0
- package/dist/assets/components/rigid-body-physics.min.js +59 -0
- package/dist/assets/components/scripting.js +816 -0
- package/dist/assets/components/scripting.min.js +1 -0
- package/dist/assets/components/texturing-3d.js +10064 -0
- package/dist/assets/components/texturing-3d.min.js +48 -0
- package/dist/assets/components/volume-rendering.js +3976 -0
- package/dist/assets/components/volume-rendering.min.js +3 -0
- package/dist/assets/components/x_ite.js +295 -0
- package/dist/assets/components/x_ite.min.js +1 -0
- package/{fonts → dist/assets/fonts}/DroidSerif-Bold.ttf +0 -0
- package/{fonts → dist/assets/fonts}/DroidSerif-BoldItalic.ttf +0 -0
- package/{fonts → dist/assets/fonts}/DroidSerif-Italic.ttf +0 -0
- package/{fonts → dist/assets/fonts}/DroidSerif-Regular.ttf +0 -0
- package/{fonts → dist/assets/fonts}/Ubuntu-B.ttf +0 -0
- package/{fonts → dist/assets/fonts}/Ubuntu-BI.ttf +0 -0
- package/{fonts → dist/assets/fonts}/Ubuntu-R.ttf +0 -0
- package/{fonts → dist/assets/fonts}/Ubuntu-RI.ttf +0 -0
- package/{fonts → dist/assets/fonts}/UbuntuMono-B.ttf +0 -0
- package/{fonts → dist/assets/fonts}/UbuntuMono-BI.ttf +0 -0
- package/{fonts → dist/assets/fonts}/UbuntuMono-R.ttf +0 -0
- package/{fonts → dist/assets/fonts}/UbuntuMono-RI.ttf +0 -0
- package/dist/assets/hatching/0.png +0 -0
- package/dist/assets/hatching/1.png +0 -0
- package/dist/assets/hatching/10.png +0 -0
- package/dist/assets/hatching/11.png +0 -0
- package/dist/assets/hatching/12.png +0 -0
- package/dist/assets/hatching/13.png +0 -0
- package/dist/assets/hatching/14.png +0 -0
- package/dist/assets/hatching/15.png +0 -0
- package/dist/assets/hatching/16.png +0 -0
- package/dist/assets/hatching/17.png +0 -0
- package/dist/assets/hatching/18.png +0 -0
- package/dist/assets/hatching/19.png +0 -0
- package/dist/assets/hatching/2.png +0 -0
- package/dist/assets/hatching/3.png +0 -0
- package/dist/assets/hatching/4.png +0 -0
- package/dist/assets/hatching/5.png +0 -0
- package/dist/assets/hatching/6.png +0 -0
- package/dist/assets/hatching/7.png +0 -0
- package/dist/assets/hatching/8.png +0 -0
- package/dist/assets/hatching/9.png +0 -0
- package/dist/{images → assets/images}/ExamineViewer.png +0 -0
- package/dist/{images → assets/images}/FlyViewer.png +0 -0
- package/dist/{images → assets/images}/NoneViewer.png +0 -0
- package/dist/{images → assets/images}/PlaneViewer.png +0 -0
- package/dist/{images → assets/images}/PrimitiveQuality.png +0 -0
- package/dist/{images → assets/images}/TextureQuality.png +0 -0
- package/dist/{images → assets/images}/Time.png +0 -0
- package/dist/{images → assets/images}/Viewpoint.png +0 -0
- package/dist/{images → assets/images}/WalkViewer.png +0 -0
- package/dist/assets/images/go-next.png +0 -0
- package/dist/{images → assets/images}/gtk-fullscreen.png +0 -0
- package/dist/{images → assets/images}/gtk-leave-fullscreen.png +0 -0
- package/dist/{images → assets/images}/gtk-zoom-fit.png +0 -0
- package/dist/{images → assets/images}/gtk-zoom-in.png +0 -0
- package/dist/{images → assets/images}/help-about.png +0 -0
- package/dist/{images → assets/images}/icon.bw.png +0 -0
- package/dist/{images → assets/images}/icon.png +0 -0
- package/dist/assets/images/logo.128.png +0 -0
- package/dist/{images → assets/images}/logo.bw.png +0 -0
- package/dist/{images → assets/images}/logo.png +0 -0
- package/dist/assets/linetype/0.png +0 -0
- package/dist/assets/linetype/1.png +0 -0
- package/dist/assets/linetype/10.png +0 -0
- package/dist/assets/linetype/11.png +0 -0
- package/dist/assets/linetype/12.png +0 -0
- package/dist/assets/linetype/13.png +0 -0
- package/dist/assets/linetype/14.png +0 -0
- package/dist/assets/linetype/15.png +0 -0
- package/dist/assets/linetype/16.png +0 -0
- package/dist/assets/linetype/2.png +0 -0
- package/dist/assets/linetype/3.png +0 -0
- package/dist/assets/linetype/4.png +0 -0
- package/dist/assets/linetype/5.png +0 -0
- package/dist/assets/linetype/6.png +0 -0
- package/dist/assets/linetype/7.png +0 -0
- package/dist/assets/linetype/8.png +0 -0
- package/dist/assets/linetype/9.png +0 -0
- package/dist/assets/shaders/webgl1/Background.fs +23 -0
- package/dist/assets/shaders/webgl1/Background.vs +16 -0
- package/dist/assets/shaders/webgl1/Depth.fs +60 -0
- package/dist/assets/shaders/webgl1/Depth.vs +13 -0
- package/dist/assets/shaders/webgl1/Fallback.fs +28 -0
- package/dist/assets/shaders/webgl1/Fallback.vs +24 -0
- package/dist/assets/shaders/webgl1/FallbackUnlit.fs +15 -0
- package/dist/assets/shaders/webgl1/FallbackUnlit.vs +18 -0
- package/dist/assets/shaders/webgl1/Gouraud.fs +529 -0
- package/dist/assets/shaders/webgl1/Gouraud.vs +107 -0
- package/dist/assets/shaders/webgl1/Phong.fs +837 -0
- package/dist/assets/shaders/webgl1/Phong.vs +52 -0
- package/dist/assets/shaders/webgl1/PointSet.fs +541 -0
- package/dist/assets/shaders/webgl1/PointSet.vs +48 -0
- package/dist/assets/shaders/webgl1/Unlit.fs +538 -0
- package/dist/assets/shaders/webgl1/Unlit.vs +52 -0
- package/dist/assets/shaders/webgl1/Wireframe.fs +93 -0
- package/dist/assets/shaders/webgl1/Wireframe.vs +47 -0
- package/dist/assets/shaders/webgl2/Background.fs +25 -0
- package/dist/assets/shaders/webgl2/Background.vs +17 -0
- package/dist/assets/shaders/webgl2/Depth.fs +62 -0
- package/dist/assets/shaders/webgl2/Depth.vs +14 -0
- package/dist/assets/shaders/webgl2/Gouraud.fs +684 -0
- package/dist/assets/shaders/webgl2/Gouraud.vs +108 -0
- package/dist/assets/shaders/webgl2/Phong.fs +1013 -0
- package/dist/assets/shaders/webgl2/Phong.vs +53 -0
- package/dist/assets/shaders/webgl2/PointSet.fs +696 -0
- package/dist/assets/shaders/webgl2/PointSet.vs +49 -0
- package/dist/assets/shaders/webgl2/Unlit.fs +693 -0
- package/dist/assets/shaders/webgl2/Unlit.vs +53 -0
- package/dist/assets/shaders/webgl2/Wireframe.fs +102 -0
- package/dist/assets/shaders/webgl2/Wireframe.vs +48 -0
- package/dist/example.html +8 -7
- package/dist/x_ite.css +167 -49
- package/dist/x_ite.js +66263 -60020
- package/dist/x_ite.min.js +41 -41
- package/dist/x_ite.zip +0 -0
- package/docs/404.md +5 -0
- package/docs/Accessing-the-External-Browser.md +319 -0
- package/docs/Browser-Support.md +47 -0
- package/docs/Custom-Shaders.md +896 -0
- package/docs/Features.md +49 -0
- package/docs/Glossary.md +339 -0
- package/docs/How-To-Configure-Your-Web-Server.md +56 -0
- package/docs/Supported-Nodes.md +370 -0
- package/docs/What's-New.md +1295 -0
- package/docs/XHTML-DOM-Integration.md +82 -0
- package/docs/_config.yml +140 -0
- package/docs/_data/navigation.yml +137 -0
- package/docs/assets/css/main.scss +100 -0
- package/docs/assets/images/logo.png +0 -0
- package/docs/google3696ee938394d7b6.html +1 -0
- package/docs/index.md +1033 -0
- package/docs/reference/Browser-Services.md +361 -0
- package/docs/reference/Constants-Services.md +376 -0
- package/docs/reference/ECMAScript-Object-and-Function-Definitions.md +128 -0
- package/docs/reference/Field-Services-and-Objects.md +1006 -0
- package/docs/reference/Prototype-Services.md +121 -0
- package/docs/reference/Route-Services.md +49 -0
- package/docs/reference/Scene-Services.md +360 -0
- package/docs/reference/Script-Node-Authoring-Interface.md +342 -0
- package/docs/tutorials/Adding-backgrounds.md +268 -0
- package/docs/tutorials/Adding-fog.md +67 -0
- package/docs/tutorials/Adding-sound.md +326 -0
- package/docs/tutorials/Animating-transforms.md +385 -0
- package/docs/tutorials/Basic-Nodes.md +317 -0
- package/docs/tutorials/Building-a-X3D-world.md +152 -0
- package/docs/tutorials/Building-elevation-grids.md +170 -0
- package/docs/tutorials/Building-extruded-shapes.md +145 -0
- package/docs/tutorials/Building-primitive-shapes.md +204 -0
- package/docs/tutorials/Building-shapes-out-of-points,-lines,-and-faces.md +311 -0
- package/docs/tutorials/Controlling-appearance-with-materials.md +186 -0
- package/docs/tutorials/Controlling-color-on-coordinate-based-geometry.md +208 -0
- package/docs/tutorials/Controlling-detail.md +130 -0
- package/docs/tutorials/Controlling-how-textures-are-mapped.md +277 -0
- package/docs/tutorials/Controlling-navigation.md +70 -0
- package/docs/tutorials/Controlling-shading-on-coordinate-based-geometry.md +180 -0
- package/docs/tutorials/Controlling-the-viewpoint.md +49 -0
- package/docs/tutorials/Creating-new-node-types.md +313 -0
- package/docs/tutorials/Grouping-nodes.md +237 -0
- package/docs/tutorials/Hello,-World!.md +204 -0
- package/docs/tutorials/Improving-Performance.md +227 -0
- package/docs/tutorials/Increasing-Rendering-Speed.md +110 -0
- package/docs/tutorials/Introducing-X3D.md +94 -0
- package/docs/tutorials/Introducing-animation.md +211 -0
- package/docs/tutorials/Introducing-script-use.md +127 -0
- package/docs/tutorials/Lighting-your-world.md +139 -0
- package/docs/tutorials/Mapping-textures.md +212 -0
- package/docs/tutorials/Naming-nodes.md +161 -0
- package/docs/tutorials/Providing-information-about-your-world.md +30 -0
- package/docs/tutorials/Sensing-the-viewer.md +205 -0
- package/docs/tutorials/Sensing-viewer-actions.md +214 -0
- package/docs/tutorials/Transforming-Shapes.md +270 -0
- package/docs/tutorials/Writing-program-scripts-with-ECMAScript.md +631 -0
- package/docs/tutorials/index.md +78 -0
- package/meta/logo/logo.png +0 -0
- package/meta/logo/logo.svg +216 -217
- package/meta/web3d.html +3 -3
- package/package.json +43 -28
- package/src/assets/components/annotation.js +87 -0
- package/src/{components → assets/components}/cad-geometry.js +0 -0
- package/src/{x_ite/Components/CubeMapTexturing.js → assets/components/cube-map-texturing.js} +15 -21
- package/src/assets/components/dis.js +84 -0
- package/src/{x_ite/Components/EventUtilities.js → assets/components/event-utilities.js} +20 -26
- package/src/{x_ite/Components/Geometry2D.js → assets/components/geometry2d.js} +22 -25
- package/src/{components → assets/components}/geospatial.js +0 -0
- package/src/{components → assets/components}/h-anim.js +9 -7
- package/src/{x_ite/Components/KeyDeviceSensor.js → assets/components/key-device-sensor.js} +17 -20
- package/src/{x_ite/Components/Layout.js → assets/components/layout.js} +20 -23
- package/src/{components → assets/components}/nurbs.js +0 -0
- package/src/{components → assets/components}/particle-systems.js +1 -1
- package/src/assets/components/picking.js +87 -0
- package/src/assets/components/projective-texture-mapping.js +75 -0
- package/src/{components → assets/components}/rigid-body-physics.js +7 -2
- package/src/{x_ite/Components/Scripting.js → assets/components/scripting.js} +13 -19
- package/src/{components → assets/components}/texturing-3d.js +12 -13
- package/src/assets/components/volume-rendering.js +118 -0
- package/src/{x_ite/Components/X_ITE.js → assets/components/x_ite.js} +12 -30
- package/src/assets/fonts/DroidSerif-Bold.ttf +0 -0
- package/src/assets/fonts/DroidSerif-BoldItalic.ttf +0 -0
- package/src/assets/fonts/DroidSerif-Italic.ttf +0 -0
- package/src/assets/fonts/DroidSerif-Regular.ttf +0 -0
- package/src/assets/fonts/Ubuntu-B.ttf +0 -0
- package/src/assets/fonts/Ubuntu-BI.ttf +0 -0
- package/src/assets/fonts/Ubuntu-R.ttf +0 -0
- package/src/assets/fonts/Ubuntu-RI.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-B.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-BI.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-R.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-RI.ttf +0 -0
- package/src/assets/hatching/0.png +0 -0
- package/src/assets/hatching/1.png +0 -0
- package/src/assets/hatching/10.png +0 -0
- package/src/assets/hatching/11.png +0 -0
- package/src/assets/hatching/12.png +0 -0
- package/src/assets/hatching/13.png +0 -0
- package/src/assets/hatching/14.png +0 -0
- package/src/assets/hatching/15.png +0 -0
- package/src/assets/hatching/16.png +0 -0
- package/src/assets/hatching/17.png +0 -0
- package/src/assets/hatching/18.png +0 -0
- package/src/assets/hatching/19.png +0 -0
- package/src/assets/hatching/2.png +0 -0
- package/src/assets/hatching/3.png +0 -0
- package/src/assets/hatching/4.png +0 -0
- package/src/assets/hatching/5.png +0 -0
- package/src/assets/hatching/6.png +0 -0
- package/src/assets/hatching/7.png +0 -0
- package/src/assets/hatching/8.png +0 -0
- package/src/assets/hatching/9.png +0 -0
- package/src/{images → assets/images}/ExamineViewer.png +0 -0
- package/src/{images → assets/images}/FlyViewer.png +0 -0
- package/src/{images → assets/images}/NoneViewer.png +0 -0
- package/src/{images → assets/images}/PlaneViewer.png +0 -0
- package/src/{images → assets/images}/PrimitiveQuality.png +0 -0
- package/src/{images → assets/images}/TextureQuality.png +0 -0
- package/src/{images → assets/images}/Time.png +0 -0
- package/src/{images → assets/images}/Viewpoint.png +0 -0
- package/src/{images → assets/images}/WalkViewer.png +0 -0
- package/src/assets/images/go-next.png +0 -0
- package/src/{images → assets/images}/gtk-fullscreen.png +0 -0
- package/src/{images → assets/images}/gtk-leave-fullscreen.png +0 -0
- package/src/{images → assets/images}/gtk-zoom-fit.png +0 -0
- package/src/{images → assets/images}/gtk-zoom-in.png +0 -0
- package/src/{images → assets/images}/help-about.png +0 -0
- package/src/{images → assets/images}/icon.bw.png +0 -0
- package/src/{images → assets/images}/icon.png +0 -0
- package/src/assets/images/logo.128.png +0 -0
- package/src/{images → assets/images}/logo.bw.png +0 -0
- package/src/{images → assets/images}/logo.png +0 -0
- package/src/assets/linetype/0.png +0 -0
- package/src/assets/linetype/1.png +0 -0
- package/src/assets/linetype/10.png +0 -0
- package/src/assets/linetype/11.png +0 -0
- package/src/assets/linetype/12.png +0 -0
- package/src/assets/linetype/13.png +0 -0
- package/src/assets/linetype/14.png +0 -0
- package/src/assets/linetype/15.png +0 -0
- package/src/assets/linetype/16.png +0 -0
- package/src/assets/linetype/2.png +0 -0
- package/src/assets/linetype/3.png +0 -0
- package/src/assets/linetype/4.png +0 -0
- package/src/assets/linetype/5.png +0 -0
- package/src/assets/linetype/6.png +0 -0
- package/src/assets/linetype/7.png +0 -0
- package/src/assets/linetype/8.png +0 -0
- package/src/assets/linetype/9.png +0 -0
- package/src/assets/shaders/Types.glsl +102 -0
- package/src/assets/shaders/webgl1/Background.fs +16 -0
- package/src/assets/shaders/webgl1/Background.vs +22 -0
- package/src/assets/shaders/webgl1/Depth.fs +16 -0
- package/src/assets/shaders/webgl1/Depth.vs +20 -0
- package/src/assets/shaders/webgl1/Fallback.fs +38 -0
- package/src/assets/shaders/webgl1/Fallback.vs +30 -0
- package/src/assets/shaders/webgl1/FallbackUnlit.fs +21 -0
- package/src/assets/shaders/webgl1/FallbackUnlit.vs +24 -0
- package/src/assets/shaders/webgl1/Gouraud.fs +66 -0
- package/src/assets/shaders/webgl1/Gouraud.vs +147 -0
- package/src/assets/shaders/webgl1/Phong.fs +172 -0
- package/src/assets/shaders/webgl1/Phong.vs +67 -0
- package/src/assets/shaders/webgl1/PointSet.fs +100 -0
- package/src/assets/shaders/webgl1/PointSet.vs +70 -0
- package/src/assets/shaders/webgl1/Unlit.fs +86 -0
- package/src/assets/shaders/webgl1/Unlit.vs +67 -0
- package/src/assets/shaders/webgl1/Wireframe.fs +74 -0
- package/src/assets/shaders/webgl1/Wireframe.vs +63 -0
- package/src/assets/shaders/webgl1/include/ClipPlanes.glsl +16 -0
- package/src/assets/shaders/webgl1/include/Fog.glsl +38 -0
- package/src/assets/shaders/webgl1/include/Hatch.glsl +18 -0
- package/src/{x_ite/Browser/Shaders/Include/Pack.h → assets/shaders/webgl1/include/Pack.glsl} +0 -1
- package/src/assets/shaders/webgl1/include/Perlin.glsl +40 -0
- package/src/{x_ite/Browser/Shaders/Include/Shadow.h → assets/shaders/webgl1/include/Shadow.glsl} +33 -33
- package/src/assets/shaders/webgl1/include/Texture.glsl +488 -0
- package/src/assets/shaders/webgl2/Background.fs +19 -0
- package/src/assets/shaders/webgl2/Background.vs +23 -0
- package/src/assets/shaders/webgl2/Depth.fs +19 -0
- package/src/assets/shaders/webgl2/Depth.vs +21 -0
- package/src/assets/shaders/webgl2/Gouraud.fs +64 -0
- package/src/assets/shaders/webgl2/Gouraud.vs +148 -0
- package/src/assets/shaders/webgl2/Phong.fs +170 -0
- package/src/assets/shaders/webgl2/Phong.vs +68 -0
- package/src/assets/shaders/webgl2/PointSet.fs +99 -0
- package/src/assets/shaders/webgl2/PointSet.vs +71 -0
- package/src/assets/shaders/webgl2/Unlit.fs +85 -0
- package/src/assets/shaders/webgl2/Unlit.vs +68 -0
- package/src/assets/shaders/webgl2/Wireframe.fs +73 -0
- package/src/assets/shaders/webgl2/Wireframe.vs +64 -0
- package/src/assets/shaders/webgl2/include/ClipPlanes.glsl +16 -0
- package/src/assets/shaders/webgl2/include/Fog.glsl +46 -0
- package/src/assets/shaders/webgl2/include/Hatch.glsl +18 -0
- package/src/assets/shaders/webgl2/include/Pack.glsl +51 -0
- package/src/assets/shaders/webgl2/include/Perlin.glsl +40 -0
- package/src/assets/shaders/webgl2/include/Shadow.glsl +324 -0
- package/src/assets/shaders/webgl2/include/Texture.glsl +623 -0
- package/src/bookmarks.js +33 -12
- package/src/dummy.js +1 -0
- package/src/example.html +8 -7
- package/src/examples.js +21 -3
- package/src/lib/ammojs/AmmoJS.js +58 -0
- package/src/lib/ammojs/Makefile +4 -0
- package/src/lib/ammojs/ammo.idl +72 -1
- package/src/lib/ammojs/ammo.js +25 -21
- package/src/lib/jpeg/jpeg.js +1019 -0
- package/src/lib/nurbs/extras/sample.js +137 -80
- package/src/locale/de.po +18 -73
- package/src/locale/fr.po +18 -74
- package/src/spinner.css +18 -6
- package/src/standard/Geospatial/Geodetic.js +43 -43
- package/src/standard/Geospatial/ReferenceEllipsoids.js +1 -1
- package/src/standard/Geospatial/UniversalTransverseMercator.js +42 -42
- package/src/standard/Math/Algorithm.js +22 -39
- package/src/standard/Math/Algorithms/Bezier.js +147 -0
- package/src/standard/Math/Algorithms/MergeSort.js +2 -2
- package/src/standard/Math/Algorithms/PartialSort.js +6 -6
- package/src/standard/Math/Algorithms/QuickSort.js +8 -6
- package/src/standard/Math/Algorithms/SAT.js +4 -8
- package/src/standard/Math/Algorithms/eigendecomposition.js +37 -33
- package/src/standard/Math/Geometry/Box2.js +84 -56
- package/src/standard/Math/Geometry/Box3.js +400 -358
- package/src/standard/Math/Geometry/Camera.js +19 -16
- package/src/standard/Math/Geometry/Cylinder3.js +13 -13
- package/src/standard/Math/Geometry/Line3.js +34 -34
- package/src/standard/Math/Geometry/Plane3.js +15 -15
- package/src/standard/Math/Geometry/Sphere3.js +122 -105
- package/src/standard/Math/Geometry/Spheroid3.js +1 -1
- package/src/standard/Math/Geometry/Triangle2.js +5 -5
- package/src/standard/Math/Geometry/Triangle3.js +12 -14
- package/src/standard/Math/Geometry/ViewVolume.js +303 -106
- package/src/standard/Math/Numbers/Color3.js +26 -23
- package/src/standard/Math/Numbers/Color4.js +9 -9
- package/src/standard/Math/Numbers/Complex.js +13 -17
- package/src/standard/Math/Numbers/Matrix2.js +20 -13
- package/src/standard/Math/Numbers/Matrix3.js +129 -205
- package/src/standard/Math/Numbers/Matrix4.js +136 -257
- package/src/standard/Math/Numbers/Quaternion.js +49 -138
- package/src/standard/Math/Numbers/Rotation4.js +42 -55
- package/src/standard/Math/Numbers/Vector2.js +32 -115
- package/src/standard/Math/Numbers/Vector3.js +46 -151
- package/src/standard/Math/Numbers/Vector4.js +44 -163
- package/src/standard/Math/Utility/BVH.js +21 -20
- package/src/standard/Math/Utility/MatrixStack.js +4 -4
- package/src/standard/Networking/BinaryTransport.js +8 -8
- package/src/standard/Time/MicroTime.js +81 -0
- package/src/standard/Utility/DataStorage.js +11 -14
- package/src/standard/Utility/MapUtilities.js +69 -0
- package/src/standard/Utility/ObjectCache.js +2 -3
- package/src/standard/Utility/Shuffle.js +5 -6
- package/src/tests.js +84 -5
- package/src/x_ite/Base/Events.js +9 -10
- package/src/x_ite/Base/X3DChildObject.js +20 -16
- package/src/x_ite/Base/X3DEventObject.js +3 -7
- package/src/x_ite/Base/X3DObject.js +44 -27
- package/src/x_ite/Basic/FieldDefinitionArray.js +11 -4
- package/src/x_ite/Basic/X3DBaseNode.js +427 -246
- package/src/x_ite/Basic/X3DField.js +48 -69
- package/src/x_ite/Basic/X3DFieldDefinition.js +0 -4
- package/src/x_ite/Basic/X3DObjectArrayField.js +102 -108
- package/src/x_ite/Basic/X3DTypedArrayField.js +194 -163
- package/src/x_ite/Bits/TraverseType.js +2 -5
- package/src/x_ite/Bits/X3DConstants.js +11 -2
- package/src/x_ite/Browser/Core/BrowserOptions.js +89 -68
- package/src/x_ite/Browser/Core/BrowserTimings.js +21 -29
- package/src/x_ite/Browser/Core/ContextMenu.js +139 -60
- package/src/x_ite/Browser/Core/Notification.js +3 -3
- package/src/x_ite/Browser/Core/PrimitiveQuality.js +3 -7
- package/src/x_ite/Browser/Core/Shading.js +3 -7
- package/src/x_ite/Browser/Core/TextureQuality.js +3 -7
- package/src/x_ite/Browser/Core/X3DCoreContext.js +398 -58
- package/src/x_ite/Browser/Core/X3DCoreContext.js.~1~ +714 -0
- package/src/x_ite/Browser/EnvironmentalEffects/X3DEnvironmentalEffectsContext.js +17 -28
- package/src/x_ite/Browser/Followers/X3DArrayChaserTemplate.js +5 -14
- package/src/x_ite/Browser/Followers/X3DArrayFollowerTemplate.js +81 -28
- package/src/x_ite/Browser/Geometry2D/Disk2DOptions.js +53 -44
- package/src/x_ite/Browser/Geometry2D/X3DGeometry2DContext.js +51 -12
- package/src/x_ite/Browser/Geometry3D/X3DGeometry3DContext.js +8 -9
- package/src/x_ite/Browser/Grouping/X3DGroupingContext.js +98 -0
- package/src/x_ite/Browser/KeyDeviceSensor/X3DKeyDeviceSensorContext.js +14 -206
- package/src/x_ite/Browser/Layout/ScreenText.js +226 -254
- package/src/x_ite/Browser/Layout/X3DLayoutContext.js +13 -11
- package/src/x_ite/Browser/Lighting/X3DLightingContext.js +15 -9
- package/src/x_ite/Browser/NURBS/NURBS.js +84 -72
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +125 -83
- package/src/x_ite/Browser/Navigation/FlyViewer.js +14 -9
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +60 -40
- package/src/x_ite/Browser/Navigation/NoneViewer.js +12 -1
- package/src/x_ite/Browser/Navigation/PlaneViewer.js +39 -20
- package/src/x_ite/Browser/Navigation/WalkViewer.js +21 -6
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +110 -85
- package/src/x_ite/Browser/Navigation/X3DNavigationContext.js +11 -6
- package/src/x_ite/Browser/Navigation/X3DViewer.js +73 -48
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +18 -24
- package/src/x_ite/Browser/Networking/urls.js +31 -16
- package/src/x_ite/Browser/ParticleSystems/X3DParticleSystemsContext.js +5 -6
- package/src/x_ite/Browser/Picking/IntersectionType.js +63 -0
- package/src/x_ite/Browser/Picking/MatchCriterion.js +64 -0
- package/src/x_ite/Browser/Picking/SortOrder.js +65 -0
- package/src/x_ite/Browser/Picking/VolumePicker.js +197 -0
- package/src/x_ite/Browser/Picking/X3DPickingContext.js +130 -0
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +26 -20
- package/src/x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext.js +17 -10
- package/src/x_ite/Browser/Rendering/X3DRenderingContext.js +38 -27
- package/src/x_ite/Browser/RigidBodyPhysics/AppliedParametersType.js +70 -0
- package/src/x_ite/Browser/Shaders/Shader.js +112 -92
- package/src/x_ite/Browser/Shaders/ShaderSource.js +140 -0
- package/src/x_ite/Browser/Shaders/ShaderTest.js +92 -77
- package/src/x_ite/Browser/Shaders/X3DShadersContext.js +134 -74
- package/src/x_ite/Browser/Shape/AlphaMode.js +65 -0
- package/src/x_ite/Browser/Shape/LineStipples.xcf +0 -0
- package/src/x_ite/Browser/Shape/X3DShapeContext.js +108 -4
- package/src/x_ite/Browser/Text/PolygonText.js +153 -170
- package/src/x_ite/Browser/Text/TextAlignment.js +3 -7
- package/src/x_ite/Browser/Text/X3DTextContext.js +38 -30
- package/src/x_ite/Browser/Text/X3DTextGeometry.js +49 -74
- package/src/x_ite/Browser/Texturing/MultiTextureFunctionType.js +64 -0
- package/src/x_ite/Browser/Texturing/MultiTextureModeType.js +81 -0
- package/src/x_ite/Browser/Texturing/MultiTextureSourceType.js +65 -0
- package/src/x_ite/Browser/Texturing/TextureCoordinateGeneratorModeType.js +73 -0
- package/src/x_ite/Browser/Texturing/X3DTexturingContext.js +147 -45
- package/src/x_ite/Browser/Texturing3D/DICOMParser.js +1126 -0
- package/src/x_ite/Browser/Texturing3D/NRRDParser.js +686 -0
- package/src/x_ite/Browser/Time/X3DTimeContext.js +20 -17
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/VolumeRendering/VolumeStyle.fs +120 -0
- package/src/x_ite/Browser/VolumeRendering/VolumeStyle.vs +28 -0
- package/src/x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext.js +114 -0
- package/src/x_ite/Browser/X3DBrowser.js +282 -224
- package/src/x_ite/Browser/X3DBrowserContext.js +60 -27
- package/src/x_ite/Components/Annotation/AnnotationLayer.js +108 -0
- package/src/x_ite/Components/Annotation/AnnotationTarget.js +101 -0
- package/src/x_ite/Components/Annotation/GroupAnnotation.js +112 -0
- package/src/x_ite/Components/Annotation/IconAnnotation.js +110 -0
- package/src/x_ite/Components/Annotation/TextAnnotation.js +102 -0
- package/src/x_ite/Components/Annotation/URLAnnotation.js +101 -0
- package/src/x_ite/Components/Annotation/X3DAnnotationNode.js +76 -0
- package/src/x_ite/Components/CADGeometry/CADAssembly.js +4 -4
- package/src/x_ite/Components/CADGeometry/CADFace.js +135 -30
- package/src/x_ite/Components/CADGeometry/CADLayer.js +3 -18
- package/src/x_ite/Components/CADGeometry/CADPart.js +4 -8
- package/src/x_ite/Components/CADGeometry/IndexedQuadSet.js +18 -10
- package/src/x_ite/Components/Core/WorldInfo.js +16 -6
- package/src/x_ite/Components/Core/X3DBindableNode.js +4 -33
- package/src/x_ite/Components/Core/X3DChildNode.js +14 -1
- package/src/x_ite/Components/Core/X3DNode.js +0 -63
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +128 -168
- package/src/x_ite/Components/Core.js +6 -9
- package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +38 -46
- package/src/x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture.js +31 -30
- package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +42 -57
- package/src/x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode.js +36 -48
- package/src/x_ite/Components/DIS/EspduTransform.js +12 -6
- package/src/x_ite/Components/DIS/ReceiverPdu.js +12 -6
- package/src/x_ite/Components/DIS/SignalPdu.js +12 -6
- package/src/x_ite/Components/DIS/TransmitterPdu.js +12 -6
- package/src/x_ite/Components/EnvironmentalEffects/Fog.js +5 -16
- package/src/x_ite/Components/EnvironmentalEffects/FogCoordinate.js +55 -3
- package/src/x_ite/Components/EnvironmentalEffects/LocalFog.js +3 -5
- package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +116 -116
- package/src/x_ite/Components/EnvironmentalEffects/X3DFogObject.js +5 -6
- package/src/x_ite/Components/EnvironmentalEffects.js +6 -9
- package/src/x_ite/Components/EnvironmentalSensor/ProximitySensor.js +116 -117
- package/src/x_ite/Components/EnvironmentalSensor/TransformSensor.js +169 -49
- package/src/x_ite/Components/EnvironmentalSensor/VisibilitySensor.js +31 -27
- package/src/x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode.js +12 -5
- package/src/x_ite/Components/EnvironmentalSensor.js +6 -9
- package/src/x_ite/Components/Followers/ColorChaser.js +1 -3
- package/src/x_ite/Components/Followers/ColorDamper.js +1 -3
- package/src/x_ite/Components/Followers/CoordinateChaser.js +1 -7
- package/src/x_ite/Components/Followers/CoordinateDamper.js +0 -6
- package/src/x_ite/Components/Followers/OrientationChaser.js +7 -3
- package/src/x_ite/Components/Followers/OrientationDamper.js +7 -3
- package/src/x_ite/Components/Followers/PositionChaser.js +1 -3
- package/src/x_ite/Components/Followers/PositionChaser2D.js +1 -3
- package/src/x_ite/Components/Followers/PositionDamper.js +1 -3
- package/src/x_ite/Components/Followers/PositionDamper2D.js +1 -3
- package/src/x_ite/Components/Followers/ScalarChaser.js +1 -3
- package/src/x_ite/Components/Followers/ScalarDamper.js +1 -3
- package/src/x_ite/Components/Followers/TexCoordChaser2D.js +1 -7
- package/src/x_ite/Components/Followers/TexCoordDamper2D.js +1 -7
- package/src/x_ite/Components/Followers/X3DChaserNode.js +20 -18
- package/src/x_ite/Components/Followers/X3DDamperNode.js +5 -7
- package/src/x_ite/Components/Followers/X3DFollowerNode.js +5 -7
- package/src/x_ite/Components/Followers.js +6 -9
- package/src/x_ite/Components/Geometry2D/Arc2D.js +10 -14
- package/src/x_ite/Components/Geometry2D/ArcClose2D.js +87 -86
- package/src/x_ite/Components/Geometry2D/Circle2D.js +1 -3
- package/src/x_ite/Components/Geometry2D/Disk2D.js +43 -58
- package/src/x_ite/Components/Geometry2D/Polyline2D.js +4 -8
- package/src/x_ite/Components/Geometry2D/Polypoint2D.js +3 -5
- package/src/x_ite/Components/Geometry2D/TriangleSet2D.js +20 -16
- package/src/x_ite/Components/Geometry3D/Cone.js +1 -3
- package/src/x_ite/Components/Geometry3D/Cylinder.js +3 -5
- package/src/x_ite/Components/Geometry3D/ElevationGrid.js +35 -17
- package/src/x_ite/Components/Geometry3D/Extrusion.js +125 -107
- package/src/x_ite/Components/Geometry3D/IndexedFaceSet.js +164 -142
- package/src/x_ite/Components/Geometry3D/Sphere.js +3 -5
- package/src/x_ite/Components/Geometry3D.js +6 -9
- package/src/x_ite/Components/Geospatial/GeoElevationGrid.js +7 -7
- package/src/x_ite/Components/Geospatial/GeoLOD.js +207 -124
- package/src/x_ite/Components/Geospatial/GeoLocation.js +6 -6
- package/src/x_ite/Components/Geospatial/GeoProximitySensor.js +5 -3
- package/src/x_ite/Components/Geospatial/GeoTransform.js +9 -9
- package/src/x_ite/Components/Geospatial/GeoViewpoint.js +27 -27
- package/src/x_ite/Components/Grouping/Group.js +3 -3
- package/src/x_ite/Components/Grouping/StaticGroup.js +49 -56
- package/src/x_ite/Components/Grouping/Switch.js +171 -21
- package/src/x_ite/Components/Grouping/Transform.js +3 -3
- package/src/x_ite/Components/Grouping/X3DBoundedObject.js +68 -15
- package/src/x_ite/Components/Grouping/X3DGroupingNode.js +339 -180
- package/src/x_ite/Components/Grouping/X3DTransformMatrix3DNode.js +51 -25
- package/src/x_ite/Components/Grouping/X3DTransformNode.js +2 -4
- package/src/x_ite/Components/Grouping.js +6 -9
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimDisplacer.js +4 -4
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimHumanoid.js +24 -14
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimJoint.js +44 -20
- package/src/x_ite/Components/HAnim/HAnimMotion.js +113 -0
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimSegment.js +6 -4
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimSite.js +4 -4
- package/src/x_ite/Components/Interpolation/OrientationInterpolator.js +8 -7
- package/src/x_ite/Components/Interpolation/SquadOrientationInterpolator.js +4 -3
- package/src/x_ite/Components/Interpolation.js +6 -9
- package/src/x_ite/Components/KeyDeviceSensor/X3DKeyDeviceSensorNode.js +1 -3
- package/src/x_ite/Components/Layering/Layer.js +12 -2
- package/src/x_ite/Components/Layering/LayerSet.js +4 -6
- package/src/x_ite/Components/Layering/Viewport.js +8 -8
- package/src/x_ite/Components/Layering/X3DLayerNode.js +67 -62
- package/src/x_ite/Components/Layering.js +6 -9
- package/src/x_ite/Components/Layout/LayoutGroup.js +18 -15
- package/src/x_ite/Components/Layout/LayoutLayer.js +10 -5
- package/src/x_ite/Components/Layout/ScreenFontStyle.js +12 -14
- package/src/x_ite/Components/Layout/ScreenGroup.js +25 -31
- package/src/x_ite/Components/Lighting/DirectionalLight.js +27 -22
- package/src/x_ite/Components/Lighting/PointLight.js +26 -29
- package/src/x_ite/Components/Lighting/SpotLight.js +29 -24
- package/src/x_ite/Components/Lighting/X3DLightNode.js +85 -66
- package/src/x_ite/Components/Lighting.js +6 -9
- package/src/x_ite/Components/NURBS/Contour2D.js +45 -1
- package/src/x_ite/Components/NURBS/ContourPolyline2D.js +53 -25
- package/src/x_ite/Components/NURBS/NurbsCurve.js +21 -24
- package/src/x_ite/Components/NURBS/NurbsCurve2D.js +44 -25
- package/src/x_ite/Components/NURBS/NurbsOrientationInterpolator.js +19 -21
- package/src/x_ite/Components/NURBS/NurbsPositionInterpolator.js +18 -20
- package/src/x_ite/Components/NURBS/NurbsSet.js +17 -6
- package/src/x_ite/Components/NURBS/NurbsSweptSurface.js +2 -2
- package/src/x_ite/Components/NURBS/NurbsSwungSurface.js +2 -2
- package/src/x_ite/Components/NURBS/NurbsTextureCoordinate.js +15 -16
- package/src/x_ite/Components/NURBS/NurbsTrimmedSurface.js +38 -1
- package/src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js +116 -43
- package/src/x_ite/Components/Navigation/Billboard.js +12 -11
- package/src/x_ite/Components/Navigation/Collision.js +10 -8
- package/src/x_ite/Components/Navigation/LOD.js +207 -59
- package/src/x_ite/Components/Navigation/NavigationInfo.js +29 -43
- package/src/x_ite/Components/Navigation/OrthoViewpoint.js +99 -18
- package/src/x_ite/Components/Navigation/Viewpoint.js +15 -15
- package/src/x_ite/Components/Navigation/ViewpointGroup.js +12 -5
- package/src/x_ite/Components/Navigation/X3DViewpointNode.js +137 -148
- package/src/x_ite/Components/Navigation.js +6 -9
- package/src/x_ite/Components/Networking/Anchor.js +22 -24
- package/src/x_ite/Components/Networking/Inline.js +63 -44
- package/src/x_ite/Components/Networking/X3DUrlObject.js +88 -8
- package/src/x_ite/Components/Networking.js +6 -9
- package/src/x_ite/Components/ParticleSystems/BoundedPhysicsModel.js +2 -2
- package/src/x_ite/Components/ParticleSystems/ParticleSystem.js +215 -199
- package/src/x_ite/Components/ParticleSystems/PolylineEmitter.js +44 -39
- package/src/x_ite/Components/ParticleSystems/SurfaceEmitter.js +48 -46
- package/src/x_ite/Components/ParticleSystems/VolumeEmitter.js +121 -117
- package/src/x_ite/Components/ParticleSystems/WindPhysicsModel.js +21 -18
- package/src/x_ite/Components/ParticleSystems/X3DParticleEmitterNode.js +20 -22
- package/src/x_ite/Components/Picking/LinePickSensor.js +251 -6
- package/src/x_ite/Components/Picking/PickableGroup.js +120 -7
- package/src/x_ite/Components/Picking/PointPickSensor.js +260 -8
- package/src/x_ite/Components/Picking/PrimitivePickSensor.js +174 -4
- package/src/x_ite/Components/Picking/VolumePickSensor.js +150 -4
- package/src/x_ite/Components/Picking/X3DPickSensorNode.js +377 -4
- package/src/x_ite/Components/Picking/X3DPickableObject.js +21 -1
- package/src/x_ite/Components/PointingDeviceSensor/CylinderSensor.js +26 -11
- package/src/x_ite/Components/PointingDeviceSensor.js +6 -9
- package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorParallel.js +282 -0
- package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorPerspective.js +227 -0
- package/src/x_ite/Components/ProjectiveTextureMapping/X3DTextureProjectorNode.js +217 -0
- package/src/x_ite/Components/Rendering/ClipPlane.js +8 -10
- package/src/x_ite/Components/Rendering/Color.js +22 -13
- package/src/x_ite/Components/Rendering/ColorRGBA.js +28 -16
- package/src/x_ite/Components/Rendering/IndexedLineSet.js +52 -33
- package/src/x_ite/Components/Rendering/IndexedTriangleFanSet.js +17 -14
- package/src/x_ite/Components/Rendering/IndexedTriangleSet.js +9 -4
- package/src/x_ite/Components/Rendering/IndexedTriangleStripSet.js +17 -17
- package/src/x_ite/Components/Rendering/LineSet.js +44 -27
- package/src/x_ite/Components/Rendering/Normal.js +20 -4
- package/src/x_ite/Components/Rendering/PointSet.js +38 -16
- package/src/x_ite/Components/Rendering/TriangleFanSet.js +7 -9
- package/src/x_ite/Components/Rendering/TriangleStripSet.js +6 -8
- package/src/x_ite/Components/Rendering/X3DColorNode.js +16 -1
- package/src/x_ite/Components/Rendering/X3DComposedGeometryNode.js +80 -55
- package/src/x_ite/Components/Rendering/X3DCoordinateNode.js +11 -13
- package/src/x_ite/Components/Rendering/X3DGeometryNode.js +622 -477
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +159 -90
- package/src/x_ite/Components/Rendering.js +6 -9
- package/src/x_ite/Components/RigidBodyPhysics/BallJoint.js +8 -10
- package/src/x_ite/Components/RigidBodyPhysics/CollidableOffset.js +142 -26
- package/src/x_ite/Components/RigidBodyPhysics/CollidableShape.js +312 -128
- package/src/x_ite/Components/RigidBodyPhysics/CollisionCollection.js +91 -7
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSensor.js +189 -4
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSpace.js +82 -4
- package/src/x_ite/Components/RigidBodyPhysics/Contact.js +1 -1
- package/src/x_ite/Components/RigidBodyPhysics/DoubleAxisHingeJoint.js +49 -37
- package/src/x_ite/Components/RigidBodyPhysics/RigidBody.js +45 -39
- package/src/x_ite/Components/RigidBodyPhysics/RigidBodyCollection.js +41 -34
- package/src/x_ite/Components/RigidBodyPhysics/SingleAxisHingeJoint.js +25 -20
- package/src/x_ite/Components/RigidBodyPhysics/SliderJoint.js +8 -10
- package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollidableNode.js +15 -16
- package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollisionSpaceNode.js +2 -4
- package/src/x_ite/Components/Scripting/Script.js +147 -101
- package/src/x_ite/Components/Scripting/X3DScriptNode.js +2 -4
- package/src/x_ite/Components/Shaders/ComposedShader.js +17 -19
- package/src/x_ite/Components/Shaders/FloatVertexAttribute.js +9 -3
- package/src/x_ite/Components/Shaders/Matrix3VertexAttribute.js +10 -3
- package/src/x_ite/Components/Shaders/Matrix4VertexAttribute.js +10 -3
- package/src/x_ite/Components/Shaders/PackagedShader.js +18 -14
- package/src/x_ite/Components/Shaders/ShaderPart.js +30 -18
- package/src/x_ite/Components/Shaders/ShaderProgram.js +15 -11
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +681 -558
- package/src/x_ite/Components/Shaders/X3DShaderNode.js +48 -12
- package/src/x_ite/Components/Shaders.js +15 -18
- package/src/x_ite/Components/Shape/Appearance.js +153 -77
- package/src/x_ite/Components/Shape/FillProperties.js +63 -4
- package/src/x_ite/Components/Shape/LineProperties.js +27 -5
- package/src/x_ite/Components/Shape/Material.js +48 -62
- package/src/x_ite/Components/Shape/PointProperties.js +162 -0
- package/src/x_ite/Components/Shape/Shape.js +86 -39
- package/src/x_ite/Components/Shape/TwoSidedMaterial.js +53 -59
- package/src/x_ite/Components/Shape/UnlitMaterial.js +109 -0
- package/src/x_ite/Components/Shape/X3DAppearanceNode.js +9 -6
- package/src/x_ite/Components/Shape/X3DMaterialNode.js +16 -3
- package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +111 -0
- package/src/x_ite/Components/Shape/X3DShapeNode.js +41 -17
- package/src/x_ite/Components/Shape.js +22 -16
- package/src/x_ite/Components/Sound/AudioClip.js +36 -50
- package/src/x_ite/Components/Sound/Sound.js +36 -36
- package/src/x_ite/Components/Sound/X3DSoundSourceNode.js +18 -6
- package/src/x_ite/Components/Sound.js +6 -9
- package/src/x_ite/Components/Text/FontStyle.js +10 -12
- package/src/x_ite/Components/Text/Text.js +6 -6
- package/src/x_ite/Components/Text/X3DFontStyleNode.js +56 -87
- package/src/x_ite/Components/Text.js +6 -9
- package/src/x_ite/Components/Texturing/ImageTexture.js +48 -63
- package/src/x_ite/Components/Texturing/MovieTexture.js +42 -56
- package/src/x_ite/Components/Texturing/MultiTexture.js +236 -11
- package/src/x_ite/Components/Texturing/MultiTextureCoordinate.js +73 -6
- package/src/x_ite/Components/Texturing/MultiTextureTransform.js +45 -4
- package/src/x_ite/Components/Texturing/PixelTexture.js +45 -11
- package/src/x_ite/Components/Texturing/TextureCoordinate.js +32 -17
- package/src/x_ite/Components/Texturing/TextureCoordinateGenerator.js +68 -8
- package/src/x_ite/Components/Texturing/TextureProperties.js +96 -65
- package/src/x_ite/Components/Texturing/TextureTransform.js +55 -47
- package/src/x_ite/Components/Texturing/X3DSingleTextureCoordinateNode.js +91 -0
- package/src/x_ite/Components/Texturing/X3DSingleTextureNode.js +183 -0
- package/src/x_ite/Components/Texturing/X3DSingleTextureTransformNode.js +77 -0
- package/src/x_ite/Components/Texturing/X3DTexture2DNode.js +42 -95
- package/src/x_ite/Components/Texturing/X3DTexture2DNode.js.~1~ +209 -0
- package/src/x_ite/Components/Texturing/X3DTextureCoordinateNode.js +3 -17
- package/src/x_ite/Components/Texturing/X3DTextureNode.js +6 -67
- package/src/x_ite/Components/Texturing/X3DTextureTransformNode.js +4 -11
- package/src/x_ite/Components/Texturing.js +31 -25
- package/src/x_ite/Components/Texturing3D/ComposedTexture3D.js +88 -4
- package/src/x_ite/Components/Texturing3D/ImageTexture3D.js +105 -13
- package/src/x_ite/Components/Texturing3D/PixelTexture3D.js +124 -4
- package/src/x_ite/Components/Texturing3D/TextureCoordinate3D.js +35 -18
- package/src/x_ite/Components/Texturing3D/TextureCoordinate4D.js +35 -18
- package/src/x_ite/Components/Texturing3D/TextureTransform3D.js +41 -31
- package/src/x_ite/Components/Texturing3D/TextureTransformMatrix3D.js +18 -11
- package/src/x_ite/Components/Texturing3D/X3DTexture3DNode.js +110 -6
- package/src/x_ite/Components/Time/TimeSensor.js +23 -19
- package/src/x_ite/Components/Time/X3DTimeDependentNode.js +11 -7
- package/src/x_ite/Components/Time.js +6 -9
- package/src/x_ite/Components/VolumeRendering/BlendedVolumeStyle.js +309 -8
- package/src/x_ite/Components/VolumeRendering/BoundaryEnhancementVolumeStyle.js +58 -4
- package/src/x_ite/Components/VolumeRendering/CartoonVolumeStyle.js +217 -6
- package/src/x_ite/Components/VolumeRendering/ComposedVolumeStyle.js +132 -3
- package/src/x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle.js +86 -5
- package/src/x_ite/Components/VolumeRendering/IsoSurfaceVolumeData.js +309 -11
- package/src/x_ite/Components/VolumeRendering/OpacityMapVolumeStyle.js +85 -3
- package/src/x_ite/Components/VolumeRendering/ProjectionVolumeStyle.js +134 -2
- package/src/x_ite/Components/VolumeRendering/SegmentedVolumeData.js +222 -9
- package/src/x_ite/Components/VolumeRendering/ShadedVolumeStyle.js +191 -8
- package/src/x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle.js +85 -6
- package/src/x_ite/Components/VolumeRendering/ToneMappedVolumeStyle.js +95 -5
- package/src/x_ite/Components/VolumeRendering/VolumeData.js +153 -8
- package/src/x_ite/Components/VolumeRendering/X3DVolumeDataNode.js +155 -3
- package/src/x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode.js +62 -0
- package/src/x_ite/Components/X_ITE/BlendMode.js +51 -51
- package/src/x_ite/Components.js +11 -16
- package/src/x_ite/Configuration/ComponentInfo.js +12 -6
- package/src/x_ite/Configuration/ComponentInfoArray.js +4 -7
- package/src/x_ite/Configuration/ProfileInfo.js +10 -6
- package/src/x_ite/Configuration/SupportedComponents.js +66 -40
- package/src/x_ite/Configuration/SupportedNodes.js +22 -6
- package/src/x_ite/Configuration/SupportedProfiles.js +91 -89
- package/src/x_ite/Configuration/UnitInfo.js +12 -2
- package/src/x_ite/Configuration/X3DInfoArray.js +37 -18
- package/src/x_ite/Execution/BindableList.js +63 -38
- package/src/x_ite/Execution/BindableStack.js +63 -71
- package/src/x_ite/Execution/ExportedNode.js +25 -2
- package/src/x_ite/Execution/ImportedNode.js +122 -39
- package/src/x_ite/Execution/Scene.js +22 -14
- package/src/x_ite/Execution/World.js +22 -19
- package/src/x_ite/Execution/X3DExecutionContext.js +381 -221
- package/src/x_ite/Execution/X3DScene.js +213 -53
- package/src/x_ite/{Error.js → Fallback.js} +26 -29
- package/src/x_ite/Fields/ArrayFields.js +176 -57
- package/src/x_ite/Fields/SFBool.js +6 -5
- package/src/x_ite/Fields/SFColor.js +24 -21
- package/src/x_ite/Fields/SFColorRGBA.js +23 -23
- package/src/x_ite/Fields/SFDouble.js +6 -5
- package/src/x_ite/Fields/SFFloat.js +7 -6
- package/src/x_ite/Fields/SFImage.js +37 -36
- package/src/x_ite/Fields/SFInt32.js +5 -4
- package/src/x_ite/Fields/SFMatrix3.js +19 -15
- package/src/x_ite/Fields/SFMatrix4.js +19 -15
- package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +10 -2
- package/src/x_ite/Fields/SFNode.js +105 -53
- package/src/x_ite/Fields/SFNodeCache.js +93 -0
- package/src/x_ite/Fields/SFRotation.js +31 -27
- package/src/x_ite/Fields/SFString.js +9 -8
- package/src/x_ite/Fields/SFTime.js +6 -5
- package/src/x_ite/Fields/SFVec2.js +17 -13
- package/src/x_ite/Fields/SFVec3.js +21 -17
- package/src/x_ite/Fields/SFVec4.js +24 -20
- package/src/x_ite/Fields/SFVecPrototypeTemplate.js +8 -4
- package/src/x_ite/Fields.js +2 -6
- package/src/x_ite/InputOutput/FileLoader.js +174 -190
- package/src/x_ite/InputOutput/Generator.js +133 -104
- package/src/x_ite/Parser/HTMLSupport.js +3 -596
- package/src/x_ite/Parser/JSONParser.js +348 -245
- package/src/x_ite/Parser/Parser.js +314 -303
- package/src/x_ite/Parser/X3DParser.js +41 -20
- package/src/x_ite/Parser/XMLParser.js +178 -60
- package/src/x_ite/Prototype/ExternProtoDeclarationArray.js +17 -0
- package/src/x_ite/Prototype/ProtoDeclarationArray.js +17 -0
- package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +104 -44
- package/src/x_ite/Prototype/X3DProtoDeclaration.js +111 -42
- package/src/x_ite/Prototype/X3DProtoDeclarationNode.js +16 -14
- package/src/x_ite/Rendering/DependentRenderer.js +7 -9
- package/src/x_ite/Rendering/TextureBuffer.js +24 -19
- package/src/x_ite/Rendering/X3DRenderObject.js +455 -428
- package/src/x_ite/Routing/RouteArray.js +34 -11
- package/src/x_ite/Routing/X3DRoute.js +60 -60
- package/src/x_ite/Routing/X3DRoutingContext.js +6 -6
- package/src/x_ite/X3D.js +30 -37
- package/src/x_ite.config.js +40 -5
- package/src/x_ite.css +165 -45
- package/src/x_ite.html +49 -29
- package/src/x_ite.js +86 -25
- package/x_ite.min.html +49 -22
- package/.bzrignore +0 -3
- package/AUTHORS.md +0 -6
- package/STYLE_GUIDE.md +0 -51
- package/X_ITE.sln +0 -54
- package/X_ITE.userprefs +0 -14
- package/build/build.mdproj +0 -47
- package/build/cad-geometry.build.js +0 -15
- package/build/geospatial.build.js +0 -15
- package/build/h-anim.build.js +0 -15
- package/build/nurbs.build.js +0 -15
- package/build/particle-systems.build.js +0 -15
- package/build/parts/cad-geometry.end.frag +0 -2
- package/build/parts/cad-geometry.start.frag +0 -6
- package/build/parts/geospatial.end.frag +0 -2
- package/build/parts/geospatial.start.frag +0 -6
- package/build/parts/h-anim.end.frag +0 -2
- package/build/parts/h-anim.start.frag +0 -6
- package/build/parts/nurbs.end.frag +0 -2
- package/build/parts/nurbs.start.frag +0 -6
- package/build/parts/particle-systems.end.frag +0 -2
- package/build/parts/particle-systems.start.frag +0 -6
- package/build/parts/rigid-body-physics.end.frag +0 -2
- package/build/parts/rigid-body-physics.start.frag +0 -6
- package/build/parts/texturing-3d.end.frag +0 -2
- package/build/parts/texturing-3d.start.frag +0 -6
- package/build/parts/x_ite.end.frag +0 -9
- package/build/parts/x_ite.start.frag +0 -6
- package/build/rigid-body-physics.build.js +0 -15
- package/build/texturing-3d.build.js +0 -15
- package/dist/components/README +0 -3
- package/dist/components/cad-geometry.min.js +0 -1
- package/dist/components/geospatial.min.js +0 -2
- package/dist/components/h-anim.min.js +0 -1
- package/dist/components/nurbs.min.js +0 -2
- package/dist/components/particle-systems.min.js +0 -2
- package/dist/components/rigid-body-physics.js +0 -3761
- package/dist/components/rigid-body-physics.min.js +0 -56
- package/dist/components/texturing-3d.min.js +0 -1
- package/dist/dist.mdproj +0 -61
- package/dist/images/logo.128.png +0 -0
- package/fonts/fonts.mdproj +0 -29
- package/meta/meta.mdproj +0 -35
- package/src/components/cad-geometry.config.js +0 -56
- package/src/components/geospatial.config.js +0 -56
- package/src/components/h-anim.config.js +0 -56
- package/src/components/nurbs.config.js +0 -61
- package/src/components/particle-systems.config.js +0 -56
- package/src/components/rigid-body-physics.config.js +0 -61
- package/src/components/texturing-3d.config.js +0 -56
- package/src/images/logo.128.png +0 -0
- package/src/locale/de.mo +0 -0
- package/src/locale/fr.mo +0 -0
- package/src/src.mdproj +0 -698
- package/src/standard/Networking/URI.js +0 -785
- package/src/test.x3d +0 -225
- package/src/x_ite/Browser/Shaders/Background.fs +0 -31
- package/src/x_ite/Browser/Shaders/Background.vs +0 -23
- package/src/x_ite/Browser/Shaders/Depth.fs +0 -32
- package/src/x_ite/Browser/Shaders/Depth.vs +0 -21
- package/src/x_ite/Browser/Shaders/Gouraud.fs +0 -135
- package/src/x_ite/Browser/Shaders/Gouraud.vs +0 -145
- package/src/x_ite/Browser/Shaders/Phong.fs +0 -269
- package/src/x_ite/Browser/Shaders/Phong.vs +0 -47
- package/src/x_ite/Browser/Shaders/PointSet.fs +0 -86
- package/src/x_ite/Browser/Shaders/Types.h +0 -55
- package/src/x_ite/Browser/Shaders/Wireframe.fs +0 -82
- package/src/x_ite/Browser/Shaders/Wireframe.vs +0 -61
- package/src/x_ite/Components/DIS.js +0 -91
- package/src/x_ite/Components/Picking.js +0 -94
- package/src/x_ite/Components/VolumeRendering.js +0 -121
|
@@ -48,51 +48,66 @@
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
define ([
|
|
51
|
-
"x_ite/Fields",
|
|
52
51
|
"x_ite/Bits/X3DCast",
|
|
53
52
|
"x_ite/Bits/X3DConstants",
|
|
54
53
|
"x_ite/Components/Navigation/OrthoViewpoint",
|
|
55
54
|
"standard/Math/Numbers/Matrix3",
|
|
56
55
|
],
|
|
57
|
-
function (
|
|
58
|
-
X3DCast,
|
|
56
|
+
function (X3DCast,
|
|
59
57
|
X3DConstants,
|
|
60
58
|
OrthoViewpoint,
|
|
61
59
|
Matrix3)
|
|
62
60
|
{
|
|
63
61
|
"use strict";
|
|
64
62
|
|
|
65
|
-
var matrix3 = new Matrix3 ();
|
|
66
|
-
|
|
67
63
|
function X3DProgrammableShaderObject (executionContext)
|
|
68
64
|
{
|
|
69
65
|
this .addType (X3DConstants .X3DProgrammableShaderObject);
|
|
70
66
|
|
|
71
|
-
this .x3d_ClipPlane
|
|
72
|
-
this .x3d_LightType
|
|
73
|
-
this .x3d_LightOn
|
|
74
|
-
this .x3d_LightColor
|
|
75
|
-
this .x3d_LightIntensity
|
|
76
|
-
this .x3d_LightAmbientIntensity
|
|
77
|
-
this .x3d_LightAttenuation
|
|
78
|
-
this .x3d_LightLocation
|
|
79
|
-
this .x3d_LightDirection
|
|
80
|
-
this .x3d_LightBeamWidth
|
|
81
|
-
this .x3d_LightCutOffAngle
|
|
82
|
-
this .x3d_LightRadius
|
|
83
|
-
this .x3d_LightMatrix
|
|
84
|
-
this .x3d_ShadowIntensity
|
|
85
|
-
this .x3d_ShadowColor
|
|
86
|
-
this .x3d_ShadowBias
|
|
87
|
-
this .x3d_ShadowMatrix
|
|
88
|
-
this .x3d_ShadowMapSize
|
|
89
|
-
this .x3d_ShadowMap
|
|
90
|
-
|
|
91
|
-
this .
|
|
92
|
-
this .
|
|
93
|
-
this .
|
|
94
|
-
|
|
95
|
-
this .
|
|
67
|
+
this .x3d_ClipPlane = [ ];
|
|
68
|
+
this .x3d_LightType = [ ];
|
|
69
|
+
this .x3d_LightOn = [ ];
|
|
70
|
+
this .x3d_LightColor = [ ];
|
|
71
|
+
this .x3d_LightIntensity = [ ];
|
|
72
|
+
this .x3d_LightAmbientIntensity = [ ];
|
|
73
|
+
this .x3d_LightAttenuation = [ ];
|
|
74
|
+
this .x3d_LightLocation = [ ];
|
|
75
|
+
this .x3d_LightDirection = [ ];
|
|
76
|
+
this .x3d_LightBeamWidth = [ ];
|
|
77
|
+
this .x3d_LightCutOffAngle = [ ];
|
|
78
|
+
this .x3d_LightRadius = [ ];
|
|
79
|
+
this .x3d_LightMatrix = [ ];
|
|
80
|
+
this .x3d_ShadowIntensity = [ ];
|
|
81
|
+
this .x3d_ShadowColor = [ ];
|
|
82
|
+
this .x3d_ShadowBias = [ ];
|
|
83
|
+
this .x3d_ShadowMatrix = [ ];
|
|
84
|
+
this .x3d_ShadowMapSize = [ ];
|
|
85
|
+
this .x3d_ShadowMap = [ ];
|
|
86
|
+
this .x3d_TextureType = [ ];
|
|
87
|
+
this .x3d_Texture2D = [ ];
|
|
88
|
+
this .x3d_Texture3D = [ ];
|
|
89
|
+
this .x3d_CubeMapTexture = [ ];
|
|
90
|
+
this .x3d_MultiTextureMode = [ ];
|
|
91
|
+
this .x3d_MultiTextureAlphaMode = [ ];
|
|
92
|
+
this .x3d_MultiTextureSource = [ ];
|
|
93
|
+
this .x3d_MultiTextureFunction = [ ];
|
|
94
|
+
this .x3d_TextureCoordinateGeneratorMode = [ ];
|
|
95
|
+
this .x3d_TextureCoordinateGeneratorParameter = [ ];
|
|
96
|
+
this .x3d_ProjectiveTexture = [ ];
|
|
97
|
+
this .x3d_ProjectiveTextureMatrix = [ ];
|
|
98
|
+
this .x3d_ProjectiveTextureLocation = [ ];
|
|
99
|
+
this .x3d_TexCoord = [ ];
|
|
100
|
+
this .x3d_TextureMatrix = [ ];
|
|
101
|
+
|
|
102
|
+
this .numClipPlanes = 0;
|
|
103
|
+
this .fogNode = null;
|
|
104
|
+
this .numLights = 0;
|
|
105
|
+
this .numGlobalLights = 0;
|
|
106
|
+
this .lightNodes = [ ];
|
|
107
|
+
this .numProjectiveTextures = 0;
|
|
108
|
+
this .numGlobalProjectiveTextures = 0;
|
|
109
|
+
this .projectiveTextureNodes = [ ];
|
|
110
|
+
this .textures = new Map ();
|
|
96
111
|
}
|
|
97
112
|
|
|
98
113
|
X3DProgrammableShaderObject .prototype =
|
|
@@ -100,19 +115,11 @@ function (Fields,
|
|
|
100
115
|
constructor: X3DProgrammableShaderObject,
|
|
101
116
|
initialize: function ()
|
|
102
117
|
{
|
|
103
|
-
|
|
118
|
+
const browser = this .getBrowser ();
|
|
104
119
|
|
|
105
120
|
this .x3d_MaxClipPlanes = browser .getMaxClipPlanes ();
|
|
106
121
|
this .x3d_MaxLights = browser .getMaxLights ();
|
|
107
122
|
this .x3d_MaxTextures = browser .getMaxTextures ();
|
|
108
|
-
|
|
109
|
-
var defaultClipPlanes = [ ];
|
|
110
|
-
|
|
111
|
-
for (var i = 0, length = this .x3d_MaxClipPlanes; i < length; ++ i)
|
|
112
|
-
defaultClipPlanes .push (0, 0, -1, 0);
|
|
113
|
-
|
|
114
|
-
this .defaultClipPlanesArray = new Float32Array (defaultClipPlanes);
|
|
115
|
-
this .textureTypeArray = new Int32Array (this .x3d_MaxTextures);
|
|
116
123
|
},
|
|
117
124
|
hasUserDefinedFields: function ()
|
|
118
125
|
{
|
|
@@ -120,17 +127,15 @@ function (Fields,
|
|
|
120
127
|
},
|
|
121
128
|
bindAttributeLocations: function (gl, program)
|
|
122
129
|
{
|
|
123
|
-
gl .bindAttribLocation (program, 3, "x3d_Color");
|
|
124
|
-
gl .bindAttribLocation (program, 2, "x3d_TexCoord");
|
|
125
|
-
gl .bindAttribLocation (program, 1, "x3d_Normal");
|
|
126
130
|
gl .bindAttribLocation (program, 0, "x3d_Vertex");
|
|
127
131
|
},
|
|
128
132
|
getDefaultUniforms: function ()
|
|
129
133
|
{
|
|
130
134
|
// Get uniforms and attributes.
|
|
131
135
|
|
|
132
|
-
|
|
133
|
-
|
|
136
|
+
const
|
|
137
|
+
browser = this .getBrowser (),
|
|
138
|
+
gl = browser .getContext (),
|
|
134
139
|
program = this .getProgram ();
|
|
135
140
|
|
|
136
141
|
this .x3d_LogarithmicFarFactor1_2 = gl .getUniformLocation (program, "x3d_LogarithmicFarFactor1_2");
|
|
@@ -140,21 +145,36 @@ function (Fields,
|
|
|
140
145
|
|
|
141
146
|
this .x3d_ClipPlanes = gl .getUniformLocation (program, "x3d_ClipPlane");
|
|
142
147
|
|
|
143
|
-
for (
|
|
144
|
-
this .x3d_ClipPlane [i]
|
|
148
|
+
for (let i = 0; i < this .x3d_MaxClipPlanes; ++ i)
|
|
149
|
+
this .x3d_ClipPlane [i] = gl .getUniformLocation (program, "x3d_ClipPlane[" + i + "]");
|
|
145
150
|
|
|
146
151
|
this .x3d_FogType = this .getUniformLocation (gl, program, "x3d_Fog.type", "x3d_FogType");
|
|
147
152
|
this .x3d_FogColor = this .getUniformLocation (gl, program, "x3d_Fog.color", "x3d_FogColor");
|
|
148
153
|
this .x3d_FogVisibilityRange = this .getUniformLocation (gl, program, "x3d_Fog.visibilityRange", "x3d_FogVisibilityRange");
|
|
149
154
|
this .x3d_FogMatrix = this .getUniformLocation (gl, program, "x3d_Fog.matrix", "x3d_FogMatrix");
|
|
155
|
+
this .x3d_FogCoord = this .getUniformLocation (gl, program, "x3d_Fog.fogCoord", "x3d_FogCoord");
|
|
156
|
+
|
|
157
|
+
this .x3d_AlphaCutoff = gl .getUniformLocation (program, "x3d_AlphaCutoff");
|
|
150
158
|
|
|
151
|
-
this .
|
|
159
|
+
this .x3d_PointPropertiesPointSizeScaleFactor = gl .getUniformLocation (program, "x3d_PointProperties.pointSizeScaleFactor");
|
|
160
|
+
this .x3d_PointPropertiesPointSizeMinValue = gl .getUniformLocation (program, "x3d_PointProperties.pointSizeMinValue");
|
|
161
|
+
this .x3d_PointPropertiesPointSizeMaxValue = gl .getUniformLocation (program, "x3d_PointProperties.pointSizeMaxValue");
|
|
162
|
+
this .x3d_PointPropertiesPointSizeAttenuation = gl .getUniformLocation (program, "x3d_PointProperties.pointSizeAttenuation");
|
|
163
|
+
this .x3d_PointPropertiesColorMode = gl .getUniformLocation (program, "x3d_PointProperties.colorMode");
|
|
164
|
+
|
|
165
|
+
this .x3d_LinePropertiesApplied = gl .getUniformLocation (program, "x3d_LineProperties.applied");
|
|
166
|
+
this .x3d_LinePropertiesLinewidthScaleFactor = this .getUniformLocation (gl, program, "x3d_LineProperties.linewidthScaleFactor", "x3d_LinewidthScaleFactor");
|
|
167
|
+
this .x3d_LinePropertiesLinetype = gl .getUniformLocation (program, "x3d_LineProperties.linetype");
|
|
168
|
+
|
|
169
|
+
this .x3d_FillPropertiesFilled = gl .getUniformLocation (program, "x3d_FillProperties.filled");
|
|
170
|
+
this .x3d_FillPropertiesHatched = gl .getUniformLocation (program, "x3d_FillProperties.hatched");
|
|
171
|
+
this .x3d_FillPropertiesHatchColor = gl .getUniformLocation (program, "x3d_FillProperties.hatchColor");
|
|
172
|
+
this .x3d_FillPropertiesHatchStyle = gl .getUniformLocation (program, "x3d_FillProperties.hatchStyle");
|
|
152
173
|
|
|
153
|
-
this .x3d_Lighting = gl .getUniformLocation (program, "x3d_Lighting");
|
|
154
174
|
this .x3d_ColorMaterial = gl .getUniformLocation (program, "x3d_ColorMaterial");
|
|
155
175
|
this .x3d_NumLights = gl .getUniformLocation (program, "x3d_NumLights");
|
|
156
176
|
|
|
157
|
-
for (
|
|
177
|
+
for (let i = 0; i < this .x3d_MaxLights; ++ i)
|
|
158
178
|
{
|
|
159
179
|
this .x3d_LightType [i] = this .getUniformLocation (gl, program, "x3d_LightSource[" + i + "].type", "x3d_LightType[" + i + "]");
|
|
160
180
|
this .x3d_LightColor [i] = this .getUniformLocation (gl, program, "x3d_LightSource[" + i + "].color", "x3d_LightColor[" + i + "]");
|
|
@@ -176,38 +196,50 @@ function (Fields,
|
|
|
176
196
|
this .x3d_ShadowMap [i] = gl .getUniformLocation (program, "x3d_ShadowMap[" + i + "]");
|
|
177
197
|
}
|
|
178
198
|
|
|
179
|
-
this .
|
|
199
|
+
this .x3d_AmbientIntensity = this .getUniformLocation (gl, program, "x3d_Material.ambientIntensity", "x3d_FrontMaterial.ambientIntensity");
|
|
200
|
+
this .x3d_DiffuseColor = this .getUniformLocation (gl, program, "x3d_Material.diffuseColor", "x3d_FrontMaterial.diffuseColor");
|
|
201
|
+
this .x3d_SpecularColor = this .getUniformLocation (gl, program, "x3d_Material.specularColor", "x3d_FrontMaterial.specularColor");
|
|
202
|
+
this .x3d_EmissiveColor = this .getUniformLocation (gl, program, "x3d_Material.emissiveColor", "x3d_FrontMaterial.emissiveColor");
|
|
203
|
+
this .x3d_Shininess = this .getUniformLocation (gl, program, "x3d_Material.shininess", "x3d_FrontMaterial.shininess");
|
|
204
|
+
this .x3d_Transparency = this .getUniformLocation (gl, program, "x3d_Material.transparency", "x3d_FrontMaterial.transparency");
|
|
205
|
+
|
|
206
|
+
this .x3d_NumTextures = gl .getUniformLocation (program, "x3d_NumTextures");
|
|
207
|
+
this .x3d_NumProjectiveTextures = gl .getUniformLocation (program, "x3d_NumProjectiveTextures");
|
|
208
|
+
this .x3d_MultiTextureColor = gl .getUniformLocation (program, "x3d_MultiTextureColor");
|
|
209
|
+
|
|
210
|
+
for (let i = 0; i < this .x3d_MaxTextures; ++ i)
|
|
211
|
+
{
|
|
212
|
+
this .x3d_TextureType [i] = gl .getUniformLocation (program, "x3d_TextureType[" + i + "]");
|
|
213
|
+
this .x3d_Texture2D [i] = gl .getUniformLocation (program, "x3d_Texture2D[" + i + "]");
|
|
214
|
+
this .x3d_Texture3D [i] = gl .getUniformLocation (program, "x3d_Texture3D[" + i + "]");
|
|
215
|
+
this .x3d_CubeMapTexture [i] = gl .getUniformLocation (program, "x3d_CubeMapTexture[" + i + "]");
|
|
180
216
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
this .x3d_Shininess = this .getUniformLocation (gl, program, "x3d_FrontMaterial.shininess", "x3d_Shininess");
|
|
186
|
-
this .x3d_Transparency = this .getUniformLocation (gl, program, "x3d_FrontMaterial.transparency", "x3d_Transparency");
|
|
217
|
+
this .x3d_MultiTextureMode [i] = gl .getUniformLocation (program, "x3d_MultiTexture[" + i + "].mode");
|
|
218
|
+
this .x3d_MultiTextureAlphaMode [i] = gl .getUniformLocation (program, "x3d_MultiTexture[" + i + "].alphaMode");
|
|
219
|
+
this .x3d_MultiTextureSource [i] = gl .getUniformLocation (program, "x3d_MultiTexture[" + i + "].source");
|
|
220
|
+
this .x3d_MultiTextureFunction [i] = gl .getUniformLocation (program, "x3d_MultiTexture[" + i + "].function");
|
|
187
221
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
this .x3d_BackSpecularColor = this .getUniformLocation (gl, program, "x3d_BackMaterial.specularColor", "x3d_BackSpecularColor");
|
|
191
|
-
this .x3d_BackEmissiveColor = this .getUniformLocation (gl, program, "x3d_BackMaterial.emissiveColor", "x3d_BackEmissiveColor");
|
|
192
|
-
this .x3d_BackShininess = this .getUniformLocation (gl, program, "x3d_BackMaterial.shininess", "x3d_BackShininess");
|
|
193
|
-
this .x3d_BackTransparency = this .getUniformLocation (gl, program, "x3d_BackMaterial.transparency", "x3d_BackTransparency");
|
|
222
|
+
this .x3d_TextureCoordinateGeneratorMode [i] = gl .getUniformLocation (program, "x3d_TextureCoordinateGenerator[" + i + "].mode");
|
|
223
|
+
this .x3d_TextureCoordinateGeneratorParameter [i] = gl .getUniformLocation (program, "x3d_TextureCoordinateGenerator[" + i + "].parameter");
|
|
194
224
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
225
|
+
this .x3d_ProjectiveTexture [i] = gl .getUniformLocation (program, "x3d_ProjectiveTexture[" + i + "]");
|
|
226
|
+
this .x3d_ProjectiveTextureMatrix [i] = gl .getUniformLocation (program, "x3d_ProjectiveTextureMatrix[" + i + "]");
|
|
227
|
+
this .x3d_ProjectiveTextureLocation [i] = gl .getUniformLocation (program, "x3d_ProjectiveTextureLocation[" + i + "]");
|
|
228
|
+
|
|
229
|
+
this .x3d_TextureMatrix [i] = gl .getUniformLocation (program, "x3d_TextureMatrix[" + i + "]");
|
|
230
|
+
this .x3d_TexCoord [i] = this .getAttribLocation (gl, program, "x3d_TexCoord" + i, i ? "" : "x3d_TexCoord");
|
|
231
|
+
}
|
|
199
232
|
|
|
200
233
|
this .x3d_Viewport = gl .getUniformLocation (program, "x3d_Viewport");
|
|
201
234
|
this .x3d_ProjectionMatrix = gl .getUniformLocation (program, "x3d_ProjectionMatrix");
|
|
202
235
|
this .x3d_ModelViewMatrix = gl .getUniformLocation (program, "x3d_ModelViewMatrix");
|
|
203
236
|
this .x3d_NormalMatrix = gl .getUniformLocation (program, "x3d_NormalMatrix");
|
|
204
|
-
this .x3d_TextureMatrix = gl .getUniformLocation (program, "x3d_TextureMatrix");
|
|
205
237
|
this .x3d_CameraSpaceMatrix = gl .getUniformLocation (program, "x3d_CameraSpaceMatrix");
|
|
206
|
-
|
|
238
|
+
|
|
239
|
+
this .x3d_FogDepth = gl .getAttribLocation (program, "x3d_FogDepth");
|
|
207
240
|
this .x3d_Color = gl .getAttribLocation (program, "x3d_Color");
|
|
208
|
-
this .x3d_TexCoord = gl .getAttribLocation (program, "x3d_TexCoord");
|
|
209
241
|
this .x3d_Normal = gl .getAttribLocation (program, "x3d_Normal");
|
|
210
|
-
this .x3d_Vertex = gl .getAttribLocation (program, "x3d_Vertex");
|
|
242
|
+
this .x3d_Vertex = gl .getAttribLocation (program, "x3d_Vertex");
|
|
211
243
|
|
|
212
244
|
this .x3d_ParticleId = gl .getUniformLocation (program, "x3d_Particle.id");
|
|
213
245
|
this .x3d_ParticleLife = gl .getUniformLocation (program, "x3d_Particle.life");
|
|
@@ -215,16 +247,32 @@ function (Fields,
|
|
|
215
247
|
|
|
216
248
|
// Fill special uniforms with default values, textures for units are created in X3DTexturingContext.
|
|
217
249
|
|
|
218
|
-
gl .
|
|
219
|
-
gl .
|
|
220
|
-
gl .
|
|
221
|
-
gl .uniform1iv (this .
|
|
222
|
-
gl .uniform1iv (
|
|
223
|
-
|
|
224
|
-
|
|
250
|
+
gl .uniform1i (this .x3d_LinePropertiesLinetype, browser .getLinetypeUnit ());
|
|
251
|
+
gl .uniform1i (this .x3d_FillPropertiesHatchStyle, browser .getHatchStyleUnit ());
|
|
252
|
+
gl .uniform1i (this .x3d_NumTextures, 0);
|
|
253
|
+
gl .uniform1iv (this .x3d_Texture2D [0], browser .getTexture2DUnits ());
|
|
254
|
+
gl .uniform1iv (this .x3d_CubeMapTexture [0], browser .getCubeMapTextureUnits ());
|
|
255
|
+
gl .uniform1iv (this .x3d_ShadowMap [0], new Int32Array (this .x3d_MaxLights) .fill (browser .getShadowTextureUnit ()));
|
|
256
|
+
|
|
257
|
+
if (browser .getProjectiveTextureMapping ())
|
|
258
|
+
gl .uniform1iv (this .x3d_ProjectiveTexture [0], browser .getProjectiveTextureUnits ());
|
|
259
|
+
|
|
260
|
+
if (gl .getVersion () >= 2)
|
|
261
|
+
gl .uniform1iv (this .x3d_Texture3D [0], browser .getTexture3DUnits ());
|
|
225
262
|
|
|
226
263
|
// Return true if valid, otherwise false.
|
|
227
264
|
|
|
265
|
+
if (this .x3d_FogDepth < 0)
|
|
266
|
+
{
|
|
267
|
+
this .enableFogDepthAttribute = Function .prototype;
|
|
268
|
+
this .disableFogDepthAttribute = Function .prototype;
|
|
269
|
+
}
|
|
270
|
+
else
|
|
271
|
+
{
|
|
272
|
+
delete this .enableFogDepthAttribute;
|
|
273
|
+
delete this .disableFogDepthAttribute;
|
|
274
|
+
}
|
|
275
|
+
|
|
228
276
|
if (this .x3d_Color < 0)
|
|
229
277
|
{
|
|
230
278
|
this .enableColorAttribute = Function .prototype;
|
|
@@ -236,15 +284,15 @@ function (Fields,
|
|
|
236
284
|
delete this .disableColorAttribute;
|
|
237
285
|
}
|
|
238
286
|
|
|
239
|
-
if (this .x3d_TexCoord
|
|
287
|
+
if (this .x3d_TexCoord .some (function (location) { return location >= 0; }))
|
|
240
288
|
{
|
|
241
|
-
this .enableTexCoordAttribute
|
|
242
|
-
this .disableTexCoordAttribute
|
|
289
|
+
delete this .enableTexCoordAttribute;
|
|
290
|
+
delete this .disableTexCoordAttribute;
|
|
243
291
|
}
|
|
244
292
|
else
|
|
245
293
|
{
|
|
246
|
-
|
|
247
|
-
|
|
294
|
+
this .enableTexCoordAttribute = Function .prototype;
|
|
295
|
+
this .disableTexCoordAttribute = Function .prototype;
|
|
248
296
|
}
|
|
249
297
|
|
|
250
298
|
if (this .x3d_Normal < 0)
|
|
@@ -260,7 +308,11 @@ function (Fields,
|
|
|
260
308
|
|
|
261
309
|
if (this .x3d_Vertex < 0)
|
|
262
310
|
{
|
|
263
|
-
|
|
311
|
+
if (gl .getVersion () >= 2)
|
|
312
|
+
console .warn ("Missing »in vec4 x3d_Vertex;«.");
|
|
313
|
+
else
|
|
314
|
+
console .warn ("Missing »attribute vec4 x3d_Vertex;«.");
|
|
315
|
+
|
|
264
316
|
return false;
|
|
265
317
|
}
|
|
266
318
|
|
|
@@ -270,39 +322,67 @@ function (Fields,
|
|
|
270
322
|
{
|
|
271
323
|
// Legacy function to get uniform location.
|
|
272
324
|
|
|
273
|
-
|
|
325
|
+
let location = gl .getUniformLocation (program, name);
|
|
274
326
|
|
|
275
327
|
if (location)
|
|
276
328
|
return location;
|
|
277
329
|
|
|
278
330
|
// Look for depreciated location.
|
|
279
331
|
|
|
280
|
-
|
|
332
|
+
if (depreciated)
|
|
333
|
+
{
|
|
334
|
+
location = gl .getUniformLocation (program, depreciated);
|
|
281
335
|
|
|
282
|
-
|
|
283
|
-
|
|
336
|
+
if (location)
|
|
337
|
+
{
|
|
338
|
+
console .warn (this .getTypeName (), this .getName (), "Using uniform location name »" + depreciated + "« is depreciated, use »" + name + "«. See https://create3000.github.io/x_ite/Custom-Shaders.html.");
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
return location;
|
|
342
|
+
}
|
|
284
343
|
|
|
285
|
-
return
|
|
344
|
+
return 0;
|
|
345
|
+
},
|
|
346
|
+
getAttribLocation: function (gl, program, name, depreciated)
|
|
347
|
+
{
|
|
348
|
+
// Legacy function to get uniform location.
|
|
349
|
+
|
|
350
|
+
let location = gl .getAttribLocation (program, name);
|
|
351
|
+
|
|
352
|
+
if (location >= 0)
|
|
353
|
+
return location;
|
|
354
|
+
|
|
355
|
+
// Look for depreciated location.
|
|
356
|
+
|
|
357
|
+
if (depreciated)
|
|
358
|
+
{
|
|
359
|
+
location = gl .getAttribLocation (program, depreciated);
|
|
360
|
+
|
|
361
|
+
if (location >= 0)
|
|
362
|
+
{
|
|
363
|
+
console .warn (this .getTypeName (), this .getName (), "Using attribute location name »" + depreciated + "« is depreciated, use »" + name + "«. See https://create3000.github.io/x_ite/Custom-Shaders.html.");
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
return location;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
return -1;
|
|
286
370
|
},
|
|
287
371
|
addShaderFields: function ()
|
|
288
372
|
{
|
|
289
|
-
|
|
373
|
+
const
|
|
290
374
|
gl = this .getBrowser () .getContext (),
|
|
291
375
|
program = this .getProgram (),
|
|
292
376
|
userDefinedFields = this .getUserDefinedFields ();
|
|
293
377
|
|
|
294
378
|
this .textures .clear ();
|
|
295
379
|
|
|
296
|
-
|
|
380
|
+
userDefinedFields .forEach (function (field)
|
|
297
381
|
{
|
|
298
|
-
|
|
382
|
+
const location = gl .getUniformLocation (program, field .getName ());
|
|
299
383
|
|
|
300
384
|
if (location)
|
|
301
385
|
{
|
|
302
|
-
field ._uniformLocation = location;
|
|
303
|
-
|
|
304
|
-
field .addInterest ("set_field__", this);
|
|
305
|
-
|
|
306
386
|
switch (field .getType ())
|
|
307
387
|
{
|
|
308
388
|
case X3DConstants .SFImage:
|
|
@@ -360,11 +440,11 @@ function (Fields,
|
|
|
360
440
|
}
|
|
361
441
|
case X3DConstants .MFNode:
|
|
362
442
|
{
|
|
363
|
-
|
|
443
|
+
const locations = location .locations = [ ];
|
|
364
444
|
|
|
365
|
-
for (
|
|
445
|
+
for (let i = 0;; ++ i)
|
|
366
446
|
{
|
|
367
|
-
|
|
447
|
+
const l = gl .getUniformLocation (program, field .getName () + "[" + i + "]");
|
|
368
448
|
|
|
369
449
|
if (! l)
|
|
370
450
|
break;
|
|
@@ -396,424 +476,456 @@ function (Fields,
|
|
|
396
476
|
}
|
|
397
477
|
}
|
|
398
478
|
|
|
479
|
+
if (location .array)
|
|
480
|
+
field ._uniformLocation = location .array .length ? location : null;
|
|
481
|
+
else
|
|
482
|
+
field ._uniformLocation = location;
|
|
483
|
+
|
|
484
|
+
field .addInterest ("set_field__", this);
|
|
485
|
+
|
|
399
486
|
this .set_field__ (field);
|
|
400
487
|
}
|
|
401
|
-
}
|
|
488
|
+
},
|
|
489
|
+
this);
|
|
402
490
|
},
|
|
403
491
|
removeShaderFields: function ()
|
|
404
492
|
{
|
|
405
|
-
|
|
493
|
+
const userDefinedFields = this .getUserDefinedFields ();
|
|
406
494
|
|
|
407
|
-
|
|
495
|
+
userDefinedFields .forEach (function (field)
|
|
408
496
|
{
|
|
409
497
|
field .removeInterest ("set_field__", this);
|
|
410
|
-
}
|
|
498
|
+
},
|
|
499
|
+
this);
|
|
411
500
|
},
|
|
412
|
-
set_field__: function (
|
|
501
|
+
set_field__: (function ()
|
|
413
502
|
{
|
|
414
|
-
|
|
415
|
-
gl = this .getBrowser () .getContext (),
|
|
416
|
-
location = field ._uniformLocation;
|
|
503
|
+
const matrix3 = new Matrix3 ();
|
|
417
504
|
|
|
418
|
-
|
|
505
|
+
return function (field)
|
|
419
506
|
{
|
|
420
|
-
|
|
507
|
+
const
|
|
508
|
+
gl = this .getBrowser () .getContext (),
|
|
509
|
+
location = field ._uniformLocation;
|
|
510
|
+
|
|
511
|
+
if (location)
|
|
421
512
|
{
|
|
422
|
-
|
|
423
|
-
case X3DConstants .SFInt32:
|
|
424
|
-
{
|
|
425
|
-
gl .uniform1i (location, field .getValue ());
|
|
426
|
-
return;
|
|
427
|
-
}
|
|
428
|
-
case X3DConstants .SFColor:
|
|
429
|
-
{
|
|
430
|
-
var value = field .getValue ();
|
|
431
|
-
gl .uniform3f (location, value .r, value .g, value .b);
|
|
432
|
-
return;
|
|
433
|
-
}
|
|
434
|
-
case X3DConstants .SFColorRGBA:
|
|
435
|
-
{
|
|
436
|
-
var value = field .getValue ();
|
|
437
|
-
gl .uniform4f (location, value .r, value .g, value .b, value .a);
|
|
438
|
-
return;
|
|
439
|
-
}
|
|
440
|
-
case X3DConstants .SFDouble:
|
|
441
|
-
case X3DConstants .SFFloat:
|
|
442
|
-
case X3DConstants .SFTime:
|
|
443
|
-
{
|
|
444
|
-
gl .uniform1f (location, field .getValue ());
|
|
445
|
-
return;
|
|
446
|
-
}
|
|
447
|
-
case X3DConstants .SFImage:
|
|
448
|
-
{
|
|
449
|
-
var
|
|
450
|
-
array = location .array,
|
|
451
|
-
pixels = field .array,
|
|
452
|
-
length = 3 + pixels .length;
|
|
453
|
-
|
|
454
|
-
if (length !== array .length)
|
|
455
|
-
array = location .array = new Int32Array (length);
|
|
456
|
-
|
|
457
|
-
array [0] = field .width;
|
|
458
|
-
array [1] = field .height;
|
|
459
|
-
array [2] = field .comp;
|
|
460
|
-
|
|
461
|
-
for (var a = 3, p = 0, length = pixels .length; p < length; ++ p, ++ a)
|
|
462
|
-
array [a] = pixels [p];
|
|
463
|
-
|
|
464
|
-
gl .uniform1iv (location, array);
|
|
465
|
-
return;
|
|
466
|
-
}
|
|
467
|
-
case X3DConstants .SFMatrix3d:
|
|
468
|
-
case X3DConstants .SFMatrix3f:
|
|
469
|
-
{
|
|
470
|
-
location .array .set (field .getValue ());
|
|
471
|
-
|
|
472
|
-
gl .uniformMatrix3fv (location, false, location .array);
|
|
473
|
-
return;
|
|
474
|
-
}
|
|
475
|
-
case X3DConstants .SFMatrix4d:
|
|
476
|
-
case X3DConstants .SFMatrix4f:
|
|
477
|
-
{
|
|
478
|
-
location .array .set (field .getValue ());
|
|
479
|
-
|
|
480
|
-
gl .uniformMatrix4fv (location, false, location .array);
|
|
481
|
-
return;
|
|
482
|
-
}
|
|
483
|
-
case X3DConstants .SFNode:
|
|
513
|
+
switch (field .getType ())
|
|
484
514
|
{
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
515
|
+
case X3DConstants .SFBool:
|
|
516
|
+
case X3DConstants .SFInt32:
|
|
517
|
+
{
|
|
518
|
+
gl .uniform1i (location, field .getValue ());
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
case X3DConstants .SFColor:
|
|
522
|
+
{
|
|
523
|
+
const value = field .getValue ();
|
|
524
|
+
gl .uniform3f (location, value .r, value .g, value .b);
|
|
525
|
+
return;
|
|
526
|
+
}
|
|
527
|
+
case X3DConstants .SFColorRGBA:
|
|
488
528
|
{
|
|
489
|
-
|
|
529
|
+
const value = field .getValue ();
|
|
530
|
+
gl .uniform4f (location, value .r, value .g, value .b, value .a);
|
|
490
531
|
return;
|
|
491
532
|
}
|
|
533
|
+
case X3DConstants .SFDouble:
|
|
534
|
+
case X3DConstants .SFFloat:
|
|
535
|
+
case X3DConstants .SFTime:
|
|
536
|
+
{
|
|
537
|
+
gl .uniform1f (location, field .getValue ());
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
540
|
+
case X3DConstants .SFImage:
|
|
541
|
+
{
|
|
542
|
+
let array = location .array;
|
|
492
543
|
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
case X3DConstants .SFRotation:
|
|
497
|
-
{
|
|
498
|
-
field .getValue () .getMatrix (location .array);
|
|
544
|
+
const
|
|
545
|
+
pixels = field .array,
|
|
546
|
+
length = 3 + pixels .length;
|
|
499
547
|
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
case X3DConstants .SFVec3f:
|
|
516
|
-
{
|
|
517
|
-
var value = field .getValue ();
|
|
518
|
-
gl .uniform3f (location, value .x, value .y, value .z);
|
|
519
|
-
return;
|
|
520
|
-
}
|
|
521
|
-
case X3DConstants .SFVec4d:
|
|
522
|
-
case X3DConstants .SFVec4f:
|
|
523
|
-
{
|
|
524
|
-
var value = field .getValue ();
|
|
525
|
-
gl .uniform4f (location, value .x, value .y, value .z, value .w);
|
|
526
|
-
return;
|
|
527
|
-
}
|
|
528
|
-
case X3DConstants .MFBool:
|
|
529
|
-
case X3DConstants .MFInt32:
|
|
530
|
-
{
|
|
531
|
-
var array = location .array;
|
|
532
|
-
|
|
533
|
-
for (var i = 0, length = field .length; i < length; ++ i)
|
|
534
|
-
array [i] = field [i];
|
|
535
|
-
|
|
536
|
-
for (var length = array .length; i < length; ++ i)
|
|
537
|
-
array [i] = 0;
|
|
538
|
-
|
|
539
|
-
gl .uniform1iv (location, array);
|
|
540
|
-
return;
|
|
541
|
-
}
|
|
542
|
-
case X3DConstants .MFColor:
|
|
543
|
-
{
|
|
544
|
-
var array = location .array;
|
|
545
|
-
|
|
546
|
-
for (var i = 0, k = 0, length = field .length; i < length; ++ i)
|
|
548
|
+
if (length !== array .length)
|
|
549
|
+
array = location .array = new Int32Array (length);
|
|
550
|
+
|
|
551
|
+
array [0] = field .width;
|
|
552
|
+
array [1] = field .height;
|
|
553
|
+
array [2] = field .comp;
|
|
554
|
+
|
|
555
|
+
for (let a = 3, p = 0, pl = pixels .length; p < pl; ++ p, ++ a)
|
|
556
|
+
array [a] = pixels [p];
|
|
557
|
+
|
|
558
|
+
gl .uniform1iv (location, array);
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
case X3DConstants .SFMatrix3d:
|
|
562
|
+
case X3DConstants .SFMatrix3f:
|
|
547
563
|
{
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
array [k++] = color .b;
|
|
564
|
+
location .array .set (field .getValue ());
|
|
565
|
+
|
|
566
|
+
gl .uniformMatrix3fv (location, false, location .array);
|
|
567
|
+
return;
|
|
553
568
|
}
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
array [k] = 0;
|
|
557
|
-
|
|
558
|
-
gl .uniform3fv (location, array);
|
|
559
|
-
return;
|
|
560
|
-
}
|
|
561
|
-
case X3DConstants .MFColorRGBA:
|
|
562
|
-
{
|
|
563
|
-
var array = location .array;
|
|
564
|
-
|
|
565
|
-
for (var i = 0, k = 0, length = field .length; i < length; ++ i)
|
|
569
|
+
case X3DConstants .SFMatrix4d:
|
|
570
|
+
case X3DConstants .SFMatrix4f:
|
|
566
571
|
{
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
array [k++] = color .b;
|
|
572
|
-
array [k++] = color .a;
|
|
572
|
+
location .array .set (field .getValue ());
|
|
573
|
+
|
|
574
|
+
gl .uniformMatrix4fv (location, false, location .array);
|
|
575
|
+
return;
|
|
573
576
|
}
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
gl .uniform4fv (location, array);
|
|
579
|
-
return;
|
|
580
|
-
}
|
|
581
|
-
case X3DConstants .MFDouble:
|
|
582
|
-
case X3DConstants .MFFloat:
|
|
583
|
-
case X3DConstants .MFTime:
|
|
584
|
-
{
|
|
585
|
-
var array = location .array;
|
|
577
|
+
case X3DConstants .SFNode:
|
|
578
|
+
{
|
|
579
|
+
const texture = X3DCast (X3DConstants .X3DTextureNode, field);
|
|
586
580
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
581
|
+
if (texture)
|
|
582
|
+
{
|
|
583
|
+
this .textures .set (location, { name: field .getName (), texture: texture, textureUnit: undefined } );
|
|
584
|
+
return;
|
|
585
|
+
}
|
|
592
586
|
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
{
|
|
598
|
-
var
|
|
599
|
-
array = location .array,
|
|
600
|
-
length = this .getImagesLength (field);
|
|
601
|
-
|
|
602
|
-
if (length !== array .length)
|
|
603
|
-
array = location .array = new Int32Array (length);
|
|
604
|
-
|
|
605
|
-
for (var i = 0, a = 0, length = field .length; i < length; ++ i)
|
|
587
|
+
this .textures .delete (location);
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
case X3DConstants .SFRotation:
|
|
606
591
|
{
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
array [a ++] = value .width;
|
|
612
|
-
array [a ++] = value .height;
|
|
613
|
-
array [a ++] = value .comp;
|
|
614
|
-
|
|
615
|
-
for (var p = 0, plength = pixels .length; p < plength; ++ p)
|
|
616
|
-
array [a ++] = pixels [p];
|
|
592
|
+
field .getValue () .getMatrix (location .array);
|
|
593
|
+
|
|
594
|
+
gl .uniformMatrix3fv (location, false, location .array);
|
|
595
|
+
return;
|
|
617
596
|
}
|
|
618
|
-
|
|
619
|
-
gl .uniform1iv (location, array);
|
|
620
|
-
return;
|
|
621
|
-
}
|
|
622
|
-
case X3DConstants .MFMatrix3d:
|
|
623
|
-
case X3DConstants .MFMatrix3f:
|
|
624
|
-
{
|
|
625
|
-
var array = location .array;
|
|
626
|
-
|
|
627
|
-
for (var i = 0, k = 0, length = field .length; i < length; ++ i)
|
|
597
|
+
case X3DConstants .SFString:
|
|
628
598
|
{
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
for (var m = 0; m < 9; ++ m)
|
|
632
|
-
array [k++] = matrix [m];
|
|
599
|
+
return;
|
|
633
600
|
}
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
array [k] = 0;
|
|
637
|
-
|
|
638
|
-
gl .uniformMatrix3fv (location, false, array);
|
|
639
|
-
return;
|
|
640
|
-
}
|
|
641
|
-
case X3DConstants .MFMatrix4d:
|
|
642
|
-
case X3DConstants .MFMatrix4f:
|
|
643
|
-
{
|
|
644
|
-
var array = location .array;
|
|
645
|
-
|
|
646
|
-
for (var i = 0, k = 0, length = field .length; i < length; ++ i)
|
|
601
|
+
case X3DConstants .SFVec2d:
|
|
602
|
+
case X3DConstants .SFVec2f:
|
|
647
603
|
{
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
array [k++] = matrix [m];
|
|
604
|
+
const value = field .getValue ();
|
|
605
|
+
gl .uniform2f (location, value .x, value .y);
|
|
606
|
+
return;
|
|
652
607
|
}
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
608
|
+
case X3DConstants .SFVec3d:
|
|
609
|
+
case X3DConstants .SFVec3f:
|
|
610
|
+
{
|
|
611
|
+
const value = field .getValue ();
|
|
612
|
+
gl .uniform3f (location, value .x, value .y, value .z);
|
|
613
|
+
return;
|
|
614
|
+
}
|
|
615
|
+
case X3DConstants .SFVec4d:
|
|
616
|
+
case X3DConstants .SFVec4f:
|
|
617
|
+
{
|
|
618
|
+
const value = field .getValue ();
|
|
619
|
+
gl .uniform4f (location, value .x, value .y, value .z, value .w);
|
|
620
|
+
return;
|
|
621
|
+
}
|
|
622
|
+
case X3DConstants .MFBool:
|
|
623
|
+
case X3DConstants .MFInt32:
|
|
624
|
+
{
|
|
625
|
+
const array = location .array;
|
|
626
|
+
|
|
627
|
+
for (var i = 0, length = field .length; i < length; ++ i)
|
|
628
|
+
array [i] = field [i];
|
|
663
629
|
|
|
664
|
-
|
|
630
|
+
for (let length = array .length; i < length; ++ i)
|
|
631
|
+
array [i] = 0;
|
|
632
|
+
|
|
633
|
+
gl .uniform1iv (location, array);
|
|
634
|
+
return;
|
|
635
|
+
}
|
|
636
|
+
case X3DConstants .MFColor:
|
|
665
637
|
{
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
638
|
+
const array = location .array;
|
|
639
|
+
|
|
640
|
+
for (var i = 0, k = 0, length = field .length; i < length; ++ i)
|
|
641
|
+
{
|
|
642
|
+
const color = field [i];
|
|
643
|
+
|
|
644
|
+
array [k++] = color .r;
|
|
645
|
+
array [k++] = color .g;
|
|
646
|
+
array [k++] = color .b;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
for (let length = array .length; k < length; ++ k)
|
|
650
|
+
array [k] = 0;
|
|
651
|
+
|
|
652
|
+
gl .uniform3fv (location, array);
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
case X3DConstants .MFColorRGBA:
|
|
656
|
+
{
|
|
657
|
+
const array = location .array;
|
|
658
|
+
|
|
659
|
+
for (var i = 0, k = 0, length = field .length; i < length; ++ i)
|
|
669
660
|
{
|
|
670
|
-
|
|
671
|
-
|
|
661
|
+
const color = field [i];
|
|
662
|
+
|
|
663
|
+
array [k++] = color .r;
|
|
664
|
+
array [k++] = color .g;
|
|
665
|
+
array [k++] = color .b;
|
|
666
|
+
array [k++] = color .a;
|
|
672
667
|
}
|
|
668
|
+
|
|
669
|
+
for (let length = array .length; k < length; ++ k)
|
|
670
|
+
array [k] = 0;
|
|
671
|
+
|
|
672
|
+
gl .uniform4fv (location, array);
|
|
673
|
+
return;
|
|
673
674
|
}
|
|
675
|
+
case X3DConstants .MFDouble:
|
|
676
|
+
case X3DConstants .MFFloat:
|
|
677
|
+
case X3DConstants .MFTime:
|
|
678
|
+
{
|
|
679
|
+
const array = location .array;
|
|
674
680
|
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
case X3DConstants .MFRotation:
|
|
678
|
-
{
|
|
679
|
-
var array = location .array;
|
|
681
|
+
for (var i = 0, length = field .length; i < length; ++ i)
|
|
682
|
+
array [i] = field [i];
|
|
680
683
|
|
|
681
|
-
|
|
684
|
+
for (let length = array .length; i < length; ++ i)
|
|
685
|
+
array [i] = 0;
|
|
686
|
+
|
|
687
|
+
gl .uniform1fv (location, array);
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
|
+
case X3DConstants .MFImage:
|
|
682
691
|
{
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
692
|
+
const array = location .array;
|
|
693
|
+
|
|
694
|
+
for (let i = 0, a = 0, length = field .length; i < length; ++ i)
|
|
695
|
+
{
|
|
696
|
+
const
|
|
697
|
+
value = field [i],
|
|
698
|
+
pixels = value .array;
|
|
699
|
+
|
|
700
|
+
array [a ++] = value .width;
|
|
701
|
+
array [a ++] = value .height;
|
|
702
|
+
array [a ++] = value .comp;
|
|
703
|
+
|
|
704
|
+
for (let p = 0, pl = pixels .length; p < pl; ++ p)
|
|
705
|
+
array [a ++] = pixels [p];
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
gl .uniform1iv (location, array);
|
|
709
|
+
return;
|
|
694
710
|
}
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
array [k] = 0;
|
|
698
|
-
|
|
699
|
-
gl .uniformMatrix3fv (location, false, array);
|
|
700
|
-
return;
|
|
701
|
-
}
|
|
702
|
-
case X3DConstants .MFString:
|
|
703
|
-
{
|
|
704
|
-
return;
|
|
705
|
-
}
|
|
706
|
-
case X3DConstants .MFVec2d:
|
|
707
|
-
case X3DConstants .MFVec2f:
|
|
708
|
-
{
|
|
709
|
-
var array = location .array;
|
|
710
|
-
|
|
711
|
-
for (var i = 0, k = 0, length = field .length; i < length; ++ i)
|
|
711
|
+
case X3DConstants .MFMatrix3d:
|
|
712
|
+
case X3DConstants .MFMatrix3f:
|
|
712
713
|
{
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
714
|
+
const array = location .array;
|
|
715
|
+
|
|
716
|
+
for (var i = 0, k = 0, length = field .length; i < length; ++ i)
|
|
717
|
+
{
|
|
718
|
+
const matrix = field [i];
|
|
719
|
+
|
|
720
|
+
for (let m = 0; m < 9; ++ m)
|
|
721
|
+
array [k++] = matrix [m];
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
for (let length = array .length; k < length; ++ k)
|
|
725
|
+
array [k] = 0;
|
|
726
|
+
|
|
727
|
+
gl .uniformMatrix3fv (location, false, array);
|
|
728
|
+
return;
|
|
717
729
|
}
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
730
|
+
case X3DConstants .MFMatrix4d:
|
|
731
|
+
case X3DConstants .MFMatrix4f:
|
|
732
|
+
{
|
|
733
|
+
const array = location .array;
|
|
721
734
|
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
735
|
+
for (var i = 0, k = 0, length = field .length; i < length; ++ i)
|
|
736
|
+
{
|
|
737
|
+
const matrix = field [i];
|
|
738
|
+
|
|
739
|
+
for (let m = 0; m < 16; ++ m)
|
|
740
|
+
array [k++] = matrix [m];
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
for (let length = array .length; k < length; ++ k)
|
|
744
|
+
array [k] = 0;
|
|
745
|
+
|
|
746
|
+
gl .uniformMatrix4fv (location, false, array);
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
749
|
+
case X3DConstants .MFNode:
|
|
731
750
|
{
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
751
|
+
const locations = location .locations;
|
|
752
|
+
|
|
753
|
+
for (let i = 0, length = field .length; i < length; ++ i)
|
|
754
|
+
{
|
|
755
|
+
const texture = X3DCast (X3DConstants .X3DTextureNode, field [i]);
|
|
756
|
+
|
|
757
|
+
if (texture)
|
|
758
|
+
{
|
|
759
|
+
this .textures .set (locations [i], { name: field [i] .getName (), texture: texture, textureUnit: undefined } );
|
|
760
|
+
continue;
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
return;
|
|
737
765
|
}
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
array
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
766
|
+
case X3DConstants .MFRotation:
|
|
767
|
+
{
|
|
768
|
+
const array = location .array;
|
|
769
|
+
|
|
770
|
+
for (var i = 0, k = 0, length = field .length; i < length; ++ i)
|
|
771
|
+
{
|
|
772
|
+
const matrix = field [i] .getValue () .getMatrix (matrix3);
|
|
773
|
+
|
|
774
|
+
array [k++] = matrix [0];
|
|
775
|
+
array [k++] = matrix [1];
|
|
776
|
+
array [k++] = matrix [2];
|
|
777
|
+
array [k++] = matrix [3];
|
|
778
|
+
array [k++] = matrix [4];
|
|
779
|
+
array [k++] = matrix [5];
|
|
780
|
+
array [k++] = matrix [6];
|
|
781
|
+
array [k++] = matrix [7];
|
|
782
|
+
array [k++] = matrix [8];
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
for (let length = array .length; k < length; ++ k)
|
|
786
|
+
array [k] = 0;
|
|
787
|
+
|
|
788
|
+
gl .uniformMatrix3fv (location, false, array);
|
|
789
|
+
return;
|
|
790
|
+
}
|
|
791
|
+
case X3DConstants .MFString:
|
|
792
|
+
{
|
|
793
|
+
return;
|
|
794
|
+
}
|
|
795
|
+
case X3DConstants .MFVec2d:
|
|
796
|
+
case X3DConstants .MFVec2f:
|
|
797
|
+
{
|
|
798
|
+
const array = location .array;
|
|
799
|
+
|
|
800
|
+
for (var i = 0, k = 0, length = field .length; i < length; ++ i)
|
|
801
|
+
{
|
|
802
|
+
const vector = field [i];
|
|
803
|
+
|
|
804
|
+
array [k++] = vector .x;
|
|
805
|
+
array [k++] = vector .y;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
for (let length = array .length; k < length; ++ k)
|
|
809
|
+
array [k] = 0;
|
|
810
|
+
|
|
811
|
+
gl .uniform2fv (location, array);
|
|
812
|
+
return;
|
|
813
|
+
}
|
|
814
|
+
case X3DConstants .MFVec3d:
|
|
815
|
+
case X3DConstants .MFVec3f:
|
|
751
816
|
{
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
817
|
+
const array = location .array;
|
|
818
|
+
|
|
819
|
+
for (var i = 0, k = 0, length = field .length; i < length; ++ i)
|
|
820
|
+
{
|
|
821
|
+
const vector = field [i];
|
|
822
|
+
|
|
823
|
+
array [k++] = vector .x;
|
|
824
|
+
array [k++] = vector .y;
|
|
825
|
+
array [k++] = vector .z;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
for (let length = array .length; k < length; ++ k)
|
|
829
|
+
array [k] = 0;
|
|
830
|
+
|
|
831
|
+
gl .uniform3fv (location, array);
|
|
832
|
+
return;
|
|
833
|
+
}
|
|
834
|
+
case X3DConstants .MFVec4d:
|
|
835
|
+
case X3DConstants .MFVec4f:
|
|
836
|
+
{
|
|
837
|
+
const array = location .array;
|
|
838
|
+
|
|
839
|
+
for (var i = 0, k = 0, length = field .length; i < length; ++ i)
|
|
840
|
+
{
|
|
841
|
+
const vector = field [i];
|
|
842
|
+
|
|
843
|
+
array [k++] = vector .x;
|
|
844
|
+
array [k++] = vector .y;
|
|
845
|
+
array [k++] = vector .z;
|
|
846
|
+
array [k++] = vector .w;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
for (let length = array .length; k < length; ++ k)
|
|
850
|
+
array [k] = 0;
|
|
851
|
+
|
|
852
|
+
gl .uniform4fv (location, array);
|
|
853
|
+
return;
|
|
758
854
|
}
|
|
759
|
-
|
|
760
|
-
for (var length = array .length; k < length; ++ k)
|
|
761
|
-
array [k] = 0;
|
|
762
|
-
|
|
763
|
-
gl .uniform4fv (location, array);
|
|
764
|
-
return;
|
|
765
855
|
}
|
|
766
856
|
}
|
|
767
|
-
}
|
|
768
|
-
},
|
|
857
|
+
};
|
|
858
|
+
})(),
|
|
769
859
|
getImagesLength: function (field)
|
|
770
860
|
{
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
861
|
+
const images = field .getValue ();
|
|
862
|
+
|
|
863
|
+
let length = 3 * images .length;
|
|
774
864
|
|
|
775
|
-
for (
|
|
776
|
-
length +=
|
|
865
|
+
for (const image of images)
|
|
866
|
+
length += image .array .length;
|
|
777
867
|
|
|
778
868
|
return length;
|
|
779
869
|
},
|
|
780
870
|
getLocationLength: function (gl, program, field)
|
|
781
871
|
{
|
|
782
|
-
|
|
872
|
+
const name = field .getName ();
|
|
783
873
|
|
|
784
|
-
for (
|
|
874
|
+
for (let i = 0; ; ++ i)
|
|
785
875
|
{
|
|
786
|
-
|
|
876
|
+
const location = gl .getUniformLocation (program, name + "[" + i + "]");
|
|
787
877
|
|
|
788
878
|
if (! location)
|
|
789
|
-
|
|
879
|
+
return i;
|
|
790
880
|
}
|
|
881
|
+
},
|
|
882
|
+
hasFog: function (fogNode)
|
|
883
|
+
{
|
|
884
|
+
if (this .fogNode === fogNode)
|
|
885
|
+
return true;
|
|
886
|
+
|
|
887
|
+
this .fogNode = fogNode;
|
|
791
888
|
|
|
792
|
-
return
|
|
889
|
+
return false;
|
|
793
890
|
},
|
|
794
|
-
|
|
891
|
+
hasLight: function (i, lightNode)
|
|
795
892
|
{
|
|
796
|
-
|
|
893
|
+
if (this .lightNodes [i] === lightNode)
|
|
894
|
+
return true;
|
|
797
895
|
|
|
798
|
-
this .
|
|
799
|
-
this .numLights = 0;
|
|
896
|
+
this .lightNodes [i] = lightNode;
|
|
800
897
|
|
|
801
|
-
|
|
898
|
+
return false;
|
|
899
|
+
},
|
|
900
|
+
hasTextureProjector: function (i, textureProjectorNode)
|
|
901
|
+
{
|
|
902
|
+
if (this .projectiveTextureNodes [i] === textureProjectorNode)
|
|
903
|
+
return true;
|
|
802
904
|
|
|
803
|
-
|
|
804
|
-
shaderObjects [i] .setShaderUniforms (gl, this);
|
|
905
|
+
this .projectiveTextureNodes [i] = textureProjectorNode;
|
|
805
906
|
|
|
806
|
-
|
|
807
|
-
|
|
907
|
+
return false;
|
|
908
|
+
},
|
|
909
|
+
setLocalObjects: function (gl, localObjects)
|
|
910
|
+
{
|
|
911
|
+
// Clip planes and local lights
|
|
912
|
+
|
|
913
|
+
this .numClipPlanes = 0;
|
|
914
|
+
this .numLights = 0;
|
|
915
|
+
this .numProjectiveTextures = 0;
|
|
916
|
+
this .lightNodes .length = 0;
|
|
917
|
+
this .projectiveTextureNodes .length = 0;
|
|
808
918
|
|
|
809
|
-
|
|
919
|
+
for (const localObject of localObjects)
|
|
920
|
+
localObject .setShaderUniforms (gl, this);
|
|
810
921
|
|
|
811
|
-
|
|
812
|
-
|
|
922
|
+
gl .uniform1i (this .x3d_NumClipPlanes, Math .min (this .numClipPlanes, this .x3d_MaxClipPlanes));
|
|
923
|
+
gl .uniform1i (this .x3d_NumLights, Math .min (this .numLights, this .x3d_MaxLights));
|
|
924
|
+
gl .uniform1i (this .x3d_NumProjectiveTextures, Math .min (this .numProjectiveTextures, this .x3d_MaxTextures));
|
|
813
925
|
},
|
|
814
926
|
setGlobalUniforms: function (gl, renderObject, cameraSpaceMatrixArray, projectionMatrixArray, viewportArray)
|
|
815
927
|
{
|
|
816
|
-
|
|
928
|
+
const globalObjects = renderObject .getGlobalObjects ();
|
|
817
929
|
|
|
818
930
|
// Set viewport
|
|
819
931
|
|
|
@@ -824,122 +936,114 @@ function (Fields,
|
|
|
824
936
|
gl .uniformMatrix4fv (this .x3d_ProjectionMatrix, false, projectionMatrixArray);
|
|
825
937
|
gl .uniformMatrix4fv (this .x3d_CameraSpaceMatrix, false, cameraSpaceMatrixArray);
|
|
826
938
|
|
|
827
|
-
//
|
|
939
|
+
// Fog
|
|
940
|
+
|
|
941
|
+
this .fogNode = null;
|
|
942
|
+
|
|
943
|
+
// Set global lights and global texture projectors
|
|
944
|
+
|
|
945
|
+
this .numLights = 0;
|
|
946
|
+
this .numProjectiveTextures = 0;
|
|
947
|
+
this .lightNodes .length = 0;
|
|
948
|
+
this .projectiveTextureNodes .length = 0;
|
|
828
949
|
|
|
829
|
-
|
|
830
|
-
|
|
950
|
+
for (const globalObject of globalObjects)
|
|
951
|
+
globalObject .setShaderUniforms (gl, this);
|
|
831
952
|
|
|
832
|
-
|
|
833
|
-
|
|
953
|
+
this .numGlobalLights = this .numLights;
|
|
954
|
+
this .numGlobalProjectiveTextures = this .numProjectiveTextures;
|
|
834
955
|
|
|
835
956
|
// Logarithmic depth buffer support.
|
|
836
957
|
|
|
837
|
-
|
|
838
|
-
|
|
958
|
+
const
|
|
959
|
+
viewpoint = renderObject .getViewpoint (),
|
|
960
|
+
navigationInfo = renderObject .getNavigationInfo ();
|
|
839
961
|
|
|
840
962
|
if (viewpoint instanceof OrthoViewpoint)
|
|
841
963
|
gl .uniform1f (this .x3d_LogarithmicFarFactor1_2, -1);
|
|
842
964
|
else
|
|
843
|
-
gl .uniform1f (this .x3d_LogarithmicFarFactor1_2, 1 / Math .log2 (navigationInfo .getFarValue (viewpoint) + 1));
|
|
965
|
+
gl .uniform1f (this .x3d_LogarithmicFarFactor1_2, 1 / Math .log2 (navigationInfo .getFarValue (viewpoint) + 1));
|
|
844
966
|
},
|
|
845
|
-
setLocalUniforms: function (gl, context)
|
|
967
|
+
setLocalUniforms: function (gl, context, front = true)
|
|
846
968
|
{
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
969
|
+
const
|
|
970
|
+
shapeNode = context .shapeNode,
|
|
971
|
+
geometryNode = context .geometryContext || shapeNode .getGeometry (),
|
|
972
|
+
geometryType = geometryNode .geometryType,
|
|
973
|
+
textureCoordinateNode = geometryNode .textureCoordinateNode,
|
|
974
|
+
appearanceNode = shapeNode .getAppearance (),
|
|
975
|
+
stylePropertiesNode = appearanceNode .stylePropertiesNode [geometryType],
|
|
976
|
+
materialNode = front ? appearanceNode .materialNode : appearanceNode .backMaterialNode,
|
|
977
|
+
textureNode = context .textureNode || appearanceNode .textureNode,
|
|
978
|
+
textureTransformNode = appearanceNode .textureTransformNode,
|
|
979
|
+
modelViewMatrix = context .modelViewMatrix,
|
|
980
|
+
localObjects = context .localObjects;
|
|
981
|
+
|
|
982
|
+
// Model view matrix
|
|
983
|
+
|
|
984
|
+
gl .uniformMatrix4fv (this .x3d_ModelViewMatrix, false, modelViewMatrix);
|
|
854
985
|
|
|
855
986
|
// Geometry type
|
|
856
987
|
|
|
857
|
-
gl .uniform1i (this .x3d_GeometryType,
|
|
988
|
+
gl .uniform1i (this .x3d_GeometryType, geometryType);
|
|
858
989
|
|
|
859
990
|
// Clip planes and local lights
|
|
860
991
|
|
|
861
|
-
this .numClipPlanes
|
|
862
|
-
this .numLights
|
|
863
|
-
|
|
864
|
-
gl .uniform4fv (this .x3d_ClipPlanes, this .defaultClipPlanesArray);
|
|
865
|
-
|
|
866
|
-
for (var i = 0, length = shaderObjects .length; i < length; ++ i)
|
|
867
|
-
shaderObjects [i] .setShaderUniforms (gl, this);
|
|
868
|
-
|
|
869
|
-
gl .uniform1i (this .x3d_NumClipPlanes, Math .min (this .numClipPlanes, this .x3d_MaxClipPlanes));
|
|
870
|
-
gl .uniform1i (this .x3d_NumLights, Math .min (this .numLights, this .x3d_MaxLights));
|
|
992
|
+
this .numClipPlanes = 0;
|
|
993
|
+
this .numLights = this .numGlobalLights;
|
|
994
|
+
this .numProjectiveTextures = this .numGlobalProjectiveTextures;
|
|
871
995
|
|
|
872
|
-
|
|
996
|
+
for (const localObject of localObjects)
|
|
997
|
+
localObject .setShaderUniforms (gl, this);
|
|
873
998
|
|
|
874
|
-
|
|
875
|
-
|
|
999
|
+
gl .uniform1i (this .x3d_NumClipPlanes, Math .min (this .numClipPlanes, this .x3d_MaxClipPlanes));
|
|
1000
|
+
gl .uniform1i (this .x3d_NumLights, Math .min (this .numLights, this .x3d_MaxLights));
|
|
1001
|
+
gl .uniform1i (this .x3d_NumProjectiveTextures, Math .min (this .numProjectiveTextures, this .x3d_MaxTextures));
|
|
876
1002
|
|
|
877
1003
|
// Fog, there is always one
|
|
878
1004
|
|
|
879
1005
|
context .fogNode .setShaderUniforms (gl, this);
|
|
1006
|
+
gl .uniform1i (this .x3d_FogCoord, geometryNode .fogCoords);
|
|
880
1007
|
|
|
881
|
-
//
|
|
1008
|
+
// Alpha
|
|
882
1009
|
|
|
883
|
-
|
|
884
|
-
{
|
|
885
|
-
var linewidthScaleFactor = linePropertiesNode .getLinewidthScaleFactor ();
|
|
1010
|
+
gl .uniform1f (this .x3d_AlphaCutoff, appearanceNode .alphaCutoff);
|
|
886
1011
|
|
|
887
|
-
|
|
888
|
-
gl .uniform1f (this .x3d_LinewidthScaleFactor, linewidthScaleFactor);
|
|
889
|
-
}
|
|
890
|
-
else
|
|
891
|
-
{
|
|
892
|
-
gl .lineWidth (1);
|
|
893
|
-
gl .uniform1f (this .x3d_LinewidthScaleFactor, 1);
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
// Material
|
|
1012
|
+
// Style
|
|
897
1013
|
|
|
898
|
-
|
|
1014
|
+
stylePropertiesNode .setShaderUniforms (gl, this);
|
|
899
1015
|
|
|
900
|
-
|
|
901
|
-
{
|
|
902
|
-
// Lights
|
|
1016
|
+
// Material
|
|
903
1017
|
|
|
904
|
-
|
|
1018
|
+
gl .uniform1i (this .x3d_ColorMaterial, geometryNode .colorMaterial);
|
|
1019
|
+
materialNode .setShaderUniforms (gl, this, front);
|
|
905
1020
|
|
|
906
|
-
|
|
1021
|
+
// Normal matrix
|
|
907
1022
|
|
|
908
|
-
|
|
1023
|
+
gl .uniformMatrix3fv (this .x3d_NormalMatrix, false, this .getNormalMatrix (modelViewMatrix));
|
|
909
1024
|
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
gl .uniformMatrix3fv (this .x3d_NormalMatrix, false, this .getNormalMatrix (modelViewMatrix));
|
|
913
|
-
}
|
|
914
|
-
else
|
|
915
|
-
{
|
|
916
|
-
gl .uniform1i (this .x3d_Lighting, false);
|
|
917
|
-
|
|
918
|
-
if (this .getCustom ())
|
|
919
|
-
gl .uniformMatrix3fv (this .x3d_NormalMatrix, false, this .getNormalMatrix (modelViewMatrix));
|
|
920
|
-
}
|
|
1025
|
+
// Texture
|
|
921
1026
|
|
|
922
1027
|
if (textureNode)
|
|
923
1028
|
{
|
|
924
|
-
textureNode
|
|
925
|
-
textureTransformNode
|
|
1029
|
+
textureNode .setShaderUniforms (gl, this, context .renderer);
|
|
1030
|
+
textureTransformNode .setShaderUniforms (gl, this);
|
|
1031
|
+
textureCoordinateNode .setShaderUniforms (gl, this);
|
|
926
1032
|
}
|
|
927
1033
|
else
|
|
928
1034
|
{
|
|
929
|
-
|
|
930
|
-
gl .uniform1iv (this .x3d_TextureType, this .textureTypeArray);
|
|
1035
|
+
gl .uniform1i (this .x3d_NumTextures, 0);
|
|
931
1036
|
|
|
932
1037
|
if (this .getCustom ())
|
|
933
1038
|
{
|
|
934
|
-
textureTransformNode
|
|
1039
|
+
textureTransformNode .setShaderUniforms (gl, this);
|
|
1040
|
+
textureCoordinateNode .setShaderUniforms (gl, this);
|
|
935
1041
|
}
|
|
936
1042
|
}
|
|
937
|
-
|
|
938
|
-
gl .uniformMatrix4fv (this .x3d_ModelViewMatrix, false, modelViewMatrix);
|
|
939
1043
|
},
|
|
940
1044
|
getNormalMatrix: (function ()
|
|
941
1045
|
{
|
|
942
|
-
|
|
1046
|
+
const normalMatrix = new Float32Array (9);
|
|
943
1047
|
|
|
944
1048
|
return function (modelViewMatrix)
|
|
945
1049
|
{
|
|
@@ -963,67 +1067,63 @@ function (Fields,
|
|
|
963
1067
|
})(),
|
|
964
1068
|
enable: function (gl)
|
|
965
1069
|
{
|
|
966
|
-
|
|
1070
|
+
const browser = this .getBrowser ();
|
|
967
1071
|
|
|
968
1072
|
//console .log (this .getName ());
|
|
969
1073
|
//console .log (browser .getCombinedTextureUnits () .length);
|
|
970
1074
|
|
|
971
|
-
|
|
1075
|
+
this .textures .forEach (function (object, location)
|
|
972
1076
|
{
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
name = object .name,
|
|
977
|
-
texture = object .texture;
|
|
1077
|
+
const
|
|
1078
|
+
name = object .name,
|
|
1079
|
+
texture = object .texture;
|
|
978
1080
|
|
|
979
1081
|
if (! browser .getCombinedTextureUnits () .length)
|
|
980
1082
|
{
|
|
981
1083
|
console .warn ("Not enough combined texture units for uniform variable '" + name + "' available.");
|
|
982
|
-
|
|
1084
|
+
return;
|
|
983
1085
|
}
|
|
984
1086
|
|
|
985
|
-
|
|
986
|
-
|
|
1087
|
+
const textureUnit = object .textureUnit = browser .getCombinedTextureUnits () .pop ();
|
|
1088
|
+
|
|
987
1089
|
gl .uniform1i (location, textureUnit);
|
|
988
1090
|
gl .activeTexture (gl .TEXTURE0 + textureUnit);
|
|
989
1091
|
gl .bindTexture (texture .getTarget (), texture .getTexture ());
|
|
990
|
-
}
|
|
1092
|
+
});
|
|
991
1093
|
|
|
992
1094
|
gl .activeTexture (gl .TEXTURE0);
|
|
993
1095
|
},
|
|
994
1096
|
disable: function (gl)
|
|
995
1097
|
{
|
|
996
|
-
|
|
1098
|
+
const browser = this .getBrowser ();
|
|
997
1099
|
|
|
998
|
-
|
|
1100
|
+
this .textures .forEach (function (object)
|
|
999
1101
|
{
|
|
1000
|
-
|
|
1001
|
-
object = item [1],
|
|
1002
|
-
textureUnit = object .textureUnit;
|
|
1102
|
+
const textureUnit = object .textureUnit;
|
|
1003
1103
|
|
|
1004
1104
|
if (textureUnit !== undefined)
|
|
1005
1105
|
browser .getCombinedTextureUnits () .push (textureUnit);
|
|
1006
1106
|
|
|
1007
1107
|
object .textureUnit = undefined;
|
|
1008
|
-
}
|
|
1108
|
+
});
|
|
1009
1109
|
|
|
1010
1110
|
//console .log (browser .getCombinedTextureUnits () .length);
|
|
1011
1111
|
},
|
|
1012
1112
|
enableFloatAttrib: function (gl, name, buffer, components)
|
|
1013
1113
|
{
|
|
1014
|
-
|
|
1015
|
-
|
|
1114
|
+
const location = gl. getAttribLocation (this .getProgram (), name);
|
|
1115
|
+
|
|
1016
1116
|
if (location === -1)
|
|
1017
1117
|
return;
|
|
1018
|
-
|
|
1118
|
+
|
|
1019
1119
|
gl .enableVertexAttribArray (location);
|
|
1020
|
-
|
|
1120
|
+
|
|
1021
1121
|
gl .bindBuffer (gl .ARRAY_BUFFER, buffer);
|
|
1022
1122
|
gl .vertexAttribPointer (location, components, gl .FLOAT, false, 0, 0);
|
|
1023
1123
|
},
|
|
1024
1124
|
disableFloatAttrib: function (gl, name)
|
|
1025
1125
|
{
|
|
1026
|
-
|
|
1126
|
+
const location = gl .getAttribLocation (this .getProgram (), name);
|
|
1027
1127
|
|
|
1028
1128
|
if (location === -1)
|
|
1029
1129
|
return;
|
|
@@ -1032,7 +1132,7 @@ function (Fields,
|
|
|
1032
1132
|
},
|
|
1033
1133
|
enableMatrix3Attrib: function (gl, name, buffer)
|
|
1034
1134
|
{
|
|
1035
|
-
|
|
1135
|
+
const location = gl .getAttribLocation (this .getProgram (), name);
|
|
1036
1136
|
|
|
1037
1137
|
if (location === -1)
|
|
1038
1138
|
return;
|
|
@@ -1049,7 +1149,7 @@ function (Fields,
|
|
|
1049
1149
|
},
|
|
1050
1150
|
disableMatrix3Attrib: function (gl, name)
|
|
1051
1151
|
{
|
|
1052
|
-
|
|
1152
|
+
const location = gl .getAttribLocation (this .getProgram (), name);
|
|
1053
1153
|
|
|
1054
1154
|
if (location === -1)
|
|
1055
1155
|
return;
|
|
@@ -1060,7 +1160,7 @@ function (Fields,
|
|
|
1060
1160
|
},
|
|
1061
1161
|
enableMatrix4Attrib: function (gl, name, buffer)
|
|
1062
1162
|
{
|
|
1063
|
-
|
|
1163
|
+
const location = gl .getAttribLocation (this .getProgram (), name);
|
|
1064
1164
|
|
|
1065
1165
|
if (location === -1)
|
|
1066
1166
|
return;
|
|
@@ -1079,7 +1179,7 @@ function (Fields,
|
|
|
1079
1179
|
},
|
|
1080
1180
|
disableMatrix4Attrib: function (gl, name)
|
|
1081
1181
|
{
|
|
1082
|
-
|
|
1182
|
+
const location = gl .getAttribLocation (this .getProgram (), name);
|
|
1083
1183
|
|
|
1084
1184
|
if (location === -1)
|
|
1085
1185
|
return;
|
|
@@ -1089,6 +1189,16 @@ function (Fields,
|
|
|
1089
1189
|
gl .disableVertexAttribArray (location + 2);
|
|
1090
1190
|
gl .disableVertexAttribArray (location + 3);
|
|
1091
1191
|
},
|
|
1192
|
+
enableFogDepthAttribute: function (gl, fogDepthBuffer)
|
|
1193
|
+
{
|
|
1194
|
+
gl .enableVertexAttribArray (this .x3d_FogDepth);
|
|
1195
|
+
gl .bindBuffer (gl .ARRAY_BUFFER, fogDepthBuffer);
|
|
1196
|
+
gl .vertexAttribPointer (this .x3d_FogDepth, 1, gl .FLOAT, false, 0, 0);
|
|
1197
|
+
},
|
|
1198
|
+
disableFogDepthAttribute: function (gl)
|
|
1199
|
+
{
|
|
1200
|
+
gl .disableVertexAttribArray (this .x3d_FogDepth);
|
|
1201
|
+
},
|
|
1092
1202
|
enableColorAttribute: function (gl, colorBuffer)
|
|
1093
1203
|
{
|
|
1094
1204
|
gl .enableVertexAttribArray (this .x3d_Color);
|
|
@@ -1099,15 +1209,33 @@ function (Fields,
|
|
|
1099
1209
|
{
|
|
1100
1210
|
gl .disableVertexAttribArray (this .x3d_Color);
|
|
1101
1211
|
},
|
|
1102
|
-
enableTexCoordAttribute: function (gl, texCoordBuffers)
|
|
1212
|
+
enableTexCoordAttribute: function (gl, texCoordBuffers, d)
|
|
1103
1213
|
{
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1214
|
+
const length = Math .min (this .x3d_MaxTextures, texCoordBuffers .length);
|
|
1215
|
+
|
|
1216
|
+
for (let i = 0; i < length; ++ i)
|
|
1217
|
+
{
|
|
1218
|
+
const x3d_TexCoord = this .x3d_TexCoord [i];
|
|
1219
|
+
|
|
1220
|
+
if (x3d_TexCoord === -1)
|
|
1221
|
+
continue;
|
|
1222
|
+
|
|
1223
|
+
gl .enableVertexAttribArray (x3d_TexCoord);
|
|
1224
|
+
gl .bindBuffer (gl .ARRAY_BUFFER, texCoordBuffers [i]);
|
|
1225
|
+
gl .vertexAttribPointer (x3d_TexCoord, 4, gl .FLOAT, false, 0, 0);
|
|
1226
|
+
}
|
|
1107
1227
|
},
|
|
1108
1228
|
disableTexCoordAttribute: function (gl)
|
|
1109
1229
|
{
|
|
1110
|
-
|
|
1230
|
+
for (let i = 0, length = this .x3d_MaxTextures; i < length; ++ i)
|
|
1231
|
+
{
|
|
1232
|
+
const x3d_TexCoord = this .x3d_TexCoord [i];
|
|
1233
|
+
|
|
1234
|
+
if (x3d_TexCoord === -1)
|
|
1235
|
+
continue;
|
|
1236
|
+
|
|
1237
|
+
gl .disableVertexAttribArray (x3d_TexCoord);
|
|
1238
|
+
}
|
|
1111
1239
|
},
|
|
1112
1240
|
enableNormalAttribute: function (gl, normalBuffer)
|
|
1113
1241
|
{
|
|
@@ -1129,14 +1257,11 @@ function (Fields,
|
|
|
1129
1257
|
{
|
|
1130
1258
|
gl .disableVertexAttribArray (this .x3d_Vertex);
|
|
1131
1259
|
},
|
|
1132
|
-
setParticle: function (gl,
|
|
1260
|
+
setParticle: function (gl, particle, modelViewMatrix)
|
|
1133
1261
|
{
|
|
1134
|
-
if (normalMatrix)
|
|
1135
|
-
gl .uniformMatrix3fv (this .x3d_NormalMatrix, false, this .getNormalMatrix (modelViewMatrix));
|
|
1136
|
-
|
|
1137
1262
|
gl .uniformMatrix4fv (this .x3d_ModelViewMatrix, false, modelViewMatrix);
|
|
1138
1263
|
|
|
1139
|
-
gl .uniform1i (this .x3d_ParticleId, id);
|
|
1264
|
+
gl .uniform1i (this .x3d_ParticleId, particle .id);
|
|
1140
1265
|
gl .uniform1i (this .x3d_ParticleLife, particle .life);
|
|
1141
1266
|
gl .uniform1f (this .x3d_ParticleElapsedTime, particle .elapsedTime / particle .lifetime);
|
|
1142
1267
|
},
|
|
@@ -1144,11 +1269,11 @@ function (Fields,
|
|
|
1144
1269
|
{
|
|
1145
1270
|
function cmp (lhs, rhs) { return lhs < rhs ? -1 : lhs > rhs ? 1 : 0; }
|
|
1146
1271
|
|
|
1147
|
-
|
|
1272
|
+
const
|
|
1148
1273
|
gl = this .getBrowser () .getContext (),
|
|
1149
1274
|
program = this .getProgram ();
|
|
1150
1275
|
|
|
1151
|
-
|
|
1276
|
+
const
|
|
1152
1277
|
result = {
|
|
1153
1278
|
attributes: [ ],
|
|
1154
1279
|
uniforms: [ ],
|
|
@@ -1160,7 +1285,7 @@ function (Fields,
|
|
|
1160
1285
|
|
|
1161
1286
|
// Taken from the WebGl spec:
|
|
1162
1287
|
// http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14
|
|
1163
|
-
|
|
1288
|
+
const enums = {
|
|
1164
1289
|
0x8B50: 'vec2',
|
|
1165
1290
|
0x8B51: 'vec3',
|
|
1166
1291
|
0x8B52: 'vec4',
|
|
@@ -1186,18 +1311,18 @@ function (Fields,
|
|
|
1186
1311
|
};
|
|
1187
1312
|
|
|
1188
1313
|
// Loop through active uniforms
|
|
1189
|
-
for (
|
|
1314
|
+
for (let i = 0; i < activeUniforms; ++ i)
|
|
1190
1315
|
{
|
|
1191
|
-
|
|
1316
|
+
const uniform = gl .getActiveUniform (program, i);
|
|
1192
1317
|
uniform .typeName = enums [uniform.type];
|
|
1193
1318
|
result .uniforms .push (Object .assign ({ }, uniform));
|
|
1194
1319
|
result .uniformCount += uniform .size;
|
|
1195
1320
|
}
|
|
1196
1321
|
|
|
1197
1322
|
// Loop through active attributes
|
|
1198
|
-
for (
|
|
1323
|
+
for (let i = 0; i < activeAttributes; ++ i)
|
|
1199
1324
|
{
|
|
1200
|
-
|
|
1325
|
+
const attribute = gl .getActiveAttrib (program, i);
|
|
1201
1326
|
attribute .typeName = enums [attribute .type];
|
|
1202
1327
|
result .attributes .push (Object .assign ({ }, attribute));
|
|
1203
1328
|
result .attributeCount += attribute .size;
|
|
@@ -1210,7 +1335,7 @@ function (Fields,
|
|
|
1210
1335
|
},
|
|
1211
1336
|
printProgramInfo: function ()
|
|
1212
1337
|
{
|
|
1213
|
-
|
|
1338
|
+
const programInfo = this .getProgramInfo ();
|
|
1214
1339
|
|
|
1215
1340
|
console .log (this .getName ());
|
|
1216
1341
|
console .table (programInfo .attributes);
|
|
@@ -1223,5 +1348,3 @@ function (Fields,
|
|
|
1223
1348
|
|
|
1224
1349
|
return X3DProgrammableShaderObject;
|
|
1225
1350
|
});
|
|
1226
|
-
|
|
1227
|
-
|