diff --git a/qubeenee.bin b/qubeenee.bin
index 6188d68..ef58d99 100644
Binary files a/qubeenee.bin and b/qubeenee.bin differ
diff --git a/qubeenee.bin.xz b/qubeenee.bin.xz
index ca35cc2..0b3920f 100644
Binary files a/qubeenee.bin.xz and b/qubeenee.bin.xz differ
diff --git a/qubeenee.blend b/qubeenee.blend
index 768d0d8..94e4c00 100644
Binary files a/qubeenee.blend and b/qubeenee.blend differ
diff --git a/qubeenee.css b/qubeenee.css
index 095aae9..a9470bc 100644
--- a/qubeenee.css
+++ b/qubeenee.css
@@ -1,33 +1,48 @@
body {
- margin: 0px;
- overflow: hidden;
+ margin: 0px;
+ overflow: hidden;
}
#container {
- position: absolute;
- top: 0px;
- left: 0px;
- width: 100%;
- height: 100%;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 100%;
+ height: 100%;
+
+}
+#lochkarte {
+ position: absolute;
+ top: 0; bottom: 0; right: 0; left: 0;
+}
+
+.dot {
+ height: 35px;
+ width: 35px;
+ padding: 7px;
+ margin: 7px;
+ background-color: #bbb;
+ border-radius: 50%;
+ display: inline-block;
}
div#fullscreen_button {
- position: absolute;
- top: 10px;
- right: 10px;
- width: 50px;
- height: 50px;
- cursor: pointer;
- background-size: 100% 100%;
- display: none;
+ position: absolute;
+ top: 10px;
+ right: 10px;
+ width: 50px;
+ height: 50px;
+ cursor: pointer;
+ background-size: 100% 100%;
+ display: none;
}
.fullscreen-open {
- background-image: url('media/fullscreen-open.png');
+ background-image: url('media/fullscreen-open.png');
}
.fullscreen-close {
- background-image: url('media/fullscreen-close.png');
+ background-image: url('media/fullscreen-close.png');
}
/* removes tap blinking on ios devices */
diff --git a/qubeenee.glb b/qubeenee.glb
new file mode 100644
index 0000000..394b28a
Binary files /dev/null and b/qubeenee.glb differ
diff --git a/qubeenee.gltf b/qubeenee.gltf
index 8926285..9f182da 100644
--- a/qubeenee.gltf
+++ b/qubeenee.gltf
@@ -17,14 +17,14 @@
"componentType" : 5126,
"count" : 4,
"max" : [
- 0.010000004433095455,
+ 1.0000004768371582,
0.0,
- 0.010000004433095455
+ 1.0000004768371582
],
"min" : [
- -0.010000004433095455,
+ -1.0000004768371582,
0.0,
- -0.010000004433095455
+ -1.0000004768371582
],
"type" : "VEC3"
},
@@ -93,14 +93,14 @@
"componentType" : 5126,
"count" : 4,
"max" : [
- 0.010000004433095455,
+ 1.0000004768371582,
0.0,
- 0.010000004433095455
+ 1.0000004768371582
],
"min" : [
- -0.010000004433095455,
+ -1.0000004768371582,
0.0,
- -0.010000004433095455
+ -1.0000004768371582
],
"type" : "VEC3"
},
@@ -154,6 +154,82 @@
},
{
"bufferView" : 10,
+ "componentType" : 5121,
+ "count" : 6,
+ "max" : [
+ 3
+ ],
+ "min" : [
+ 0
+ ],
+ "type" : "SCALAR"
+ },
+ {
+ "bufferView" : 11,
+ "componentType" : 5126,
+ "count" : 4,
+ "max" : [
+ 1.0000004768371582,
+ 0.0,
+ 1.0000004768371582
+ ],
+ "min" : [
+ -1.0000004768371582,
+ 0.0,
+ -1.0000004768371582
+ ],
+ "type" : "VEC3"
+ },
+ {
+ "bufferView" : 12,
+ "componentType" : 5126,
+ "count" : 4,
+ "max" : [
+ 0.0,
+ 1.0,
+ -0.0
+ ],
+ "min" : [
+ 0.0,
+ 1.0,
+ -0.0
+ ],
+ "type" : "VEC3"
+ },
+ {
+ "bufferView" : 13,
+ "componentType" : 5126,
+ "count" : 4,
+ "max" : [
+ 1.0,
+ 0.0,
+ -0.0,
+ 1.0
+ ],
+ "min" : [
+ 1.0,
+ 0.0,
+ -0.0,
+ 1.0
+ ],
+ "type" : "VEC4"
+ },
+ {
+ "bufferView" : 14,
+ "componentType" : 5126,
+ "count" : 4,
+ "max" : [
+ 1.0,
+ 1.0
+ ],
+ "min" : [
+ 0.0,
+ 0.0
+ ],
+ "type" : "VEC2"
+ },
+ {
+ "bufferView" : 15,
"componentType" : 5123,
"count" : 11904,
"max" : [
@@ -165,7 +241,7 @@
"type" : "SCALAR"
},
{
- "bufferView" : 11,
+ "bufferView" : 16,
"componentType" : 5126,
"count" : 2785,
"max" : [
@@ -181,7 +257,7 @@
"type" : "VEC3"
},
{
- "bufferView" : 12,
+ "bufferView" : 17,
"componentType" : 5126,
"count" : 2785,
"max" : [
@@ -197,7 +273,7 @@
"type" : "VEC3"
},
{
- "bufferView" : 13,
+ "bufferView" : 18,
"componentType" : 5126,
"count" : 2785,
"max" : [
@@ -215,7 +291,7 @@
"type" : "VEC4"
},
{
- "bufferView" : 14,
+ "bufferView" : 19,
"componentType" : 5126,
"count" : 2785,
"max" : [
@@ -229,7 +305,7 @@
"type" : "VEC2"
},
{
- "bufferView" : 15,
+ "bufferView" : 20,
"componentType" : 5123,
"count" : 23808,
"max" : [
@@ -241,7 +317,7 @@
"type" : "SCALAR"
},
{
- "bufferView" : 16,
+ "bufferView" : 21,
"componentType" : 5126,
"count" : 5578,
"max" : [
@@ -257,7 +333,7 @@
"type" : "VEC3"
},
{
- "bufferView" : 17,
+ "bufferView" : 22,
"componentType" : 5126,
"count" : 5578,
"max" : [
@@ -273,7 +349,7 @@
"type" : "VEC3"
},
{
- "bufferView" : 18,
+ "bufferView" : 23,
"componentType" : 5126,
"count" : 5578,
"max" : [
@@ -291,7 +367,7 @@
"type" : "VEC4"
},
{
- "bufferView" : 19,
+ "bufferView" : 24,
"componentType" : 5126,
"count" : 5578,
"max" : [
@@ -305,7 +381,7 @@
"type" : "VEC2"
},
{
- "bufferView" : 20,
+ "bufferView" : 25,
"componentType" : 5123,
"count" : 2880,
"max" : [
@@ -317,7 +393,7 @@
"type" : "SCALAR"
},
{
- "bufferView" : 21,
+ "bufferView" : 26,
"componentType" : 5126,
"count" : 559,
"max" : [
@@ -333,7 +409,7 @@
"type" : "VEC3"
},
{
- "bufferView" : 22,
+ "bufferView" : 27,
"componentType" : 5126,
"count" : 559,
"max" : [
@@ -349,7 +425,7 @@
"type" : "VEC3"
},
{
- "bufferView" : 23,
+ "bufferView" : 28,
"componentType" : 5126,
"count" : 559,
"max" : [
@@ -367,7 +443,159 @@
"type" : "VEC4"
},
{
- "bufferView" : 24,
+ "bufferView" : 29,
+ "componentType" : 5126,
+ "count" : 559,
+ "max" : [
+ 1.000000238418579,
+ 1.0
+ ],
+ "min" : [
+ 0.0,
+ 0.0
+ ],
+ "type" : "VEC2"
+ },
+ {
+ "bufferView" : 30,
+ "componentType" : 5123,
+ "count" : 2880,
+ "max" : [
+ 558
+ ],
+ "min" : [
+ 0
+ ],
+ "type" : "SCALAR"
+ },
+ {
+ "bufferView" : 31,
+ "componentType" : 5126,
+ "count" : 559,
+ "max" : [
+ 0.3528563678264618,
+ 0.35285627841949463,
+ 0.3528563976287842
+ ],
+ "min" : [
+ -0.35285621881484985,
+ -0.35285627841949463,
+ -0.35285627841949463
+ ],
+ "type" : "VEC3"
+ },
+ {
+ "bufferView" : 32,
+ "componentType" : 5126,
+ "count" : 559,
+ "max" : [
+ 1.0,
+ 1.0,
+ 1.0
+ ],
+ "min" : [
+ -1.0,
+ -1.0,
+ -1.0
+ ],
+ "type" : "VEC3"
+ },
+ {
+ "bufferView" : 33,
+ "componentType" : 5126,
+ "count" : 559,
+ "max" : [
+ 1.0,
+ 0.049123480916023254,
+ 1.0,
+ 1.0
+ ],
+ "min" : [
+ -1.0,
+ -0.04912358149886131,
+ -1.0,
+ 1.0
+ ],
+ "type" : "VEC4"
+ },
+ {
+ "bufferView" : 34,
+ "componentType" : 5126,
+ "count" : 559,
+ "max" : [
+ 1.000000238418579,
+ 1.0
+ ],
+ "min" : [
+ 0.0,
+ 0.0
+ ],
+ "type" : "VEC2"
+ },
+ {
+ "bufferView" : 35,
+ "componentType" : 5123,
+ "count" : 2880,
+ "max" : [
+ 558
+ ],
+ "min" : [
+ 0
+ ],
+ "type" : "SCALAR"
+ },
+ {
+ "bufferView" : 36,
+ "componentType" : 5126,
+ "count" : 559,
+ "max" : [
+ 0.3528563678264618,
+ 0.35285627841949463,
+ 0.3528563976287842
+ ],
+ "min" : [
+ -0.35285621881484985,
+ -0.35285627841949463,
+ -0.35285627841949463
+ ],
+ "type" : "VEC3"
+ },
+ {
+ "bufferView" : 37,
+ "componentType" : 5126,
+ "count" : 559,
+ "max" : [
+ 1.0,
+ 1.0,
+ 1.0
+ ],
+ "min" : [
+ -1.0,
+ -1.0,
+ -1.0
+ ],
+ "type" : "VEC3"
+ },
+ {
+ "bufferView" : 38,
+ "componentType" : 5126,
+ "count" : 559,
+ "max" : [
+ 1.0,
+ 0.049123480916023254,
+ 1.0,
+ 1.0
+ ],
+ "min" : [
+ -1.0,
+ -0.04912358149886131,
+ -1.0,
+ 1.0
+ ],
+ "type" : "VEC4"
+ },
+ {
+ "bufferView" : 39,
"componentType" : 5126,
"count" : 559,
"max" : [
@@ -448,98 +676,188 @@
},
{
"buffer" : 0,
- "byteLength" : 23808,
+ "byteLength" : 6,
"byteOffset" : 400,
"target" : 34963
},
+ {
+ "buffer" : 0,
+ "byteLength" : 48,
+ "byteOffset" : 408,
+ "target" : 34962
+ },
+ {
+ "buffer" : 0,
+ "byteLength" : 48,
+ "byteOffset" : 456,
+ "target" : 34962
+ },
+ {
+ "buffer" : 0,
+ "byteLength" : 64,
+ "byteOffset" : 504,
+ "target" : 34962
+ },
+ {
+ "buffer" : 0,
+ "byteLength" : 32,
+ "byteOffset" : 568,
+ "target" : 34962
+ },
+ {
+ "buffer" : 0,
+ "byteLength" : 23808,
+ "byteOffset" : 600,
+ "target" : 34963
+ },
{
"buffer" : 0,
"byteLength" : 33420,
- "byteOffset" : 24208,
+ "byteOffset" : 24408,
"target" : 34962
},
{
"buffer" : 0,
"byteLength" : 33420,
- "byteOffset" : 57628,
+ "byteOffset" : 57828,
"target" : 34962
},
{
"buffer" : 0,
"byteLength" : 44560,
- "byteOffset" : 91048,
+ "byteOffset" : 91248,
"target" : 34962
},
{
"buffer" : 0,
"byteLength" : 22280,
- "byteOffset" : 135608,
+ "byteOffset" : 135808,
"target" : 34962
},
{
"buffer" : 0,
"byteLength" : 47616,
- "byteOffset" : 157888,
+ "byteOffset" : 158088,
"target" : 34963
},
{
"buffer" : 0,
"byteLength" : 66936,
- "byteOffset" : 205504,
+ "byteOffset" : 205704,
"target" : 34962
},
{
"buffer" : 0,
"byteLength" : 66936,
- "byteOffset" : 272440,
+ "byteOffset" : 272640,
"target" : 34962
},
{
"buffer" : 0,
"byteLength" : 89248,
- "byteOffset" : 339376,
+ "byteOffset" : 339576,
"target" : 34962
},
{
"buffer" : 0,
"byteLength" : 44624,
- "byteOffset" : 428624,
+ "byteOffset" : 428824,
"target" : 34962
},
{
"buffer" : 0,
"byteLength" : 5760,
- "byteOffset" : 473248,
+ "byteOffset" : 473448,
"target" : 34963
},
{
"buffer" : 0,
"byteLength" : 6708,
- "byteOffset" : 479008,
+ "byteOffset" : 479208,
"target" : 34962
},
{
"buffer" : 0,
"byteLength" : 6708,
- "byteOffset" : 485716,
+ "byteOffset" : 485916,
"target" : 34962
},
{
"buffer" : 0,
"byteLength" : 8944,
- "byteOffset" : 492424,
+ "byteOffset" : 492624,
"target" : 34962
},
{
"buffer" : 0,
"byteLength" : 4472,
- "byteOffset" : 501368,
+ "byteOffset" : 501568,
+ "target" : 34962
+ },
+ {
+ "buffer" : 0,
+ "byteLength" : 5760,
+ "byteOffset" : 506040,
+ "target" : 34963
+ },
+ {
+ "buffer" : 0,
+ "byteLength" : 6708,
+ "byteOffset" : 511800,
+ "target" : 34962
+ },
+ {
+ "buffer" : 0,
+ "byteLength" : 6708,
+ "byteOffset" : 518508,
+ "target" : 34962
+ },
+ {
+ "buffer" : 0,
+ "byteLength" : 8944,
+ "byteOffset" : 525216,
+ "target" : 34962
+ },
+ {
+ "buffer" : 0,
+ "byteLength" : 4472,
+ "byteOffset" : 534160,
+ "target" : 34962
+ },
+ {
+ "buffer" : 0,
+ "byteLength" : 5760,
+ "byteOffset" : 538632,
+ "target" : 34963
+ },
+ {
+ "buffer" : 0,
+ "byteLength" : 6708,
+ "byteOffset" : 544392,
+ "target" : 34962
+ },
+ {
+ "buffer" : 0,
+ "byteLength" : 6708,
+ "byteOffset" : 551100,
+ "target" : 34962
+ },
+ {
+ "buffer" : 0,
+ "byteLength" : 8944,
+ "byteOffset" : 557808,
+ "target" : 34962
+ },
+ {
+ "buffer" : 0,
+ "byteLength" : 4472,
+ "byteOffset" : 566752,
"target" : 34962
}
],
"buffers" : [
{
- "byteLength" : 505840,
+ "byteLength" : 571224,
"uri" : "qubeenee.bin"
}
],
@@ -822,6 +1140,111 @@
},
"name" : "energycenter"
},
+ {
+ "extensions" : {
+ "S8S_v3d_material_data" : {
+ "nodeGraph" : {
+ "edges" : [
+ {
+ "fromNode" : 1,
+ "fromOutput" : 0,
+ "toInput" : 0,
+ "toNode" : 0
+ }
+ ],
+ "nodes" : [
+ {
+ "inputs" : [
+ [
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ [
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ ],
+ "is_active_output" : true,
+ "name" : "Material Output",
+ "outputs" : [],
+ "type" : "OUTPUT_MATERIAL"
+ },
+ {
+ "inputs" : [
+ [
+ 0.8000000715255737,
+ 0.001376279047690332,
+ 0.0,
+ 1.0
+ ],
+ 0.0,
+ [
+ 1.0,
+ 0.20000000298023224,
+ 0.10000000149011612
+ ],
+ [
+ 0.609065055847168,
+ 0.8000000715255737,
+ 0.7311621308326721,
+ 1.0
+ ],
+ 0.00564885139465332,
+ 0.6145038604736328,
+ 0.0,
+ 0.232824444770813,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.5,
+ 0.0,
+ 0.029999999329447746,
+ 1.4500000476837158,
+ 0.0,
+ 0.0,
+ [
+ 0.0,
+ 0.0,
+ 0.0
+ ],
+ [
+ 0.0,
+ 0.0,
+ 0.0
+ ],
+ [
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ ],
+ "is_active_output" : false,
+ "name" : "Principled BSDF",
+ "outputs" : [
+ [
+ 0,
+ 0,
+ 0,
+ 0
+ ]
+ ],
+ "type" : "BSDF_PRINCIPLED"
+ }
+ ]
+ }
+ }
+ },
+ "name" : "on"
+ },
{
"alphaMode" : "BLEND",
"doubleSided" : true,
@@ -1175,7 +1598,7 @@
"TEXCOORD_0" : 4
},
"indices" : 0,
- "material" : 3,
+ "material" : 4,
"mode" : 4
}
]
@@ -1213,7 +1636,7 @@
}
}
},
- "name" : "Sphere",
+ "name" : "Plane.002",
"primitives" : [
{
"attributes" : {
@@ -1223,6 +1646,30 @@
"TEXCOORD_0" : 14
},
"indices" : 10,
+ "material" : 2,
+ "mode" : 4
+ }
+ ]
+ },
+ {
+ "extensions" : {
+ "S8S_v3d_mesh_data" : {
+ "colorLayers" : {},
+ "uvLayers" : {
+ "UVMap" : "TEXCOORD_0"
+ }
+ }
+ },
+ "name" : "Sphere",
+ "primitives" : [
+ {
+ "attributes" : {
+ "NORMAL" : 17,
+ "POSITION" : 16,
+ "TANGENT" : 18,
+ "TEXCOORD_0" : 19
+ },
+ "indices" : 15,
"material" : 0,
"mode" : 4
}
@@ -1241,13 +1688,13 @@
"primitives" : [
{
"attributes" : {
- "NORMAL" : 17,
- "POSITION" : 16,
- "TANGENT" : 18,
- "TEXCOORD_0" : 19
+ "NORMAL" : 22,
+ "POSITION" : 21,
+ "TANGENT" : 23,
+ "TEXCOORD_0" : 24
},
- "indices" : 15,
- "material" : 2,
+ "indices" : 20,
+ "material" : 3,
"mode" : 4
}
]
@@ -1265,16 +1712,64 @@
"primitives" : [
{
"attributes" : {
- "NORMAL" : 22,
- "POSITION" : 21,
- "TANGENT" : 23,
- "TEXCOORD_0" : 24
+ "NORMAL" : 27,
+ "POSITION" : 26,
+ "TANGENT" : 28,
+ "TEXCOORD_0" : 29
},
- "indices" : 20,
+ "indices" : 25,
"material" : 1,
"mode" : 4
}
]
+ },
+ {
+ "extensions" : {
+ "S8S_v3d_mesh_data" : {
+ "colorLayers" : {},
+ "uvLayers" : {
+ "UVMap" : "TEXCOORD_0"
+ }
+ }
+ },
+ "name" : "Sphere.003",
+ "primitives" : [
+ {
+ "attributes" : {
+ "NORMAL" : 32,
+ "POSITION" : 31,
+ "TANGENT" : 33,
+ "TEXCOORD_0" : 34
+ },
+ "indices" : 30,
+ "material" : 0,
+ "mode" : 4
+ }
+ ]
+ },
+ {
+ "extensions" : {
+ "S8S_v3d_mesh_data" : {
+ "colorLayers" : {},
+ "uvLayers" : {
+ "UVMap" : "TEXCOORD_0"
+ }
+ }
+ },
+ "name" : "Sphere.004",
+ "primitives" : [
+ {
+ "attributes" : {
+ "NORMAL" : 37,
+ "POSITION" : 36,
+ "TANGENT" : 38,
+ "TEXCOORD_0" : 39
+ },
+ "indices" : 35,
+ "material" : 0,
+ "mode" : 4
+ }
+ ]
}
],
"nodes" : [
@@ -1287,7 +1782,7 @@
"renderOrder" : 0
}
},
- "mesh" : 2,
+ "mesh" : 3,
"name" : "bit",
"translation" : [
-6.0,
@@ -1295,6 +1790,101 @@
-0.0
]
},
+ {
+ "extensions" : {
+ "S8S_v3d_node_data" : {
+ "frustumCulling" : true,
+ "groupNames" : [],
+ "hidden" : false,
+ "renderOrder" : 0
+ }
+ },
+ "mesh" : 7,
+ "name" : "recordqubit",
+ "scale" : [
+ 0.7053155303001404,
+ 0.7053155303001404,
+ 0.7053154110908508
+ ],
+ "translation" : [
+ -0.061569999903440475,
+ -0.9987030029296875,
+ 6.999632835388184
+ ]
+ },
+ {
+ "extensions" : {
+ "S8S_v3d_node_data" : {
+ "frustumCulling" : true,
+ "groupNames" : [],
+ "hidden" : false,
+ "renderOrder" : 0
+ }
+ },
+ "mesh" : 6,
+ "name" : "recordbit",
+ "scale" : [
+ 0.7053154706954956,
+ 0.7053154706954956,
+ 0.7053154706954956
+ ],
+ "translation" : [
+ -5.938425540924072,
+ -0.998703122138977,
+ 6.999633312225342
+ ]
+ },
+ {
+ "extensions" : {
+ "S8S_v3d_node_data" : {
+ "frustumCulling" : true,
+ "groupNames" : [],
+ "hidden" : false,
+ "renderOrder" : 0
+ }
+ },
+ "mesh" : 1,
+ "name" : "matholderblack",
+ "translation" : [
+ -2.936447858810425,
+ -0.02485582046210766,
+ 27.280128479003906
+ ]
+ },
+ {
+ "extensions" : {
+ "S8S_v3d_node_data" : {
+ "frustumCulling" : true,
+ "groupNames" : [],
+ "hidden" : false,
+ "renderOrder" : 0
+ }
+ },
+ "mesh" : 0,
+ "name" : "matholderwhite",
+ "translation" : [
+ -2.936447858810425,
+ -0.02485582046210766,
+ 24.218271255493164
+ ]
+ },
+ {
+ "extensions" : {
+ "S8S_v3d_node_data" : {
+ "frustumCulling" : true,
+ "groupNames" : [],
+ "hidden" : false,
+ "renderOrder" : 0
+ }
+ },
+ "mesh" : 2,
+ "name" : "matholderwhite.001",
+ "translation" : [
+ -2.936447858810425,
+ -0.02485582046210766,
+ 21.218271255493164
+ ]
+ },
{
"camera" : 0,
"extensions" : {
@@ -1337,43 +1927,9 @@
"renderOrder" : 0
}
},
- "mesh" : 3,
+ "mesh" : 4,
"name" : "qubit"
},
- {
- "extensions" : {
- "S8S_v3d_node_data" : {
- "frustumCulling" : true,
- "groupNames" : [],
- "hidden" : false,
- "renderOrder" : 0
- }
- },
- "mesh" : 1,
- "name" : "matholderblack",
- "translation" : [
- -2.936447858810425,
- -0.02485582046210766,
- 28.280128479003906
- ]
- },
- {
- "extensions" : {
- "S8S_v3d_node_data" : {
- "frustumCulling" : true,
- "groupNames" : [],
- "hidden" : false,
- "renderOrder" : 0
- }
- },
- "mesh" : 0,
- "name" : "matholderwhite",
- "translation" : [
- -2.936447858810425,
- -0.02485582046210766,
- 24.218271255493164
- ]
- },
{
"extensions" : {
"S8S_v3d_node_data" : {
@@ -1386,7 +1942,7 @@
"renderOrder" : 0
}
},
- "mesh" : 4,
+ "mesh" : 5,
"name" : "qubit_controller"
}
],
@@ -1399,7 +1955,7 @@
"light" : 0,
"physicallyCorrectLights" : true,
"useHDR" : true,
- "worldMaterial" : 4
+ "worldMaterial" : 5
}
},
"extras" : {
@@ -1410,9 +1966,12 @@
0,
4,
3,
- 1,
2,
- 5
+ 1,
+ 5,
+ 6,
+ 7,
+ 8
]
}
]
diff --git a/qubeenee.gltf.xz b/qubeenee.gltf.xz
index 6451605..91978a2 100644
Binary files a/qubeenee.gltf.xz and b/qubeenee.gltf.xz differ
diff --git a/qubeenee.html b/qubeenee.html
index a0e78cd..9afe912 100644
--- a/qubeenee.html
+++ b/qubeenee.html
@@ -1,6 +1,5 @@
-
Qubeenee
@@ -30,15 +29,24 @@
- -->
-
-
+-->
+
+
+
+
+
-
+
+
+
+
+
+
+
diff --git a/qubeenee.js b/qubeenee.js
index 7b772c2..e3d5f50 100644
--- a/qubeenee.js
+++ b/qubeenee.js
@@ -1,7 +1,5 @@
'use strict';
-/* __V3D_TEMPLATE__ - template-based file; delete this line to prevent this file from being updated */
-
window.addEventListener('load', function() {
(function() {
@@ -166,30 +164,61 @@ function initFullScreen() {
}
function prepareExternalInterface(app) {
+
app.ExternalInterface.HSVtoRGB = function(h, s, v) {
- var r, g, b, i, f, p, q, t;
- i = Math.floor(h * 6);
- f = h * 6 - i;
- p = v * (1 - s);
- q = v * (1 - f * s);
- t = v * (1 - (1 - f) * s);
- switch (i % 6) {
- case 0: r = v, g = t, b = p; break;
- case 1: r = q, g = v, b = p; break;
- case 2: r = p, g = v, b = t; break;
- case 3: r = p, g = q, b = v; break;
- case 4: r = t, g = p, b = v; break;
- case 5: r = v, g = p, b = q; break;
- }
- app.ExternalInterface.setRGB(r, g, b);
+ var r, g, b, i, f, p, q, t;
+ i = Math.floor(h * 6);
+ f = h * 6 - i;
+ p = v * (1 - s);
+ q = v * (1 - f * s);
+ t = v * (1 - (1 - f) * s);
+ switch (i % 6) {
+ case 0: r = v, g = t, b = p; break;
+ case 1: r = q, g = v, b = p; break;
+ case 2: r = p, g = v, b = t; break;
+ case 3: r = p, g = q, b = v; break;
+ case 4: r = t, g = p, b = v; break;
+ case 5: r = v, g = p, b = q; break;
}
+ app.ExternalInterface.setRGB(r, g, b);
+ }
+
+ let bid = 0;
+ let qid = 0;
+ app.ExternalInterface.addBit = function(state) {
+ $("#lochkarte").append("");
+ $("#b" + bid).css("background-color","rgb("+255*state+", "+255*state+", "+255*state+")")
+ bid++;
+ }
+
+
+ app.ExternalInterface.addQubit = function(stateR, stateG, stateB) {
+ $("#lochkarte").append("");
+ $("#q" + qid).css("background-color","rgb("+255*stateR+", "+255*stateG+", "+255*stateB+")")
+ qid++;
+ }
+
+ /*
+
+ app.ExternalInterface.setDivWidth = function(d) {
+ console.log(d);
+ $( "#lochkarte" ).width = d;
+ }
+
+ function reportWindowSize() {
+ app.ExternalInterface.rs();
+ }
+
+ window.onresize = reportWindowSize;
+ */
}
+
function runCode(app) {
- // add your code here, e.g. console.log('Hello, World!');
+ //window.onresize = app.ExternalInterface.setDivWidth;
}
});
diff --git a/v3d.js b/v3d.js
index 907d2e6..33d9ad1 100644
--- a/v3d.js
+++ b/v3d.js
@@ -1 +1 @@
-!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.v3d=e.v3d||{})}(this,function(e){"use strict";function t(){}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===Math.sign&&(Math.sign=function(e){return e<0?-1:0>8&255]+i[e>>16&255]+i[e>>24&255]+"-"+i[255&t]+i[t>>8&255]+"-"+i[t>>16&15|64]+i[t>>24&255]+"-"+i[63&n|128]+i[n>>8&255]+"-"+i[n>>16&255]+i[n>>24&255]+i[255&r]+i[r>>8&255]+i[r>>16&255]+i[r>>24&255]).toUpperCase()}}(),clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:n<=e?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:n<=e?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*Nt.DEG2RAD},radToDeg:function(e){return e*Nt.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},hashString:function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0},expAverage:function(e,t,n,r){var i=Math.exp(-n/r);return e*i+(1-i)*t},angleToRange_0_2Pi:function(e){return this.clamp(e-2*Math.PI*Math.floor(e/(2*Math.PI)),0,2*Math.PI)},clampAngle:function(e,t,n){var r=this.angleToRange_0_2Pi(e-t),i=this.angleToRange_0_2Pi(n-t);return iNumber.EPSILON){var x=Math.sqrt(y),_=Math.atan2(x,v*g);m=Math.sin(m*_)/x,o=Math.sin(o*_)/x}var b=o*g;if(s=s*m+h*b,l=l*m+d*b,c=c*m+p*b,u=u*m+f*b,m===1-o){var w=1/Math.sqrt(s*s+l*l+c*c+u*u);s*=w,l*=w,c*=w,u*=w}}e[t]=s,e[t+1]=l,e[t+2]=c,e[t+3]=u}}),Object.defineProperties(Ut.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this.onChangeCallback()}}}),Object.assign(Ut.prototype,{isQuaternion:!0,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this.onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw new Error("v3d.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,r=e._y,i=e._z,a=e.order,o=Math.cos,s=Math.sin,l=o(n/2),c=o(r/2),u=o(i/2),h=s(n/2),d=s(r/2),p=s(i/2);return"XYZ"===a?(this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p):"YXZ"===a?(this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p):"ZXY"===a?(this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p):"ZYX"===a?(this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p):"YZX"===a?(this._x=h*c*u+l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u-h*d*p):"XZY"===a&&(this._x=h*c*u-l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u+h*d*p),!1!==t&&this.onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this.onChangeCallback(),this},setFromRotationMatrix:function(e){var t,n=e.elements,r=n[0],i=n[4],a=n[8],o=n[1],s=n[5],l=n[9],c=n[2],u=n[6],h=n[10],d=r+s+h;return this._z=0Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0):(this._x=0,this._y=-e.z,this._z=e.y)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x),n),this.normalize()},angleTo:function(e){return 2*Math.acos(Math.abs(Nt.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,t){var n=this.angleTo(e);if(0===n)return this;var r=Math.min(1,t/n);return this.slerp(e,r),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return this._w=0===e?(this._x=0,this._y=0,this._z=0,1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w*e),this.onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(console.warn("v3d.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions(a, b) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,l=t._z,c=t._w;return this._x=n*c+a*o+r*l-i*s,this._y=r*c+a*s+i*o-n*l,this._z=i*c+a*l+n*s-r*o,this._w=a*c-n*o-r*s-i*l,this.onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,a=this._w,o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),1<=o)return this._w=a,this._x=n,this._y=r,this._z=i,this;var s=1-o*o;if(s<=Number.EPSILON){var l=1-t;return this._w=l*a+t*this._w,this._x=l*n+t*this._x,this._y=l*r+t*this._y,this._z=l*i+t*this._z,this.normalize()}var c=Math.sqrt(s),u=Math.atan2(c,o),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=a*h+this._w*d,this._x=n*h+this._x*d,this._y=r*h+this._y*d,this._z=i*h+this._z*d,this.onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(Bt.prototype,{isVector3:!0,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("v3d.Vector3: .add() now only accepts one argument. Use .addVectors(a, b) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("v3d.Vector3: .sub() now only accepts one argument. Use .subVectors(a, b) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("v3d.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors(a, b) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:(c=new Ut,function(e){return e&&e.isEuler||console.error("v3d.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(c.setFromEuler(e))}),applyAxisAngle:(l=new Ut,function(e,t){return this.applyQuaternion(l.setFromAxisAngle(e,t))}),applyMatrix3:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this},applyQuaternion:function(e){var t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,l=s*t+a*r-o*n,c=s*n+o*t-i*r,u=s*r+i*n-a*t,h=-i*t-a*n-o*r;return this.x=l*s+h*-i+c*-o-u*-a,this.y=c*s+h*-a+u*-i-l*-o,this.z=u*s+h*-o+l*-a-c*-i,this},project:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)},unproject:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)},transformDirection:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:(o=new Bt,s=new Bt,function(e,t){return o.set(e,e,e),s.set(t,t,t),this.clamp(o,s)}),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},cross:function(e,t){return void 0!==t?(console.warn("v3d.Vector3: .cross() now only accepts one argument. Use .crossVectors(a, b) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this},projectOnVector:function(e){var t=e.dot(this)/e.lengthSq();return this.copy(e).multiplyScalar(t)},projectOnPlane:(a=new Bt,function(e){return a.copy(this).projectOnVector(e),this.sub(a)}),reflect:(i=new Bt,function(e){return this.sub(i.copy(e).multiplyScalar(2*this.dot(e)))}),angleTo:function(e){var t=this.dot(e)/Math.sqrt(this.lengthSq()*e.lengthSq());return Math.acos(Nt.clamp(t,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)},setFromSphericalCoords:function(e,t,n){var r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this},setFromCylindrical:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},setFromCylindricalCoords:function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("v3d.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}}),Object.assign(zt.prototype,{isMatrix3:!0,set:function(e,t,n,r,i,a,o,s,l){var c=this.elements;return c[0]=e,c[1]=r,c[2]=o,c[3]=t,c[4]=i,c[5]=s,c[6]=n,c[7]=a,c[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this},setFromMatrix4:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},applyToBufferAttribute:(u=new Bt,function(e){for(var t=0,n=e.count;tthis.max.x||e.ythis.max.y||e.zthis.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){return void 0===t&&(console.warn("v3d.Box3: .getParameter() target is now required"),t=new Bt),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)},intersectsSphere:(Xt=new Bt,function(e){return this.clampPoint(e.center,Xt),Xt.distanceToSquared(e.center)<=e.radius*e.radius}),intersectsPlane:function(e){var t,n;return n=0=-e.constant},intersectsTriangle:function(){var s=new Bt,l=new Bt,c=new Bt,n=new Bt,r=new Bt,i=new Bt,u=new Bt,a=new Bt,h=new Bt,o=new Bt;function d(e){var t,n;for(t=0,n=e.length-3;t<=n;t+=3){u.fromArray(e,t);var r=h.x*Math.abs(u.x)+h.y*Math.abs(u.y)+h.z*Math.abs(u.z),i=s.dot(u),a=l.dot(u),o=c.dot(u);if(Math.max(-Math.max(i,a,o),Math.min(i,a,o))>r)return!1}return!0}return function(e){if(this.isEmpty())return!1;this.getCenter(a),h.subVectors(this.max,a),s.subVectors(e.a,a),l.subVectors(e.b,a),c.subVectors(e.c,a),n.subVectors(l,s),r.subVectors(c,l),i.subVectors(s,c);var t=[0,-n.z,n.y,0,-r.z,r.y,0,-i.z,i.y,n.z,0,-n.x,r.z,0,-r.x,i.z,0,-i.x,-n.y,n.x,0,-r.y,r.x,0,-i.y,i.x,0];return!!d(t)&&(!!d(t=[1,0,0,0,1,0,0,0,1])&&(o.crossVectors(n,r),d(t=[o.x,o.y,o.z])))}}(),clampPoint:function(e,t){return void 0===t&&(console.warn("v3d.Box3: .clampPoint() target is now required"),t=new Bt),t.copy(e).clamp(this.min,this.max)},distanceToPoint:(Wt=new Bt,function(e){return Wt.copy(e).clamp(this.min,this.max).sub(e).length()}),getBoundingSphere:(jt=new Bt,function(e){return void 0===e&&console.error("v3d.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(jt).length(),e}),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:(Vt=[new Bt,new Bt,new Bt,new Bt,new Bt,new Bt,new Bt,new Bt],function(e){return this.isEmpty()||(Vt[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Vt[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Vt[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Vt[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Vt[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Vt[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Vt[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Vt[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Vt)),this}),translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),Object.assign(bn.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:(Yt=new _n,function(e,t){var n=this.center;void 0!==t?n.copy(t):Yt.setFromPoints(e).getCenter(n);for(var r=0,i=0,a=e.length;ithis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t},getBoundingBox:function(e){return void 0===e&&(console.warn("v3d.Sphere: .getBoundingBox() target is now required"),e=new _n),e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}}),Object.assign(wn.prototype,{set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:(Kt=new Bt,Jt=new Bt,function(e,t,n){var r=Kt.subVectors(n,t).cross(Jt.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return void 0===t&&(console.warn("v3d.Plane: .projectPoint() target is now required"),t=new Bt),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:(Zt=new Bt,function(e,t){void 0===t&&(console.warn("v3d.Plane: .intersectLine() target is now required"),t=new Bt);var n=e.delta(Zt),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):void 0;var i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||1 0.0) {\n distanceFalloff *= pow2(saturate(1.0 - pow4(lightDistance / cutoffDistance)));\n }\n return distanceFalloff;\n#elif defined(BLENDER_LIGHTS)\n return cutoffDistance / (cutoffDistance + pow2(lightDistance));\n#else\n if(cutoffDistance > 0.0) {\n return pow(saturate(-lightDistance / cutoffDistance + 1.0), decayExponent);\n }\n return 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert(const in vec3 diffuseColor) {\n return RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick(const in vec3 specularColor, const in float dotLH) {\n float fresnel = exp2((-5.55473 * dotLH - 6.98316) * dotLH);\n return (1.0 - specularColor) * fresnel + specularColor;\n}\nfloat G_GGX_Smith(const in float alpha, const in float dotNL, const in float dotNV) {\n float a2 = pow2(alpha);\n float gl = dotNL + sqrt(a2 + (1.0 - a2) * pow2(dotNL));\n float gv = dotNV + sqrt(a2 + (1.0 - a2) * pow2(dotNV));\n return 1.0 / (gl * gv);\n}\nfloat G_GGX_SmithCorrelated(const in float alpha, const in float dotNL, const in float dotNV) {\n float a2 = pow2(alpha);\n float gv = dotNL * sqrt(a2 + (1.0 - a2) * pow2(dotNV));\n float gl = dotNV * sqrt(a2 + (1.0 - a2) * pow2(dotNL));\n return 0.5 / max(gv + gl, EPSILON);\n}\nfloat D_GGX(const in float alpha, const in float dotNH) {\n float a2 = pow2(alpha);\n float denom = pow2(dotNH) * (a2 - 1.0) + 1.0;\n return RECIPROCAL_PI * a2 / pow2(denom);\n}\nvec3 BRDF_Specular_GGX(const in IncidentLight incidentLight, const in vec3 viewDir,\n const in vec3 normal, const in vec3 specularColor, const in float roughness) {\n float alpha = pow2(roughness);\n vec3 halfDir = normalize(incidentLight.direction + viewDir);\n float dotNL = saturate(dot(normal, incidentLight.direction));\n float dotNV = saturate(dot(normal, viewDir));\n float dotNH = saturate(dot(normal, halfDir));\n float dotLH = saturate(dot(incidentLight.direction, halfDir));\n vec3 F = F_Schlick(specularColor, dotLH);\n float G = G_GGX_SmithCorrelated(alpha, dotNL, dotNV);\n float D = D_GGX(alpha, dotNH);\n return F * (G * D);\n}\n#if NUM_RECT_AREA_LIGHTS > 0\nvec2 LTC_Uv(const in vec3 N, const in vec3 V, const in float roughness) {\n const float LUT_SIZE = 64.0;\n const float LUT_SCALE = (LUT_SIZE - 1.0) / LUT_SIZE;\n const float LUT_BIAS = 0.5 / LUT_SIZE;\n float dotNV = saturate(dot(N, V));\n vec2 uv = vec2(roughness, sqrt(1.0 - dotNV));\n uv = uv * LUT_SCALE + LUT_BIAS;\n return uv;\n}\nfloat LTC_ClippedSphereFormFactor(const in vec3 f) {\n float l = length(f);\n return max((l * l + f.z) / (l + 1.0), 0.0);\n}\nvec3 LTC_EdgeVectorFormFactor(const in vec3 v1, const in vec3 v2) {\n float x = dot(v1, v2);\n float y = abs(x);\n float a = 0.8543985 + (0.4965155 + 0.0145206 * y) * y;\n float b = 3.4175940 + (4.1616724 + y) * y;\n float v = a / b;\n float theta_sintheta = (x > 0.0) ? v : 0.5 * inversesqrt(max(1.0 - x * x, 1e-7)) - v;\n return cross(v1, v2) * theta_sintheta;\n}\nvec3 LTC_Evaluate(const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[4]) {\n vec3 v1 = rectCoords[1] - rectCoords[0];\n vec3 v2 = rectCoords[3] - rectCoords[0];\n vec3 lightNormal = cross(v1, v2);\n if(dot(lightNormal, P - rectCoords[0]) < 0.0) return vec3(0.0);\n vec3 T1, T2;\n T1 = normalize(V - N * dot(V, N));\n T2 = - cross(N, T1);\n mat3 mat = mInv * transposeMat3(mat3(T1, T2, N));\n vec3 coords[4];\n coords[0] = mat * (rectCoords[0] - P);\n coords[1] = mat * (rectCoords[1] - P);\n coords[2] = mat * (rectCoords[2] - P);\n coords[3] = mat * (rectCoords[3] - P);\n coords[0] = normalize(coords[0]);\n coords[1] = normalize(coords[1]);\n coords[2] = normalize(coords[2]);\n coords[3] = normalize(coords[3]);\n vec3 vectorFormFactor = vec3(0.0);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[0], coords[1]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[1], coords[2]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[2], coords[3]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[3], coords[0]);\n float result = LTC_ClippedSphereFormFactor(vectorFormFactor);\n return vec3(result);\n}\n#endif\nvec3 BRDF_Specular_GGX_Environment(const in GeometricContext geometry,\n const in vec3 specularColor, const in float roughness, const int useCoat) {\n vec3 normal = geometry.normal;\n if (useCoat == 1) {\n normal = geometry.coatNormal;\n }\n float dotNV = saturate(dot(normal, geometry.viewDir));\n const vec4 c0 = vec4(- 1, - 0.0275, - 0.572, 0.022);\n const vec4 c1 = vec4(1, 0.0425, 1.04, - 0.04);\n vec4 r = roughness * c0 + c1;\n float a004 = min(r.x * r.x, exp2(- 9.28 * dotNV)) * r.x + r.y;\n vec2 AB = vec2(-1.04, 1.04) * a004 + r.zw;\n return specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit() {\n return 0.25;\n}\nfloat D_BlinnPhong(const in float shininess, const in float dotNH) {\n return RECIPROCAL_PI * (shininess * 0.5 + 1.0) * pow(dotNH, shininess);\n}\nvec3 BRDF_Specular_BlinnPhong(const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess) {\n vec3 halfDir = normalize(incidentLight.direction + geometry.viewDir);\n float dotNH = saturate(dot(geometry.normal, halfDir));\n float dotLH = saturate(dot(incidentLight.direction, halfDir));\n vec3 F = F_Schlick(specularColor, dotLH);\n float G = G_BlinnPhong_Implicit();\n float D = D_BlinnPhong(shininess, dotNH);\n return F * (G * D);\n}\nfloat GGXRoughnessToBlinnExponent(const in float ggxRoughness) {\n return (2.0 / pow2(ggxRoughness + 0.0001) - 2.0);\n}\nfloat BlinnExponentToGGXRoughness(const in float blinnExponent) {\n return sqrt(2.0 / (blinnExponent + 2.0));\n}",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n vec2 dHdxy_fwd() {\n vec2 dSTdx = dFdx(vUv);\n vec2 dSTdy = dFdy(vUv);\n float Hll = bumpScale * texture2D(bumpMap, vUv).x;\n float dBx = bumpScale * texture2D(bumpMap, vUv + dSTdx).x - Hll;\n float dBy = bumpScale * texture2D(bumpMap, vUv + dSTdy).x - Hll;\n return vec2(dBx, dBy);\n }\n vec3 perturbNormalArb(vec3 surf_pos, vec3 surf_norm, vec2 dHdxy) {\n vec3 vSigmaX = vec3(dFdx(surf_pos.x), dFdx(surf_pos.y), dFdx(surf_pos.z));\n vec3 vSigmaY = vec3(dFdy(surf_pos.x), dFdy(surf_pos.y), dFdy(surf_pos.z));\n vec3 vN = surf_norm;\n vec3 R1 = cross(vSigmaY, vN);\n vec3 R2 = cross(vN, vSigmaX);\n float fDet = dot(vSigmaX, R1);\n fDet *= (float(gl_FrontFacing) * 2.0 - 1.0);\n vec3 vGrad = sign(fDet) * (dHdxy.x * R1 + dHdxy.y * R2);\n return normalize(abs(fDet) * surf_norm - vGrad);\n }\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n vec4 plane;\n #pragma unroll_loop\n for (int i = 0; i < UNION_CLIPPING_PLANES; i++) {\n plane = clippingPlanes[i];\n if (dot(vViewPosition, plane.xyz) > plane.w) discard;\n }\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n bool clipped = true;\n #pragma unroll_loop\n for (int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i++) {\n plane = clippingPlanes[i];\n clipped = (dot(vViewPosition, plane.xyz) > plane.w) && clipped;\n }\n if (clipped) discard;\n #endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n #if !defined(PHYSICAL) && !defined(PHONG) && !defined(MATCAP)&& !defined(NODE)\n varying vec3 vViewPosition;\n #endif\n uniform vec4 clippingPlanes[NUM_CLIPPING_PLANES];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && !defined(PHYSICAL) && !defined(PHONG) && !defined(MATCAP) && !defined(NODE)\n varying vec3 vViewPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && !defined(PHYSICAL) && !defined(PHONG) && !defined(MATCAP) && !defined(NODE)\n vViewPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n diffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n varying vec3 vColor;\n#endif",color_pars_vertex:"#ifdef USE_COLOR\n varying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n vColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp(a, 0.0, 1.0)\n#define whiteCompliment(a) (1.0 - saturate(a))\n#define RECIPROCAL_3 0.333333333333\nfloat pow2(const in float x) { return x*x; }\nfloat pow3(const in float x) { return x*x*x; }\nfloat pow4(const in float x) { float x2 = x*x; return x2*x2; }\nfloat average(const in vec3 color) { return dot(color, vec3(0.3333)); }\nhighp float rand(const in vec2 uv) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(uv.xy, vec2(a,b)), sn = mod(dt, PI);\n return fract(sin(sn) * c);\n}\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\nstruct GeometricContext {\n vec3 position;\n vec3 normal;\n vec3 viewDir;\n vec3 originalNormal;\n vec3 coatNormal;\n};\nvec3 transformDirection(in vec3 dir, in mat4 matrix) {\n return normalize((matrix * vec4(dir, 0.0)).xyz);\n}\nvec3 inverseTransformDirection(in vec3 dir, in mat4 matrix) {\n return normalize((vec4(dir, 0.0) * matrix).xyz);\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal) {\n float distance = dot(planeNormal, point - pointOnPlane);\n return - distance * planeNormal + point;\n}\nfloat sideOfPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal) {\n return sign(dot(point - pointOnPlane, planeNormal));\n}\nvec3 linePlaneIntersect(in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal) {\n return lineDirection * (dot(planeNormal, pointOnPlane - pointOnLine) / dot(planeNormal, lineDirection)) + pointOnLine;\n}\nmat3 transposeMat3(const in mat3 m) {\n mat3 tmp;\n tmp[0] = vec3(m[0].x, m[1].x, m[2].x);\n tmp[1] = vec3(m[0].y, m[1].y, m[2].y);\n tmp[2] = vec3(m[0].z, m[1].z, m[2].z);\n return tmp;\n}\nfloat linearToRelativeLuminance(const in vec3 color) {\n vec3 weights = vec3(0.2126, 0.7152, 0.0722);\n return dot(weights, color.rgb);\n}\nfloat powCompat(const in float val, const in float power) {\n if (power == 0.0)\n return 1.0;\n else if (val < 0.0) {\n if (mod(-power, 2.0) == 0.0)\n return pow(-val, power);\n else\n return -pow(-val, power);\n } else if (val == 0.0)\n return 0.0;\n return pow(val, power);\n}\nfloat maxFromRGB(vec3 rgb) {\n return max(max(rgb.r, rgb.g), rgb.b);\n}\nbool isOrtho(const in mat4 m) {\n if (m[3][3] != 0.0)\n return true;\n else\n return false;\n}\nvec3 swizzleUpZ(const vec3 vec) {\n return vec3(vec[0], -vec[2], vec[1]);\n}\nvec3 swizzleUpY(const vec3 vec) {\n return vec3(vec[0], vec[2], -vec[1]);\n}\nvec3 xyz_to_sRGB(vec3 xyz) {\n mat3 convMat = mat3(\n 3.2406, -0.9689, 0.0557,\n -1.5372, 1.8758, -0.2040,\n -0.4986, 0.0415, 1.0570\n );\n return convMat * xyz;\n}\nvec3 xyY_to_XYZ(float x, float y, float Y) {\n float X = 0.0;\n float Z = 0.0;\n if (y != 0.0) {\n X = (Y / y) * x;\n Z = (Y / y) * (1.0 - x - y);\n }\n return vec3(X, Y, Z);\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\n#define cubeUV_faceSize (cubeUV_textureSize * 0.25)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo(vec3 dir, float roughnessLevel) {\n dir = normalize(dir) * (sqrt(3.0) + 1.0) / 2.0;\n vec3 dx = dFdx(dir);\n vec3 dy = dFdy(dir);\n float derivCoeff = cubeUV_faceSize / exp2(roughnessLevel) / 2.0;\n dx *= derivCoeff;\n dy *= derivCoeff;\n float d = max(dot(dx, dx), dot(dy, dy));\n d = clamp(d, 1.0, cubeUV_rangeClamp);\n float mipLevel = 0.5 * log2(d);\n return vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_faceSize) - 2.0)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n mipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n float a = 16.0 * cubeUV_rcpTextureSize;\n vec2 exp2_packed = exp2(vec2(roughnessLevel, mipLevel));\n vec2 rcp_exp2_packed = vec2(1.0) / exp2_packed;\n float powScale = exp2_packed.x * exp2_packed.y;\n float scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n float mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n bool bRes = mipLevel == 0.0;\n scale = bRes && (scale < a) ? a : scale;\n vec3 absDir = abs(direction);\n float maxAbsVal = max(max(absDir.x, absDir.y), absDir.z);\n bool Xy = absDir.x >= absDir.y, Xz = absDir.x >= absDir.z, Yz = absDir.y >= absDir.z;\n vec3 projMax = vec3(Xy && Xz, !Xy && Yz, !Xz && !Yz);\n mat3 vecToUV = mat3(\n projMax.y + projMax.z * sign(direction.z), 0.0, projMax.x,\n 0.0, projMax.x + projMax.z, projMax.y,\n sign(-direction.x) * projMax.x, sign(direction.y) * projMax.y, projMax.z\n );\n vec2 uv = (vecToUV * (direction / maxAbsVal)).xy;\n uv = (uv + vec2(1.0)) * 0.5;\n float offCoeffX = dot(projMax, vec3(0.0, 1.0, 2.0));\n float rowBottomOrTop = (sign(dot(projMax, direction)) + 1.0) / 2.0;\n float offCoeffY = 0.5 + 0.25 * rowBottomOrTop;\n float zeroMipCoeff = a * rowBottomOrTop;\n vec2 offset = vec2(offCoeffX * scale + mipOffset, offCoeffY / powScale);\n offset.y = bRes && (offset.y < 2.0 * a) ? zeroMipCoeff : offset.y;\n float texelOffset = 0.5 * cubeUV_rcpTextureSize;\n vec2 base = offset + vec2(texelOffset);\n return base + uv * (scale - 2.0 * texelOffset);\n}\n#define cubeUV_maxLods3 (log2(cubeUV_faceSize) - 3.0)\nvec4 textureCubeUV(sampler2D envMap, vec3 reflDir, vec3 reflDirMipLevel, float roughness) {\n float roughnessVal = roughness * cubeUV_maxLods3;\n float r0 = floor(roughnessVal);\n float r1 = r0 + 1.0;\n float rfactor = fract(roughnessVal);\n vec2 mipInfo = MipLevelInfo(reflDirMipLevel, r0);\n float l0 = mipInfo.x;\n float l1 = min(l0 + 1.0, 5.0);\n float lfactor = mipInfo.y;\n vec2 uv_r0_l0 = getCubeUV(reflDir, r0, l0);\n vec2 uv_r0_l1 = getCubeUV(reflDir, r0, l1);\n vec2 uv_r1_l0 = getCubeUV(reflDir, r1, l0);\n vec2 uv_r1_l1 = getCubeUV(reflDir, r1, l1);\n vec4 color_r0_l0 = envMapTexelToLinear(texture2D(envMap, uv_r0_l0));\n vec4 color_r0_l1 = envMapTexelToLinear(texture2D(envMap, uv_r0_l1));\n vec4 color_r1_l0 = envMapTexelToLinear(texture2D(envMap, uv_r1_l0));\n vec4 color_r1_l1 = envMapTexelToLinear(texture2D(envMap, uv_r1_l1));\n vec4 color_r0 = mix(color_r0_l0, color_r0_l1, lfactor);\n vec4 color_r1 = mix(color_r1_l0, color_r1_l1, lfactor);\n vec4 result = mix(color_r0, color_r1, rfactor);\n return vec4(result.rgb, 1.0);\n}\nvec4 textureCubeUVMaxRoughness(sampler2D envMap, vec3 reflDir) {\n vec2 uv = getCubeUV(reflDir, cubeUV_maxLods3, 0.0);\n vec4 result = envMapTexelToLinear(texture2D(envMap, uv));\n return vec4(result.rgb, 1.0);\n}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n transformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n vec3 transformedTangent = normalMatrix * objectTangent;\n #ifdef FLIP_SIDED\n transformedTangent = - transformedTangent;\n #endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n transformed += normalize(objectNormal) * (texture2D(displacementMap, uv).x * displacementScale + displacementBias);\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n vec4 emissiveColor = texture2D(emissiveMap, vUv);\n emissiveColor.rgb = emissiveMapTexelToLinear(emissiveColor).rgb;\n totalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel(gl_FragColor);",encodings_pars_fragment:"\nvec4 LinearToLinear(in vec4 value) {\n return value;\n}\nvec4 GammaToLinear(in vec4 value, in float gammaFactor) {\n return vec4(pow(value.rgb, vec3(gammaFactor)), value.a);\n}\nvec4 LinearToGamma(in vec4 value, in float gammaFactor) {\n return vec4(pow(value.rgb, vec3(1.0 / gammaFactor)), value.a);\n}\nvec4 sRGBToLinear(in vec4 value) {\n return vec4(mix(pow(value.rgb * 0.9478672986 + vec3(0.0521327014), vec3(2.4)), value.rgb * 0.0773993808, vec3(lessThanEqual(value.rgb, vec3(0.04045)))), value.a);\n}\nvec4 LinearTosRGB(in vec4 value) {\n return vec4(mix(pow(value.rgb, vec3(0.41666)) * 1.055 - vec3(0.055), value.rgb * 12.92, vec3(lessThanEqual(value.rgb, vec3(0.0031308)))), value.a);\n}\nvec4 RGBEToLinear(in vec4 value) {\n return vec4(value.rgb * exp2(value.a * 255.0 - 128.0), 1.0);\n}\nvec4 LinearToRGBE(in vec4 value) {\n float maxComponent = max(max(value.r, value.g), value.b);\n float fExp = clamp(ceil(log2(maxComponent)), -128.0, 127.0);\n return vec4(value.rgb / exp2(fExp), (fExp + 128.0) / 255.0);\n}\nvec4 RGBMToLinear(in vec4 value, in float maxRange) {\n return vec4(value.rgb * value.a * maxRange, 1.0);\n}\nvec4 LinearToRGBM(in vec4 value, in float maxRange) {\n float maxRGB = max(value.r, max(value.g, value.b));\n float M = clamp(maxRGB / maxRange, 0.0, 1.0);\n M = ceil(M * 255.0) / 255.0;\n return vec4(value.rgb / (M * maxRange), M);\n}\nvec4 RGBDToLinear(in vec4 value, in float maxRange) {\n return vec4(value.rgb * ((maxRange / 255.0) / value.a), 1.0);\n}\nvec4 LinearToRGBD(in vec4 value, in float maxRange) {\n float maxRGB = max(value.r, max(value.g, value.b));\n float D = max(maxRange / maxRGB, 1.0);\n D = min(floor(D) / 255.0, 1.0);\n return vec4(value.rgb * (D * (255.0 / maxRange)), D);\n}\nconst mat3 cLogLuvM = mat3(0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969);\nvec4 LinearToLogLuv(in vec4 value) {\n vec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract(Le);\n vResult.z = (Le - (floor(vResult.w * 255.0)) / 255.0) / 255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3(6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268);\nvec4 LogLuvToLinear(in vec4 value) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n return vec4(max(vRGB, 0.0), 1.0);\n}",envmap_fragment:"#ifdef USE_ENVMAP\n #if defined(USE_BUMPMAP) || defined(USE_NORMALMAP) || defined(PHONG) || defined(NODE)\n vec3 cameraToVertex = normalize(vWorldPosition - cameraPosition);\n vec3 worldNormal = inverseTransformDirection(normal, viewMatrix);\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect(cameraToVertex, worldNormal);\n #else\n vec3 reflectVec = refract(cameraToVertex, worldNormal, refractionRatio);\n #endif\n #else\n vec3 reflectVec = vReflect;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube(envMap, vec3(flipEnvMap * reflectVec.x, reflectVec.yz));\n #elif defined(ENVMAP_TYPE_EQUIREC)\n vec2 sampleUV;\n reflectVec = normalize(reflectVec);\n sampleUV.y = asin(clamp(reflectVec.y, - 1.0, 1.0)) * RECIPROCAL_PI + 0.5;\n sampleUV.x = atan(reflectVec.z, reflectVec.x) * RECIPROCAL_PI2 + 0.5;\n vec4 envColor = texture2D(envMap, sampleUV);\n #elif defined(ENVMAP_TYPE_SPHERE)\n reflectVec = normalize(reflectVec);\n vec3 reflectView = normalize((viewMatrix * vec4(reflectVec, 0.0)).xyz + vec3(0.0, 0.0, 1.0));\n vec4 envColor = texture2D(envMap, reflectView.xy * 0.5 + 0.5);\n #else\n vec4 envColor = vec4(0.0);\n #endif\n envColor = envMapTexelToLinear(envColor);\n #ifdef ENVMAP_BLENDING_MULTIPLY\n outgoingLight = mix(outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity);\n #elif defined(ENVMAP_BLENDING_MIX)\n outgoingLight = mix(outgoingLight, envColor.xyz, specularStrength * reflectivity);\n #elif defined(ENVMAP_BLENDING_ADD)\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n #endif\n#endif",envmap_pars_fragment:"#if defined(USE_ENVMAP) || defined(PHYSICAL)\n uniform float reflectivity;\n uniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n #if !defined(PHYSICAL) && (defined(USE_BUMPMAP) || defined(USE_NORMALMAP) || defined(PHONG))\n varying vec3 vWorldPosition;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n uniform float flipEnvMap;\n uniform int maxMipLevel;\n #if defined(USE_BUMPMAP) || defined(USE_NORMALMAP) || defined(PHONG) || defined(NODE) || defined(PHYSICAL)\n uniform float refractionRatio;\n #else\n varying vec3 vReflect;\n #endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n #if defined(USE_BUMPMAP) || defined(USE_NORMALMAP) || defined(PHONG) || defined(NODE)\n varying vec3 vWorldPosition;\n #else\n varying vec3 vReflect;\n uniform float refractionRatio;\n #endif\n#endif",envmap_physical_pars_fragment:"#if defined(USE_ENVMAP) && defined(PHYSICAL)\n vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel) {\n vec3 worldNormal = inverseTransformDirection(geometry.normal, viewMatrix);\n #ifdef ENVMAP_TYPE_CUBE\n vec3 queryVec = vec3(flipEnvMap * worldNormal.x, worldNormal.yz);\n #ifdef TEXTURE_LOD_EXT\n vec4 envMapColor = textureCubeLodEXT(envMap, queryVec, float(maxMIPLevel));\n #else\n vec4 envMapColor = textureCube(envMap, queryVec, float(maxMIPLevel));\n #endif\n envMapColor.rgb = envMapTexelToLinear(envMapColor).rgb;\n #elif defined(ENVMAP_TYPE_CUBE_UV)\n vec3 queryVec = vec3(flipEnvMap * worldNormal.x, worldNormal.yz);\n vec4 envMapColor = textureCubeUVMaxRoughness(envMap, queryVec);\n #else\n vec4 envMapColor = vec4(0.0);\n #endif\n return PI * envMapColor.rgb * envMapIntensity;\n }\n float getSpecularMIPLevel(const in float blinnShininessExponent, const in int maxMIPLevel) {\n float maxMIPLevelScalar = float(maxMIPLevel);\n float desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2(pow2(blinnShininessExponent) + 1.0);\n return clamp(desiredMIPLevel, 0.0, maxMIPLevelScalar);\n }\n vec3 _getLightProbeIndirect(const float blinnShininessExponent,\n const int maxMIPLevel, vec3 directionVec, vec3 directionVecMipLevel) {\n float specularMIPLevel = getSpecularMIPLevel(blinnShininessExponent, maxMIPLevel);\n #ifdef ENVMAP_TYPE_CUBE\n vec3 queryVec = vec3(flipEnvMap * directionVec.x, directionVec.yz);\n #ifdef TEXTURE_LOD_EXT\n vec4 envMapColor = textureCubeLodEXT(envMap, queryVec, specularMIPLevel);\n #else\n vec4 envMapColor = textureCube(envMap, queryVec, specularMIPLevel);\n #endif\n envMapColor.rgb = envMapTexelToLinear(envMapColor).rgb;\n #elif defined(ENVMAP_TYPE_CUBE_UV)\n vec3 queryVec = vec3(flipEnvMap * directionVec.x, directionVec.yz);\n vec3 queryVecMipLevel = vec3(flipEnvMap * directionVecMipLevel.x,\n directionVecMipLevel.yz);\n vec4 envMapColor = textureCubeUV(envMap, queryVec, queryVecMipLevel,\n BlinnExponentToGGXRoughness(blinnShininessExponent));\n #elif defined(ENVMAP_TYPE_EQUIREC)\n vec2 sampleUV;\n sampleUV.y = asin(clamp(directionVec.y, - 1.0, 1.0)) * RECIPROCAL_PI + 0.5;\n sampleUV.x = atan(directionVec.z, directionVec.x) * RECIPROCAL_PI2 + 0.5;\n #ifdef TEXTURE_LOD_EXT\n vec4 envMapColor = texture2DLodEXT(envMap, sampleUV, specularMIPLevel);\n #else\n vec4 envMapColor = texture2D(envMap, sampleUV, specularMIPLevel);\n #endif\n envMapColor.rgb = envMapTexelToLinear(envMapColor).rgb;\n #elif defined(ENVMAP_TYPE_SPHERE)\n vec3 reflectView = normalize((viewMatrix * vec4(directionVec, 0.0)).xyz + vec3(0.0,0.0,1.0));\n #ifdef TEXTURE_LOD_EXT\n vec4 envMapColor = texture2DLodEXT(envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel);\n #else\n vec4 envMapColor = texture2D(envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel);\n #endif\n envMapColor.rgb = envMapTexelToLinear(envMapColor).rgb;\n #endif\n return envMapColor.rgb * envMapIntensity;\n }\n vec3 getLightProbeIndirectRadiance(\n const GeometricContext geometry, const float blinnShininessExponent,\n const int maxMIPLevel, const int useCoat) {\n vec3 normal = geometry.normal;\n if (useCoat == 1) {\n normal = geometry.coatNormal;\n }\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 directionVec = reflect(-geometry.viewDir, normal);\n #else\n vec3 directionVec = refract(-geometry.viewDir, normal, refractionRatio);\n #endif\n directionVec = inverseTransformDirection(directionVec, viewMatrix);\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 directionVecMipLevel = reflect(-geometry.viewDir, geometry.originalNormal);\n #else\n vec3 directionVecMipLevel = refract(-geometry.viewDir, geometry.originalNormal, refractionRatio);\n #endif\n directionVecMipLevel = inverseTransformDirection(directionVecMipLevel, viewMatrix);\n return _getLightProbeIndirect(blinnShininessExponent, maxMIPLevel,\n directionVec, directionVecMipLevel);\n }\n vec3 getLightProbeIndirectRefraction(\n const GeometricContext geometry, const float blinnShininessExponent,\n const int maxMIPLevel, const float refrRatio) {\n vec3 directionVec = refract(-geometry.viewDir, geometry.normal, refrRatio);\n directionVec = inverseTransformDirection(directionVec, viewMatrix);\n vec3 directionVecMipLevel = refract(-geometry.viewDir, geometry.originalNormal, refrRatio);\n directionVecMipLevel = inverseTransformDirection(directionVecMipLevel, viewMatrix);\n return _getLightProbeIndirect(blinnShininessExponent, maxMIPLevel,\n directionVec, directionVecMipLevel);\n }\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n #if defined(USE_BUMPMAP) || defined(USE_NORMALMAP) || defined(PHONG) || defined(NODE)\n vWorldPosition = worldPosition.xyz;\n #else\n vec3 cameraToVertex = normalize(worldPosition.xyz - cameraPosition);\n vec3 worldNormal = inverseTransformDirection(transformedNormal, viewMatrix);\n #ifdef ENVMAP_MODE_REFLECTION\n vReflect = reflect(cameraToVertex, worldNormal);\n #else\n vReflect = refract(cameraToVertex, worldNormal, refractionRatio);\n #endif\n #endif\n#endif",fog_vertex:"#ifdef USE_FOG\n fogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n varying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n #ifdef FOG_EXP2\n float fogFactor = whiteCompliment(exp2(- fogDensity * fogDensity * fogDepth * fogDepth * LOG2));\n #else\n float fogFactor = smoothstep(fogNear, fogFar, fogDepth);\n #endif\n gl_FragColor.rgb = mix(gl_FragColor.rgb, fogColor, fogFactor);\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n uniform vec3 fogColor;\n varying float fogDepth;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n#endif",gradientmap_pars_fragment:"#ifdef TOON\n uniform sampler2D gradientMap;\n vec3 getGradientIrradiance(vec3 normal, vec3 lightDirection) {\n float dotNL = dot(normal, lightDirection);\n vec2 coord = vec2(dotNL * 0.5 + 0.5, 0.0);\n #ifdef USE_GRADIENTMAP\n return texture2D(gradientMap, coord).rgb;\n #else\n return (coord.x < 0.7) ? vec3(0.7) : vec3(1.0);\n #endif\n }\n#endif",lightmap_fragment:"#ifdef USE_LIGHTMAP\n reflectedLight.indirectDiffuse += PI * texture2D(lightMap, vUv2).xyz * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3(1.0);\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize(transformedNormal);\ngeometry.originalNormal = geometry.normal;\ngeometry.viewDir = normalize(-mvPosition.xyz);\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.originalNormal = -geometry.originalNormal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3(0.0);\nvIndirectFront = vec3(0.0);\n#ifdef DOUBLE_SIDED\n vLightBack = vec3(0.0);\n vIndirectBack = vec3(0.0);\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n #pragma unroll_loop\n for (int i = 0; i < NUM_POINT_LIGHTS; i++) {\n getPointDirectLightIrradiance(pointLights[i], geometry, directLight);\n dotNL = dot(geometry.normal, directLight.direction);\n directLightColor_Diffuse = PI * directLight.color;\n vLightFront += saturate(dotNL) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate(-dotNL) * directLightColor_Diffuse;\n #endif\n }\n#endif\n#if NUM_SPOT_LIGHTS > 0\n #pragma unroll_loop\n for (int i = 0; i < NUM_SPOT_LIGHTS; i++) {\n getSpotDirectLightIrradiance(spotLights[i], geometry, directLight);\n dotNL = dot(geometry.normal, directLight.direction);\n directLightColor_Diffuse = PI * directLight.color;\n vLightFront += saturate(dotNL) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate(-dotNL) * directLightColor_Diffuse;\n #endif\n }\n#endif\n#if NUM_DIR_LIGHTS > 0\n #pragma unroll_loop\n for (int i = 0; i < NUM_DIR_LIGHTS; i++) {\n getDirectionalDirectLightIrradiance(directionalLights[i], geometry, directLight);\n dotNL = dot(geometry.normal, directLight.direction);\n directLightColor_Diffuse = PI * directLight.color;\n vLightFront += saturate(dotNL) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate(-dotNL) * directLightColor_Diffuse;\n #endif\n }\n#endif\n#if NUM_HEMI_LIGHTS > 0\n #pragma unroll_loop\n for (int i = 0; i < NUM_HEMI_LIGHTS; i++) {\n vIndirectFront += getHemisphereLightIrradiance(hemisphereLights[i], geometry);\n #ifdef DOUBLE_SIDED\n vIndirectBack += getHemisphereLightIrradiance(hemisphereLights[i], backGeometry);\n #endif\n }\n#endif",lights_pars_begin:"uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance(const in vec3 ambientLightColor) {\n vec3 irradiance = ambientLightColor;\n #if defined(BLENDER_LIGHTS) || !defined(PHYSICALLY_CORRECT_LIGHTS)\n irradiance *= PI;\n #endif\n return irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n int shadow;\n float shadowBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLight directionalLights[NUM_DIR_LIGHTS];\n void getDirectionalDirectLightIrradiance(const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight) {\n directLight.color = directionalLight.color;\n directLight.direction = directionalLight.direction;\n directLight.visible = true;\n }\n#endif\n#if NUM_POINT_LIGHTS > 0\n struct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n int shadow;\n float shadowBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLight pointLights[NUM_POINT_LIGHTS];\n void getPointDirectLightIrradiance(const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight) {\n vec3 lVector = pointLight.position - geometry.position;\n directLight.direction = normalize(lVector);\n float lightDistance = length(lVector);\n directLight.color = pointLight.color;\n directLight.color *= punctualLightIntensityToIrradianceFactor(lightDistance, pointLight.distance, pointLight.decay);\n directLight.visible = (directLight.color != vec3(0.0));\n }\n#endif\n#if NUM_SPOT_LIGHTS > 0\n struct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n int shadow;\n float shadowBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLight spotLights[NUM_SPOT_LIGHTS];\n void getSpotDirectLightIrradiance(const in SpotLight spotLight,\n const in GeometricContext geometry, out IncidentLight directLight) {\n vec3 lVector = spotLight.position - geometry.position;\n directLight.direction = normalize(lVector);\n float lightDistance = length(lVector);\n float angleCos = dot(directLight.direction, spotLight.direction);\n #if defined(MT_MAX) && defined(PHYSICALLY_CORRECT_LIGHTS)\n float coneCosDecayed = 2.0 * spotLight.coneCos - spotLight.penumbraCos;\n if (angleCos > coneCosDecayed) {\n float spotEffect = pow(angleCos, log(0.5) / log(spotLight.penumbraCos) - 1.0);\n if (angleCos < spotLight.coneCos) {\n float decayFac = 1.0 + (spotLight.coneCos - angleCos)\n / (spotLight.coneCos - spotLight.penumbraCos);\n spotEffect *= pow2(decayFac) * (3.0 - 2.0 * decayFac);\n }\n directLight.color = spotLight.color * spotEffect\n * punctualLightIntensityToIrradianceFactor(lightDistance,\n spotLight.distance, spotLight.decay);\n directLight.visible = true;\n } else {\n directLight.color = vec3(0.0);\n directLight.visible = false;\n }\n #else\n if (angleCos > spotLight.coneCos) {\n float spotEffect = smoothstep(spotLight.coneCos, spotLight.penumbraCos, angleCos);\n directLight.color = spotLight.color * spotEffect\n * punctualLightIntensityToIrradianceFactor(lightDistance,\n spotLight.distance, spotLight.decay);\n directLight.visible = true;\n } else {\n directLight.color = vec3(0.0);\n directLight.visible = false;\n }\n #endif\n }\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n struct RectAreaLight {\n vec3 color;\n vec3 position;\n vec3 halfWidth;\n vec3 halfHeight;\n };\n uniform sampler2D ltc_1;\n uniform sampler2D ltc_2;\n uniform RectAreaLight rectAreaLights[NUM_RECT_AREA_LIGHTS];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n struct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n };\n uniform HemisphereLight hemisphereLights[NUM_HEMI_LIGHTS];\n vec3 getHemisphereLightIrradiance(const in HemisphereLight hemiLight, const in GeometricContext geometry) {\n float dotNL = dot(geometry.normal, hemiLight.direction);\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix(hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight);\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n irradiance *= PI;\n #endif\n return irradiance;\n }\n#endif",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\nvoid RE_Direct_BlinnPhong(const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight) {\n #ifdef TOON\n vec3 irradiance = getGradientIrradiance(geometry.normal, directLight.direction) * directLight.color;\n #else\n float dotNL = saturate(dot(geometry.normal, directLight.direction));\n vec3 irradiance = dotNL * directLight.color;\n #endif\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n irradiance *= PI;\n #endif\n reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert(material.diffuseColor);\n reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong(directLight, geometry, material.specularColor, material.specularShininess) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong(const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert(material.diffuseColor);\n}\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD(material) (0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * (1.0 - metalnessFactor);\nmaterial.specularRoughness = clamp(roughnessFactor, 0.04, 1.0);\n#ifdef STANDARD\n material.specularColor = mix(vec3(DEFAULT_SPECULAR_COEFFICIENT), diffuseColor.rgb, metalnessFactor);\n#else\n material.specularColor = mix(vec3(MAXIMUM_SPECULAR_COEFFICIENT * pow2(reflectivity)), diffuseColor.rgb, metalnessFactor);\n material.clearCoat = saturate(clearCoat);\n material.clearCoatRoughness = clamp(clearCoatRoughness, 0.04, 1.0);\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n vec3 diffuseColor;\n float specularRoughness;\n vec3 specularColor;\n #ifndef STANDARD\n float clearCoat;\n float clearCoatRoughness;\n #endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox(const in float roughness, const in float dotNL) {\n return DEFAULT_SPECULAR_COEFFICIENT + (1.0 - DEFAULT_SPECULAR_COEFFICIENT) * (pow(1.0 - dotNL, 5.0) * pow(1.0 - roughness, 2.0));\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n void RE_Direct_RectArea_Physical(const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n vec3 normal = geometry.normal;\n vec3 viewDir = geometry.viewDir;\n vec3 position = geometry.position;\n vec3 lightPos = rectAreaLight.position;\n vec3 halfWidth = rectAreaLight.halfWidth;\n vec3 halfHeight = rectAreaLight.halfHeight;\n vec3 lightColor = rectAreaLight.color;\n float roughness = material.specularRoughness;\n vec3 rectCoords[4];\n rectCoords[0] = lightPos + halfWidth - halfHeight;\n rectCoords[1] = lightPos - halfWidth - halfHeight;\n rectCoords[2] = lightPos - halfWidth + halfHeight;\n rectCoords[3] = lightPos + halfWidth + halfHeight;\n vec2 uv = LTC_Uv(normal, viewDir, roughness);\n vec4 t1 = texture2D(ltc_1, uv);\n vec4 t2 = texture2D(ltc_2, uv);\n mat3 mInv = mat3(\n vec3(t1.x, 0, t1.y),\n vec3( 0, 1, 0),\n vec3(t1.z, 0, t1.w)\n );\n vec3 fresnel = (material.specularColor * t2.x + (vec3(1.0) - material.specularColor) * t2.y);\n reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate(normal, viewDir, position, mInv, rectCoords);\n reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate(normal, viewDir, position, mat3(1.0), rectCoords);\n }\n#endif\nvoid RE_Direct_Physical(const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n float dotNL = saturate(dot(geometry.normal, directLight.direction));\n vec3 irradiance = dotNL * directLight.color;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n irradiance *= PI;\n #endif\n #ifndef STANDARD\n float clearCoatDHR = material.clearCoat * clearCoatDHRApprox(material.clearCoatRoughness, dotNL);\n #else\n float clearCoatDHR = 0.0;\n #endif\n reflectedLight.directSpecular += (1.0 - clearCoatDHR) * irradiance\n * BRDF_Specular_GGX(directLight, geometry.viewDir, geometry.normal,\n material.specularColor, material.specularRoughness);\n reflectedLight.directDiffuse += (1.0 - clearCoatDHR) * irradiance * BRDF_Diffuse_Lambert(material.diffuseColor);\n #ifndef STANDARD\n reflectedLight.directSpecular += irradiance * material.clearCoat\n * BRDF_Specular_GGX(directLight, geometry.viewDir, geometry.coatNormal,\n vec3(DEFAULT_SPECULAR_COEFFICIENT), material.clearCoatRoughness);\n #endif\n}\nvoid RE_IndirectDiffuse_Physical(const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert(material.diffuseColor);\n}\nvoid RE_IndirectSpecular_Physical(const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n #ifndef STANDARD\n float coatDotNL = saturate(dot(geometry.coatNormal, geometry.viewDir));\n float clearCoatDHR = material.clearCoat * clearCoatDHRApprox(material.clearCoatRoughness, coatDotNL);\n #else\n float clearCoatDHR = 0.0;\n #endif\n reflectedLight.indirectSpecular += (1.0 - clearCoatDHR) * radiance\n * BRDF_Specular_GGX_Environment(geometry, material.specularColor,\n material.specularRoughness, 0);\n #ifndef STANDARD\n reflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat\n * BRDF_Specular_GGX_Environment(geometry, vec3(DEFAULT_SPECULAR_COEFFICIENT),\n material.clearCoatRoughness, 1);\n #endif\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_Direct_RectArea RE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent(material) GGXRoughnessToBlinnExponent(material.specularRoughness)\n#define Material_ClearCoat_BlinnShininessExponent(material) GGXRoughnessToBlinnExponent(material.clearCoatRoughness)\nfloat computeSpecularOcclusion(const in float dotNV, const in float ambientOcclusion, const in float roughness) {\n return saturate(pow(dotNV + ambientOcclusion, exp2(- 16.0 * roughness - 1.0)) - 1.0 + ambientOcclusion);\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize(vViewPosition);\n#if defined(ORIGINAL_NORMAL)\n geometry.originalNormal = ORIGINAL_NORMAL;\n#else\n geometry.originalNormal = geometry.normal;\n#endif\n#if defined(COAT_NORMAL)\n geometry.coatNormal = COAT_NORMAL;\n#else\n geometry.coatNormal = geometry.normal;\n#endif\nIncidentLight directLight;\n#if (NUM_POINT_LIGHTS > 0) && defined(RE_Direct)\n PointLight pointLight;\n #pragma unroll_loop\n for (int i = 0; i < NUM_POINT_LIGHTS; i++) {\n pointLight = pointLights[i];\n getPointDirectLightIrradiance(pointLight, geometry, directLight);\n #ifdef USE_SHADOWMAP\n directLight.color *= all(bvec2(pointLight.shadow, directLight.visible)) ? getPointShadow(pointShadowMap[i], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[i], pointLight.shadowCameraNear, pointLight.shadowCameraFar) : 1.0;\n #endif\n RE_Direct(directLight, geometry, material, reflectedLight);\n }\n#endif\n#if (NUM_SPOT_LIGHTS > 0) && defined(RE_Direct)\n SpotLight spotLight;\n #pragma unroll_loop\n for (int i = 0; i < NUM_SPOT_LIGHTS; i++) {\n spotLight = spotLights[i];\n getSpotDirectLightIrradiance(spotLight, geometry, directLight);\n #ifdef USE_SHADOWMAP\n directLight.color *= all(bvec2(spotLight.shadow, directLight.visible)) ? getShadow(spotShadowMap[i], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[i]) : 1.0;\n #endif\n RE_Direct(directLight, geometry, material, reflectedLight);\n }\n#endif\n#if (NUM_DIR_LIGHTS > 0) && defined(RE_Direct)\n DirectionalLight directionalLight;\n #pragma unroll_loop\n for (int i = 0; i < NUM_DIR_LIGHTS; i++) {\n directionalLight = directionalLights[i];\n getDirectionalDirectLightIrradiance(directionalLight, geometry, directLight);\n #ifdef USE_SHADOWMAP\n directLight.color *= all(bvec2(directionalLight.shadow, directLight.visible)) ? getShadow(directionalShadowMap[i], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[i]) : 1.0;\n #endif\n RE_Direct(directLight, geometry, material, reflectedLight);\n }\n#endif\n#if (NUM_RECT_AREA_LIGHTS > 0) && defined(RE_Direct_RectArea)\n RectAreaLight rectAreaLight;\n #pragma unroll_loop\n for (int i = 0; i < NUM_RECT_AREA_LIGHTS; i++) {\n rectAreaLight = rectAreaLights[i];\n RE_Direct_RectArea(rectAreaLight, geometry, material, reflectedLight);\n }\n#endif\n#if defined(RE_IndirectDiffuse)\n vec3 irradiance = getAmbientLightIrradiance(ambientLightColor);\n #if (NUM_HEMI_LIGHTS > 0)\n #pragma unroll_loop\n for (int i = 0; i < NUM_HEMI_LIGHTS; i++) {\n irradiance += getHemisphereLightIrradiance(hemisphereLights[i], geometry);\n #if defined(BLENDER_LIGHTS) && !defined(PHYSICAL)\n RE_HemiSpec_Blender(hemisphereLights[i], geometry, material, reflectedLight);\n #endif\n }\n #endif\n#endif\n#if defined(RE_IndirectSpecular)\n vec3 radiance = vec3(0.0);\n vec3 clearCoatRadiance = vec3(0.0);\n#endif\n#if defined(RE_Refraction) && defined(USE_REFRACTED_LIGHT)\n vec3 refraction = vec3(0.0);\n#endif",lights_fragment_maps:"#if defined(RE_IndirectDiffuse)\n #ifdef USE_LIGHTMAP\n vec3 lightMapIrradiance = texture2D(lightMap, vUv2).xyz * lightMapIntensity;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n lightMapIrradiance *= PI;\n #endif\n irradiance += lightMapIrradiance;\n #endif\n #if defined(USE_ENVMAP) && defined(PHYSICAL) && defined(ENVMAP_TYPE_CUBE_UV)\n irradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel);\n #endif\n#endif\n#if defined(USE_ENVMAP) && defined(RE_IndirectSpecular)\n radiance += getLightProbeIndirectRadiance(geometry,\n Material_BlinnShininessExponent(material), maxMipLevel, 0);\n #ifndef STANDARD\n clearCoatRadiance += getLightProbeIndirectRadiance(geometry,\n Material_ClearCoat_BlinnShininessExponent(material), maxMipLevel, 1);\n #endif\n#endif\n#if defined(USE_ENVMAP) && defined(RE_Refraction) && defined(USE_REFRACTED_LIGHT)\n refraction += getLightProbeIndirectRefraction(geometry,\n Material_Refraction_BlinnShininessExponent(material), maxMipLevel,\n 1.0 / material.refractionIOR);\n#endif",lights_fragment_end:"#if defined(RE_IndirectDiffuse)\n RE_IndirectDiffuse(irradiance, geometry, material, reflectedLight);\n#endif\n#if defined(RE_IndirectSpecular)\n RE_IndirectSpecular(radiance, clearCoatRadiance, geometry, material, reflectedLight);\n#endif\n#if defined(RE_Refraction) && defined(USE_REFRACTED_LIGHT)\n RE_Refraction(refraction, material, refractedLight);\n#endif",logdepthbuf_fragment:"#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n gl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n uniform float logDepthBufFC;\n varying float vFragDepth;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n #ifdef USE_LOGDEPTHBUF_EXT\n varying float vFragDepth;\n #else\n uniform float logDepthBufFC;\n #endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n #ifdef USE_LOGDEPTHBUF_EXT\n vFragDepth = 1.0 + gl_Position.w;\n #else\n gl_Position.z = log2(max(EPSILON, gl_Position.w + 1.0)) * logDepthBufFC - 1.0;\n gl_Position.z *= gl_Position.w;\n #endif\n#endif",map_fragment:"#ifdef USE_MAP\n vec4 texelColor = texture2D(map, vUv);\n texelColor = mapTexelToLinear(texelColor);\n diffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n uniform sampler2D map;\n#endif",map_particle_fragment:"#ifdef USE_MAP\n vec2 uv = (uvTransform * vec3(gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1)).xy;\n vec4 mapTexel = texture2D(map, uv);\n diffuseColor *= mapTexelToLinear(mapTexel);\n#endif",map_particle_pars_fragment:"#ifdef USE_MAP\n uniform mat3 uvTransform;\n uniform sampler2D map;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n vec4 texelMetalness = texture2D(metalnessMap, vUv);\n metalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n uniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n objectNormal += (morphNormal0 - normal) * morphTargetInfluences[0];\n objectNormal += (morphNormal1 - normal) * morphTargetInfluences[1];\n objectNormal += (morphNormal2 - normal) * morphTargetInfluences[2];\n objectNormal += (morphNormal3 - normal) * morphTargetInfluences[3];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n #ifndef USE_MORPHNORMALS\n uniform float morphTargetInfluences[8];\n #else\n uniform float morphTargetInfluences[4];\n #endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n transformed += (morphTarget0 - position) * morphTargetInfluences[0];\n transformed += (morphTarget1 - position) * morphTargetInfluences[1];\n transformed += (morphTarget2 - position) * morphTargetInfluences[2];\n transformed += (morphTarget3 - position) * morphTargetInfluences[3];\n #ifndef USE_MORPHNORMALS\n transformed += (morphTarget4 - position) * morphTargetInfluences[4];\n transformed += (morphTarget5 - position) * morphTargetInfluences[5];\n transformed += (morphTarget6 - position) * morphTargetInfluences[6];\n transformed += (morphTarget7 - position) * morphTargetInfluences[7];\n #endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n vec3 fdx = vec3(dFdx(vViewPosition.x), dFdx(vViewPosition.y), dFdx(vViewPosition.z));\n vec3 fdy = vec3(dFdy(vViewPosition.x), dFdy(vViewPosition.y), dFdy(vViewPosition.z));\n vec3 normal = normalize(cross(fdx, fdy));\n#else\n vec3 normal = normalize(vNormal);\n #ifdef DOUBLE_SIDED\n normal = normal * (float(gl_FrontFacing) * 2.0 - 1.0);\n #endif\n#endif\n vec3 originalNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP\n #ifdef OBJECTSPACE_NORMALMAP\n normal = texture2D(normalMap, vUv).xyz * 2.0 - 1.0;\n #ifdef FLIP_SIDED\n normal = - normal;\n #endif\n #ifdef DOUBLE_SIDED\n normal = normal * (float(gl_FrontFacing) * 2.0 - 1.0);\n #endif\n normal = normalize(normalMatrix * normal);\n #else\n #ifdef USE_TANGENT\n normal = perturbNormalTang(vNormal);\n #else\n normal = perturbNormal2Arb(-vViewPosition, normal);\n #endif\n #endif\n#elif defined(USE_BUMPMAP)\n normal = perturbNormalArb(-vViewPosition, normal, dHdxy_fwd());\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n #ifdef OBJECTSPACE_NORMALMAP\n uniform mat3 normalMatrix;\n #elif defined(USE_TANGENT)\n \n uniform mat4 modelViewMatrix;\n varying vec4 vTangent;\n vec3 perturbNormalTang(vec3 normal) {\n vec3 normalTex = texture2D(normalMap, vUv).xyz * 2.0 - 1.0;\n normalTex.xy *= normalScale;\n normalTex = normalize(normalTex);\n vec4 viewTangent = vec4(normalize((modelViewMatrix * vec4(vTangent.xyz, 0.0)).xyz), vTangent.w);\n vec3 bitangent = -viewTangent.w * cross(normal, viewTangent.xyz);\n vec3 normalOut = normalTex.x * (viewTangent.xyz) + normalTex.y * bitangent \n + normalTex.z * normal;\n normalOut = normalize(normalOut);\n return normalOut;\n }\n #else\n vec3 perturbNormal2Arb(vec3 eye_pos, vec3 surf_norm) {\n vec3 q0 = vec3(dFdx(eye_pos.x), dFdx(eye_pos.y), dFdx(eye_pos.z));\n vec3 q1 = vec3(dFdy(eye_pos.x), dFdy(eye_pos.y), dFdy(eye_pos.z));\n vec2 st0 = dFdx(vUv.st);\n vec2 st1 = dFdy(vUv.st);\n float scale = sign(st1.t * st0.s - st0.t * st1.s);\n vec3 S = normalize((q0 * st1.t - q1 * st0.t) * scale);\n vec3 T = normalize((- q0 * st1.s + q1 * st0.s) * scale);\n vec3 N = normalize(surf_norm);\n mat3 tsn = mat3(S, T, N);\n vec3 mapN = texture2D(normalMap, vUv).xyz * 2.0 - 1.0;\n mapN.xy *= normalScale;\n mapN.xy *= (float(gl_FrontFacing) * 2.0 - 1.0);\n return normalize(tsn * mapN);\n }\n #endif\n#endif",packing:"vec3 packNormalToRGB(const in vec3 normal) {\n return normalize(normal) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal(const in vec3 rgb) {\n return 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;\nconst float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3(256. * 256. * 256., 256. * 256., 256.);\nconst vec4 UnpackFactors = UnpackDownscale / vec4(PackFactors, 1.);\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA(const in float v) {\n vec4 r = vec4(fract(v * PackFactors), v);\n r.yzw -= r.xyz * ShiftRight8;\n return r * PackUpscale;\n}\nfloat unpackRGBAToDepth(const in vec4 v) {\n return dot(v, UnpackFactors);\n}\nfloat viewZToOrthographicDepth(const in float viewZ, const in float near, const in float far) {\n return (viewZ + near) / (near - far);\n}\nfloat orthographicDepthToViewZ(const in float linearClipZ, const in float near, const in float far) {\n return linearClipZ * (near - far) - near;\n}\nfloat viewZToPerspectiveDepth(const in float viewZ, const in float near, const in float far) {\n return ((near + viewZ) * far) / ((far - near) * viewZ);\n}\nfloat perspectiveDepthToViewZ(const in float invClipZ, const in float near, const in float far) {\n return (near * far) / ((far - near) * invClipZ - far);\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4(transformed, 1.0);\ngl_Position = projectionMatrix * mvPosition;\n#if defined(BACKGROUND_DEPTH)\n gl_Position.z = gl_Position.w;\n#endif",dithering_fragment:"#if defined(DITHERING)\n gl_FragColor.rgb = dithering(gl_FragColor.rgb);\n#endif",dithering_pars_fragment:"#if defined(DITHERING)\n vec3 dithering(vec3 color) {\n float grid_position = rand(gl_FragCoord.xy);\n vec3 dither_shift_RGB = vec3(0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0);\n dither_shift_RGB = mix(2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position);\n return color + dither_shift_RGB;\n }\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n vec4 texelRoughness = texture2D(roughnessMap, vUv);\n roughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n uniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHTS > 0\n uniform sampler2D directionalShadowMap[NUM_DIR_LIGHTS];\n varying vec4 vDirectionalShadowCoord[NUM_DIR_LIGHTS];\n #endif\n #if NUM_SPOT_LIGHTS > 0\n uniform sampler2D spotShadowMap[NUM_SPOT_LIGHTS];\n varying vec4 vSpotShadowCoord[NUM_SPOT_LIGHTS];\n #endif\n #if NUM_POINT_LIGHTS > 0\n uniform sampler2D pointShadowMap[NUM_POINT_LIGHTS];\n varying vec4 vPointShadowCoord[NUM_POINT_LIGHTS];\n #endif\n float texture2DCompare(sampler2D depths, vec2 uv, float compare) {\n return step(compare, unpackRGBAToDepth(texture2D(depths, uv)));\n }\n float texture2DShadowLerp(sampler2D depths, vec2 size, vec2 uv, float compare) {\n const vec2 offset = vec2(0.0, 1.0);\n vec2 texelSize = vec2(1.0) / size;\n vec2 centroidUV = floor(uv * size + 0.5) / size;\n float lb = texture2DCompare(depths, centroidUV + texelSize * offset.xx, compare);\n float lt = texture2DCompare(depths, centroidUV + texelSize * offset.xy, compare);\n float rb = texture2DCompare(depths, centroidUV + texelSize * offset.yx, compare);\n float rt = texture2DCompare(depths, centroidUV + texelSize * offset.yy, compare);\n vec2 f = fract(uv * size + 0.5);\n float a = mix(lb, lt, f.y);\n float b = mix(rb, rt, f.y);\n float c = mix(a, b, f.x);\n return c;\n }\n float getShadow(sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bvec4 inFrustumVec = bvec4 (shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0);\n bool inFrustum = all(inFrustumVec);\n bvec2 frustumTestVec = bvec2(inFrustum, shadowCoord.z <= 1.0);\n bool frustumTest = all(frustumTestVec);\n if (frustumTest) {\n #if defined(SHADOWMAP_TYPE_PCF)\n vec2 texelSize = vec2(1.0) / shadowMapSize;\n float dx0 = - texelSize.x * shadowRadius;\n float dy0 = - texelSize.y * shadowRadius;\n float dx1 = + texelSize.x * shadowRadius;\n float dy1 = + texelSize.y * shadowRadius;\n shadow = (\n texture2DCompare(shadowMap, shadowCoord.xy + vec2(dx0, dy0), shadowCoord.z) +\n texture2DCompare(shadowMap, shadowCoord.xy + vec2(0.0, dy0), shadowCoord.z) +\n texture2DCompare(shadowMap, shadowCoord.xy + vec2(dx1, dy0), shadowCoord.z) +\n texture2DCompare(shadowMap, shadowCoord.xy + vec2(dx0, 0.0), shadowCoord.z) +\n texture2DCompare(shadowMap, shadowCoord.xy, shadowCoord.z) +\n texture2DCompare(shadowMap, shadowCoord.xy + vec2(dx1, 0.0), shadowCoord.z) +\n texture2DCompare(shadowMap, shadowCoord.xy + vec2(dx0, dy1), shadowCoord.z) +\n texture2DCompare(shadowMap, shadowCoord.xy + vec2(0.0, dy1), shadowCoord.z) +\n texture2DCompare(shadowMap, shadowCoord.xy + vec2(dx1, dy1), shadowCoord.z)\n ) * (1.0 / 9.0);\n #elif defined(SHADOWMAP_TYPE_PCF_SOFT)\n vec2 texelSize = vec2(1.0) / shadowMapSize;\n float dx0 = - texelSize.x * shadowRadius;\n float dy0 = - texelSize.y * shadowRadius;\n float dx1 = + texelSize.x * shadowRadius;\n float dy1 = + texelSize.y * shadowRadius;\n shadow = (\n texture2DShadowLerp(shadowMap, shadowMapSize, shadowCoord.xy + vec2(dx0, dy0), shadowCoord.z) +\n texture2DShadowLerp(shadowMap, shadowMapSize, shadowCoord.xy + vec2(0.0, dy0), shadowCoord.z) +\n texture2DShadowLerp(shadowMap, shadowMapSize, shadowCoord.xy + vec2(dx1, dy0), shadowCoord.z) +\n texture2DShadowLerp(shadowMap, shadowMapSize, shadowCoord.xy + vec2(dx0, 0.0), shadowCoord.z) +\n texture2DShadowLerp(shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z) +\n texture2DShadowLerp(shadowMap, shadowMapSize, shadowCoord.xy + vec2(dx1, 0.0), shadowCoord.z) +\n texture2DShadowLerp(shadowMap, shadowMapSize, shadowCoord.xy + vec2(dx0, dy1), shadowCoord.z) +\n texture2DShadowLerp(shadowMap, shadowMapSize, shadowCoord.xy + vec2(0.0, dy1), shadowCoord.z) +\n texture2DShadowLerp(shadowMap, shadowMapSize, shadowCoord.xy + vec2(dx1, dy1), shadowCoord.z)\n ) * (1.0 / 9.0);\n #else\n shadow = texture2DCompare(shadowMap, shadowCoord.xy, shadowCoord.z);\n #endif\n }\n return shadow;\n }\n vec2 cubeToUV(vec3 v, float texelSizeY) {\n vec3 absV = abs(v);\n float scaleToCube = 1.0 / max(absV.x, max(absV.y, absV.z));\n absV *= scaleToCube;\n v *= scaleToCube * (1.0 - 2.0 * texelSizeY);\n vec2 planar = v.xy;\n float almostATexel = 1.5 * texelSizeY;\n float almostOne = 1.0 - almostATexel;\n if (absV.z >= almostOne) {\n if (v.z > 0.0)\n planar.x = 4.0 - v.x;\n } else if (absV.x >= almostOne) {\n float signX = sign(v.x);\n planar.x = v.z * signX + 2.0 * signX;\n } else if (absV.y >= almostOne) {\n float signY = sign(v.y);\n planar.x = v.x + 2.0 * signY + 2.0;\n planar.y = v.z * signY - 2.0;\n }\n return vec2(0.125, 0.25) * planar + vec2(0.375, 0.75);\n }\n float getPointShadow(sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar) {\n vec2 texelSize = vec2(1.0) / (shadowMapSize * vec2(4.0, 2.0));\n vec3 lightToPosition = shadowCoord.xyz;\n float dp = (length(lightToPosition) - shadowCameraNear) / (shadowCameraFar - shadowCameraNear);\n dp += shadowBias;\n vec3 bd3D = normalize(lightToPosition);\n #if defined(SHADOWMAP_TYPE_PCF) || defined(SHADOWMAP_TYPE_PCF_SOFT)\n vec2 offset = vec2(- 1, 1) * shadowRadius * texelSize.y;\n return (\n texture2DCompare(shadowMap, cubeToUV(bd3D + offset.xyy, texelSize.y), dp) +\n texture2DCompare(shadowMap, cubeToUV(bd3D + offset.yyy, texelSize.y), dp) +\n texture2DCompare(shadowMap, cubeToUV(bd3D + offset.xyx, texelSize.y), dp) +\n texture2DCompare(shadowMap, cubeToUV(bd3D + offset.yyx, texelSize.y), dp) +\n texture2DCompare(shadowMap, cubeToUV(bd3D, texelSize.y), dp) +\n texture2DCompare(shadowMap, cubeToUV(bd3D + offset.xxy, texelSize.y), dp) +\n texture2DCompare(shadowMap, cubeToUV(bd3D + offset.yxy, texelSize.y), dp) +\n texture2DCompare(shadowMap, cubeToUV(bd3D + offset.xxx, texelSize.y), dp) +\n texture2DCompare(shadowMap, cubeToUV(bd3D + offset.yxx, texelSize.y), dp)\n ) * (1.0 / 9.0);\n #else\n return texture2DCompare(shadowMap, cubeToUV(bd3D, texelSize.y), dp);\n #endif\n }\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHTS > 0\n uniform mat4 directionalShadowMatrix[NUM_DIR_LIGHTS];\n varying vec4 vDirectionalShadowCoord[NUM_DIR_LIGHTS];\n #endif\n #if NUM_SPOT_LIGHTS > 0\n uniform mat4 spotShadowMatrix[NUM_SPOT_LIGHTS];\n varying vec4 vSpotShadowCoord[NUM_SPOT_LIGHTS];\n #endif\n #if NUM_POINT_LIGHTS > 0\n uniform mat4 pointShadowMatrix[NUM_POINT_LIGHTS];\n varying vec4 vPointShadowCoord[NUM_POINT_LIGHTS];\n #endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHTS > 0\n #pragma unroll_loop\n for (int i = 0; i < NUM_DIR_LIGHTS; i++) {\n vDirectionalShadowCoord[i] = directionalShadowMatrix[i] * worldPosition;\n }\n #endif\n #if NUM_SPOT_LIGHTS > 0\n #pragma unroll_loop\n for (int i = 0; i < NUM_SPOT_LIGHTS; i++) {\n vSpotShadowCoord[i] = spotShadowMatrix[i] * worldPosition;\n }\n #endif\n #if NUM_POINT_LIGHTS > 0\n #pragma unroll_loop\n for (int i = 0; i < NUM_POINT_LIGHTS; i++) {\n vPointShadowCoord[i] = pointShadowMatrix[i] * worldPosition;\n }\n #endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n float shadow = 1.0;\n #ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHTS > 0\n DirectionalLight directionalLight;\n #pragma unroll_loop\n for (int i = 0; i < NUM_DIR_LIGHTS; i++) {\n directionalLight = directionalLights[i];\n shadow *= bool(directionalLight.shadow) ? getShadow(directionalShadowMap[i], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[i]) : 1.0;\n }\n #endif\n #if NUM_SPOT_LIGHTS > 0\n SpotLight spotLight;\n #pragma unroll_loop\n for (int i = 0; i < NUM_SPOT_LIGHTS; i++) {\n spotLight = spotLights[i];\n shadow *= bool(spotLight.shadow) ? getShadow(spotShadowMap[i], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[i]) : 1.0;\n }\n #endif\n #if NUM_POINT_LIGHTS > 0\n PointLight pointLight;\n #pragma unroll_loop\n for (int i = 0; i < NUM_POINT_LIGHTS; i++) {\n pointLight = pointLights[i];\n shadow *= bool(pointLight.shadow) ? getPointShadow(pointShadowMap[i], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[i], pointLight.shadowCameraNear, pointLight.shadowCameraFar) : 1.0;\n }\n #endif\n #endif\n return shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix(skinIndex.x);\n mat4 boneMatY = getBoneMatrix(skinIndex.y);\n mat4 boneMatZ = getBoneMatrix(skinIndex.z);\n mat4 boneMatW = getBoneMatrix(skinIndex.w);\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n #ifdef BONE_TEXTURE\n uniform sampler2D boneTexture;\n uniform int boneTextureSize;\n mat4 getBoneMatrix(const in float i) {\n float j = i * 4.0;\n float x = mod(j, float(boneTextureSize));\n float y = floor(j / float(boneTextureSize));\n float dx = 1.0 / float(boneTextureSize);\n float dy = 1.0 / float(boneTextureSize);\n y = dy * (y + 0.5);\n vec4 v1 = texture2D(boneTexture, vec2(dx * (x + 0.5), y));\n vec4 v2 = texture2D(boneTexture, vec2(dx * (x + 1.5), y));\n vec4 v3 = texture2D(boneTexture, vec2(dx * (x + 2.5), y));\n vec4 v4 = texture2D(boneTexture, vec2(dx * (x + 3.5), y));\n mat4 bone = mat4(v1, v2, v3, v4);\n return bone;\n }\n #else\n uniform mat4 boneMatrices[MAX_BONES];\n mat4 getBoneMatrix(const in float i) {\n mat4 bone = boneMatrices[int(i)];\n return bone;\n }\n #endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n vec4 skinVertex = bindMatrix * vec4(transformed, 1.0);\n vec4 skinned = vec4(0.0);\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n transformed = (bindMatrixInverse * skinned).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n mat4 skinMatrix = mat4(0.0);\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n objectNormal = vec4(skinMatrix * vec4(objectNormal, 0.0)).xyz;\n #ifdef USE_TANGENT\n objectTangent = vec4(skinMatrix * vec4(objectTangent, 0.0)).xyz;\n #endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture2D(specularMap, vUv);\n specularStrength = texelSpecular.r;\n#else\n specularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n uniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined(TONE_MAPPING)\n gl_FragColor.rgb = toneMapping(gl_FragColor.rgb);\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n #define saturate(a) clamp(a, 0.0, 1.0)\n#endif\n#ifndef PI\n #define PI 3.14159265359\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nuniform float toneMappingBrightness;\nuniform float toneMappingContrast;\nuniform float toneMappingMidTones;\nuniform float toneMappingPhysicalScale;\nuniform bool toneMappingChromaticAdaptation;\nuniform vec3 toneMappingWhiteColor;\nuniform bool toneMappingColorDifferentiation;\nuniform bool toneMappingExteriorDaylight;\nvec3 LinearToneMapping(vec3 color) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping(vec3 color) {\n color *= toneMappingExposure;\n return saturate(color / (vec3(1.0) + color));\n}\n#define Uncharted2Helper(x) max(((x * (0.15 * x + 0.10 * 0.50) + 0.20 * 0.02) / (x * (0.15 * x + 0.50) + 0.20 * 0.30)) - 0.02 / 0.30, vec3(0.0))\nvec3 Uncharted2ToneMapping(vec3 color) {\n color *= toneMappingExposure;\n return saturate(Uncharted2Helper(color) / Uncharted2Helper(vec3(toneMappingWhitePoint)));\n}\nvec3 OptimizedCineonToneMapping(vec3 color) {\n color *= toneMappingExposure;\n color = max(vec3(0.0), color - 0.004);\n return pow((color * (6.2 * color + 0.5)) / (color * (6.2 * color + 1.7) + 0.06), vec3(2.2));\n}\nvec3 ACESFilmicToneMapping(vec3 color) {\n color *= toneMappingExposure;\n return saturate((color * (2.51 * color + 0.03)) / (color * (2.43 * color + 0.59) + 0.14));\n}\n#define ORDERS_OF_MAG 5.0\nfloat toneCalcBrightness(in vec3 color)\n{\n return (abs(color.r) * 0.263 + abs(color.g) * 0.655 + abs(color.b) * 0.082);\n}\nfloat toneApproximateScotopicLuminance(vec3 color)\n{\n return (0.062 * color.r + 0.608 * color.g + 0.330 * color.b);\n}\nvec3 LogarithmicMaxToneMapping(vec3 color) {\n float inputScaleFactor = toneMappingPhysicalScale / PI;\n float brightness = (toneMappingBrightness < 0.0) ? 0.0 : (toneMappingBrightness * 0.7);\n float powerBot = toneMappingExteriorDaylight ? 4.0 : 2.0;\n float res = 100.0 / ORDERS_OF_MAG;\n float mag = floor((50.0 / res));\n float power = ((brightness / 20.0 - ORDERS_OF_MAG) - powerBot) + mag;\n float stepsize = 9.0 / res;\n float step = 50.0 - (mag * res);\n float param_c = (0.02 * toneMappingContrast) * 2.0;\n float param_b = pow(10.0, power) * (1.0 + (stepsize * step));\n float param_a = param_b * (1.0 + param_c);\n param_c /= pow(2.0, toneMappingMidTones - 1.0);\n param_b *= PI;\n vec3 whiteConstancyFactor = toneMappingWhiteColor;\n if (toneMappingChromaticAdaptation) {\n float luminance = toneCalcBrightness(whiteConstancyFactor);\n whiteConstancyFactor.r = (whiteConstancyFactor.r > 0.001) ? luminance / whiteConstancyFactor.r : luminance / 0.001;\n whiteConstancyFactor.g = (whiteConstancyFactor.g > 0.001) ? luminance / whiteConstancyFactor.g : luminance / 0.001;\n whiteConstancyFactor.b = (whiteConstancyFactor.b > 0.001) ? luminance / whiteConstancyFactor.b : luminance / 0.001;\n }\n vec3 outColor = inputScaleFactor * color;\n if (toneMappingChromaticAdaptation) {\n outColor *= whiteConstancyFactor.rgb;\n }\n float luminance = toneCalcBrightness(outColor);\n if (toneMappingColorDifferentiation && (luminance < 5.62)) {\n float sLuminance = toneApproximateScotopicLuminance(outColor);\n if (luminance <= 5.62e-3) {\n outColor = vec3(sLuminance);\n } else {\n float w = (luminance - 5.62e-3) / 5.61438;\n outColor = outColor * w + sLuminance * (1.0 - w);\n }\n }\n outColor = outColor * (param_a / (param_b * outColor + param_c));\n return outColor;\n}",uv_pars_fragment:"#if defined(USE_MAP) || defined(USE_BUMPMAP) || defined(USE_NORMALMAP) || defined(USE_SPECULARMAP) || defined(USE_ALPHAMAP) || defined(USE_EMISSIVEMAP) || defined(USE_ROUGHNESSMAP) || defined(USE_METALNESSMAP)\n varying vec2 vUv;\n#endif",uv_pars_vertex:"#if defined(USE_MAP) || defined(USE_BUMPMAP) || defined(USE_NORMALMAP) || defined(USE_SPECULARMAP) || defined(USE_ALPHAMAP) || defined(USE_EMISSIVEMAP) || defined(USE_ROUGHNESSMAP) || defined(USE_METALNESSMAP)\n varying vec2 vUv;\n uniform mat3 uvTransform;\n#endif",uv_vertex:"#if defined(USE_MAP) || defined(USE_BUMPMAP) || defined(USE_NORMALMAP) || defined(USE_SPECULARMAP) || defined(USE_ALPHAMAP) || defined(USE_EMISSIVEMAP) || defined(USE_ROUGHNESSMAP) || defined(USE_METALNESSMAP)\n vUv = (uvTransform * vec3(uv, 1)).xy;\n#endif",uv2_pars_fragment:"#if defined(USE_LIGHTMAP) || defined(USE_AOMAP)\n varying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined(USE_LIGHTMAP) || defined(USE_AOMAP)\n attribute vec2 uv2;\n varying vec2 vUv2;\n#endif",uv2_vertex:"#if defined(USE_LIGHTMAP) || defined(USE_AOMAP)\n vUv2 = uv2;\n#endif",worldpos_vertex:"#if defined(USE_ENVMAP) || defined(DISTANCE) || defined (USE_SHADOWMAP) || defined(MASK) || defined(NODE)\n vec4 worldPosition = modelMatrix * vec4(transformed, 1.0);\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n vec4 texColor = texture2D(t2D, vUv);\n gl_FragColor = mapTexelToLinear(texColor);\n #include \n #include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n vUv = (uvTransform * vec3(uv, 1)).xy;\n gl_Position = vec4(position.xy, 1.0, 1.0);\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n vec4 texColor = textureCube(tCube, vec3(tFlip * vWorldDirection.x, vWorldDirection.yz));\n gl_FragColor = mapTexelToLinear(texColor);\n gl_FragColor.a *= opacity;\n #include \n #include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection(position, modelMatrix);\n #include \n #include \n gl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec4 diffuseColor = vec4(1.0);\n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include \n #include \n #include \n #include \n #if DEPTH_PACKING == 3200\n gl_FragColor = vec4(vec3(1.0 - gl_FragCoord.z), opacity);\n #elif DEPTH_PACKING == 3201\n gl_FragColor = packDepthToRGBA(gl_FragCoord.z);\n #endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #ifdef USE_DISPLACEMENTMAP\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n #include \n vec4 diffuseColor = vec4(1.0);\n #include \n #include \n #include \n float dist = length(vWorldPosition - referencePosition);\n dist = (dist - nearDistance) / (farDistance - nearDistance);\n dist = saturate(dist);\n gl_FragColor = packDepthToRGBA(dist);\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #ifdef USE_DISPLACEMENTMAP\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nuniform bool invertU;\nuniform float offsetU;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n vec3 direction = normalize(vWorldDirection);\n vec2 sampleUV;\n sampleUV.y = asin(clamp(direction.y, - 1.0, 1.0)) * RECIPROCAL_PI + 0.5;\n sampleUV.x = atan(direction.z, direction.x) * RECIPROCAL_PI2 + 0.5;\n \n if (invertU) {\n sampleUV.x = 1.0 - sampleUV.x;\n }\n \n sampleUV.x += offsetU;\n vec4 texColor = texture2D(tEquirect, sampleUV);\n gl_FragColor = mapTexelToLinear(texColor);\n #include \n #include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection(position, modelMatrix);\n #include \n #include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n if (mod(vLineDistance, totalSize) > dashSize) {\n discard;\n }\n vec3 outgoingLight = vec3(0.0);\n vec4 diffuseColor = vec4(diffuse, opacity);\n #include \n #include \n outgoingLight = diffuseColor.rgb;\n gl_FragColor = vec4(outgoingLight, diffuseColor.a);\n #include \n #include \n #include \n #include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vLineDistance = scale * lineDistance;\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n #include \n #include \n #include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec4 diffuseColor = vec4(diffuse, opacity);\n #include \n #include \n #include \n #include \n #include \n #include \n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n #ifdef USE_LIGHTMAP\n reflectedLight.indirectDiffuse += texture2D(lightMap, vUv2).xyz * lightMapIntensity;\n #else\n reflectedLight.indirectDiffuse += vec3(1.0);\n #endif\n #include \n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include \n gl_FragColor = vec4(outgoingLight, diffuseColor.a);\n #include \n #include \n #include \n #include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #ifdef USE_ENVMAP\n #include \n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n varying vec3 vLightBack;\n varying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec4 diffuseColor = vec4(diffuse, opacity);\n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n reflectedLight.indirectDiffuse = getAmbientLightIrradiance(ambientLightColor);\n #ifdef DOUBLE_SIDED\n reflectedLight.indirectDiffuse += (gl_FrontFacing) ? vIndirectFront : vIndirectBack;\n #else\n reflectedLight.indirectDiffuse += vIndirectFront;\n #endif\n #include \n reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert(diffuseColor.rgb);\n #ifdef DOUBLE_SIDED\n reflectedLight.directDiffuse = (gl_FrontFacing) ? vLightFront : vLightBack;\n #else\n reflectedLight.directDiffuse = vLightFront;\n #endif\n reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert(diffuseColor.rgb) * getShadowMask();\n #include \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include \n gl_FragColor = vec4(outgoingLight, diffuseColor.a);\n #include \n #include \n #include \n #include \n #include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n varying vec3 vLightBack;\n varying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec4 diffuseColor = vec4(diffuse, opacity);\n #include \n #include \n #include \n #include \n #include \n #include \n vec3 viewDir = normalize(vViewPosition);\n vec3 x = normalize(vec3(viewDir.z, 0.0, - viewDir.x));\n vec3 y = cross(viewDir, x);\n vec2 uv = vec2(dot(x, normal), dot(y, normal)) * 0.495 + 0.5;\n #ifdef USE_MATCAP\n vec4 matcapColor = texture2D(matcap, uv);\n matcapColor = matcapTexelToLinear(matcapColor);\n #else\n vec4 matcapColor = vec4(1.0);\n #endif\n vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n gl_FragColor = vec4(outgoingLight, diffuseColor.a);\n #include \n #include \n #include \n #include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include