|
@@ -32417,7 +32417,7 @@ var BABYLON;
|
|
|
* Modifies the mesh geometry according to the passed transformation matrix.
|
|
|
* This method returns nothing but it really modifies the mesh even if it's originally not set as updatable.
|
|
|
* The mesh normals are modified accordingly the same transformation.
|
|
|
- * tuto : http://doc.babylonjs.com/tutorials/How_Rotations_and_Translations_Work#baking-transform
|
|
|
+ * tuto : http://doc.babylonjs.com/resources/baking_transformations
|
|
|
* Note that, under the hood, this method sets a new VertexBuffer each call.
|
|
|
* Returns the Mesh.
|
|
|
*/
|
|
@@ -33273,7 +33273,7 @@ var BABYLON;
|
|
|
* It's the offset to join together the points from the same path. Ex : offset = 10 means the point 1 is joined to the point 11.
|
|
|
* The optional parameter `instance` is an instance of an existing Ribbon object to be updated with the passed `pathArray` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#ribbon
|
|
|
* You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
*/
|
|
|
Mesh.CreateRibbon = function (name, pathArray, closeArray, closePath, offset, scene, updatable, sideOrientation, instance) {
|
|
@@ -33295,7 +33295,7 @@ var BABYLON;
|
|
|
* The parameter `radius` sets the radius size (float) of the polygon (default 0.5).
|
|
|
* The parameter `tessellation` sets the number of polygon sides (positive integer, default 64). So a tessellation valued to 3 will build a triangle, to 4 a square, etc.
|
|
|
* You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
*/
|
|
|
Mesh.CreateDisc = function (name, radius, tessellation, scene, updatable, sideOrientation) {
|
|
@@ -33313,7 +33313,7 @@ var BABYLON;
|
|
|
* Please consider using the same method from the MeshBuilder class instead.
|
|
|
* The parameter `size` sets the size (float) of each box side (default 1).
|
|
|
* You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
*/
|
|
|
Mesh.CreateBox = function (name, size, scene, updatable, sideOrientation) {
|
|
@@ -33331,7 +33331,7 @@ var BABYLON;
|
|
|
* The parameter `diameter` sets the diameter size (float) of the sphere (default 1).
|
|
|
* The parameter `segments` sets the sphere number of horizontal stripes (positive integer, default 32).
|
|
|
* You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
*/
|
|
|
Mesh.CreateSphere = function (name, segments, diameter, scene, updatable, sideOrientation) {
|
|
@@ -33354,7 +33354,7 @@ var BABYLON;
|
|
|
* The parameter `tessellation` sets the number of cylinder sides (positive integer, default 24). Set it to 3 to get a prism for instance.
|
|
|
* The parameter `subdivisions` sets the number of rings along the cylinder height (positive integer, default 1).
|
|
|
* You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
*/
|
|
|
Mesh.CreateCylinder = function (name, height, diameterTop, diameterBottom, tessellation, subdivisions, scene, updatable, sideOrientation) {
|
|
@@ -33385,7 +33385,7 @@ var BABYLON;
|
|
|
* The parameter `thickness` sets the diameter size of the tube of the torus (float, default 0.5).
|
|
|
* The parameter `tessellation` sets the number of torus sides (postive integer, default 16).
|
|
|
* You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
*/
|
|
|
Mesh.CreateTorus = function (name, diameter, thickness, tessellation, scene, updatable, sideOrientation) {
|
|
@@ -33406,7 +33406,7 @@ var BABYLON;
|
|
|
* The parameter `tubularSegments` sets the number of tubes to decompose the knot into (positive integer, default 32).
|
|
|
* The parameters `p` and `q` are the number of windings on each axis (positive integers, default 2 and 3).
|
|
|
* You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
*/
|
|
|
Mesh.CreateTorusKnot = function (name, radius, tube, radialSegments, tubularSegments, p, q, scene, updatable, sideOrientation) {
|
|
@@ -33505,7 +33505,7 @@ var BABYLON;
|
|
|
* The extrusion is a parametric shape : http://doc.babylonjs.com/tutorials/Parametric_Shapes. It has no predefined shape. Its final shape will depend on the input parameters.
|
|
|
* Please consider using the same method from the MeshBuilder class instead.
|
|
|
*
|
|
|
- * Please read this full tutorial to understand how to design an extruded shape : http://doc.babylonjs.com/tutorials/Parametric_Shapes#extrusion
|
|
|
+ * Please read this full tutorial to understand how to design an extruded shape : http://doc.babylonjs.com/how_to/parametric_shapes#extruded-shapes
|
|
|
* The parameter `shape` is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be
|
|
|
* extruded along the Z axis.
|
|
|
* The parameter `path` is a required array of successive Vector3. This is the axis curve the shape is extruded along.
|
|
@@ -33515,7 +33515,7 @@ var BABYLON;
|
|
|
* The optional parameter `instance` is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#extruded-shape
|
|
|
* Remember you can only change the shape or path point positions, not their number when updating an extruded shape.
|
|
|
* You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
*/
|
|
|
Mesh.ExtrudeShape = function (name, shape, path, scale, rotation, cap, scene, updatable, sideOrientation, instance) {
|
|
@@ -33537,7 +33537,7 @@ var BABYLON;
|
|
|
* The custom extrusion is a parametric shape : http://doc.babylonjs.com/tutorials/Parametric_Shapes. It has no predefined shape. Its final shape will depend on the input parameters.
|
|
|
* Please consider using the same method from the MeshBuilder class instead.
|
|
|
*
|
|
|
- * Please read this full tutorial to understand how to design a custom extruded shape : http://doc.babylonjs.com/tutorials/Parametric_Shapes#extrusion
|
|
|
+ * Please read this full tutorial to understand how to design a custom extruded shape : http://doc.babylonjs.com/how_to/parametric_shapes#extruded-shapes
|
|
|
* The parameter `shape` is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be
|
|
|
* extruded along the Z axis.
|
|
|
* The parameter `path` is a required array of successive Vector3. This is the axis curve the shape is extruded along.
|
|
@@ -33563,7 +33563,7 @@ var BABYLON;
|
|
|
* The optional parameter `instance` is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#extruded-shape
|
|
|
* Remember you can only change the shape or path point positions, not their number when updating an extruded shape.
|
|
|
* You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
*/
|
|
|
Mesh.ExtrudeShapeCustom = function (name, shape, path, scaleFunction, rotationFunction, ribbonCloseArray, ribbonClosePath, cap, scene, updatable, sideOrientation, instance) {
|
|
@@ -33590,7 +33590,7 @@ var BABYLON;
|
|
|
* The parameter `radius` (positive float, default 1) is the radius value of the lathe.
|
|
|
* The parameter `tessellation` (positive integer, default 64) is the side number of the lathe.
|
|
|
* You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
*/
|
|
|
Mesh.CreateLathe = function (name, shape, radius, tessellation, scene, updatable, sideOrientation) {
|
|
@@ -33608,7 +33608,7 @@ var BABYLON;
|
|
|
* Please consider using the same method from the MeshBuilder class instead.
|
|
|
* The parameter `size` sets the size (float) of both sides of the plane at once (default 1).
|
|
|
* You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
*/
|
|
|
Mesh.CreatePlane = function (name, size, scene, updatable, sideOrientation) {
|
|
@@ -33662,7 +33662,7 @@ var BABYLON;
|
|
|
};
|
|
|
/**
|
|
|
* Creates a ground mesh from a height map.
|
|
|
- * tuto : http://doc.babylonjs.com/tutorials/14._Height_Map
|
|
|
+ * tuto : http://doc.babylonjs.com/babylon101/height_map
|
|
|
* Please consider using the same method from the MeshBuilder class instead.
|
|
|
* The parameter `url` sets the URL of the height map image resource.
|
|
|
* The parameters `width` and `height` (positive floats, default 10) set the ground width and height sizes.
|
|
@@ -33707,7 +33707,7 @@ var BABYLON;
|
|
|
* The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL
|
|
|
* The optional parameter `instance` is an instance of an existing Tube object to be updated with the passed `pathArray` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#tube
|
|
|
* You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
*/
|
|
|
Mesh.CreateTube = function (name, path, radius, tessellation, radiusFunction, cap, scene, updatable, sideOrientation, instance) {
|
|
@@ -33737,7 +33737,7 @@ var BABYLON;
|
|
|
* To understand how to set `faceUV` or `faceColors`, please read this by considering the right number of faces of your polyhedron, instead of only 6 for the box : http://doc.babylonjs.com/tutorials/CreateBox_Per_Face_Textures_And_Colors
|
|
|
* The parameter `flat` (boolean, default true). If set to false, it gives the polyhedron a single global face, so less vertices and shared normals. In this case, `faceColors` and `faceUV` are ignored.
|
|
|
* You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
*/
|
|
|
Mesh.CreatePolyhedron = function (name, options, scene) {
|
|
@@ -33751,7 +33751,7 @@ var BABYLON;
|
|
|
* The parameter `subdivisions` sets the number of subdivisions (postive integer, default 4). The more subdivisions, the more faces on the icosphere whatever its size.
|
|
|
* The parameter `flat` (boolean, default true) gives each side its own normals. Set it to false to get a smooth continuous light reflection on the surface.
|
|
|
* You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
*/
|
|
|
Mesh.CreateIcoSphere = function (name, options, scene) {
|
|
@@ -43298,10 +43298,6 @@ var BABYLON;
|
|
|
defines.INVERTCUBICMAP = (this._reflectionTexture.coordinatesMode === BABYLON.Texture.INVCUBIC_MODE);
|
|
|
defines.REFLECTIONMAP_3D = this._reflectionTexture.isCube;
|
|
|
switch (this._reflectionTexture.coordinatesMode) {
|
|
|
- case BABYLON.Texture.CUBIC_MODE:
|
|
|
- case BABYLON.Texture.INVCUBIC_MODE:
|
|
|
- defines.setReflectionMode("REFLECTIONMAP_CUBIC");
|
|
|
- break;
|
|
|
case BABYLON.Texture.EXPLICIT_MODE:
|
|
|
defines.setReflectionMode("REFLECTIONMAP_EXPLICIT");
|
|
|
break;
|
|
@@ -43326,6 +43322,11 @@ var BABYLON;
|
|
|
case BABYLON.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:
|
|
|
defines.setReflectionMode("REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED");
|
|
|
break;
|
|
|
+ case BABYLON.Texture.CUBIC_MODE:
|
|
|
+ case BABYLON.Texture.INVCUBIC_MODE:
|
|
|
+ default:
|
|
|
+ defines.setReflectionMode("REFLECTIONMAP_CUBIC");
|
|
|
+ break;
|
|
|
}
|
|
|
defines.USE_LOCAL_REFLECTIONMAP_CUBIC = this._reflectionTexture.boundingBoxSize ? true : false;
|
|
|
}
|
|
@@ -45164,11 +45165,6 @@ var BABYLON;
|
|
|
}
|
|
|
defines.REFLECTIONMAP_3D = reflectionTexture.isCube;
|
|
|
switch (reflectionTexture.coordinatesMode) {
|
|
|
- case BABYLON.Texture.CUBIC_MODE:
|
|
|
- case BABYLON.Texture.INVCUBIC_MODE:
|
|
|
- defines.REFLECTIONMAP_CUBIC = true;
|
|
|
- defines.USE_LOCAL_REFLECTIONMAP_CUBIC = reflectionTexture.boundingBoxSize ? true : false;
|
|
|
- break;
|
|
|
case BABYLON.Texture.EXPLICIT_MODE:
|
|
|
defines.REFLECTIONMAP_EXPLICIT = true;
|
|
|
break;
|
|
@@ -45193,6 +45189,12 @@ var BABYLON;
|
|
|
case BABYLON.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:
|
|
|
defines.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = true;
|
|
|
break;
|
|
|
+ case BABYLON.Texture.CUBIC_MODE:
|
|
|
+ case BABYLON.Texture.INVCUBIC_MODE:
|
|
|
+ default:
|
|
|
+ defines.REFLECTIONMAP_CUBIC = true;
|
|
|
+ defines.USE_LOCAL_REFLECTIONMAP_CUBIC = reflectionTexture.boundingBoxSize ? true : false;
|
|
|
+ break;
|
|
|
}
|
|
|
if (reflectionTexture.coordinatesMode !== BABYLON.Texture.SKYBOX_MODE) {
|
|
|
if (reflectionTexture.sphericalPolynomial) {
|
|
@@ -60827,7 +60829,7 @@ var BABYLON;
|
|
|
* * You can set different colors and different images to each box side by using the parameters `faceColors` (an array of 6 Color3 elements) and `faceUV` (an array of 6 Vector4 elements)
|
|
|
* * Please read this tutorial : http://doc.babylonjs.com/tutorials/CreateBox_Per_Face_Textures_And_Colors
|
|
|
* * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
|
|
|
* @see http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#box
|
|
|
* @param name defines the name of the mesh
|
|
@@ -60852,7 +60854,7 @@ var BABYLON;
|
|
|
* * You can create an unclosed sphere with the parameter `arc` (positive float, default 1), valued between 0 and 1, what is the ratio of the circumference (latitude) : 2 x PI x ratio
|
|
|
* * You can create an unclosed sphere on its height with the parameter `slice` (positive float, default1), valued between 0 and 1, what is the height ratio (longitude)
|
|
|
* * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
|
|
|
* @param name defines the name of the mesh
|
|
|
* @param options defines the options used to create the mesh
|
|
@@ -60874,13 +60876,13 @@ var BABYLON;
|
|
|
* * The parameter `tessellation` sets the number of polygon sides (positive integer, default 64). So a tessellation valued to 3 will build a triangle, to 4 a square, etc
|
|
|
* * You can create an unclosed polygon with the parameter `arc` (positive float, default 1), valued between 0 and 1, what is the ratio of the circumference : 2 x PI x ratio
|
|
|
* * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
|
|
|
* @param name defines the name of the mesh
|
|
|
* @param options defines the options used to create the mesh
|
|
|
* @param scene defines the hosting scene
|
|
|
* @returns the plane polygonal mesh
|
|
|
- * @see http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#disc
|
|
|
+ * @see http://doc.babylonjs.com/how_to/set_shapes#disc-or-regular-polygon
|
|
|
*/
|
|
|
MeshBuilder.CreateDisc = function (name, options, scene) {
|
|
|
if (scene === void 0) { scene = null; }
|
|
@@ -60898,13 +60900,13 @@ var BABYLON;
|
|
|
* * The parameter `subdivisions` sets the number of subdivisions (postive integer, default 4). The more subdivisions, the more faces on the icosphere whatever its size
|
|
|
* * The parameter `flat` (boolean, default true) gives each side its own normals. Set it to false to get a smooth continuous light reflection on the surface
|
|
|
* * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
|
|
|
* @param name defines the name of the mesh
|
|
|
* @param options defines the options used to create the mesh
|
|
|
* @param scene defines the hosting scene
|
|
|
* @returns the icosahedron mesh
|
|
|
- * @see http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#icosphere
|
|
|
+ * @see http://doc.babylonjs.com/how_to/polyhedra_shapes#icosphere
|
|
|
*/
|
|
|
MeshBuilder.CreateIcoSphere = function (name, options, scene) {
|
|
|
var sphere = new BABYLON.Mesh(name, scene);
|
|
@@ -60924,7 +60926,7 @@ var BABYLON;
|
|
|
* * It's the offset to join the points from the same path. Ex : offset = 10 means the point 1 is joined to the point 11
|
|
|
* * The optional parameter `instance` is an instance of an existing Ribbon object to be updated with the passed `pathArray` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#ribbon
|
|
|
* * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture
|
|
|
* * The parameter `uvs` is an optional flat array of `Vector2` to update/set each ribbon vertex with its own custom UV values instead of the computed ones
|
|
|
* * The parameters `colors` is an optional flat array of `Color4` to set/update each ribbon vertex with its own custom color values
|
|
@@ -61080,7 +61082,7 @@ var BABYLON;
|
|
|
* * If `enclose` is true, a ring surface is 3 successive elements in the array : the tubular surface, then the two closing faces.
|
|
|
* * Example how to set colors and textures on a sliced cylinder : http://www.html5gamedevs.com/topic/17945-creating-a-closed-slice-of-a-cylinder/#comment-106379
|
|
|
* * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
* @param name defines the name of the mesh
|
|
|
* @param options defines the options used to create the mesh
|
|
@@ -61102,7 +61104,7 @@ var BABYLON;
|
|
|
* * The parameter `thickness` sets the diameter size of the tube of the torus (float, default 0.5)
|
|
|
* * The parameter `tessellation` sets the number of torus sides (postive integer, default 16)
|
|
|
* * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
* @param name defines the name of the mesh
|
|
|
* @param options defines the options used to create the mesh
|
|
@@ -61125,7 +61127,7 @@ var BABYLON;
|
|
|
* * The parameter `tubularSegments` sets the number of tubes to decompose the knot into (positive integer, default 32)
|
|
|
* * The parameters `p` and `q` are the number of windings on each axis (positive integers, default 2 and 3)
|
|
|
* * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
* @param name defines the name of the mesh
|
|
|
* @param options defines the options used to create the mesh
|
|
@@ -61152,7 +61154,7 @@ var BABYLON;
|
|
|
* * Updating a simple Line mesh, you just need to update every line in the `lines` array : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#lines-and-dashedlines
|
|
|
* * When updating an instance, remember that only line point positions can change, not the number of points, neither the number of lines
|
|
|
* * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
|
|
|
- * @see http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#linesystem
|
|
|
+ * @see http://doc.babylonjs.com/how_to/parametric_shapes#line-system
|
|
|
* @param name defines the name of the new line system
|
|
|
* @param options defines the options used to create the line system
|
|
|
* @param scene defines the hosting scene
|
|
@@ -61211,7 +61213,7 @@ var BABYLON;
|
|
|
* * The optional parameter `useVertexAlpha` is to be set to `false` (default `true`) when you don't need alpha blending (faster)
|
|
|
* * When updating an instance, remember that only point positions can change, not the number of points
|
|
|
* * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
|
|
|
- * @see http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#lines
|
|
|
+ * @see http://doc.babylonjs.com/how_to/parametric_shapes#lines
|
|
|
* @param name defines the name of the new line system
|
|
|
* @param options defines the options used to create the line system
|
|
|
* @param scene defines the hosting scene
|
|
@@ -61238,7 +61240,7 @@ var BABYLON;
|
|
|
* @param options defines the options used to create the mesh
|
|
|
* @param scene defines the hosting scene
|
|
|
* @returns the dashed line mesh
|
|
|
- * @see http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#dashed-lines
|
|
|
+ * @see http://doc.babylonjs.com/how_to/parametric_shapes#dashed-lines
|
|
|
*/
|
|
|
MeshBuilder.CreateDashedLines = function (name, options, scene) {
|
|
|
if (scene === void 0) { scene = null; }
|
|
@@ -61309,7 +61311,7 @@ var BABYLON;
|
|
|
* * The optional parameter `instance` is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#extruded-shape
|
|
|
* * Remember you can only change the shape or path point positions, not their number when updating an extruded shape.
|
|
|
* * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture.
|
|
|
* * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
* @param name defines the name of the mesh
|
|
@@ -61317,8 +61319,8 @@ var BABYLON;
|
|
|
* @param scene defines the hosting scene
|
|
|
* @returns the extruded shape mesh
|
|
|
* @see http://doc.babylonjs.com/tutorials/Parametric_Shapes
|
|
|
- * @see http://doc.babylonjs.com/tutorials/Parametric_Shapes#extrusion
|
|
|
- * @see http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#extruded-shapes
|
|
|
+ * @see http://doc.babylonjs.com/how_to/parametric_shapes#extruded-shapes
|
|
|
+ * @see http://doc.babylonjs.com/how_to/parametric_shapes#extruded-shapes
|
|
|
*/
|
|
|
MeshBuilder.ExtrudeShape = function (name, options, scene) {
|
|
|
if (scene === void 0) { scene = null; }
|
|
@@ -61348,16 +61350,16 @@ var BABYLON;
|
|
|
* * The optional parameter `instance` is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#extruded-shape
|
|
|
* * Remember you can only change the shape or path point positions, not their number when updating an extruded shape
|
|
|
* * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture
|
|
|
* * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
|
|
|
* @param name defines the name of the mesh
|
|
|
* @param options defines the options used to create the mesh
|
|
|
* @param scene defines the hosting scene
|
|
|
* @returns the custom extruded shape mesh
|
|
|
- * @see http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#custom-extruded-shapes
|
|
|
+ * @see http://doc.babylonjs.com/how_to/parametric_shapes#custom-extruded-shapes
|
|
|
* @see http://doc.babylonjs.com/tutorials/Parametric_Shapes
|
|
|
- * @see http://doc.babylonjs.com/tutorials/Parametric_Shapes#extrusion
|
|
|
+ * @see http://doc.babylonjs.com/how_to/parametric_shapes#extruded-shapes
|
|
|
*/
|
|
|
MeshBuilder.ExtrudeShapeCustom = function (name, options, scene) {
|
|
|
var path = options.path;
|
|
@@ -61383,14 +61385,14 @@ var BABYLON;
|
|
|
* * The parameter `closed` (boolean, default true) opens/closes the lathe circumference. This should be set to false when used with the parameter "arc"
|
|
|
* * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL
|
|
|
* * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture
|
|
|
* * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
|
|
|
* @param name defines the name of the mesh
|
|
|
* @param options defines the options used to create the mesh
|
|
|
* @param scene defines the hosting scene
|
|
|
* @returns the lathe mesh
|
|
|
- * @see http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#lathe
|
|
|
+ * @see http://doc.babylonjs.com/how_to/parametric_shapes#lathe
|
|
|
*/
|
|
|
MeshBuilder.CreateLathe = function (name, options, scene) {
|
|
|
var arc = options.arc ? ((options.arc <= 0 || options.arc > 1) ? 1.0 : options.arc) : 1.0;
|
|
@@ -61436,7 +61438,7 @@ var BABYLON;
|
|
|
* * You can set some different plane dimensions by using the parameters `width` and `height` (both by default have the same value than `size`)
|
|
|
* * The parameter `sourcePlane` is a Plane instance. It builds a mesh plane from a Math plane
|
|
|
* * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
|
|
|
* @param name defines the name of the mesh
|
|
|
* @param options defines the options used to create the mesh
|
|
@@ -61519,7 +61521,7 @@ var BABYLON;
|
|
|
* @param options defines the options used to create the mesh
|
|
|
* @param scene defines the hosting scene
|
|
|
* @returns the ground mesh
|
|
|
- * @see http://doc.babylonjs.com/tutorials/14._Height_Map
|
|
|
+ * @see http://doc.babylonjs.com/babylon101/height_map
|
|
|
* @see http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#ground-from-a-height-map
|
|
|
*/
|
|
|
MeshBuilder.CreateGroundFromHeightMap = function (name, url, options, scene) {
|
|
@@ -61642,7 +61644,7 @@ var BABYLON;
|
|
|
* * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL
|
|
|
* * The optional parameter `instance` is an instance of an existing Tube object to be updated with the passed `pathArray` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#tube
|
|
|
* * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture
|
|
|
* * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
|
|
|
* @param name defines the name of the mesh
|
|
@@ -61767,13 +61769,13 @@ var BABYLON;
|
|
|
* * To understand how to set `faceUV` or `faceColors`, please read this by considering the right number of faces of your polyhedron, instead of only 6 for the box : http://doc.babylonjs.com/tutorials/CreateBox_Per_Face_Textures_And_Colors
|
|
|
* * The parameter `flat` (boolean, default true). If set to false, it gives the polyhedron a single global face, so less vertices and shared normals. In this case, `faceColors` and `faceUV` are ignored
|
|
|
* * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
* * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
|
|
|
* @param name defines the name of the mesh
|
|
|
* @param options defines the options used to create the mesh
|
|
|
* @param scene defines the hosting scene
|
|
|
* @returns the polyhedron mesh
|
|
|
- * @see http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#polyhedron
|
|
|
+ * @see http://doc.babylonjs.com/how_to/polyhedra_shapes
|
|
|
*/
|
|
|
MeshBuilder.CreatePolyhedron = function (name, options, scene) {
|
|
|
var polyhedron = new BABYLON.Mesh(name, scene);
|
|
@@ -61795,7 +61797,7 @@ var BABYLON;
|
|
|
* @param options defines the options used to create the mesh
|
|
|
* @param scene defines the hosting scene
|
|
|
* @returns the decal mesh
|
|
|
- * @see http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#decals
|
|
|
+ * @see http://doc.babylonjs.com/how_to/decals
|
|
|
*/
|
|
|
MeshBuilder.CreateDecal = function (name, sourceMesh, options) {
|
|
|
var indices = sourceMesh.getIndices();
|
|
@@ -97400,10 +97402,6 @@ var BABYLON;
|
|
|
}
|
|
|
defines.REFLECTIONMAP_3D = reflectionTexture.isCube;
|
|
|
switch (reflectionTexture.coordinatesMode) {
|
|
|
- case BABYLON.Texture.CUBIC_MODE:
|
|
|
- case BABYLON.Texture.INVCUBIC_MODE:
|
|
|
- defines.REFLECTIONMAP_CUBIC = true;
|
|
|
- break;
|
|
|
case BABYLON.Texture.EXPLICIT_MODE:
|
|
|
defines.REFLECTIONMAP_EXPLICIT = true;
|
|
|
break;
|
|
@@ -97428,6 +97426,11 @@ var BABYLON;
|
|
|
case BABYLON.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:
|
|
|
defines.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = true;
|
|
|
break;
|
|
|
+ case BABYLON.Texture.CUBIC_MODE:
|
|
|
+ case BABYLON.Texture.INVCUBIC_MODE:
|
|
|
+ default:
|
|
|
+ defines.REFLECTIONMAP_CUBIC = true;
|
|
|
+ break;
|
|
|
}
|
|
|
if (this.reflectionFresnel) {
|
|
|
defines.REFLECTIONFRESNEL = true;
|
|
@@ -101642,6 +101645,12 @@ var BABYLON;
|
|
|
*/
|
|
|
this.compileShadowGenerators = false;
|
|
|
/**
|
|
|
+ * Defines if the Alpha blended materials are only applied as coverage.
|
|
|
+ * If false, (default) The luminance of each pixel will reduce its opacity to simulate the behaviour of most physical materials.
|
|
|
+ * If true, no extra effects are applied to transparent pixels.
|
|
|
+ */
|
|
|
+ this.transparencyAsCoverage = false;
|
|
|
+ /**
|
|
|
* Function called before loading a url referenced by the asset.
|
|
|
*/
|
|
|
this.preprocessUrlAsync = function (url) { return Promise.resolve(url); };
|
|
@@ -101952,6 +101961,7 @@ var BABYLON;
|
|
|
loader.compileMaterials = this.compileMaterials;
|
|
|
loader.useClipPlane = this.useClipPlane;
|
|
|
loader.compileShadowGenerators = this.compileShadowGenerators;
|
|
|
+ loader.transparencyAsCoverage = this.transparencyAsCoverage;
|
|
|
loader.preprocessUrlAsync = this.preprocessUrlAsync;
|
|
|
loader.onMeshLoadedObservable.add(function (mesh) { return _this.onMeshLoadedObservable.notifyObservers(mesh); });
|
|
|
loader.onTextureLoadedObservable.add(function (texture) { return _this.onTextureLoadedObservable.notifyObservers(texture); });
|
|
@@ -103532,6 +103542,7 @@ var BABYLON;
|
|
|
this.compileMaterials = false;
|
|
|
this.useClipPlane = false;
|
|
|
this.compileShadowGenerators = false;
|
|
|
+ this.transparencyAsCoverage = false;
|
|
|
this.preprocessUrlAsync = function (url) { return Promise.resolve(url); };
|
|
|
this.onMeshLoadedObservable = new BABYLON.Observable();
|
|
|
this.onTextureLoadedObservable = new BABYLON.Observable();
|
|
@@ -104408,6 +104419,12 @@ var BABYLON;
|
|
|
*/
|
|
|
this.compileShadowGenerators = false;
|
|
|
/**
|
|
|
+ * Defines if the Alpha blended materials are only applied as coverage.
|
|
|
+ * If false, (default) The luminance of each pixel will reduce its opacity to simulate the behaviour of most physical materials.
|
|
|
+ * If true, no extra effects are applied to transparent pixels.
|
|
|
+ */
|
|
|
+ this.transparencyAsCoverage = false;
|
|
|
+ /**
|
|
|
* Function called before loading a url referenced by the asset.
|
|
|
*/
|
|
|
this.preprocessUrlAsync = function (url) { return Promise.resolve(url); };
|
|
@@ -104531,12 +104548,12 @@ var BABYLON;
|
|
|
GLTFLoader.prototype._loadAsync = function (nodes, scene, data, rootUrl, onProgress) {
|
|
|
var _this = this;
|
|
|
return Promise.resolve().then(function () {
|
|
|
- _this._loadExtensions();
|
|
|
_this._babylonScene = scene;
|
|
|
_this._rootUrl = rootUrl;
|
|
|
_this._progressCallback = onProgress;
|
|
|
_this._state = BABYLON.GLTFLoaderState.LOADING;
|
|
|
_this._loadData(data);
|
|
|
+ _this._loadExtensions();
|
|
|
_this._checkExtensions();
|
|
|
var promises = new Array();
|
|
|
if (nodes) {
|
|
@@ -104581,15 +104598,6 @@ var BABYLON;
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
- GLTFLoader.prototype._loadExtensions = function () {
|
|
|
- for (var _i = 0, _a = GLTFLoader._ExtensionNames; _i < _a.length; _i++) {
|
|
|
- var name_1 = _a[_i];
|
|
|
- var extension = GLTFLoader._ExtensionFactories[name_1](this);
|
|
|
- this._extensions[name_1] = extension;
|
|
|
- this.onExtensionLoadedObservable.notifyObservers(extension);
|
|
|
- }
|
|
|
- this.onExtensionLoadedObservable.clear();
|
|
|
- };
|
|
|
GLTFLoader.prototype._loadData = function (data) {
|
|
|
this._gltf = data.json;
|
|
|
this._setupData();
|
|
@@ -104640,6 +104648,15 @@ var BABYLON;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
+ GLTFLoader.prototype._loadExtensions = function () {
|
|
|
+ for (var _i = 0, _a = GLTFLoader._ExtensionNames; _i < _a.length; _i++) {
|
|
|
+ var name_1 = _a[_i];
|
|
|
+ var extension = GLTFLoader._ExtensionFactories[name_1](this);
|
|
|
+ this._extensions[name_1] = extension;
|
|
|
+ this.onExtensionLoadedObservable.notifyObservers(extension);
|
|
|
+ }
|
|
|
+ this.onExtensionLoadedObservable.clear();
|
|
|
+ };
|
|
|
GLTFLoader.prototype._checkExtensions = function () {
|
|
|
if (this._gltf.extensionsRequired) {
|
|
|
for (var _i = 0, _a = this._gltf.extensionsRequired; _i < _a.length; _i++) {
|
|
@@ -105453,7 +105470,7 @@ var BABYLON;
|
|
|
GLTFLoader.prototype._getDefaultMaterial = function (drawMode) {
|
|
|
var babylonMaterial = this._defaultBabylonMaterials[drawMode];
|
|
|
if (!babylonMaterial) {
|
|
|
- babylonMaterial = this._createMaterial(BABYLON.PBRMaterial, "__gltf_default", drawMode);
|
|
|
+ babylonMaterial = this._createMaterial("__gltf_default", drawMode);
|
|
|
babylonMaterial.transparencyMode = BABYLON.PBRMaterial.PBRMATERIAL_OPAQUE;
|
|
|
babylonMaterial.metallic = 1;
|
|
|
babylonMaterial.roughness = 1;
|
|
@@ -105505,7 +105522,7 @@ var BABYLON;
|
|
|
if (!babylonData) {
|
|
|
var promises = new Array();
|
|
|
var name_3 = material.name || "materialSG_" + material._index;
|
|
|
- var babylonMaterial = this._createMaterial(BABYLON.PBRMaterial, name_3, babylonDrawMode);
|
|
|
+ var babylonMaterial = this._createMaterial(name_3, babylonDrawMode);
|
|
|
promises.push(this._loadMaterialBasePropertiesAsync(context, material, babylonMaterial));
|
|
|
promises.push(this._loadMaterialMetallicRoughnessPropertiesAsync(context, material, babylonMaterial));
|
|
|
this.onMaterialLoadedObservable.notifyObservers(babylonMaterial);
|
|
@@ -105521,10 +105538,13 @@ var BABYLON;
|
|
|
return babylonData.loaded;
|
|
|
};
|
|
|
/** @hidden */
|
|
|
- GLTFLoader.prototype._createMaterial = function (type, name, drawMode) {
|
|
|
- var babylonMaterial = new type(name, this._babylonScene);
|
|
|
+ GLTFLoader.prototype._createMaterial = function (name, drawMode) {
|
|
|
+ var babylonMaterial = new BABYLON.PBRMaterial(name, this._babylonScene);
|
|
|
babylonMaterial.sideOrientation = this._babylonScene.useRightHandedSystem ? BABYLON.Material.CounterClockWiseSideOrientation : BABYLON.Material.ClockWiseSideOrientation;
|
|
|
babylonMaterial.fillMode = drawMode;
|
|
|
+ babylonMaterial.enableSpecularAntiAliasing = true;
|
|
|
+ babylonMaterial.useRadianceOverAlpha = !this.transparencyAsCoverage;
|
|
|
+ babylonMaterial.useSpecularOverAlpha = !this.transparencyAsCoverage;
|
|
|
return babylonMaterial;
|
|
|
};
|
|
|
/** @hidden */
|
|
@@ -106152,6 +106172,96 @@ var BABYLON;
|
|
|
(function (GLTF2) {
|
|
|
var Extensions;
|
|
|
(function (Extensions) {
|
|
|
+ var NAME = "MSFT_minecraftMesh";
|
|
|
+ /** @hidden */
|
|
|
+ var MSFT_minecraftMesh = /** @class */ (function (_super) {
|
|
|
+ __extends(MSFT_minecraftMesh, _super);
|
|
|
+ function MSFT_minecraftMesh(loader) {
|
|
|
+ var _this = _super.call(this, loader) || this;
|
|
|
+ _this.name = NAME;
|
|
|
+ _this._onMaterialLoaded = function (material) {
|
|
|
+ if (material.needAlphaBlending()) {
|
|
|
+ material.forceDepthWrite = true;
|
|
|
+ material.separateCullingPass = true;
|
|
|
+ }
|
|
|
+ material.backFaceCulling = material.forceDepthWrite;
|
|
|
+ material.twoSidedLighting = true;
|
|
|
+ };
|
|
|
+ var meshes = loader._gltf.meshes;
|
|
|
+ if (meshes && meshes.length) {
|
|
|
+ for (var _i = 0, meshes_1 = meshes; _i < meshes_1.length; _i++) {
|
|
|
+ var mesh = meshes_1[_i];
|
|
|
+ if (mesh && mesh.extras && mesh.extras.MSFT_minecraftMesh) {
|
|
|
+ _this._loader.onMaterialLoadedObservable.add(_this._onMaterialLoaded);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return _this;
|
|
|
+ }
|
|
|
+ return MSFT_minecraftMesh;
|
|
|
+ }(GLTF2.GLTFLoaderExtension));
|
|
|
+ Extensions.MSFT_minecraftMesh = MSFT_minecraftMesh;
|
|
|
+ GLTF2.GLTFLoader._Register(NAME, function (loader) { return new MSFT_minecraftMesh(loader); });
|
|
|
+ })(Extensions = GLTF2.Extensions || (GLTF2.Extensions = {}));
|
|
|
+ })(GLTF2 = BABYLON.GLTF2 || (BABYLON.GLTF2 = {}));
|
|
|
+})(BABYLON || (BABYLON = {}));
|
|
|
+
|
|
|
+//# sourceMappingURL=MSFT_minecraftMesh.js.map
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+var BABYLON;
|
|
|
+(function (BABYLON) {
|
|
|
+ var GLTF2;
|
|
|
+ (function (GLTF2) {
|
|
|
+ var Extensions;
|
|
|
+ (function (Extensions) {
|
|
|
+ var NAME = "MSFT_sRGBFactors";
|
|
|
+ /** @hidden */
|
|
|
+ var MSFT_sRGBFactors = /** @class */ (function (_super) {
|
|
|
+ __extends(MSFT_sRGBFactors, _super);
|
|
|
+ function MSFT_sRGBFactors(loader) {
|
|
|
+ var _this = _super.call(this, loader) || this;
|
|
|
+ _this.name = NAME;
|
|
|
+ _this._onMaterialLoaded = function (material) {
|
|
|
+ if (!material.albedoTexture) {
|
|
|
+ material.albedoColor.toLinearSpaceToRef(material.albedoColor);
|
|
|
+ }
|
|
|
+ if (!material.reflectivityTexture) {
|
|
|
+ material.reflectivityColor.toLinearSpaceToRef(material.reflectivityColor);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var materials = loader._gltf.materials;
|
|
|
+ if (materials && materials.length) {
|
|
|
+ for (var _i = 0, materials_1 = materials; _i < materials_1.length; _i++) {
|
|
|
+ var material = materials_1[_i];
|
|
|
+ if (material && material.extras && material.extras.MSFT_sRGBFactors) {
|
|
|
+ _this._loader.onMaterialLoadedObservable.add(_this._onMaterialLoaded);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return _this;
|
|
|
+ }
|
|
|
+ return MSFT_sRGBFactors;
|
|
|
+ }(GLTF2.GLTFLoaderExtension));
|
|
|
+ Extensions.MSFT_sRGBFactors = MSFT_sRGBFactors;
|
|
|
+ GLTF2.GLTFLoader._Register(NAME, function (loader) { return new MSFT_sRGBFactors(loader); });
|
|
|
+ })(Extensions = GLTF2.Extensions || (GLTF2.Extensions = {}));
|
|
|
+ })(GLTF2 = BABYLON.GLTF2 || (BABYLON.GLTF2 = {}));
|
|
|
+})(BABYLON || (BABYLON = {}));
|
|
|
+
|
|
|
+//# sourceMappingURL=MSFT_sRGBFactors.js.map
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+var BABYLON;
|
|
|
+(function (BABYLON) {
|
|
|
+ var GLTF2;
|
|
|
+ (function (GLTF2) {
|
|
|
+ var Extensions;
|
|
|
+ (function (Extensions) {
|
|
|
var NAME = "KHR_draco_mesh_compression";
|
|
|
/**
|
|
|
* [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression)
|
|
@@ -106262,7 +106372,7 @@ var BABYLON;
|
|
|
if (!babylonData) {
|
|
|
var promises = new Array();
|
|
|
var name_1 = material.name || "materialSG_" + material._index;
|
|
|
- var babylonMaterial = _this._loader._createMaterial(BABYLON.PBRMaterial, name_1, babylonDrawMode);
|
|
|
+ var babylonMaterial = _this._loader._createMaterial(name_1, babylonDrawMode);
|
|
|
promises.push(_this._loader._loadMaterialBasePropertiesAsync(context, material, babylonMaterial));
|
|
|
promises.push(_this._loadSpecularGlossinessPropertiesAsync(extensionContext, material, extension, babylonMaterial));
|
|
|
_this._loader.onMaterialLoadedObservable.notifyObservers(babylonMaterial);
|
|
@@ -106340,7 +106450,7 @@ var BABYLON;
|
|
|
var babylonData = material._babylonData[babylonDrawMode];
|
|
|
if (!babylonData) {
|
|
|
var name_1 = material.name || "materialUnlit_" + material._index;
|
|
|
- var babylonMaterial = _this._loader._createMaterial(BABYLON.PBRMaterial, name_1, babylonDrawMode);
|
|
|
+ var babylonMaterial = _this._loader._createMaterial(name_1, babylonDrawMode);
|
|
|
babylonMaterial.unlit = true;
|
|
|
var promise = _this._loadUnlitPropertiesAsync(context, material, babylonMaterial);
|
|
|
_this._loader.onMaterialLoadedObservable.notifyObservers(babylonMaterial);
|
|
@@ -106391,8 +106501,6 @@ var BABYLON;
|
|
|
})(GLTF2 = BABYLON.GLTF2 || (BABYLON.GLTF2 = {}));
|
|
|
})(BABYLON || (BABYLON = {}));
|
|
|
|
|
|
-//# sourceMappingURL=KHR_materials_unlit.js.map
|
|
|
-
|
|
|
|
|
|
|
|
|
var BABYLON;
|
|
@@ -106488,8 +106596,6 @@ var BABYLON;
|
|
|
})(GLTF2 = BABYLON.GLTF2 || (BABYLON.GLTF2 = {}));
|
|
|
})(BABYLON || (BABYLON = {}));
|
|
|
|
|
|
-//# sourceMappingURL=KHR_lights.js.map
|
|
|
-
|
|
|
|
|
|
|
|
|
return BABYLON;
|
|
@@ -106550,6 +106656,22 @@ var ViewerModel = /** @class */ (function () {
|
|
|
_this._initAnimations();
|
|
|
});
|
|
|
}
|
|
|
+ Object.defineProperty(ViewerModel.prototype, "enabled", {
|
|
|
+ /**
|
|
|
+ * Is this model enabled?
|
|
|
+ */
|
|
|
+ get: function () {
|
|
|
+ return this.rootMesh.isEnabled();
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * Set whether this model is enabled or not.
|
|
|
+ */
|
|
|
+ set: function (enable) {
|
|
|
+ this.rootMesh.setEnabled(enable);
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
/**
|
|
|
* Get the viewer showing this model
|
|
|
*/
|
|
@@ -107253,6 +107375,7 @@ var SceneManager = /** @class */ (function () {
|
|
|
});
|
|
|
/**
|
|
|
* Sets the engine flags to unlock all babylon features.
|
|
|
+ * Can also be configured using the scene.flags configuration object
|
|
|
*/
|
|
|
SceneManager.prototype.unlockBabylonFeatures = function () {
|
|
|
this.scene.shadowsEnabled = true;
|
|
@@ -107289,13 +107412,17 @@ var SceneManager = /** @class */ (function () {
|
|
|
}
|
|
|
// create a new scene
|
|
|
this.scene = new babylonjs_1.Scene(this._viewer.engine);
|
|
|
- // default material should be a PBRMaterial
|
|
|
- var defaultMaterial = new BABYLON.PBRMaterial('default-material', this.scene);
|
|
|
- defaultMaterial.environmentBRDFTexture = null;
|
|
|
- defaultMaterial.usePhysicalLightFalloff = true;
|
|
|
- defaultMaterial.reflectivityColor = new BABYLON.Color3(0.1, 0.1, 0.1);
|
|
|
- defaultMaterial.microSurface = 0.6;
|
|
|
- this.scene.defaultMaterial = defaultMaterial;
|
|
|
+ // TODO - is this needed, now that Babylon is integrated?
|
|
|
+ // set a default PBR material
|
|
|
+ if (!sceneConfiguration.defaultMaterial) {
|
|
|
+ var defaultMaterial = new BABYLON.PBRMaterial('defaultMaterial', this.scene);
|
|
|
+ defaultMaterial.reflectivityColor = new BABYLON.Color3(0.1, 0.1, 0.1);
|
|
|
+ defaultMaterial.microSurface = 0.6;
|
|
|
+ if (this.scene.defaultMaterial) {
|
|
|
+ this.scene.defaultMaterial.dispose();
|
|
|
+ }
|
|
|
+ this.scene.defaultMaterial = defaultMaterial;
|
|
|
+ }
|
|
|
this.scene.animationPropertiesOverride = new babylonjs_1.AnimationPropertiesOverride();
|
|
|
this.scene.animationPropertiesOverride.enableBlending = true;
|
|
|
babylonjs_1.Animation.AllowMatricesInterpolation = true;
|
|
@@ -107309,14 +107436,6 @@ var SceneManager = /** @class */ (function () {
|
|
|
}
|
|
|
var gl = new BABYLON.GlowLayer("glow", this.scene, options);
|
|
|
}
|
|
|
- /*if (sceneConfiguration) {
|
|
|
- this._configureScene(sceneConfiguration);
|
|
|
-
|
|
|
- // Scene optimizer
|
|
|
- if (optimizerConfiguration) {
|
|
|
- this._configureOptimizer(optimizerConfiguration);
|
|
|
- }
|
|
|
- }*/
|
|
|
return this.onSceneInitObservable.notifyObserversWithPromise(this.scene);
|
|
|
};
|
|
|
SceneManager.prototype.clearScene = function (clearModels, clearLights) {
|
|
@@ -107340,25 +107459,6 @@ var SceneManager = /** @class */ (function () {
|
|
|
// update scene configuration
|
|
|
if (newConfiguration.scene) {
|
|
|
this._configureScene(newConfiguration.scene);
|
|
|
- // process mainColor changes:
|
|
|
- if (newConfiguration.scene.mainColor) {
|
|
|
- this._mainColor = this._mainColor || babylonjs_1.Color3.White();
|
|
|
- var mc = newConfiguration.scene.mainColor;
|
|
|
- if (mc.r !== undefined) {
|
|
|
- this._mainColor.r = mc.r;
|
|
|
- }
|
|
|
- if (mc.g !== undefined) {
|
|
|
- this._mainColor.g = mc.g;
|
|
|
- }
|
|
|
- if (mc.b !== undefined) {
|
|
|
- this._mainColor.b = mc.b;
|
|
|
- }
|
|
|
- /*this._mainColor.toLinearSpaceToRef(this._mainColor);
|
|
|
- let exposure = Math.pow(2.0, -((globalConfiguration.camera && globalConfiguration.camera.exposure) || 0.75)) * Math.PI;
|
|
|
- this._mainColor.scaleToRef(1 / exposure, this._mainColor);
|
|
|
- let environmentTint = (globalConfiguration.lab && globalConfiguration.lab.environmentMap && globalConfiguration.lab.environmentMap.tintLevel) || 0;
|
|
|
- this._mainColor = Color3.Lerp(this._white, this._mainColor, environmentTint);*/
|
|
|
- }
|
|
|
}
|
|
|
// optimizer
|
|
|
if (newConfiguration.optimizer) {
|
|
@@ -107489,6 +107589,42 @@ var SceneManager = /** @class */ (function () {
|
|
|
else if (this.camera && sceneConfig.disableCameraControl === false) {
|
|
|
this.camera.attachControl(this._viewer.canvas);
|
|
|
}
|
|
|
+ // process mainColor changes:
|
|
|
+ if (sceneConfig.mainColor) {
|
|
|
+ this._mainColor = this._mainColor || babylonjs_1.Color3.White();
|
|
|
+ var mc = sceneConfig.mainColor;
|
|
|
+ if (mc.r !== undefined) {
|
|
|
+ this._mainColor.r = mc.r;
|
|
|
+ }
|
|
|
+ if (mc.g !== undefined) {
|
|
|
+ this._mainColor.g = mc.g;
|
|
|
+ }
|
|
|
+ if (mc.b !== undefined) {
|
|
|
+ this._mainColor.b = mc.b;
|
|
|
+ }
|
|
|
+ /*this._mainColor.toLinearSpaceToRef(this._mainColor);
|
|
|
+ let exposure = Math.pow(2.0, -((globalConfiguration.camera && globalConfiguration.camera.exposure) || 0.75)) * Math.PI;
|
|
|
+ this._mainColor.scaleToRef(1 / exposure, this._mainColor);
|
|
|
+ let environmentTint = (globalConfiguration.lab && globalConfiguration.lab.environmentMap && globalConfiguration.lab.environmentMap.tintLevel) || 0;
|
|
|
+ this._mainColor = Color3.Lerp(this._white, this._mainColor, environmentTint);*/
|
|
|
+ }
|
|
|
+ if (sceneConfig.defaultMaterial) {
|
|
|
+ var conf = sceneConfig.defaultMaterial;
|
|
|
+ if ((conf.materialType === 'standard' && this.scene.defaultMaterial.getClassName() !== 'StandardMaterial') ||
|
|
|
+ (conf.materialType === 'pbr' && this.scene.defaultMaterial.getClassName() !== 'PBRMaterial')) {
|
|
|
+ this.scene.defaultMaterial.dispose();
|
|
|
+ if (conf.materialType === 'standard') {
|
|
|
+ this.scene.defaultMaterial = new babylonjs_1.StandardMaterial("defaultMaterial", this.scene);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.scene.defaultMaterial = new babylonjs_1.PBRMaterial("defaultMaterial", this.scene);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ helper_1.extendClassWithConfig(this.scene.defaultMaterial, conf);
|
|
|
+ }
|
|
|
+ if (sceneConfig.flags) {
|
|
|
+ helper_1.extendClassWithConfig(this.scene, sceneConfig.flags);
|
|
|
+ }
|
|
|
this.onSceneConfiguredObservable.notifyObservers({
|
|
|
sceneManager: this,
|
|
|
object: this.scene,
|
|
@@ -107779,7 +107915,6 @@ var SceneManager = /** @class */ (function () {
|
|
|
SceneManager.prototype._configureLights = function (lightsConfiguration, model) {
|
|
|
var _this = this;
|
|
|
if (lightsConfiguration === void 0) { lightsConfiguration = {}; }
|
|
|
- var focusMeshes = model ? model.meshes : this.scene.meshes;
|
|
|
// sanity check!
|
|
|
if (!Object.keys(lightsConfiguration).length) {
|
|
|
if (!this.scene.lights.length)
|
|
@@ -107876,15 +108011,7 @@ var SceneManager = /** @class */ (function () {
|
|
|
// TODO blur kernel definition
|
|
|
}
|
|
|
// add the focues meshes to the shadow list
|
|
|
- var shadownMap = shadowGenerator.getShadowMap();
|
|
|
- if (!shadownMap)
|
|
|
- return;
|
|
|
- var renderList = shadownMap.renderList;
|
|
|
- for (var index = 0; index < focusMeshes.length; index++) {
|
|
|
- if (babylonjs_1.Tags.MatchesQuery(focusMeshes[index], 'castShadow')) {
|
|
|
- renderList && renderList.push(focusMeshes[index]);
|
|
|
- }
|
|
|
- }
|
|
|
+ _this._updateShadowRenderList(shadowGenerator, model);
|
|
|
var blurKernel = _this.getBlurKernel(light, bufferSize);
|
|
|
//shadowGenerator.useBlurCloseExponentialShadowMap = true;
|
|
|
//shadowGenerator.useKernelBlur = true;
|
|
@@ -107917,6 +108044,40 @@ var SceneManager = /** @class */ (function () {
|
|
|
model: model
|
|
|
});
|
|
|
};
|
|
|
+ SceneManager.prototype._updateShadowRenderList = function (shadowGenerator, model, resetList) {
|
|
|
+ var focusMeshes = model ? model.meshes : this.scene.meshes;
|
|
|
+ // add the focues meshes to the shadow list
|
|
|
+ var shadownMap = shadowGenerator.getShadowMap();
|
|
|
+ if (!shadownMap)
|
|
|
+ return;
|
|
|
+ if (resetList && shadownMap.renderList) {
|
|
|
+ shadownMap.renderList.length = 0;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ shadownMap.renderList = [];
|
|
|
+ }
|
|
|
+ for (var index = 0; index < focusMeshes.length; index++) {
|
|
|
+ var mesh = focusMeshes[index];
|
|
|
+ if (babylonjs_1.Tags.MatchesQuery(mesh, 'castShadow') && shadownMap.renderList.indexOf(mesh) === -1) {
|
|
|
+ shadownMap.renderList.push(mesh);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ SceneManager.prototype._updateGroundMirrorRenderList = function (model, resetList) {
|
|
|
+ if (this.environmentHelper.groundMirror && this.environmentHelper.groundMirror.renderList) {
|
|
|
+ var focusMeshes = model ? model.meshes : this.scene.meshes;
|
|
|
+ var renderList = this.environmentHelper.groundMirror.renderList;
|
|
|
+ if (resetList) {
|
|
|
+ renderList.length = 0;
|
|
|
+ }
|
|
|
+ for (var index = 0; index < focusMeshes.length; index++) {
|
|
|
+ var mesh = focusMeshes[index];
|
|
|
+ if (renderList.indexOf(mesh) === -1) {
|
|
|
+ renderList.push(mesh);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
/**
|
|
|
* Gets the shadow map blur kernel according to the light configuration.
|
|
|
* @param light The light used to generate the shadows
|
|
@@ -109595,63 +109756,6 @@ var ExtendedMaterialLoaderPlugin = /** @class */ (function () {
|
|
|
ExtendedMaterialLoaderPlugin.prototype.onMaterialLoaded = function (baseMaterial) {
|
|
|
var material = baseMaterial;
|
|
|
material.alphaMode = babylonjs_1.Engine.ALPHA_PREMULTIPLIED_PORTERDUFF;
|
|
|
- var isAlphaOnlyOne = function (texture) {
|
|
|
- var pixels = texture.readPixels();
|
|
|
- var alphaOne = true;
|
|
|
- for (var i = 3; i < pixels.length; i += 4) {
|
|
|
- if (pixels[i] !== 255) {
|
|
|
- alphaOne = false;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- return alphaOne;
|
|
|
- };
|
|
|
- if (material.albedoTexture) {
|
|
|
- material.albedoColor = babylonjs_1.Color3.White();
|
|
|
- }
|
|
|
- else {
|
|
|
- material.albedoColor = material.albedoColor.toLinearSpace();
|
|
|
- }
|
|
|
- if (material.reflectivityTexture) {
|
|
|
- material.reflectivityColor = babylonjs_1.Color3.White();
|
|
|
- material.microSurface = 1;
|
|
|
- if (material.reflectivityTexture) {
|
|
|
- if (material.reflectivityTexture.isReady()) {
|
|
|
- if (isAlphaOnlyOne(material.reflectivityTexture)) {
|
|
|
- material.useMicroSurfaceFromReflectivityMapAlpha = false;
|
|
|
- material.useAutoMicroSurfaceFromReflectivityMap = true;
|
|
|
- }
|
|
|
- }
|
|
|
- else {
|
|
|
- material.reflectivityTexture.onLoadObservable.add(function (loadedTexture) {
|
|
|
- if (isAlphaOnlyOne(loadedTexture)) {
|
|
|
- material.useMicroSurfaceFromReflectivityMapAlpha = false;
|
|
|
- material.useAutoMicroSurfaceFromReflectivityMap = true;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- else {
|
|
|
- material.reflectivityColor = material.reflectivityColor.toLinearSpace();
|
|
|
- }
|
|
|
- if (material.bumpTexture) {
|
|
|
- material.bumpTexture.level = 1;
|
|
|
- // Normal maps are currently DirectX convention instead of OpenGL.
|
|
|
- material.invertNormalMapY = true;
|
|
|
- }
|
|
|
- if (material.emissiveTexture) {
|
|
|
- material.emissiveColor = babylonjs_1.Color3.White();
|
|
|
- }
|
|
|
- material.useRadianceOcclusion = false;
|
|
|
- material.useHorizonOcclusion = false;
|
|
|
- material.useAlphaFresnel = material.needAlphaBlending();
|
|
|
- material.backFaceCulling = material.forceDepthWrite;
|
|
|
- material.twoSidedLighting = true;
|
|
|
- material.useSpecularOverAlpha = false;
|
|
|
- material.useRadianceOverAlpha = false;
|
|
|
- material.usePhysicalLightFalloff = true;
|
|
|
- material.forceNormalForward = true;
|
|
|
};
|
|
|
return ExtendedMaterialLoaderPlugin;
|
|
|
}());
|