Selaa lähdekoodia

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

Jaskar 8 vuotta sitten
vanhempi
commit
f575eefde6
100 muutettua tiedostoa jossa 20472 lisäystä ja 5365 poistoa
  1. BIN
      Exporters/Blender/Blender2Babylon-5.3.zip
  2. 3 1
      Exporters/Blender/src/babylon-js/__init__.py
  3. 5 5
      Exporters/Blender/src/babylon-js/camera.py
  4. 6 0
      Exporters/Blender/src/babylon-js/exporter_settings_panel.py
  5. 2 3
      Exporters/Blender/src/babylon-js/json_exporter.py
  6. 31 19
      Exporters/Blender/src/babylon-js/light_shadow.py
  7. 1 0
      Exporters/Blender/src/babylon-js/logger.py
  8. 96 4
      Exporters/Blender/src/babylon-js/mesh.py
  9. 23 8
      Exporters/Blender/src/babylon-js/package_level.py
  10. 64 45
      Playground/debug.html
  11. 34 33
      Playground/frame.html
  12. 31 13
      Playground/index-local.html
  13. 33 33
      Playground/index.html
  14. 34 12
      Playground/index2_5.html
  15. 11 4
      Playground/js/index.js
  16. 20 0
      Playground/textures/DemageFont.fnt
  17. BIN
      Playground/textures/DemageFont.png
  18. 4916 0
      Playground/textures/HorrorBlue.3dl
  19. 4916 0
      Playground/textures/LateSunset.3dl
  20. BIN
      Playground/textures/Logo.png
  21. BIN
      Playground/textures/SunDiffuse.png
  22. BIN
      Playground/textures/big_buck_bunny.mp4
  23. BIN
      Playground/textures/candleopacity.png
  24. BIN
      Playground/textures/co.png
  25. BIN
      Playground/textures/country.hdr
  26. BIN
      Playground/textures/distortion.png
  27. BIN
      Playground/textures/environment.babylon.hdr
  28. BIN
      Playground/textures/fire.png
  29. BIN
      Playground/textures/floor.png
  30. BIN
      Playground/textures/floor_bump.PNG
  31. BIN
      Playground/textures/forest.hdr
  32. BIN
      Playground/textures/fur.jpg
  33. BIN
      Playground/textures/grass.png
  34. BIN
      Playground/textures/grassn.png
  35. BIN
      Playground/textures/heightMapTriPlanar.png
  36. BIN
      Playground/textures/invmask.png
  37. BIN
      Playground/textures/lensdirt.jpg
  38. BIN
      Playground/textures/leopard_fur.JPG
  39. BIN
      Playground/textures/mixMap.png
  40. BIN
      Playground/textures/nba.png
  41. BIN
      Playground/textures/night.hdr
  42. BIN
      Playground/textures/parking.hdr
  43. BIN
      Playground/textures/rock.png
  44. BIN
      Playground/textures/rockn.png
  45. BIN
      Playground/textures/roundMask.png
  46. BIN
      Playground/textures/sand.jpg
  47. BIN
      Playground/textures/speckles.jpg
  48. BIN
      Playground/textures/walk.png
  49. 4 0
      Tools/Gulp/config.json
  50. 1 1
      Tools/Gulp/gulpfile.js
  51. 16 0
      dist/materialsLibrary/babylon.customMaterial.d.ts
  52. 403 0
      dist/materialsLibrary/babylon.customMaterial.js
  53. 1 0
      dist/materialsLibrary/babylon.customMaterial.min.js
  54. 28 0
      dist/materialsLibrary/babylon.fireMaterial.d.ts
  55. 323 0
      dist/materialsLibrary/babylon.fireMaterial.js
  56. 1 0
      dist/materialsLibrary/babylon.fireMaterial.min.js
  57. 43 0
      dist/materialsLibrary/babylon.furMaterial.d.ts
  58. 471 0
      dist/materialsLibrary/babylon.furMaterial.js
  59. 1 0
      dist/materialsLibrary/babylon.furMaterial.min.js
  60. 30 0
      dist/materialsLibrary/babylon.gradientMaterial.d.ts
  61. 327 0
      dist/materialsLibrary/babylon.gradientMaterial.js
  62. 1 0
      dist/materialsLibrary/babylon.gradientMaterial.min.js
  63. 55 0
      dist/materialsLibrary/babylon.gridMaterial.d.ts
  64. 202 0
      dist/materialsLibrary/babylon.gridMaterial.js
  65. 1 0
      dist/materialsLibrary/babylon.gridMaterial.min.js
  66. 34 0
      dist/materialsLibrary/babylon.lavaMaterial.d.ts
  67. 371 0
      dist/materialsLibrary/babylon.lavaMaterial.js
  68. 1 0
      dist/materialsLibrary/babylon.lavaMaterial.min.js
  69. 26 0
      dist/materialsLibrary/babylon.normalMaterial.d.ts
  70. 326 0
      dist/materialsLibrary/babylon.normalMaterial.js
  71. 1 0
      dist/materialsLibrary/babylon.normalMaterial.min.js
  72. 21 0
      dist/materialsLibrary/babylon.shadowOnlyMaterial.d.ts
  73. 214 0
      dist/materialsLibrary/babylon.shadowOnlyMaterial.js
  74. 1 0
      dist/materialsLibrary/babylon.shadowOnlyMaterial.min.js
  75. 27 0
      dist/materialsLibrary/babylon.simpleMaterial.d.ts
  76. 292 0
      dist/materialsLibrary/babylon.simpleMaterial.js
  77. 1 0
      dist/materialsLibrary/babylon.simpleMaterial.min.js
  78. 32 0
      dist/materialsLibrary/babylon.skyMaterial.d.ts
  79. 255 0
      dist/materialsLibrary/babylon.skyMaterial.js
  80. 1 0
      dist/materialsLibrary/babylon.skyMaterial.min.js
  81. 34 0
      dist/materialsLibrary/babylon.terrainMaterial.d.ts
  82. 357 0
      dist/materialsLibrary/babylon.terrainMaterial.js
  83. 1 0
      dist/materialsLibrary/babylon.terrainMaterial.min.js
  84. 35 0
      dist/materialsLibrary/babylon.triPlanarMaterial.d.ts
  85. 350 0
      dist/materialsLibrary/babylon.triPlanarMaterial.js
  86. 1 0
      dist/materialsLibrary/babylon.triPlanarMaterial.min.js
  87. 99 0
      dist/materialsLibrary/babylon.waterMaterial.d.ts
  88. 593 0
      dist/materialsLibrary/babylon.waterMaterial.js
  89. 1 0
      dist/materialsLibrary/babylon.waterMaterial.min.js
  90. 0 31
      dist/preview release/babylon.core.js
  91. 2467 2451
      dist/preview release/babylon.d.ts
  92. 40 40
      dist/preview release/babylon.js
  93. 232 114
      dist/preview release/babylon.max.js
  94. 2467 2451
      dist/preview release/babylon.module.d.ts
  95. 0 41
      dist/preview release/babylon.noworker.js
  96. 41 41
      dist/preview release/babylon.worker.js
  97. 11 11
      dist/preview release/canvas2D/babylon.canvas2d.min.js
  98. 3 3
      dist/preview release/inspector/babylon.inspector.bundle.js
  99. 3 1
      dist/preview release/inspector/babylon.inspector.js
  100. 0 0
      dist/preview release/inspector/babylon.inspector.min.js

BIN
Exporters/Blender/Blender2Babylon-5.3.zip


+ 3 - 1
Exporters/Blender/src/babylon-js/__init__.py

@@ -1,7 +1,7 @@
 bl_info = {
     'name': 'Babylon.js',
     'author': 'David Catuhe, Jeff Palmer',
-    'version': (5, 2, 1),
+    'version': (5, 3, -1),
     'blender': (2, 76, 0),
     'location': 'File > Export > Babylon.js (.babylon)',
     'description': 'Export Babylon.js scenes (.babylon)',
@@ -24,6 +24,7 @@ if "bpy" in locals():
     imp.reload(material)
     imp.reload(mesh)
     imp.reload(package_level)
+    imp.reload(shape_key_group)
     imp.reload(sound)
     imp.reload(world)
 else:
@@ -38,6 +39,7 @@ else:
     from . import material
     from . import mesh
     from . import package_level
+    from . import shape_key_group
     from . import sound
     from . import world
 

+ 5 - 5
Exporters/Blender/src/babylon-js/camera.py

@@ -11,7 +11,7 @@ import mathutils
 ARC_ROTATE_CAM = 'ArcRotateCamera'
 DEV_ORIENT_CAM = 'DeviceOrientationCamera'
 FOLLOW_CAM = 'FollowCamera'
-FREE_CAM = 'FreeCamera'
+UNIVERSAL_CAM = 'UniversalCamera'
 GAMEPAD_CAM = 'GamepadCamera'
 TOUCH_CAM = 'TouchCamera'
 V_JOYSTICKS_CAM = 'VirtualJoysticksCamera'
@@ -61,7 +61,7 @@ class Camera(FCurveAnimatable):
 
         if self.CameraType == ARC_ROTATE_CAM or self.CameraType == FOLLOW_CAM:
             if not hasattr(self, 'lockedTargetId'):
-                Logger.warn('Camera type with manditory target specified, but no target to track set.  Ignored', 2)
+                Logger.warn('Camera type with mandatory target specified, but no target to track set.  Ignored', 2)
                 self.fatalProblem = True
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     def update_for_target_attributes(self, meshesAndNodes):
@@ -146,14 +146,14 @@ bpy.types.Camera.CameraType = bpy.props.EnumProperty(
              (V_JOYSTICKS_CAM        , 'Virtual Joysticks'       , 'Use Virtual Joysticks Camera'),
              (TOUCH_CAM              , 'Touch'                   , 'Use Touch Camera'),
              (GAMEPAD_CAM            , 'Gamepad'                 , 'Use Gamepad Camera'),
-             (FREE_CAM               , 'Free'                    , 'Use Free Camera'),
+             (UNIVERSAL_CAM          , 'Universal'               , 'Use Universal Camera'),
              (FOLLOW_CAM             , 'Follow'                  , 'Use Follow Camera'),
              (DEV_ORIENT_CAM         , 'Device Orientation'      , 'Use Device Orientation Camera'),
              (ARC_ROTATE_CAM         , 'Arc Rotate'              , 'Use Arc Rotate Camera'),
              (VR_DEV_ORIENT_FREE_CAM , 'VR Dev Orientation Free' , 'Use VR Dev Orientation Free Camera'),
              (WEB_VR_FREE_CAM        , 'Web VR Free'             , 'Use Web VR Free Camera')
             ),
-    default = FREE_CAM
+    default = UNIVERSAL_CAM
 )
 bpy.types.Camera.checkCollisions = bpy.props.BoolProperty(
     name='Check Collisions',
@@ -175,7 +175,7 @@ bpy.types.Camera.Camera3DRig = bpy.props.EnumProperty(
     description='',
     items = (
              (RIG_MODE_NONE                             , 'None'                  , 'No 3D effects'),
-             (RIG_MODE_STEREOSCOPIC_ANAGLYPH            , 'Anaaglph'              , 'Stereoscopic Anagylph'),
+             (RIG_MODE_STEREOSCOPIC_ANAGLYPH            , 'Anaglyph'              , 'Stereoscopic Anagylph'),
              (RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL , 'side-by-side Parallel' , 'Stereoscopic side-by-side parallel'),
              (RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED, 'side-by-side crosseyed', 'Stereoscopic side-by-side crosseyed'),
              (RIG_MODE_STEREOSCOPIC_OVERUNDER           , 'over-under'            , 'Stereoscopic over-under'),

+ 6 - 0
Exporters/Blender/src/babylon-js/exporter_settings_panel.py

@@ -18,6 +18,11 @@ class ExporterSettingsPanel(bpy.types.Panel):
         description='Use face normals on all meshes.  Increases vertices.',
         default = False,
         )
+    bpy.types.Scene.force64Kmeshes = bpy.props.BoolProperty(
+        name='Force 64k per Mesh Vertex Limit',
+        description='When true, break up meshes with > 64k vertices for older\nhardware.  No effect when no qualifying meshes.',
+        default = True,
+        )
     bpy.types.Scene.attachedSound = bpy.props.StringProperty(
         name='Sound',
         description='',
@@ -55,6 +60,7 @@ class ExporterSettingsPanel(bpy.types.Panel):
         scene = context.scene
         layout.prop(scene, 'export_onlySelectedLayer')
         layout.prop(scene, 'export_flatshadeScene')
+        layout.prop(scene, 'force64Kmeshes')
         layout.prop(scene, 'ignoreIKBones')
 
         box = layout.box()

+ 2 - 3
Exporters/Blender/src/babylon-js/json_exporter.py

@@ -30,7 +30,7 @@ class JsonExporter:
             if bpy.ops.object.mode_set.poll():
                 bpy.ops.object.mode_set(mode = 'OBJECT')
 
-            # assign texture location, purely temporary if inlining
+            # assign texture location, purely temporary if in-lining
             self.textureDir = path.dirname(filepath)
             if not scene.inlineTextures:
                 self.textureDir = path.join(self.textureDir, scene.textureDir)
@@ -45,7 +45,6 @@ class JsonExporter:
             Logger.log('inline textures:  ' + format_bool(scene.inlineTextures), 2)
             if not scene.inlineTextures:
                 Logger.log('texture directory:  ' + self.textureDir, 2)
-                
             self.world = World(scene)
 
             bpy.ops.screen.animation_cancel()
@@ -99,7 +98,7 @@ class JsonExporter:
                     while True and self.isInSelectedLayer(object, scene):
                         mesh = Mesh(object, scene, nextStartFace, forcedParent, nameID, self)
                         if mesh.hasUnappliedTransforms and hasattr(mesh, 'skeletonWeights'):
-                            self.fatalError = 'Mesh: ' + mesh.name + ' has unapplied transformations.  This will never work for a mesh with an armature.  Export cancelled'
+                            self.fatalError = 'Mesh: ' + mesh.name + ' has un-applied transformations.  This will never work for a mesh with an armature.  Export cancelled'
                             Logger.log(self.fatalError)
                             return
 

+ 31 - 19
Exporters/Blender/src/babylon-js/light_shadow.py

@@ -16,8 +16,8 @@ HEMI_LIGHT = 3
 NO_SHADOWS = 'NONE'
 STD_SHADOWS = 'STD'
 POISSON_SHADOWS = 'POISSON'
-VARIANCE_SHADOWS = 'VARIANCE'
-BLUR_VARIANCE_SHADOWS = 'BLUR_VARIANCE'
+ESM_SHADOWS = 'ESM'
+BLUR_ESM_SHADOWS = 'BLUR_ESM'
 #===============================================================================
 class Light(FCurveAnimatable):
     def __init__(self, light, meshesAndNodes):
@@ -114,12 +114,12 @@ class ShadowGenerator:
         self.mapSize = lamp.data.shadowMapSize
         self.shadowBias = lamp.data.shadowBias
 
-        if lamp.data.shadowMap == VARIANCE_SHADOWS:
-            self.useVarianceShadowMap = True
+        if lamp.data.shadowMap == ESM_SHADOWS:
+            self.useExponentialShadowMap = True
         elif lamp.data.shadowMap == POISSON_SHADOWS:
             self.usePoissonSampling = True
-        elif lamp.data.shadowMap == BLUR_VARIANCE_SHADOWS:
-            self.useBlurVarianceShadowMap = True
+        elif lamp.data.shadowMap == BLUR_ESM_SHADOWS:
+            self.useBlurExponentialShadowMap = True
             self.shadowBlurScale = lamp.data.shadowBlurScale
             self.shadowBlurBoxOffset = lamp.data.shadowBlurBoxOffset
 
@@ -135,12 +135,12 @@ class ShadowGenerator:
         write_string(file_handler, 'lightId', self.lightId)
         write_float(file_handler, 'bias', self.shadowBias)
 
-        if hasattr(self, 'useVarianceShadowMap') :
-            write_bool(file_handler, 'useVarianceShadowMap', self.useVarianceShadowMap)
+        if hasattr(self, 'useExponentialShadowMap') :
+            write_bool(file_handler, 'useExponentialShadowMap', self.useExponentialShadowMap)
         elif hasattr(self, 'usePoissonSampling'):
             write_bool(file_handler, 'usePoissonSampling', self.usePoissonSampling)
-        elif hasattr(self, 'useBlurVarianceShadowMap'):
-            write_bool(file_handler, 'useBlurVarianceShadowMap', self.useBlurVarianceShadowMap)
+        elif hasattr(self, 'useBlurExponentialShadowMap'):
+            write_bool(file_handler, 'useBlurExponentialShadowMap', self.useBlurExponentialShadowMap)
             write_int(file_handler, 'blurScale', self.shadowBlurScale)
             write_int(file_handler, 'blurBoxOffset', self.shadowBlurBoxOffset)
 
@@ -167,8 +167,8 @@ bpy.types.Lamp.shadowMap = bpy.props.EnumProperty(
     items = ((NO_SHADOWS           , 'None'         , 'No Shadow Maps'),
              (STD_SHADOWS          , 'Standard'     , 'Use Standard Shadow Maps'),
              (POISSON_SHADOWS      , 'Poisson'      , 'Use Poisson Sampling'),
-             (VARIANCE_SHADOWS     , 'Variance'     , 'Use Variance Shadow Maps'),
-             (BLUR_VARIANCE_SHADOWS, 'Blur Variance', 'Use Blur Variance Shadow Maps')
+             (ESM_SHADOWS          , 'ESM'          , 'Use Exponential Shadow Maps'),
+             (BLUR_ESM_SHADOWS     , 'Blur ESM'     , 'Use Blur Exponential Shadow Maps')
             ),
     default = NO_SHADOWS
 )
@@ -186,13 +186,13 @@ bpy.types.Lamp.shadowBias = bpy.props.FloatProperty(
 
 bpy.types.Lamp.shadowBlurScale = bpy.props.IntProperty(
     name='Blur Scale',
-    description='',
+    description='Setting when using a Blur Variance shadow map',
     default = 2
 )
 
 bpy.types.Lamp.shadowBlurBoxOffset = bpy.props.IntProperty(
     name='Blur Box Offset',
-    description='',
+    description='Setting when using a Blur Variance shadow map',
     default = 0
 )
 #===============================================================================
@@ -211,12 +211,24 @@ class LightPanel(bpy.types.Panel):
         ob = context.object
         layout = self.layout
         layout.prop(ob.data, 'shadowMap')
-        layout.prop(ob.data, 'shadowMapSize')
-        layout.prop(ob.data, 'shadowBias')
+
+        usingShadows =  ob.data.shadowMap != NO_SHADOWS
+        row = layout.row()
+        row.enabled = usingShadows
+        row.prop(ob.data, 'shadowMapSize')
+        
+        row = layout.row()
+        row.enabled = usingShadows
+        row.prop(ob.data, 'shadowBias')
 
         box = layout.box()
-        box.label(text="Blur Variance Shadows")
-        box.prop(ob.data, 'shadowBlurScale')
-        box.prop(ob.data, 'shadowBlurBoxOffset')
+        box.label(text="Blur ESM Shadows")
+        usingBlur = ob.data.shadowMap == BLUR_ESM_SHADOWS
+        row = box.row()
+        row.enabled = usingBlur
+        row.prop(ob.data, 'shadowBlurScale')
+        row = box.row()
+        row.enabled = usingBlur
+        row.prop(ob.data, 'shadowBlurBoxOffset')
 
         layout.prop(ob.data, 'autoAnimate')

+ 1 - 0
Exporters/Blender/src/babylon-js/logger.py

@@ -53,4 +53,5 @@ class Logger:
             Logger.instance.log_handler.write('\t')
 
         Logger.instance.log_handler.write(msg)
+        print(msg) # for debugging / running Blender fron console
         if not noNewLine: Logger.instance.log_handler.write('\n')

+ 96 - 4
Exporters/Blender/src/babylon-js/mesh.py

@@ -4,6 +4,7 @@ from .package_level import *
 from .f_curve_animatable import *
 from .armature import *
 from .material import *
+from .shape_key_group import *
 
 import bpy
 import math
@@ -13,7 +14,7 @@ import shutil
 # output related constants
 MAX_VERTEX_ELEMENTS = 65535
 MAX_VERTEX_ELEMENTS_32Bit = 16777216
-COMPRESS_MATRIX_INDICES = True # this is True for .babylon exporter & False for TOB
+COMPRESS_MATRIX_INDICES = True
 
 # used in Mesh & Node constructors, defined in BABYLON.AbstractMesh
 BILLBOARDMODE_NONE = 0
@@ -31,6 +32,8 @@ CAPSULE_IMPOSTER = 5
 CONE_IMPOSTER = 6
 CYLINDER_IMPOSTER = 7
 CONVEX_HULL_IMPOSTER = 8
+
+SHAPE_KEY_GROUPS_ALLOWED = False
 #===============================================================================
 class Mesh(FCurveAnimatable):
     def __init__(self, object, scene, startFace, forcedParent, nameID, exporter):
@@ -141,7 +144,7 @@ class Mesh(FCurveAnimatable):
             self.physicsRestitution = object.rigid_body.restitution
 
         # process all of the materials required
-        maxVerts = MAX_VERTEX_ELEMENTS # change for multi-materials
+        maxVerts = MAX_VERTEX_ELEMENTS if scene.force64Kmeshes else MAX_VERTEX_ELEMENTS_32Bit # change for multi-materials or shapekeys
         recipe = BakingRecipe(object)
         self.billboardMode = BILLBOARDMODE_ALL if recipe.isBillboard else BILLBOARDMODE_NONE
 
@@ -212,6 +215,19 @@ class Mesh(FCurveAnimatable):
             totalInfluencers = 0
             highestInfluenceObserved = 0
 
+        hasShapeKeys = False
+        if object.data.shape_keys:
+            for block in object.data.shape_keys.key_blocks:
+                if (block.name == 'Basis'):
+                    hasShapeKeys = True
+                    keyOrderMap = []
+                    basis = block
+                    maxVerts = MAX_VERTEX_ELEMENTS_32Bit
+                    break
+
+            if not hasShapeKeys:
+                Logger.warn('Basis key missing, shape-key processing NOT performed', 2)
+
         # used tracking of vertices as they are received
         alreadySavedVertices = []
         vertices_Normals = []
@@ -370,6 +386,9 @@ class Mesh(FCurveAnimatable):
                             weightsPerVertex.append(matricesWeights)
                             indicesPerVertex.append(matricesIndices)
 
+                        if hasShapeKeys:
+                            keyOrderMap.append([vertex_index, len(self.positions)]) # use len positions before it is append to convert from 1 to 0 origin
+
                         vertices_indices[vertex_index].append(index)
 
                         self.positions.append(position)
@@ -381,7 +400,7 @@ class Mesh(FCurveAnimatable):
             self.subMeshes.append(SubMesh(materialIndex, subMeshVerticesStart, subMeshIndexStart, verticesCount - subMeshVerticesStart, indicesCount - subMeshIndexStart))
 
         if verticesCount > MAX_VERTEX_ELEMENTS:
-            Logger.warn('Due to multi-materials / Shapekeys & this meshes size, 32bit indices must be used.  This may not run on all hardware.', 2)
+            Logger.warn('Due to multi-materials, Shapekeys, or exporter settings & this meshes size, 32bit indices must be used.  This may not run on all hardware.', 2)
 
         BakedMaterial.meshBakingClean(object)
 
@@ -411,11 +430,56 @@ class Mesh(FCurveAnimatable):
         numZeroAreaFaces = self.find_zero_area_faces()
         if numZeroAreaFaces > 0:
             Logger.warn('# of 0 area faces found:  ' + str(numZeroAreaFaces), 2)
+
+        # shape keys for mesh
+        if hasShapeKeys:
+            Mesh.sort(keyOrderMap)
+            self.rawShapeKeys = []
+            groupNames = []
+            Logger.log('Shape Keys:', 2)
+
+            # process the keys in the .blend
+            for block in object.data.shape_keys.key_blocks:
+                # perform name format validation, before processing
+                keyName = block.name
+
+                # the Basis shape key is a member of all groups, processed in 2nd pass
+                if keyName == 'Basis': continue
+
+                if keyName.find('-') <= 0 and SHAPE_KEY_GROUPS_ALLOWED:
+                    if object.data.defaultShapeKeyGroup != DEFAULT_SHAPE_KEY_GROUP:
+                        keyName = object.data.defaultShapeKeyGroup + '-' + keyName
+                    else: continue
+                
+                group = None
+                state = keyName
+                if SHAPE_KEY_GROUPS_ALLOWED:
+                    temp = keyName.upper().partition('-')
+                    group = temp[0]
+                    state = temp[2]
+                self.rawShapeKeys.append(RawShapeKey(block, group, state, keyOrderMap, basis))
+
+                if SHAPE_KEY_GROUPS_ALLOWED:
+                    # check for a new group, add to groupNames if so
+                    newGroup = True
+                    for group in groupNames:
+                        if temp[0] == group:
+                            newGroup = False
+                            break
+                    if newGroup:
+                       groupNames.append(temp[0])
+
+            # process into ShapeKeyGroups, when rawShapeKeys found and groups allowed (implied)
+            if len(groupNames) > 0:
+                self.shapeKeyGroups = []
+                basis = RawShapeKey(basis, None, 'BASIS', keyOrderMap, basis)
+                for group in groupNames:
+                    self.shapeKeyGroups.append(ShapeKeyGroup(group,self.rawShapeKeys, basis.vertices))
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     def find_zero_area_faces(self):
         nFaces = int(len(self.indices) / 3)
         nZeroAreaFaces = 0
-        for f in range(0, nFaces):
+        for f in range(nFaces):
             faceOffset = f * 3
             p1 = self.positions[self.indices[faceOffset    ]]
             p2 = self.positions[self.indices[faceOffset + 1]]
@@ -426,6 +490,19 @@ class Mesh(FCurveAnimatable):
         return nZeroAreaFaces
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     @staticmethod
+    # ShapeKeyGroup depends on AffectedIndices being in asending order, so sort it, probably nothing to do
+    def sort(keyOrderMap):
+        notSorted = True
+        while(notSorted):
+            notSorted = False
+            for idx in range(1, len(keyOrderMap)):
+                if keyOrderMap[idx - 1][1] > keyOrderMap[idx][1]:
+                    tmp = keyOrderMap[idx]
+                    keyOrderMap[idx    ] = keyOrderMap[idx - 1]
+                    keyOrderMap[idx - 1] = tmp
+                    notSorted = True
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    @staticmethod
     def mesh_triangulate(mesh):
         try:
             import bmesh
@@ -596,6 +673,21 @@ class Mesh(FCurveAnimatable):
 
             first = False
         file_handler.write(']')
+        
+        # Shape Keys
+        if hasattr(self, 'rawShapeKeys'):
+            first = True
+            file_handler.write('\n,"MorphTargetManager":{')
+            write_string(file_handler, 'id', self.name, True)
+            file_handler.write('\n,"targets":[')
+            for key in self.rawShapeKeys:
+                if first == False:
+                    file_handler.write(',')
+
+                key.to_scene_file(file_handler)
+
+                first = False
+            file_handler.write(']}')
 
         # Close mesh
         file_handler.write('}\n')

+ 23 - 8
Exporters/Blender/src/babylon-js/package_level.py

@@ -19,7 +19,10 @@ def format_exporter_version(bl_info = None):
     if bl_info is None:
         bl_info = get_bl_info()
     exporterVersion = bl_info['version']
-    return str(exporterVersion[0]) + '.' + str(exporterVersion[1]) +  '.' + str(exporterVersion[2])
+    if exporterVersion[2] >= 0:
+        return str(exporterVersion[0]) + '.' + str(exporterVersion[1]) +  '.' + str(exporterVersion[2])
+    else:
+        return str(exporterVersion[0]) + '.' + str(exporterVersion[1]) +  '-beta'
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 def blenderMajorMinorVersion():
     # in form of '2.77 (sub 0)'
@@ -123,16 +126,18 @@ def format_matrix4(matrix):
 def format_array3(array):
     return format_f(array[0]) + ',' + format_f(array[1]) + ',' + format_f(array[2])
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-def format_array(array, indent = ''):
+def format_array(array, indent = '', beginIdx = 0, firstNotIncludedIdx = -1):
     ret = ''
     first = True
     nOnLine = 0
-    for element in array:
+    
+    endIdx = len(array) if firstNotIncludedIdx == -1 else firstNotIncludedIdx
+    for idx in range(beginIdx, endIdx):
         if (first != True):
             ret +=','
         first = False;
 
-        ret += format_f(element)
+        ret += format_f(array[idx])
         nOnLine += 1
 
         if nOnLine >= VERTEX_OUTPUT_PER_LINE:
@@ -147,7 +152,7 @@ def format_color(color):
 def format_vector(vector, switchYZ = True):
     return format_f(vector.x) + ',' + format_f(vector.z) + ',' + format_f(vector.y) if switchYZ else format_f(vector.x) + ',' + format_f(vector.y) + ',' + format_f(vector.z)
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-def format_vector_array(vectorArray, indent = ''):
+def format_vector_array(vectorArray, indent = '', switchYZ = True):
     ret = ''
     first = True
     nOnLine = 0
@@ -156,7 +161,7 @@ def format_vector_array(vectorArray, indent = ''):
             ret +=','
         first = False;
 
-        ret += format_vector(vector)
+        ret += format_vector(vector, switchYZ)
         nOnLine += 3
 
         if nOnLine >= VERTEX_OUTPUT_PER_LINE:
@@ -216,6 +221,16 @@ def same_vertex(vertA, vertB):
 
     return True
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+def similar_vertex(vertA, vertB, tolerance = 0.00015):
+    if vertA is None or vertB is None: return False
+
+    if (abs(vertA.x - vertB.x) > tolerance or
+        abs(vertA.y - vertB.y) > tolerance or
+        abs(vertA.z - vertB.z) > tolerance ):
+        return False
+
+    return True
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 def same_array(arrayA, arrayB):
     if(arrayA is None or arrayB is None): return False
     if len(arrayA) != len(arrayB): return False
@@ -241,8 +256,8 @@ def write_color(file_handler, name, color):
 def write_vector(file_handler, name, vector, switchYZ = True):
     file_handler.write(',"' + name + '":[' + format_vector(vector, switchYZ) + ']')
 
-def write_vector_array(file_handler, name, vectorArray):
-    file_handler.write('\n,"' + name + '":[' + format_vector_array(vectorArray) + ']')
+def write_vector_array(file_handler, name, vectorArray, switchYZ = True):
+    file_handler.write('\n,"' + name + '":[' + format_vector_array(vectorArray, '', switchYZ) + ']')
 
 def write_quaternion(file_handler, name, quaternion):
     file_handler.write(',"' + name  +'":[' + format_quaternion(quaternion) + ']')

+ 64 - 45
Playground/debug.html

@@ -16,39 +16,39 @@
     <!--Monaco-->
     <script src="node_modules/monaco-editor/min/vs/loader.js"></script>
     <!-- Babylon.js -->
-    <script src="https://www.babylonjs.com/cannon.js"></script>
-    <script src="https://www.babylonjs.com/Oimo.js"></script>
-    <script src="https://www.babylonjs.com/babylon.max.js"></script>
-    <script src="https://www.babylonjs.com/babylon.canvas2d.js"></script>
-    <script src="https://www.babylonjs.com/babylon.inspector.bundle.js"></script>
-
-    <script src="https://www.babylonjs.com/lib/babylon.fireMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.waterMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.lavaMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.normalMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.skyMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.triPlanarMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.terrainMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.gradientMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.furMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.gridMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.shadowOnlyMaterial.min.js"></script>
-
-    <script src="https://www.babylonjs.com/lib/babylon.brickProceduralTexture.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.cloudProceduralTexture.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.fireProceduralTexture.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.grassProceduralTexture.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.marbleProceduralTexture.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.roadProceduralTexture.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.starfieldProceduralTexture.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.woodProceduralTexture.min.js"></script>
-
-    <script src="https://www.babylonjs.com/lib/babylon.asciiArtPostProcess.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.digitalRainPostProcess.min.js"></script>
-
-    <script src="https://www.babylonjs.com/lib/babylon.glTFFileLoader.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.objFileLoader.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.stlFileLoader.js"></script>
+    <script src="https://preview.babylonjs.com/cannon.js"></script>
+    <script src="https://preview.babylonjs.com/Oimo.js"></script>
+    <script src="https://preview.babylonjs.com/babylon.max.js"></script>    
+    <script src="https://preview.babylonjs.com/canvas2D/babylon.canvas2d.js"></script>
+    <script src="https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js"></script>
+
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.fireMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.waterMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.lavaMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.normalMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.skyMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.triPlanarMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.terrainMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.gradientMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.furMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.gridMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.shadowOnlyMaterial.min.js"></script>
+
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.brickProceduralTexture.min.js"></script>
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.cloudProceduralTexture.min.js"></script>
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.fireProceduralTexture.min.js"></script>
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.grassProceduralTexture.min.js"></script>
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.marbleProceduralTexture.min.js"></script>
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.roadProceduralTexture.min.js"></script>
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.starfieldProceduralTexture.min.js"></script>
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.woodProceduralTexture.min.js"></script>
+
+    <script src="https://preview.babylonjs.com/postProcessesLibrary/babylon.asciiArtPostProcess.min.js"></script>
+    <script src="https://preview.babylonjs.com/postProcessesLibrary/babylon.digitalRainPostProcess.min.js"></script>
+
+    <script src="https://preview.babylonjs.com/loaders/babylon.glTFFileLoader.js"></script>
+    <script src="https://preview.babylonjs.com/loaders/babylon.objFileLoader.js"></script>
+    <script src="https://preview.babylonjs.com/loaders/babylon.stlFileLoader.js"></script>
 
     <script src="https://rawgit.com/BabylonJS/Extensions/master/ClonerSystem/src/babylonx.cloner.js"></script>
 
@@ -58,7 +58,7 @@
 </head>
 
 <body>
-    <div class="navbar">
+     <div class="navbar">
         <div class="title">
             Babylon.js Playground
         </div>
@@ -73,17 +73,18 @@
 
         <div class="category">
             <div class="button" id="newButton">New<i class="fa fa-file" aria-hidden="true"></i></div>
-            <div class="button" id="clearButton">Clear<i class="fa fa-trash" aria-hidden="true"></i></div>
+            <div class="button removeOnPhone" id="clearButton">Clear<i class="fa fa-trash" aria-hidden="true"></i></div>
         </div>
 
         <div class="category">
             <div class="button" id="saveButton">Save <i class="fa fa-floppy-o" aria-hidden="true"></i></div>
-            <div class="button" id="zipButton">Zip<i class="fa fa-download" aria-hidden="true"></i></div>
+            <div class="button removeOnPhone" id="zipButton">Zip<i class="fa fa-download" aria-hidden="true"></i></div>
         </div>
 
 
-        <div class="category desktopOnly">
-            <div class="button select"><span id="currentFontSize">Font: 14</span>
+        <!--<div class="category desktopOnly">-->
+
+        <!--<div class="button select"><span id="currentFontSize">Font: 14</span>
                 <div class="toDisplay">
                     <div class="option" onclick="setFontSize(12);">12</div>
                     <div class="option" onclick="setFontSize(14);">14</div>
@@ -92,26 +93,44 @@
                     <div class="option" onclick="setFontSize(20);">20</div>
                     <div class="option" onclick="setFontSize(22);">22</div>
                 </div>
-            </div>
-            <div class="button select">Theme
+            </div>-->
+
+        <!--<div class="button select">Theme
                 <div class="toDisplay">
                     <div class="option" id="darkTheme">Dark</div>
                     <div class="option" id="lightTheme">Light</div>
                 </div>
-            </div>
-        </div>
+            </div>-->
+        <!--</div>-->
         <div class="category desktopTabletOnly">
             <div class="button select">Settings
                 <div class="toDisplay">
+                    <div class="option subSelect">Theme <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" id="darkTheme">Dark</div>
+                            <div class="option" id="lightTheme">Light</div>
+                        </div>
+                    </div>
+                    <div class="option subSelect"><span id="currentFontSize">Font: 14</span><i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" onclick="setFontSize(12);">12</div>
+                            <div class="option" onclick="setFontSize(14);">14</div>
+                            <div class="option" onclick="setFontSize(16);">16</div>
+                            <div class="option" onclick="setFontSize(18);">18</div>
+                            <div class="option" onclick="setFontSize(20);">20</div>
+                            <div class="option" onclick="setFontSize(22);">22</div>
+                        </div>
+                    </div>
                     <div class="option" id='safemodeToggle'>Safe mode <i class="fa fa-square-o" aria-hidden="true"></i></div>
                     <div class="option checked" id="editorButton">Editor <i class="fa fa-check-square" aria-hidden="true"></i>
                     </div>
                     <div class="option" id="fullscreenButton">Fullscreen</div>
-                    <div class="option" id="metadataButton">Metadata</div>
+                    <div class="option" id="formatButton">Format code</div>
                 </div>
             </div>
 
             <div class="button check uncheck" id="debugButton">Debug layer</div>
+            <div class="button" id="metadataButton">Metadata</div>
         </div>
 
 
@@ -150,11 +169,11 @@
     <div class="navbarBottom">
         <div id="statusBar"></div>
         <div class="links">
+            <div class='link'><a target='_new' href="https://www.netlify.com/">Deployed by Netlify</a></div>
             <div class='link'> <a target='_new' href="http://www.html5gamedevs.com/forum/16-babylonjs/">Forum</a></div>
             <div class='link'><a target='_new' href="https://www.babylonjs.com/sandbox">Sandbox</a></div>
-            <div class='link'><a target='_new' href="https://github.com/BabylonJS/Babylon.js/wiki">Wiki</a></div>
             <div class='link'><a target='_new' href="https://doc.babylonjs.com">Documentation</a></div>
-            <div class='link'><a target='_new' href="https://doc.babylonjs.com/playground">Playground Search</a></div>
+            <div class='link'><a target='_new' href="https://doc.babylonjs.com/playground">Search</a></div>
         </div>
     </div>
 

+ 34 - 33
Playground/frame.html

@@ -5,39 +5,40 @@
     <title>Babylon.js Playground</title>
     <script src="https://code.jquery.com/pep/0.4.2/pep.min.js"></script>
     <!-- Babylon.js -->
-    <script src="https://www.babylonjs.com/cannon.js"></script>
-    <script src="https://www.babylonjs.com/Oimo.js"></script>
-    <script src="https://www.babylonjs.com/babylon.js"></script>
-    <script src="https://www.babylonjs.com/babylon.canvas2d.js"></script>
-
-    <script src="https://www.babylonjs.com/lib/babylon.fireMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.waterMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.lavaMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.normalMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.skyMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.triPlanarMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.terrainMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.gradientMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.furMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.gridMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.shadowOnlyMaterial.min.js"></script>
-
-    <script src="https://www.babylonjs.com/lib/babylon.brickProceduralTexture.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.cloudProceduralTexture.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.fireProceduralTexture.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.grassProceduralTexture.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.marbleProceduralTexture.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.roadProceduralTexture.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.starfieldProceduralTexture.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.woodProceduralTexture.min.js"></script>
-
-    <script src="https://www.babylonjs.com/lib/babylon.asciiArtPostProcess.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.digitalRainPostProcess.min.js"></script>
-
-    <script src="https://www.babylonjs.com/lib/babylon.glTFFileLoader.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.objFileLoader.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.stlFileLoader.js"></script>
-
+    <script src="https://preview.babylonjs.com/cannon.js"></script>
+    <script src="https://preview.babylonjs.com/Oimo.js"></script>
+    <script src="https://preview.babylonjs.com/babylon.js"></script>    
+    <script src="https://preview.babylonjs.com/canvas2D/babylon.canvas2d.js"></script>
+    <script src="https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js"></script>
+
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.fireMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.waterMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.lavaMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.normalMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.skyMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.triPlanarMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.terrainMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.gradientMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.furMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.gridMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.shadowOnlyMaterial.min.js"></script>
+
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.brickProceduralTexture.min.js"></script>
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.cloudProceduralTexture.min.js"></script>
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.fireProceduralTexture.min.js"></script>
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.grassProceduralTexture.min.js"></script>
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.marbleProceduralTexture.min.js"></script>
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.roadProceduralTexture.min.js"></script>
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.starfieldProceduralTexture.min.js"></script>
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.woodProceduralTexture.min.js"></script>
+
+    <script src="https://preview.babylonjs.com/postProcessesLibrary/babylon.asciiArtPostProcess.min.js"></script>
+    <script src="https://preview.babylonjs.com/postProcessesLibrary/babylon.digitalRainPostProcess.min.js"></script>
+
+    <script src="https://preview.babylonjs.com/loaders/babylon.glTFFileLoader.js"></script>
+    <script src="https://preview.babylonjs.com/loaders/babylon.objFileLoader.js"></script>
+    <script src="https://preview.babylonjs.com/loaders/babylon.stlFileLoader.js"></script>
+    
     <script src="https://rawgit.com/BabylonJS/Extensions/master/ClonerSystem/src/babylonx.cloner.js"></script>
     <script src="https://rawgit.com/BabylonJS/Extensions/master/CompoundShader/src/babylonx.CompoundShader.js"></script>
     <link href="frame.css" rel="stylesheet" />

+ 31 - 13
Playground/index-local.html

@@ -24,7 +24,7 @@
 </head>
 
 <body>
-    <div class="navbar">
+   <div class="navbar">
         <div class="title">
             Babylon.js Playground
         </div>
@@ -39,17 +39,18 @@
 
         <div class="category">
             <div class="button" id="newButton">New<i class="fa fa-file" aria-hidden="true"></i></div>
-            <div class="button" id="clearButton">Clear<i class="fa fa-trash" aria-hidden="true"></i></div>
+            <div class="button removeOnPhone" id="clearButton">Clear<i class="fa fa-trash" aria-hidden="true"></i></div>
         </div>
 
         <div class="category">
             <div class="button" id="saveButton">Save <i class="fa fa-floppy-o" aria-hidden="true"></i></div>
-            <div class="button" id="zipButton">Zip<i class="fa fa-download" aria-hidden="true"></i></div>
+            <div class="button removeOnPhone" id="zipButton">Zip<i class="fa fa-download" aria-hidden="true"></i></div>
         </div>
 
 
-        <div class="category desktopOnly">
-            <div class="button select"><span id="currentFontSize">Font: 14</span>
+        <!--<div class="category desktopOnly">-->
+
+        <!--<div class="button select"><span id="currentFontSize">Font: 14</span>
                 <div class="toDisplay">
                     <div class="option" onclick="setFontSize(12);">12</div>
                     <div class="option" onclick="setFontSize(14);">14</div>
@@ -58,26 +59,44 @@
                     <div class="option" onclick="setFontSize(20);">20</div>
                     <div class="option" onclick="setFontSize(22);">22</div>
                 </div>
-            </div>
-            <div class="button select">Theme
+            </div>-->
+
+        <!--<div class="button select">Theme
                 <div class="toDisplay">
                     <div class="option" id="darkTheme">Dark</div>
                     <div class="option" id="lightTheme">Light</div>
                 </div>
-            </div>
-        </div>
+            </div>-->
+        <!--</div>-->
         <div class="category desktopTabletOnly">
             <div class="button select">Settings
                 <div class="toDisplay">
+                    <div class="option subSelect">Theme <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" id="darkTheme">Dark</div>
+                            <div class="option" id="lightTheme">Light</div>
+                        </div>
+                    </div>
+                    <div class="option subSelect"><span id="currentFontSize">Font: 14</span><i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" onclick="setFontSize(12);">12</div>
+                            <div class="option" onclick="setFontSize(14);">14</div>
+                            <div class="option" onclick="setFontSize(16);">16</div>
+                            <div class="option" onclick="setFontSize(18);">18</div>
+                            <div class="option" onclick="setFontSize(20);">20</div>
+                            <div class="option" onclick="setFontSize(22);">22</div>
+                        </div>
+                    </div>
                     <div class="option" id='safemodeToggle'>Safe mode <i class="fa fa-square-o" aria-hidden="true"></i></div>
                     <div class="option checked" id="editorButton">Editor <i class="fa fa-check-square" aria-hidden="true"></i>
                     </div>
                     <div class="option" id="fullscreenButton">Fullscreen</div>
-                    <div class="option" id="metadataButton">Metadata</div>
+                    <div class="option" id="formatButton">Format code</div>
                 </div>
             </div>
 
             <div class="button check uncheck" id="debugButton">Debug layer</div>
+            <div class="button" id="metadataButton">Metadata</div>
         </div>
 
 
@@ -116,11 +135,11 @@
     <div class="navbarBottom">
         <div id="statusBar"></div>
         <div class="links">
+            <div class='link'><a target='_new' href="https://www.netlify.com/">Deployed by Netlify</a></div>
             <div class='link'> <a target='_new' href="http://www.html5gamedevs.com/forum/16-babylonjs/">Forum</a></div>
             <div class='link'><a target='_new' href="https://www.babylonjs.com/sandbox">Sandbox</a></div>
-            <div class='link'><a target='_new' href="https://github.com/BabylonJS/Babylon.js/wiki">Wiki</a></div>
             <div class='link'><a target='_new' href="https://doc.babylonjs.com">Documentation</a></div>
-            <div class='link'><a target='_new' href="https://doc.babylonjs.com/playground">Playground Search</a></div>
+            <div class='link'><a target='_new' href="https://doc.babylonjs.com/playground">Search</a></div>
         </div>
     </div>
 
@@ -145,7 +164,6 @@
             </div>
         </div>
     </div>
-
     <script src="https://code.jquery.com/jquery.js"></script>
 
     <script src="js/actions.js"></script>

+ 33 - 33
Playground/index.html

@@ -16,39 +16,39 @@
     <!--Monaco-->
     <script src="node_modules/monaco-editor/min/vs/loader.js"></script>
     <!-- Babylon.js -->
-    <script src="https://www.babylonjs.com/cannon.js"></script>
-    <script src="https://www.babylonjs.com/Oimo.js"></script>
-    <script src="https://www.babylonjs.com/babylon.js"></script>
-    <script src="https://www.babylonjs.com/babylon.canvas2d.js"></script>
-    <script src="https://www.babylonjs.com/babylon.inspector.bundle.js"></script>
-
-    <script src="https://www.babylonjs.com/lib/babylon.fireMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.waterMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.lavaMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.normalMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.skyMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.triPlanarMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.terrainMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.gradientMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.furMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.gridMaterial.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.shadowOnlyMaterial.min.js"></script>
-
-    <script src="https://www.babylonjs.com/lib/babylon.brickProceduralTexture.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.cloudProceduralTexture.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.fireProceduralTexture.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.grassProceduralTexture.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.marbleProceduralTexture.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.roadProceduralTexture.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.starfieldProceduralTexture.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.woodProceduralTexture.min.js"></script>
-
-    <script src="https://www.babylonjs.com/lib/babylon.asciiArtPostProcess.min.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.digitalRainPostProcess.min.js"></script>
-
-    <script src="https://www.babylonjs.com/lib/babylon.glTFFileLoader.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.objFileLoader.js"></script>
-    <script src="https://www.babylonjs.com/lib/babylon.stlFileLoader.js"></script>
+    <script src="https://preview.babylonjs.com/cannon.js"></script>
+    <script src="https://preview.babylonjs.com/Oimo.js"></script>
+    <script src="https://preview.babylonjs.com/babylon.js"></script>    
+    <script src="https://preview.babylonjs.com/canvas2D/babylon.canvas2d.js"></script>
+    <script src="https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js"></script>
+
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.fireMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.waterMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.lavaMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.normalMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.skyMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.triPlanarMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.terrainMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.gradientMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.furMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.gridMaterial.min.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylon.shadowOnlyMaterial.min.js"></script>
+
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.brickProceduralTexture.min.js"></script>
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.cloudProceduralTexture.min.js"></script>
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.fireProceduralTexture.min.js"></script>
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.grassProceduralTexture.min.js"></script>
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.marbleProceduralTexture.min.js"></script>
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.roadProceduralTexture.min.js"></script>
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.starfieldProceduralTexture.min.js"></script>
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylon.woodProceduralTexture.min.js"></script>
+
+    <script src="https://preview.babylonjs.com/postProcessesLibrary/babylon.asciiArtPostProcess.min.js"></script>
+    <script src="https://preview.babylonjs.com/postProcessesLibrary/babylon.digitalRainPostProcess.min.js"></script>
+
+    <script src="https://preview.babylonjs.com/loaders/babylon.glTFFileLoader.js"></script>
+    <script src="https://preview.babylonjs.com/loaders/babylon.objFileLoader.js"></script>
+    <script src="https://preview.babylonjs.com/loaders/babylon.stlFileLoader.js"></script>
 
     <script src="https://rawgit.com/BabylonJS/Extensions/master/ClonerSystem/src/babylonx.cloner.js"></script>
 

+ 34 - 12
Playground/index2_5.html

@@ -31,7 +31,7 @@
 </head>
 
 <body>
-    <div class="navbar">
+      <div class="navbar">
         <div class="title">
             Babylon.js Playground
         </div>
@@ -46,17 +46,18 @@
 
         <div class="category">
             <div class="button" id="newButton">New<i class="fa fa-file" aria-hidden="true"></i></div>
-            <div class="button" id="clearButton">Clear<i class="fa fa-trash" aria-hidden="true"></i></div>
+            <div class="button removeOnPhone" id="clearButton">Clear<i class="fa fa-trash" aria-hidden="true"></i></div>
         </div>
 
         <div class="category">
             <div class="button" id="saveButton">Save <i class="fa fa-floppy-o" aria-hidden="true"></i></div>
-            <div class="button" id="zipButton">Zip<i class="fa fa-download" aria-hidden="true"></i></div>
+            <div class="button removeOnPhone" id="zipButton">Zip<i class="fa fa-download" aria-hidden="true"></i></div>
         </div>
 
 
-        <div class="category desktopOnly">
-            <div class="button select"><span id="currentFontSize">Font: 14</span>
+        <!--<div class="category desktopOnly">-->
+
+        <!--<div class="button select"><span id="currentFontSize">Font: 14</span>
                 <div class="toDisplay">
                     <div class="option" onclick="setFontSize(12);">12</div>
                     <div class="option" onclick="setFontSize(14);">14</div>
@@ -65,26 +66,44 @@
                     <div class="option" onclick="setFontSize(20);">20</div>
                     <div class="option" onclick="setFontSize(22);">22</div>
                 </div>
-            </div>
-            <div class="button select">Theme
+            </div>-->
+
+        <!--<div class="button select">Theme
                 <div class="toDisplay">
                     <div class="option" id="darkTheme">Dark</div>
                     <div class="option" id="lightTheme">Light</div>
                 </div>
-            </div>
-        </div>
+            </div>-->
+        <!--</div>-->
         <div class="category desktopTabletOnly">
             <div class="button select">Settings
                 <div class="toDisplay">
+                    <div class="option subSelect">Theme <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" id="darkTheme">Dark</div>
+                            <div class="option" id="lightTheme">Light</div>
+                        </div>
+                    </div>
+                    <div class="option subSelect"><span id="currentFontSize">Font: 14</span><i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" onclick="setFontSize(12);">12</div>
+                            <div class="option" onclick="setFontSize(14);">14</div>
+                            <div class="option" onclick="setFontSize(16);">16</div>
+                            <div class="option" onclick="setFontSize(18);">18</div>
+                            <div class="option" onclick="setFontSize(20);">20</div>
+                            <div class="option" onclick="setFontSize(22);">22</div>
+                        </div>
+                    </div>
                     <div class="option" id='safemodeToggle'>Safe mode <i class="fa fa-square-o" aria-hidden="true"></i></div>
                     <div class="option checked" id="editorButton">Editor <i class="fa fa-check-square" aria-hidden="true"></i>
                     </div>
                     <div class="option" id="fullscreenButton">Fullscreen</div>
-                    <div class="option" id="metadataButton">Metadata</div>
+                    <div class="option" id="formatButton">Format code</div>
                 </div>
             </div>
 
             <div class="button check uncheck" id="debugButton">Debug layer</div>
+            <div class="button" id="metadataButton">Metadata</div>
         </div>
 
 
@@ -123,11 +142,11 @@
     <div class="navbarBottom">
         <div id="statusBar"></div>
         <div class="links">
+            <div class='link'><a target='_new' href="https://www.netlify.com/">Deployed by Netlify</a></div>
             <div class='link'> <a target='_new' href="http://www.html5gamedevs.com/forum/16-babylonjs/">Forum</a></div>
             <div class='link'><a target='_new' href="https://www.babylonjs.com/sandbox">Sandbox</a></div>
-            <div class='link'><a target='_new' href="https://github.com/BabylonJS/Babylon.js/wiki">Wiki</a></div>
             <div class='link'><a target='_new' href="https://doc.babylonjs.com">Documentation</a></div>
-            <div class='link'><a target='_new' href="https://doc.babylonjs.com/playground">Playground Search</a></div>
+            <div class='link'><a target='_new' href="https://doc.babylonjs.com/playground">Search</a></div>
         </div>
     </div>
 
@@ -136,12 +155,15 @@
             <label for="saveFormTitle">TITLE</label>
             <div class="separator"></div>
             <input type="text" maxlength="120" id="saveFormTitle" class="save-form-title">
+
             <label for="saveFormDescription">DESCRIPTION</label>
             <div class="separator"></div>
             <textarea id="saveFormDescription" rows="4" cols="10"></textarea>
+
             <label for="saveFormTags">TAGS (separated by comma)</label>
             <div class="separator"></div>
             <textarea id="saveFormTags" rows="4" cols="10"></textarea>
+
             <div class="save-form-buttons" id="saveFormButtons">
 
                 <div id="saveFormButtonOk" class="button">OK</div>

+ 11 - 4
Playground/js/index.js

@@ -19,16 +19,19 @@
     var run = function () {
         var blockEditorChange = false;
 
-        jsEditor.onKeyDown(function (evt) {
-        });
-
-        jsEditor.onKeyUp(function (evt) {
+        var markDirty = function() {
             if (blockEditorChange) {
                 return;
             }
 
             document.getElementById("currentScript").innerHTML = "Custom";
             document.getElementById('safemodeToggle').classList.add('checked');
+
+            document.getElementById('safemodeToggle').innerHTML = 'Safe mode <i class="fa fa-check-square" aria-hidden="true"></i>';
+        }
+
+        jsEditor.onKeyUp(function (evt) {
+            markDirty();
         });
 
         var snippetUrl = "https://babylonjs-api2.azurewebsites.net/snippets";
@@ -588,6 +591,10 @@
             jsEditor.setValue(oldCode);
             setFontSize(fontSize);
 
+            jsEditor.onKeyUp(function (evt) {
+                markDirty();
+            });
+
             for (var index = 0; index < elementToTheme.length; index++) {
                 var obj = elementToTheme[index];
                 let domObjArr = document.querySelectorAll(obj);

+ 20 - 0
Playground/textures/DemageFont.fnt

@@ -0,0 +1,20 @@
+info face="Arial" size=32 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1 outline=0
+common lineHeight=32 base=26 scaleW=128 scaleH=128 pages=1 packed=0 alphaChnl=1 redChnl=0 greenChnl=0 blueChnl=0
+page id=0 file="DemageFont.png"
+chars count=16
+char id=45   x=62    y=93    width=28    height=30    xoffset=0     yoffset=0     xadvance=28    page=0  chnl=15
+char id=48   x=0     y=0     width=30    height=30    xoffset=0     yoffset=0     xadvance=30    page=0  chnl=15
+char id=49   x=91    y=93    width=22    height=30    xoffset=0     yoffset=0     xadvance=22    page=0  chnl=15
+char id=50   x=31    y=0     width=30    height=30    xoffset=0     yoffset=0     xadvance=30    page=0  chnl=15
+char id=51   x=62    y=0     width=30    height=30    xoffset=0     yoffset=0     xadvance=30    page=0  chnl=15
+char id=52   x=93    y=0     width=30    height=30    xoffset=0     yoffset=0     xadvance=30    page=0  chnl=15
+char id=53   x=0     y=31    width=30    height=30    xoffset=0     yoffset=0     xadvance=30    page=0  chnl=15
+char id=54   x=31    y=31    width=30    height=30    xoffset=0     yoffset=0     xadvance=30    page=0  chnl=15
+char id=55   x=62    y=31    width=30    height=30    xoffset=0     yoffset=0     xadvance=30    page=0  chnl=15
+char id=56   x=93    y=31    width=30    height=30    xoffset=0     yoffset=0     xadvance=30    page=0  chnl=15
+char id=57   x=0     y=62    width=30    height=30    xoffset=0     yoffset=0     xadvance=30    page=0  chnl=15
+char id=68   x=31    y=62    width=30    height=30    xoffset=0     yoffset=0     xadvance=30    page=0  chnl=15
+char id=69   x=62    y=62    width=30    height=30    xoffset=0     yoffset=0     xadvance=30    page=0  chnl=15
+char id=70   x=93    y=62    width=30    height=30    xoffset=0     yoffset=0     xadvance=30    page=0  chnl=15
+char id=71   x=0     y=93    width=30    height=30    xoffset=0     yoffset=0     xadvance=30    page=0  chnl=15
+char id=74   x=31    y=93    width=30    height=30    xoffset=0     yoffset=0     xadvance=30    page=0  chnl=15

BIN
Playground/textures/DemageFont.png


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 4916 - 0
Playground/textures/HorrorBlue.3dl


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 4916 - 0
Playground/textures/LateSunset.3dl


BIN
Playground/textures/Logo.png


BIN
Playground/textures/SunDiffuse.png


BIN
Playground/textures/big_buck_bunny.mp4


BIN
Playground/textures/candleopacity.png


BIN
Playground/textures/co.png


BIN
Playground/textures/country.hdr


BIN
Playground/textures/distortion.png


BIN
Playground/textures/environment.babylon.hdr


BIN
Playground/textures/fire.png


BIN
Playground/textures/floor.png


BIN
Playground/textures/floor_bump.PNG


BIN
Playground/textures/forest.hdr


BIN
Playground/textures/fur.jpg


BIN
Playground/textures/grass.png


BIN
Playground/textures/grassn.png


BIN
Playground/textures/heightMapTriPlanar.png


BIN
Playground/textures/invmask.png


BIN
Playground/textures/lensdirt.jpg


BIN
Playground/textures/leopard_fur.JPG


BIN
Playground/textures/mixMap.png


BIN
Playground/textures/nba.png


BIN
Playground/textures/night.hdr


BIN
Playground/textures/parking.hdr


BIN
Playground/textures/rock.png


BIN
Playground/textures/rockn.png


BIN
Playground/textures/roundMask.png


BIN
Playground/textures/sand.jpg


BIN
Playground/textures/speckles.jpg


BIN
Playground/textures/walk.png


+ 4 - 0
Tools/Gulp/config.json

@@ -854,6 +854,10 @@
             ],
             "dependUpon" : [
                 "core"
+            ],
+            "shaders" : [
+                "layer.vertex",
+                "layer.fragment"
             ]
         }
     },

+ 1 - 1
Tools/Gulp/gulpfile.js

@@ -398,7 +398,7 @@ gulp.task('run', ['watch', 'webserver'], function () {
 
 gulp.task("zip-blender" , function() {
     return gulp.src('../../Exporters/Blender/src/**')
-    .pipe(zip('Blender2Babylon-5.2.zip'))
+    .pipe(zip('Blender2Babylon-5.3.zip'))
     .pipe(gulp.dest('../../Exporters/Blender'));
 });
 

+ 16 - 0
dist/materialsLibrary/babylon.customMaterial.d.ts

@@ -0,0 +1,16 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class CustomShaderHelper {
+    }
+    interface ICustomMaterialBuilder {
+        (builder: CustomShaderHelper, name: string, mainPart: string, diffusePart: string, vertexPositionPart: string): string;
+    }
+    class CustomMaterial extends StandardMaterial {
+        builder: ICustomMaterialBuilder;
+        private _mainPart;
+        private _diffusePart;
+        private _vertexPositionPart;
+        constructor(name: string, builder: ICustomMaterialBuilder, scene: Scene);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+    }
+}

+ 403 - 0
dist/materialsLibrary/babylon.customMaterial.js

@@ -0,0 +1,403 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts"/>
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = Object.setPrototypeOf ||
+        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+var BABYLON;
+(function (BABYLON) {
+    var CustomShaderHelper = (function () {
+        function CustomShaderHelper() {
+        }
+        return CustomShaderHelper;
+    }());
+    BABYLON.CustomShaderHelper = CustomShaderHelper;
+    var CustomMaterial = (function (_super) {
+        __extends(CustomMaterial, _super);
+        function CustomMaterial(name, builder, scene) {
+            var _this = _super.call(this, name, scene) || this;
+            _this._mainPart = 'void main(void) {';
+            _this._diffusePart = 'vec3 diffuseColor=vDiffuseColor.rgb;';
+            _this._vertexPositionPart = 'gl_Position=viewProjection*finalWorld*vec4(position,1.0);';
+            _this.builder = builder;
+            return _this;
+        }
+        CustomMaterial.prototype.isReady = function (mesh, useInstances) {
+            if (this.isFrozen) {
+                if (this._wasPreviouslyReady) {
+                    return true;
+                }
+            }
+            var scene = this.getScene();
+            var engine = scene.getEngine();
+            var needUVs = false;
+            var needNormals = false;
+            this._defines.reset();
+            // Lights
+            if (scene.lightsEnabled && !this.disableLighting) {
+                needNormals = BABYLON.MaterialHelper.PrepareDefinesForLights(scene, mesh, this._defines, this.maxSimultaneousLights);
+            }
+            if (!this.checkReadyOnEveryCall) {
+                if (this._renderId === scene.getRenderId()) {
+                    if (this._checkCache(scene, mesh, useInstances)) {
+                        return true;
+                    }
+                }
+            }
+            // Textures
+            if (scene.texturesEnabled) {
+                if (this.diffuseTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) {
+                    if (!this.diffuseTexture.isReady()) {
+                        return false;
+                    }
+                    else {
+                        needUVs = true;
+                        this._defines.DIFFUSE = true;
+                    }
+                }
+                if (this.ambientTexture && BABYLON.StandardMaterial.AmbientTextureEnabled) {
+                    if (!this.ambientTexture.isReady()) {
+                        return false;
+                    }
+                    else {
+                        needUVs = true;
+                        this._defines.AMBIENT = true;
+                    }
+                }
+                if (this.opacityTexture && BABYLON.StandardMaterial.OpacityTextureEnabled) {
+                    if (!this.opacityTexture.isReady()) {
+                        return false;
+                    }
+                    else {
+                        needUVs = true;
+                        this._defines.OPACITY = true;
+                        if (this.opacityTexture.getAlphaFromRGB) {
+                            this._defines.OPACITYRGB = true;
+                        }
+                    }
+                }
+                if (this.reflectionTexture && BABYLON.StandardMaterial.ReflectionTextureEnabled) {
+                    if (!this.reflectionTexture.isReady()) {
+                        return false;
+                    }
+                    else {
+                        needNormals = true;
+                        this._defines.REFLECTION = true;
+                        if (this.roughness > 0) {
+                            this._defines.ROUGHNESS = true;
+                        }
+                        if (this.useReflectionOverAlpha) {
+                            this._defines.REFLECTIONOVERALPHA = true;
+                        }
+                        if (this.reflectionTexture.coordinatesMode === BABYLON.Texture.INVCUBIC_MODE) {
+                            this._defines.INVERTCUBICMAP = true;
+                        }
+                        this._defines.REFLECTIONMAP_3D = this.reflectionTexture.isCube;
+                        switch (this.reflectionTexture.coordinatesMode) {
+                            case BABYLON.Texture.CUBIC_MODE:
+                            case BABYLON.Texture.INVCUBIC_MODE:
+                                this._defines.REFLECTIONMAP_CUBIC = true;
+                                break;
+                            case BABYLON.Texture.EXPLICIT_MODE:
+                                this._defines.REFLECTIONMAP_EXPLICIT = true;
+                                break;
+                            case BABYLON.Texture.PLANAR_MODE:
+                                this._defines.REFLECTIONMAP_PLANAR = true;
+                                break;
+                            case BABYLON.Texture.PROJECTION_MODE:
+                                this._defines.REFLECTIONMAP_PROJECTION = true;
+                                break;
+                            case BABYLON.Texture.SKYBOX_MODE:
+                                this._defines.REFLECTIONMAP_SKYBOX = true;
+                                break;
+                            case BABYLON.Texture.SPHERICAL_MODE:
+                                this._defines.REFLECTIONMAP_SPHERICAL = true;
+                                break;
+                            case BABYLON.Texture.EQUIRECTANGULAR_MODE:
+                                this._defines.REFLECTIONMAP_EQUIRECTANGULAR = true;
+                                break;
+                            case BABYLON.Texture.FIXED_EQUIRECTANGULAR_MODE:
+                                this._defines.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = true;
+                                break;
+                        }
+                    }
+                }
+                if (this.emissiveTexture && BABYLON.StandardMaterial.EmissiveTextureEnabled) {
+                    if (!this.emissiveTexture.isReady()) {
+                        return false;
+                    }
+                    else {
+                        needUVs = true;
+                        this._defines.EMISSIVE = true;
+                    }
+                }
+                if (this.lightmapTexture && BABYLON.StandardMaterial.LightmapTextureEnabled) {
+                    if (!this.lightmapTexture.isReady()) {
+                        return false;
+                    }
+                    else {
+                        needUVs = true;
+                        this._defines.LIGHTMAP = true;
+                        this._defines.USELIGHTMAPASSHADOWMAP = this.useLightmapAsShadowmap;
+                    }
+                }
+                if (this.specularTexture && BABYLON.StandardMaterial.SpecularTextureEnabled) {
+                    if (!this.specularTexture.isReady()) {
+                        return false;
+                    }
+                    else {
+                        needUVs = true;
+                        this._defines.SPECULAR = true;
+                        this._defines.GLOSSINESS = this.useGlossinessFromSpecularMapAlpha;
+                    }
+                }
+                if (scene.getEngine().getCaps().standardDerivatives && this.bumpTexture && BABYLON.StandardMaterial.BumpTextureEnabled) {
+                    if (!this.bumpTexture.isReady()) {
+                        return false;
+                    }
+                    else {
+                        needUVs = true;
+                        this._defines.BUMP = true;
+                        if (this.useParallax) {
+                            this._defines.PARALLAX = true;
+                            if (this.useParallaxOcclusion) {
+                                this._defines.PARALLAXOCCLUSION = true;
+                            }
+                        }
+                        if (this.invertNormalMapX) {
+                            this._defines.INVERTNORMALMAPX = true;
+                        }
+                        if (this.invertNormalMapY) {
+                            this._defines.INVERTNORMALMAPY = true;
+                        }
+                        if (scene._mirroredCameraPosition) {
+                            this._defines.INVERTNORMALMAPX = !this._defines.INVERTNORMALMAPX;
+                            this._defines.INVERTNORMALMAPY = !this._defines.INVERTNORMALMAPY;
+                        }
+                    }
+                }
+                if (this.refractionTexture && BABYLON.StandardMaterial.RefractionTextureEnabled) {
+                    if (!this.refractionTexture.isReady()) {
+                        return false;
+                    }
+                    else {
+                        needUVs = true;
+                        this._defines.REFRACTION = true;
+                        this._defines.REFRACTIONMAP_3D = this.refractionTexture.isCube;
+                    }
+                }
+                if (this.cameraColorGradingTexture && BABYLON.StandardMaterial.ColorGradingTextureEnabled) {
+                    if (!this.cameraColorGradingTexture.isReady()) {
+                        return false;
+                    }
+                    else {
+                        this._defines.CAMERACOLORGRADING = true;
+                    }
+                }
+            }
+            // Effect
+            if (scene.clipPlane) {
+                this._defines.CLIPPLANE = true;
+            }
+            if (engine.getAlphaTesting()) {
+                this._defines.ALPHATEST = true;
+            }
+            if (this._shouldUseAlphaFromDiffuseTexture()) {
+                this._defines.ALPHAFROMDIFFUSE = true;
+            }
+            if (this.useEmissiveAsIllumination) {
+                this._defines.EMISSIVEASILLUMINATION = true;
+            }
+            if (this.linkEmissiveWithDiffuse) {
+                this._defines.LINKEMISSIVEWITHDIFFUSE = true;
+            }
+            if (this.useLogarithmicDepth) {
+                this._defines.LOGARITHMICDEPTH = true;
+            }
+            if (this.cameraColorCurves) {
+                this._defines.CAMERACOLORCURVES = true;
+            }
+            // Point size
+            if (this.pointsCloud || scene.forcePointsCloud) {
+                this._defines.POINTSIZE = true;
+            }
+            // Fog
+            if (scene.fogEnabled && mesh && mesh.applyFog && scene.fogMode !== BABYLON.Scene.FOGMODE_NONE && this.fogEnabled) {
+                this._defines.FOG = true;
+            }
+            if (BABYLON.StandardMaterial.FresnelEnabled) {
+                // Fresnel
+                if (this.diffuseFresnelParameters && this.diffuseFresnelParameters.isEnabled ||
+                    this.opacityFresnelParameters && this.opacityFresnelParameters.isEnabled ||
+                    this.emissiveFresnelParameters && this.emissiveFresnelParameters.isEnabled ||
+                    this.refractionFresnelParameters && this.refractionFresnelParameters.isEnabled ||
+                    this.reflectionFresnelParameters && this.reflectionFresnelParameters.isEnabled) {
+                    if (this.diffuseFresnelParameters && this.diffuseFresnelParameters.isEnabled) {
+                        this._defines.DIFFUSEFRESNEL = true;
+                    }
+                    if (this.opacityFresnelParameters && this.opacityFresnelParameters.isEnabled) {
+                        this._defines.OPACITYFRESNEL = true;
+                    }
+                    if (this.reflectionFresnelParameters && this.reflectionFresnelParameters.isEnabled) {
+                        this._defines.REFLECTIONFRESNEL = true;
+                        if (this.useReflectionFresnelFromSpecular) {
+                            this._defines.REFLECTIONFRESNELFROMSPECULAR = true;
+                        }
+                    }
+                    if (this.refractionFresnelParameters && this.refractionFresnelParameters.isEnabled) {
+                        this._defines.REFRACTIONFRESNEL = true;
+                    }
+                    if (this.emissiveFresnelParameters && this.emissiveFresnelParameters.isEnabled) {
+                        this._defines.EMISSIVEFRESNEL = true;
+                    }
+                    needNormals = true;
+                    this._defines.FRESNEL = true;
+                }
+            }
+            if (this._defines.SPECULARTERM && this.useSpecularOverAlpha) {
+                this._defines.SPECULAROVERALPHA = true;
+            }
+            // Attribs
+            if (mesh) {
+                if (needNormals && mesh.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) {
+                    this._defines.NORMAL = true;
+                }
+                if (needUVs) {
+                    if (mesh.isVerticesDataPresent(BABYLON.VertexBuffer.UVKind)) {
+                        this._defines.UV1 = true;
+                    }
+                    if (mesh.isVerticesDataPresent(BABYLON.VertexBuffer.UV2Kind)) {
+                        this._defines.UV2 = true;
+                    }
+                }
+                if (mesh.useVertexColors && mesh.isVerticesDataPresent(BABYLON.VertexBuffer.ColorKind)) {
+                    this._defines.VERTEXCOLOR = true;
+                    if (mesh.hasVertexAlpha) {
+                        this._defines.VERTEXALPHA = true;
+                    }
+                }
+                if (mesh.useBones && mesh.computeBonesUsingShaders) {
+                    this._defines.NUM_BONE_INFLUENCERS = mesh.numBoneInfluencers;
+                    this._defines.BonesPerMesh = (mesh.skeleton.bones.length + 1);
+                }
+                // Instances
+                if (useInstances) {
+                    this._defines.INSTANCES = true;
+                }
+            }
+            // Get correct effect      
+            if (!this._defines.isEqual(this._cachedDefines)) {
+                this._defines.cloneTo(this._cachedDefines);
+                scene.resetCachedMaterial();
+                // Fallbacks
+                var fallbacks = new BABYLON.EffectFallbacks();
+                if (this._defines.REFLECTION) {
+                    fallbacks.addFallback(0, "REFLECTION");
+                }
+                if (this._defines.SPECULAR) {
+                    fallbacks.addFallback(0, "SPECULAR");
+                }
+                if (this._defines.BUMP) {
+                    fallbacks.addFallback(0, "BUMP");
+                }
+                if (this._defines.PARALLAX) {
+                    fallbacks.addFallback(1, "PARALLAX");
+                }
+                if (this._defines.PARALLAXOCCLUSION) {
+                    fallbacks.addFallback(0, "PARALLAXOCCLUSION");
+                }
+                if (this._defines.SPECULAROVERALPHA) {
+                    fallbacks.addFallback(0, "SPECULAROVERALPHA");
+                }
+                if (this._defines.FOG) {
+                    fallbacks.addFallback(1, "FOG");
+                }
+                if (this._defines.POINTSIZE) {
+                    fallbacks.addFallback(0, "POINTSIZE");
+                }
+                if (this._defines.LOGARITHMICDEPTH) {
+                    fallbacks.addFallback(0, "LOGARITHMICDEPTH");
+                }
+                BABYLON.MaterialHelper.HandleFallbacksForShadows(this._defines, fallbacks, this.maxSimultaneousLights);
+                if (this._defines.SPECULARTERM) {
+                    fallbacks.addFallback(0, "SPECULARTERM");
+                }
+                if (this._defines.DIFFUSEFRESNEL) {
+                    fallbacks.addFallback(1, "DIFFUSEFRESNEL");
+                }
+                if (this._defines.OPACITYFRESNEL) {
+                    fallbacks.addFallback(2, "OPACITYFRESNEL");
+                }
+                if (this._defines.REFLECTIONFRESNEL) {
+                    fallbacks.addFallback(3, "REFLECTIONFRESNEL");
+                }
+                if (this._defines.EMISSIVEFRESNEL) {
+                    fallbacks.addFallback(4, "EMISSIVEFRESNEL");
+                }
+                if (this._defines.FRESNEL) {
+                    fallbacks.addFallback(4, "FRESNEL");
+                }
+                //Attributes
+                var attribs = [BABYLON.VertexBuffer.PositionKind];
+                if (this._defines.NORMAL) {
+                    attribs.push(BABYLON.VertexBuffer.NormalKind);
+                }
+                if (this._defines.UV1) {
+                    attribs.push(BABYLON.VertexBuffer.UVKind);
+                }
+                if (this._defines.UV2) {
+                    attribs.push(BABYLON.VertexBuffer.UV2Kind);
+                }
+                if (this._defines.VERTEXCOLOR) {
+                    attribs.push(BABYLON.VertexBuffer.ColorKind);
+                }
+                BABYLON.MaterialHelper.PrepareAttributesForBones(attribs, mesh, this._defines, fallbacks);
+                BABYLON.MaterialHelper.PrepareAttributesForInstances(attribs, this._defines);
+                var shaderName = "default";
+                if (this.builder) {
+                    shaderName = this.builder(new CustomShaderHelper(), shaderName, this._mainPart, this._diffusePart, this._vertexPositionPart);
+                }
+                var join = this._defines.toString();
+                var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vAmbientColor", "vDiffuseColor", "vSpecularColor", "vEmissiveColor",
+                    "vFogInfos", "vFogColor", "pointSize",
+                    "vDiffuseInfos", "vAmbientInfos", "vOpacityInfos", "vReflectionInfos", "vEmissiveInfos", "vSpecularInfos", "vBumpInfos", "vLightmapInfos", "vRefractionInfos",
+                    "mBones",
+                    "vClipPlane", "diffuseMatrix", "ambientMatrix", "opacityMatrix", "reflectionMatrix", "emissiveMatrix", "specularMatrix", "bumpMatrix", "lightmapMatrix", "refractionMatrix",
+                    "depthValues",
+                    "diffuseLeftColor", "diffuseRightColor", "opacityParts", "reflectionLeftColor", "reflectionRightColor", "emissiveLeftColor", "emissiveRightColor", "refractionLeftColor", "refractionRightColor",
+                    "logarithmicDepthConstant"
+                ];
+                var samplers = ["diffuseSampler", "ambientSampler", "opacitySampler", "reflectionCubeSampler", "reflection2DSampler", "emissiveSampler", "specularSampler", "bumpSampler", "lightmapSampler", "refractionCubeSampler", "refraction2DSampler"];
+                if (this._defines.CAMERACOLORCURVES) {
+                    BABYLON.ColorCurves.PrepareUniforms(uniforms);
+                }
+                if (this._defines.CAMERACOLORGRADING) {
+                    BABYLON.ColorGradingTexture.PrepareUniformsAndSamplers(uniforms, samplers);
+                }
+                BABYLON.MaterialHelper.PrepareUniformsAndSamplersList(uniforms, samplers, this._defines, this.maxSimultaneousLights);
+                this._effect = scene.getEngine().createEffect(shaderName, attribs, uniforms, samplers, join, fallbacks, this.onCompiled, this.onError, { maxSimultaneousLights: this.maxSimultaneousLights - 1 });
+            }
+            if (!this._effect.isReady()) {
+                return false;
+            }
+            this._renderId = scene.getRenderId();
+            this._wasPreviouslyReady = true;
+            if (mesh) {
+                if (!mesh._materialDefines) {
+                    mesh._materialDefines = new BABYLON.StandardMaterialDefines();
+                }
+                this._defines.cloneTo(mesh._materialDefines);
+            }
+            return true;
+        };
+        return CustomMaterial;
+    }(BABYLON.StandardMaterial));
+    BABYLON.CustomMaterial = CustomMaterial;
+})(BABYLON || (BABYLON = {}));
+
+//# sourceMappingURL=babylon.customMaterial.js.map

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
dist/materialsLibrary/babylon.customMaterial.min.js


+ 28 - 0
dist/materialsLibrary/babylon.fireMaterial.d.ts

@@ -0,0 +1,28 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class FireMaterial extends Material {
+        diffuseTexture: BaseTexture;
+        distortionTexture: BaseTexture;
+        opacityTexture: BaseTexture;
+        diffuseColor: Color3;
+        speed: number;
+        private _scaledDiffuse;
+        private _renderId;
+        private _defines;
+        private _cachedDefines;
+        private _lastTime;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): BaseTexture;
+        private _checkCache(scene, mesh?, useInstances?);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+        bindOnlyWorldMatrix(world: Matrix): void;
+        bind(world: Matrix, mesh?: Mesh): void;
+        getAnimatables(): IAnimatable[];
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): FireMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): FireMaterial;
+    }
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 323 - 0
dist/materialsLibrary/babylon.fireMaterial.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
dist/materialsLibrary/babylon.fireMaterial.min.js


+ 43 - 0
dist/materialsLibrary/babylon.furMaterial.d.ts

@@ -0,0 +1,43 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class FurMaterial extends Material {
+        diffuseTexture: BaseTexture;
+        heightTexture: BaseTexture;
+        diffuseColor: Color3;
+        furLength: number;
+        furAngle: number;
+        furColor: Color3;
+        furOffset: number;
+        furSpacing: number;
+        furGravity: Vector3;
+        furSpeed: number;
+        furDensity: number;
+        furTexture: DynamicTexture;
+        disableLighting: boolean;
+        highLevelFur: boolean;
+        maxSimultaneousLights: number;
+        _meshes: AbstractMesh[];
+        private _worldViewProjectionMatrix;
+        private _renderId;
+        private _furTime;
+        private _defines;
+        private _cachedDefines;
+        constructor(name: string, scene: Scene);
+        furTime: number;
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): BaseTexture;
+        updateFur(): void;
+        private _checkCache(scene, mesh?, useInstances?);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+        bindOnlyWorldMatrix(world: Matrix): void;
+        bind(world: Matrix, mesh?: Mesh): void;
+        getAnimatables(): IAnimatable[];
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): FurMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): FurMaterial;
+        static GenerateTexture(name: string, scene: Scene): DynamicTexture;
+        static FurifyMesh(sourceMesh: Mesh, quality: number): Mesh[];
+    }
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 471 - 0
dist/materialsLibrary/babylon.furMaterial.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
dist/materialsLibrary/babylon.furMaterial.min.js


+ 30 - 0
dist/materialsLibrary/babylon.gradientMaterial.d.ts

@@ -0,0 +1,30 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class GradientMaterial extends Material {
+        topColor: Color3;
+        topColorAlpha: number;
+        bottomColor: Color3;
+        bottomColorAlpha: number;
+        offset: number;
+        smoothness: number;
+        disableLighting: boolean;
+        private _worldViewProjectionMatrix;
+        private _scaledDiffuse;
+        private _renderId;
+        private _defines;
+        private _cachedDefines;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): BaseTexture;
+        private _checkCache(scene, mesh?, useInstances?);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+        bindOnlyWorldMatrix(world: Matrix): void;
+        bind(world: Matrix, mesh?: Mesh): void;
+        getAnimatables(): IAnimatable[];
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): GradientMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): GradientMaterial;
+    }
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 327 - 0
dist/materialsLibrary/babylon.gradientMaterial.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
dist/materialsLibrary/babylon.gradientMaterial.min.js


+ 55 - 0
dist/materialsLibrary/babylon.gridMaterial.d.ts

@@ -0,0 +1,55 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    /**
+     * The grid materials allows you to wrap any shape with a grid.
+     * Colors are customizable.
+     */
+    class GridMaterial extends BABYLON.Material {
+        /**
+         * Main color of the grid (e.g. between lines)
+         */
+        mainColor: Color3;
+        /**
+         * Color of the grid lines.
+         */
+        lineColor: Color3;
+        /**
+         * The scale of the grid compared to unit.
+         */
+        gridRatio: number;
+        /**
+         * The frequency of thicker lines.
+         */
+        majorUnitFrequency: number;
+        /**
+         * The visibility of minor units in the grid.
+         */
+        minorUnitVisibility: number;
+        /**
+         * The grid opacity outside of the lines.
+         */
+        opacity: number;
+        private _gridControl;
+        private _renderId;
+        private _defines;
+        private _cachedDefines;
+        /**
+         * constructor
+         * @param name The name given to the material in order to identify it afterwards.
+         * @param scene The scene the material is used in.
+         */
+        constructor(name: string, scene: Scene);
+        /**
+         * Returns wehter or not the grid requires alpha blending.
+         */
+        needAlphaBlending(): boolean;
+        private _checkCache(scene, mesh?, useInstances?);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+        bindOnlyWorldMatrix(world: Matrix): void;
+        bind(world: Matrix, mesh?: Mesh): void;
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): GridMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): GridMaterial;
+    }
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 202 - 0
dist/materialsLibrary/babylon.gridMaterial.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
dist/materialsLibrary/babylon.gridMaterial.min.js


+ 34 - 0
dist/materialsLibrary/babylon.lavaMaterial.d.ts

@@ -0,0 +1,34 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class LavaMaterial extends Material {
+        diffuseTexture: BaseTexture;
+        noiseTexture: BaseTexture;
+        fogColor: Color3;
+        speed: number;
+        movingSpeed: number;
+        lowFrequencySpeed: number;
+        fogDensity: number;
+        private _lastTime;
+        diffuseColor: Color3;
+        disableLighting: boolean;
+        maxSimultaneousLights: number;
+        private _worldViewProjectionMatrix;
+        private _scaledDiffuse;
+        private _renderId;
+        private _defines;
+        private _cachedDefines;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): BaseTexture;
+        private _checkCache(scene, mesh?, useInstances?);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+        bindOnlyWorldMatrix(world: Matrix): void;
+        bind(world: Matrix, mesh?: Mesh): void;
+        getAnimatables(): IAnimatable[];
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): LavaMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): LavaMaterial;
+    }
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 371 - 0
dist/materialsLibrary/babylon.lavaMaterial.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
dist/materialsLibrary/babylon.lavaMaterial.min.js


+ 26 - 0
dist/materialsLibrary/babylon.normalMaterial.d.ts

@@ -0,0 +1,26 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class NormalMaterial extends Material {
+        diffuseTexture: BaseTexture;
+        diffuseColor: Color3;
+        disableLighting: boolean;
+        private _worldViewProjectionMatrix;
+        private _scaledDiffuse;
+        private _renderId;
+        private _defines;
+        private _cachedDefines;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): BaseTexture;
+        private _checkCache(scene, mesh?, useInstances?);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+        bindOnlyWorldMatrix(world: Matrix): void;
+        bind(world: Matrix, mesh?: Mesh): void;
+        getAnimatables(): IAnimatable[];
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): NormalMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): NormalMaterial;
+    }
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 326 - 0
dist/materialsLibrary/babylon.normalMaterial.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
dist/materialsLibrary/babylon.normalMaterial.min.js


+ 21 - 0
dist/materialsLibrary/babylon.shadowOnlyMaterial.d.ts

@@ -0,0 +1,21 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class ShadowOnlyMaterial extends Material {
+        private _worldViewProjectionMatrix;
+        private _scaledDiffuse;
+        private _renderId;
+        private _defines;
+        private _cachedDefines;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): BaseTexture;
+        private _checkCache(scene, mesh?, useInstances?);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+        bindOnlyWorldMatrix(world: Matrix): void;
+        bind(world: Matrix, mesh?: Mesh): void;
+        clone(name: string): ShadowOnlyMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): ShadowOnlyMaterial;
+    }
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 214 - 0
dist/materialsLibrary/babylon.shadowOnlyMaterial.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
dist/materialsLibrary/babylon.shadowOnlyMaterial.min.js


+ 27 - 0
dist/materialsLibrary/babylon.simpleMaterial.d.ts

@@ -0,0 +1,27 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class SimpleMaterial extends Material {
+        diffuseTexture: BaseTexture;
+        diffuseColor: Color3;
+        disableLighting: boolean;
+        maxSimultaneousLights: number;
+        private _worldViewProjectionMatrix;
+        private _scaledDiffuse;
+        private _renderId;
+        private _defines;
+        private _cachedDefines;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): BaseTexture;
+        private _checkCache(scene, mesh?, useInstances?);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+        bindOnlyWorldMatrix(world: Matrix): void;
+        bind(world: Matrix, mesh?: Mesh): void;
+        getAnimatables(): IAnimatable[];
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): SimpleMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): SimpleMaterial;
+    }
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 292 - 0
dist/materialsLibrary/babylon.simpleMaterial.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
dist/materialsLibrary/babylon.simpleMaterial.min.js


+ 32 - 0
dist/materialsLibrary/babylon.skyMaterial.d.ts

@@ -0,0 +1,32 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class SkyMaterial extends Material {
+        luminance: number;
+        turbidity: number;
+        rayleigh: number;
+        mieCoefficient: number;
+        mieDirectionalG: number;
+        distance: number;
+        inclination: number;
+        azimuth: number;
+        sunPosition: Vector3;
+        useSunPosition: boolean;
+        private _cameraPosition;
+        private _renderId;
+        private _defines;
+        private _cachedDefines;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): BaseTexture;
+        private _checkCache(scene, mesh?, useInstances?);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+        bindOnlyWorldMatrix(world: Matrix): void;
+        bind(world: Matrix, mesh?: Mesh): void;
+        getAnimatables(): IAnimatable[];
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): SkyMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): SkyMaterial;
+    }
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 255 - 0
dist/materialsLibrary/babylon.skyMaterial.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
dist/materialsLibrary/babylon.skyMaterial.min.js


+ 34 - 0
dist/materialsLibrary/babylon.terrainMaterial.d.ts

@@ -0,0 +1,34 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class TerrainMaterial extends Material {
+        mixTexture: BaseTexture;
+        diffuseTexture1: Texture;
+        diffuseTexture2: Texture;
+        diffuseTexture3: Texture;
+        bumpTexture1: Texture;
+        bumpTexture2: Texture;
+        bumpTexture3: Texture;
+        diffuseColor: Color3;
+        specularColor: Color3;
+        specularPower: number;
+        disableLighting: boolean;
+        maxSimultaneousLights: number;
+        private _worldViewProjectionMatrix;
+        private _renderId;
+        private _defines;
+        private _cachedDefines;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): BaseTexture;
+        private _checkCache(scene, mesh?, useInstances?);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+        bindOnlyWorldMatrix(world: Matrix): void;
+        bind(world: Matrix, mesh?: Mesh): void;
+        getAnimatables(): IAnimatable[];
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): TerrainMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): TerrainMaterial;
+    }
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 357 - 0
dist/materialsLibrary/babylon.terrainMaterial.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
dist/materialsLibrary/babylon.terrainMaterial.min.js


+ 35 - 0
dist/materialsLibrary/babylon.triPlanarMaterial.d.ts

@@ -0,0 +1,35 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class TriPlanarMaterial extends Material {
+        mixTexture: BaseTexture;
+        diffuseTextureX: Texture;
+        diffuseTextureY: Texture;
+        diffuseTextureZ: Texture;
+        normalTextureX: Texture;
+        normalTextureY: Texture;
+        normalTextureZ: Texture;
+        tileSize: number;
+        diffuseColor: Color3;
+        specularColor: Color3;
+        specularPower: number;
+        disableLighting: boolean;
+        maxSimultaneousLights: number;
+        private _worldViewProjectionMatrix;
+        private _renderId;
+        private _defines;
+        private _cachedDefines;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): BaseTexture;
+        private _checkCache(scene, mesh?, useInstances?);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+        bindOnlyWorldMatrix(world: Matrix): void;
+        bind(world: Matrix, mesh?: Mesh): void;
+        getAnimatables(): IAnimatable[];
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): TriPlanarMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): TriPlanarMaterial;
+    }
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 350 - 0
dist/materialsLibrary/babylon.triPlanarMaterial.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
dist/materialsLibrary/babylon.triPlanarMaterial.min.js


+ 99 - 0
dist/materialsLibrary/babylon.waterMaterial.d.ts

@@ -0,0 +1,99 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class WaterMaterial extends Material {
+        renderTargetSize: Vector2;
+        bumpTexture: BaseTexture;
+        diffuseColor: Color3;
+        specularColor: Color3;
+        specularPower: number;
+        disableLighting: boolean;
+        maxSimultaneousLights: number;
+        /**
+        * @param {number}: Represents the wind force
+        */
+        windForce: number;
+        /**
+        * @param {Vector2}: The direction of the wind in the plane (X, Z)
+        */
+        windDirection: Vector2;
+        /**
+        * @param {number}: Wave height, represents the height of the waves
+        */
+        waveHeight: number;
+        /**
+        * @param {number}: Bump height, represents the bump height related to the bump map
+        */
+        bumpHeight: number;
+        /**
+         * @param {boolean}: Add a smaller moving bump to less steady waves.
+         */
+        bumpSuperimpose: boolean;
+        /**
+         * @param {boolean}: Color refraction and reflection differently with .waterColor2 and .colorBlendFactor2. Non-linear (physically correct) fresnel.
+         */
+        fresnelSeparate: boolean;
+        /**
+         * @param {boolean}: bump Waves modify the reflection.
+         */
+        bumpAffectsReflection: boolean;
+        /**
+        * @param {number}: The water color blended with the refraction (near)
+        */
+        waterColor: Color3;
+        /**
+        * @param {number}: The blend factor related to the water color
+        */
+        colorBlendFactor: number;
+        /**
+         * @param {number}: The water color blended with the reflection (far)
+         */
+        waterColor2: Color3;
+        /**
+         * @param {number}: The blend factor related to the water color (reflection, far)
+         */
+        colorBlendFactor2: number;
+        /**
+        * @param {number}: Represents the maximum length of a wave
+        */
+        waveLength: number;
+        /**
+        * @param {number}: Defines the waves speed
+        */
+        waveSpeed: number;
+        private _mesh;
+        private _refractionRTT;
+        private _reflectionRTT;
+        private _material;
+        private _reflectionTransform;
+        private _lastTime;
+        private _renderId;
+        private _defines;
+        private _cachedDefines;
+        private _useLogarithmicDepth;
+        /**
+        * Constructor
+        */
+        constructor(name: string, scene: Scene, renderTargetSize?: Vector2);
+        useLogarithmicDepth: boolean;
+        readonly refractionTexture: RenderTargetTexture;
+        readonly reflectionTexture: RenderTargetTexture;
+        addToRenderList(node: any): void;
+        enableRenderTargets(enable: boolean): void;
+        getRenderList(): AbstractMesh[];
+        readonly renderTargetsEnabled: boolean;
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): BaseTexture;
+        private _checkCache(scene, mesh?, useInstances?);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+        bindOnlyWorldMatrix(world: Matrix): void;
+        bind(world: Matrix, mesh?: Mesh): void;
+        private _createRenderTargets(scene, renderTargetSize);
+        getAnimatables(): IAnimatable[];
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): WaterMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): WaterMaterial;
+        static CreateDefaultMesh(name: string, scene: Scene): Mesh;
+    }
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 593 - 0
dist/materialsLibrary/babylon.waterMaterial.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 0
dist/materialsLibrary/babylon.waterMaterial.min.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 31
dist/preview release/babylon.core.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 2467 - 2451
dist/preview release/babylon.d.ts


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 40 - 40
dist/preview release/babylon.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 232 - 114
dist/preview release/babylon.max.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 2467 - 2451
dist/preview release/babylon.module.d.ts


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 41
dist/preview release/babylon.noworker.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 41 - 41
dist/preview release/babylon.worker.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 11 - 11
dist/preview release/canvas2D/babylon.canvas2d.min.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 3 - 3
dist/preview release/inspector/babylon.inspector.bundle.js


+ 3 - 1
dist/preview release/inspector/babylon.inspector.js

@@ -1237,7 +1237,9 @@ var INSPECTOR;
             var tools = [];
             tools.push(new INSPECTOR.Checkbox(this));
             tools.push(new INSPECTOR.DebugArea(this));
-            tools.push(new INSPECTOR.BoundingBox(this));
+            if (this._obj.getTotalVertices() > 0) {
+                tools.push(new INSPECTOR.BoundingBox(this));
+            }
             tools.push(new INSPECTOR.Info(this));
             return tools;
         };

+ 0 - 0
dist/preview release/inspector/babylon.inspector.min.js


Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä