ソースを参照

Merge pull request #1 from nockawa/dev

Dev to Master
nockawa 9 年 前
コミット
17ac539aad
100 ファイル変更7937 行追加3008 行削除
  1. 390 0
      Babylon.js.csproj
  2. 5 5
      Tools/NormalHeightMapTool/NormalHeightMapTool.sln
  3. BIN
      Exporters/3ds Max/Max2Babylon-0.4.4.zip
  4. BIN
      Exporters/3ds Max/Max2Babylon-0.4.6.zip
  5. 2 2
      Exporters/3ds Max/Max2Babylon/Forms/CameraPropertiesForm.Designer.cs
  6. 14 14
      Exporters/3ds Max/Max2Babylon/Forms/LightPropertiesForm.Designer.cs
  7. 2 2
      Exporters/3ds Max/Max2Babylon/Forms/ObjectPropertiesForm.Designer.cs
  8. 64 59
      Exporters/FBX/BabylonFbxNative/BabylonMesh.cpp
  9. 2 0
      Exporters/FBX/readme.md
  10. 4 5
      Tools/NormalHeightMapTool/NormalHeightMapTool/Properties/AssemblyInfo.cs
  11. 5 3
      Tools/Gulp/config.json
  12. 97 0
      Tools/Gulp/gulp-removeShaderComments.js
  13. 7 2
      Tools/Gulp/gulpfile.js
  14. 0 6
      Tools/NormalHeightMapTool/NormalHeightMapTool/App.config
  15. 0 66
      Tools/NormalHeightMapTool/NormalHeightMapTool/NormalHeightMapTool.csproj
  16. 0 276
      Tools/NormalHeightMapTool/NormalHeightMapTool/Program.cs
  17. 0 4
      Tools/NormalHeightMapTool/NormalHeightMapTool/packages.config
  18. 0 25
      Tools/NormalHeightMapTool/ReadMe.md
  19. BIN
      Tools/NormalHeightMapTool/Redist/NormalHeightMapTool.exe
  20. 30 0
      Web.Debug.config
  21. 31 0
      Web.Release.config
  22. 63 0
      Web.config
  23. BIN
      assets/BrickWall.png
  24. BIN
      assets/brickwall_nh.png
  25. BIN
      assets/rock.png
  26. BIN
      assets/rock_nh.png
  27. 22 23
      dist/preview release/babylon.core.js
  28. 915 759
      dist/preview release/babylon.d.ts
  29. 29 29
      dist/preview release/babylon.js
  30. 1887 416
      dist/preview release/babylon.max.js
  31. 29 29
      dist/preview release/babylon.noworker.js
  32. 4 0
      dist/preview release/what's new.md
  33. 179 0
      index.html
  34. 2 2
      materialsLibrary/dist/babylon.fireMaterial.js
  35. 1 1
      materialsLibrary/dist/babylon.fireMaterial.min.js
  36. 2 2
      materialsLibrary/dist/babylon.furMaterial.js
  37. 1 1
      materialsLibrary/dist/babylon.furMaterial.min.js
  38. 2 2
      materialsLibrary/dist/babylon.gradientMaterial.js
  39. 1 1
      materialsLibrary/dist/babylon.gradientMaterial.min.js
  40. 2 2
      materialsLibrary/dist/babylon.lavaMaterial.js
  41. 1 1
      materialsLibrary/dist/babylon.lavaMaterial.min.js
  42. 2 2
      materialsLibrary/dist/babylon.normalMaterial.js
  43. 1 1
      materialsLibrary/dist/babylon.normalMaterial.min.js
  44. 45 8
      materialsLibrary/dist/babylon.pbrMaterial.js
  45. 3 3
      materialsLibrary/dist/babylon.pbrMaterial.min.js
  46. 2 2
      materialsLibrary/dist/babylon.simpleMaterial.js
  47. 1 1
      materialsLibrary/dist/babylon.simpleMaterial.min.js
  48. 29 10
      materialsLibrary/dist/babylon.skyMaterial.js
  49. 1 1
      materialsLibrary/dist/babylon.skyMaterial.min.js
  50. 2 2
      materialsLibrary/dist/babylon.terrainMaterial.js
  51. 1 1
      materialsLibrary/dist/babylon.terrainMaterial.min.js
  52. 2 2
      materialsLibrary/dist/babylon.triPlanarMaterial.js
  53. 1 1
      materialsLibrary/dist/babylon.triPlanarMaterial.min.js
  54. 2 2
      materialsLibrary/dist/babylon.waterMaterial.js
  55. 1 1
      materialsLibrary/dist/babylon.waterMaterial.min.js
  56. 3 0
      materialsLibrary/dist/dts/babylon.pbrMaterial.d.ts
  57. 3 1
      materialsLibrary/dist/dts/babylon.skyMaterial.d.ts
  58. 97 0
      materialsLibrary/gulp-removeShaderComments.js
  59. 4 1
      materialsLibrary/gulpfile.js
  60. 10 9
      materialsLibrary/materials/gradient/gradient.fragment.fx
  61. 9 8
      materialsLibrary/materials/lava/lava.fragment.fx
  62. 9 8
      materialsLibrary/materials/normal/normal.fragment.fx
  63. 44 4
      materialsLibrary/materials/pbr/babylon.pbrMaterial.ts
  64. 4 4
      materialsLibrary/materials/pbr/legacypbr.fragment.fx
  65. 60 20
      materialsLibrary/materials/pbr/pbr.fragment.fx
  66. 9 8
      materialsLibrary/materials/simple/simple.fragment.fx
  67. 27 9
      materialsLibrary/materials/sky/babylon.skyMaterial.ts
  68. 4 4
      materialsLibrary/materials/sky/sky.fragment.fx
  69. 3 0
      materialsLibrary/test/add/addpbr.js
  70. 2683 1084
      materialsLibrary/test/refs/babylon.max.js
  71. 5 0
      packages.config
  72. 17 0
      src/Animations/babylon.animatable.js
  73. 21 0
      src/Animations/babylon.animatable.ts
  74. 94 5
      src/Animations/babylon.animation.js
  75. 109 6
      src/Animations/babylon.animation.ts
  76. 1 0
      src/Bones/babylon.bone.js
  77. 1 0
      src/Bones/babylon.bone.ts
  78. 2 2
      src/Cameras/VR/babylon.webVRCamera.js
  79. 5 4
      src/Cameras/VR/babylon.webVRCamera.ts
  80. 5 5
      src/Cameras/babylon.arcRotateCamera.js
  81. 5 6
      src/Cameras/babylon.arcRotateCamera.ts
  82. 2 2
      src/Cameras/babylon.camera.js
  83. 2 2
      src/Cameras/babylon.camera.ts
  84. 5 5
      src/Cameras/babylon.targetCamera.js
  85. 7 7
      src/Cameras/babylon.targetCamera.ts
  86. 1 1
      src/Culling/babylon.boundingBox.js
  87. 1 1
      src/Culling/babylon.boundingBox.ts
  88. 1 1
      src/Culling/babylon.boundingSphere.js
  89. 1 1
      src/Culling/babylon.boundingSphere.ts
  90. 171 0
      src/Culling/babylon.ray.js
  91. 208 0
      src/Culling/babylon.ray.ts
  92. 35 1
      src/Debug/babylon.debugLayer.js
  93. 44 1
      src/Debug/babylon.debugLayer.ts
  94. 137 0
      src/Debug/babylon.skeletonViewer.js
  95. 140 0
      src/Debug/babylon.skeletonViewer.ts
  96. 24 11
      src/Layer/babylon.layer.js
  97. 36 11
      src/Layer/babylon.layer.ts
  98. 1 1
      src/LensFlare/babylon.lensFlareSystem.js
  99. 1 1
      src/LensFlare/babylon.lensFlareSystem.ts
  100. 0 0
      src/Lights/babylon.light.js

+ 390 - 0
Babylon.js.csproj

@@ -0,0 +1,390 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props" Condition="Exists('packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props')" />
+  <Import Project="packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
+  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props')" />
+  <Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
+  <Import Project="..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props')" />
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>
+    </ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{FF5C7EB0-3C10-48A7-93AA-3EE78FDB5CA4}</ProjectGuid>
+    <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Babylon.js</RootNamespace>
+    <AssemblyName>Babylon.js</AssemblyName>
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <UseIISExpress>true</UseIISExpress>
+    <IISExpressSSLPort />
+    <IISExpressAnonymousAuthentication />
+    <IISExpressWindowsAuthentication />
+    <IISExpressUseClassicPipelineMode />
+    <UseGlobalApplicationHostFile />
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
+    <TypeScriptToolsVersion>1.7</TypeScriptToolsVersion>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Web.DynamicData" />
+    <Reference Include="System.Web.Entity" />
+    <Reference Include="System.Web.ApplicationServices" />
+    <Reference Include="System.ComponentModel.DataAnnotations" />
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Web.Extensions" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Web" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Configuration" />
+    <Reference Include="System.Web.Services" />
+    <Reference Include="System.EnterpriseServices" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="assets\BrickWall.png" />
+    <Content Include="assets\brickwall_nh.png" />
+    <Content Include="assets\rock.png" />
+    <Content Include="assets\rock_nh.png" />
+    <Content Include="index.html" />
+    <Content Include="packages.config" />
+    <Content Include="src\Shaders\ShadersInclude\bonesDeclaration.fx" />
+    <Content Include="src\Shaders\ShadersInclude\bonesVertex.fx" />
+    <Content Include="src\Shaders\ShadersInclude\bumpFragment.fx" />
+    <Content Include="src\Shaders\ShadersInclude\bumpFragmentFunctions.fx" />
+    <Content Include="src\Shaders\ShadersInclude\clipPlaneFragment.fx" />
+    <Content Include="src\Shaders\ShadersInclude\clipPlaneFragmentDeclaration.fx" />
+    <Content Include="src\Shaders\ShadersInclude\clipPlaneVertex.fx" />
+    <Content Include="src\Shaders\ShadersInclude\clipPlaneVertexDeclaration.fx" />
+    <Content Include="src\Shaders\ShadersInclude\fogFragment.fx" />
+    <Content Include="src\Shaders\ShadersInclude\fogFragmentDeclaration.fx" />
+    <Content Include="src\Shaders\ShadersInclude\fogVertex.fx" />
+    <Content Include="src\Shaders\ShadersInclude\fogVertexDeclaration.fx" />
+    <Content Include="src\Shaders\ShadersInclude\fresnelFunction.fx" />
+    <Content Include="src\Shaders\ShadersInclude\helperFunctions.fx" />
+    <Content Include="src\Shaders\ShadersInclude\instancesDeclaration.fx" />
+    <Content Include="src\Shaders\ShadersInclude\instancesVertex.fx" />
+    <Content Include="src\Shaders\ShadersInclude\light0Fragment.fx" />
+    <Content Include="src\Shaders\ShadersInclude\light0FragmentDeclaration.fx" />
+    <Content Include="src\Shaders\ShadersInclude\light1Fragment.fx" />
+    <Content Include="src\Shaders\ShadersInclude\light1FragmentDeclaration.fx" />
+    <Content Include="src\Shaders\ShadersInclude\light2Fragment.fx" />
+    <Content Include="src\Shaders\ShadersInclude\light2FragmentDeclaration.fx" />
+    <Content Include="src\Shaders\ShadersInclude\light3Fragment.fx" />
+    <Content Include="src\Shaders\ShadersInclude\light3FragmentDeclaration.fx" />
+    <Content Include="src\Shaders\ShadersInclude\lightsFragmentFunctions.fx" />
+    <Content Include="src\Shaders\ShadersInclude\logDepthDeclaration.fx" />
+    <Content Include="src\Shaders\ShadersInclude\logDepthFragment.fx" />
+    <Content Include="src\Shaders\ShadersInclude\logDepthVertex.fx" />
+    <Content Include="src\Shaders\ShadersInclude\pointCloudVertex.fx" />
+    <Content Include="src\Shaders\ShadersInclude\pointCloudVertexDeclaration.fx" />
+    <Content Include="src\Shaders\ShadersInclude\reflectionFunction.fx" />
+    <Content Include="src\Shaders\ShadersInclude\shadowsFragmentFunctions.fx" />
+    <Content Include="src\Shaders\ShadersInclude\shadowsVertex.fx" />
+    <Content Include="src\Shaders\ShadersInclude\shadowsVertexDeclaration.fx" />
+    <Content Include="src\tsconfig.json" />
+    <None Include="Web.Debug.config">
+      <DependentUpon>Web.config</DependentUpon>
+    </None>
+    <None Include="Web.Release.config">
+      <DependentUpon>Web.config</DependentUpon>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="src\.gitignore" />
+    <Content Include="src\Shaders\anaglyph.fragment.fx" />
+    <Content Include="src\Shaders\blackAndWhite.fragment.fx" />
+    <Content Include="src\Shaders\blur.fragment.fx" />
+    <Content Include="src\Shaders\chromaticAberration.fragment.fx" />
+    <Content Include="src\Shaders\color.fragment.fx" />
+    <Content Include="src\Shaders\color.vertex.fx" />
+    <Content Include="src\Shaders\colorCorrection.fragment.fx" />
+    <Content Include="src\Shaders\convolution.fragment.fx" />
+    <Content Include="src\Shaders\default.fragment.fx" />
+    <Content Include="src\Shaders\default.vertex.fx" />
+    <Content Include="src\Shaders\depth.fragment.fx" />
+    <Content Include="src\Shaders\depth.vertex.fx" />
+    <Content Include="src\Shaders\depthBoxBlur.fragment.fx" />
+    <Content Include="src\Shaders\depthOfField.fragment.fx" />
+    <Content Include="src\Shaders\displayPass.fragment.fx" />
+    <Content Include="src\Shaders\filter.fragment.fx" />
+    <Content Include="src\Shaders\fxaa.fragment.fx" />
+    <Content Include="src\Shaders\hdr.fragment.fx" />
+    <Content Include="src\Shaders\layer.fragment.fx" />
+    <Content Include="src\Shaders\layer.vertex.fx" />
+    <Content Include="src\Shaders\legacydefault.fragment.fx" />
+    <Content Include="src\Shaders\legacydefault.vertex.fx" />
+    <Content Include="src\Shaders\lensFlare.fragment.fx" />
+    <Content Include="src\Shaders\lensFlare.vertex.fx" />
+    <Content Include="src\Shaders\lensHighlights.fragment.fx" />
+    <Content Include="src\Shaders\line.fragment.fx" />
+    <Content Include="src\Shaders\line.vertex.fx" />
+    <Content Include="src\Shaders\outline.fragment.fx" />
+    <Content Include="src\Shaders\outline.vertex.fx" />
+    <Content Include="src\Shaders\particles.fragment.fx" />
+    <Content Include="src\Shaders\particles.vertex.fx" />
+    <Content Include="src\Shaders\pass.fragment.fx" />
+    <Content Include="src\Shaders\postprocess.vertex.fx" />
+    <Content Include="src\Shaders\procedural.vertex.fx" />
+    <Content Include="src\Shaders\refraction.fragment.fx" />
+    <Content Include="src\Shaders\shadowMap.fragment.fx" />
+    <Content Include="src\Shaders\shadowMap.vertex.fx" />
+    <Content Include="src\Shaders\sprites.fragment.fx" />
+    <Content Include="src\Shaders\sprites.vertex.fx" />
+    <Content Include="src\Shaders\ssao.fragment.fx" />
+    <Content Include="src\Shaders\ssaoCombine.fragment.fx" />
+    <Content Include="src\Shaders\stereoscopicInterlace.fragment.fx" />
+    <Content Include="src\Shaders\tonemap.fragment.fx" />
+    <Content Include="src\Shaders\volumetricLightScattering.fragment.fx" />
+    <Content Include="src\Shaders\volumetricLightScatteringPass.fragment.fx" />
+    <Content Include="src\Shaders\vrDistortionCorrection.fragment.fx" />
+    <Content Include="Web.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <TypeScriptCompile Include="external references\poly2tri.d.ts" />
+    <TypeScriptCompile Include="src\Actions\babylon.action.ts" />
+    <TypeScriptCompile Include="src\Actions\babylon.actionManager.ts" />
+    <TypeScriptCompile Include="src\Actions\babylon.condition.ts" />
+    <TypeScriptCompile Include="src\Actions\babylon.directActions.ts" />
+    <TypeScriptCompile Include="src\Actions\babylon.interpolateValueAction.ts" />
+    <TypeScriptCompile Include="src\Animations\babylon.animatable.ts" />
+    <TypeScriptCompile Include="src\Animations\babylon.animation.ts" />
+    <TypeScriptCompile Include="src\Animations\babylon.easing.ts" />
+    <TypeScriptCompile Include="src\Audio\babylon.analyser.ts" />
+    <TypeScriptCompile Include="src\Audio\babylon.audioEngine.ts" />
+    <TypeScriptCompile Include="src\Audio\babylon.sound.ts" />
+    <TypeScriptCompile Include="src\Audio\babylon.soundtrack.ts" />
+    <TypeScriptCompile Include="src\babylon.engine.ts" />
+    <TypeScriptCompile Include="src\babylon.mixins.ts" />
+    <TypeScriptCompile Include="src\babylon.node.ts" />
+    <TypeScriptCompile Include="src\babylon.scene.ts" />
+    <TypeScriptCompile Include="src\Bones\babylon.bone.ts" />
+    <TypeScriptCompile Include="src\Bones\babylon.skeleton.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.arcRotateCamera.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.camera.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.deviceOrientationCamera.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.followCamera.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.freeCamera.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.gamepadCamera.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.stereoscopicCameras.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.targetCamera.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.touchCamera.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.universalCamera.ts" />
+    <TypeScriptCompile Include="src\Cameras\babylon.virtualJoysticksCamera.ts" />
+    <TypeScriptCompile Include="src\Cameras\VR\babylon.vrCameraMetrics.ts" />
+    <TypeScriptCompile Include="src\Cameras\VR\babylon.vrDeviceOrientationCamera.ts" />
+    <TypeScriptCompile Include="src\Cameras\VR\babylon.webVRCamera.ts" />
+    <TypeScriptCompile Include="src\Collisions\babylon.collider.ts" />
+    <TypeScriptCompile Include="src\Collisions\babylon.collisionCoordinator.ts" />
+    <TypeScriptCompile Include="src\Collisions\babylon.collisionWorker.ts" />
+    <TypeScriptCompile Include="src\Collisions\babylon.pickingInfo.ts" />
+    <TypeScriptCompile Include="src\Culling\babylon.boundingBox.ts" />
+    <TypeScriptCompile Include="src\Culling\babylon.boundingInfo.ts" />
+    <TypeScriptCompile Include="src\Culling\babylon.boundingSphere.ts" />
+    <TypeScriptCompile Include="src\Culling\Octrees\babylon.octree.ts" />
+    <TypeScriptCompile Include="src\Culling\Octrees\babylon.octreeBlock.ts" />
+    <TypeScriptCompile Include="src\Debug\babylon.debugLayer.ts" />
+    <TypeScriptCompile Include="src\Layer\babylon.layer.ts" />
+    <TypeScriptCompile Include="src\LensFlare\babylon.lensFlare.ts" />
+    <TypeScriptCompile Include="src\LensFlare\babylon.lensFlareSystem.ts" />
+    <TypeScriptCompile Include="src\Lights\babylon.directionalLight.ts" />
+    <TypeScriptCompile Include="src\Lights\babylon.hemisphericLight.ts" />
+    <TypeScriptCompile Include="src\Lights\babylon.light.ts" />
+    <TypeScriptCompile Include="src\Lights\babylon.pointLight.ts" />
+    <TypeScriptCompile Include="src\Lights\babylon.spotLight.ts" />
+    <TypeScriptCompile Include="src\Lights\Shadows\babylon.shadowGenerator.ts" />
+    <TypeScriptCompile Include="src\Loading\babylon.sceneLoader.ts" />
+    <TypeScriptCompile Include="src\Loading\Plugins\babylon.babylonFileLoader.ts" />
+    <TypeScriptCompile Include="src\Materials\babylon.effect.ts" />
+    <TypeScriptCompile Include="src\Materials\babylon.fresnelParameters.ts" />
+    <TypeScriptCompile Include="src\Materials\babylon.material.ts" />
+    <TypeScriptCompile Include="src\Materials\babylon.materialHelper.ts" />
+    <TypeScriptCompile Include="src\Materials\babylon.multiMaterial.ts" />
+    <TypeScriptCompile Include="src\Materials\babylon.shaderMaterial.ts" />
+    <TypeScriptCompile Include="src\Materials\babylon.standardMaterial.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\babylon.baseTexture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\babylon.cubeTexture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\babylon.dynamicTexture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\babylon.hdrcubetexture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\babylon.mirrorTexture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\babylon.rawTexture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\babylon.refractionTexture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\babylon.renderTargetTexture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\babylon.texture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\babylon.videoTexture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\Procedurals\babylon.customProceduralTexture.ts" />
+    <TypeScriptCompile Include="src\Materials\Textures\Procedurals\babylon.proceduralTexture.ts" />
+    <TypeScriptCompile Include="src\Math\babylon.math.SIMD.ts" />
+    <TypeScriptCompile Include="src\Math\babylon.math.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.abstractMesh.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.csg.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.geometry.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.groundMesh.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.instancedMesh.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.linesMesh.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.mesh.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.mesh.vertexData.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.meshBuilder.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.meshLODLevel.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.meshSimplification.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.polygonMesh.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.subMesh.ts" />
+    <TypeScriptCompile Include="src\Mesh\babylon.vertexBuffer.ts" />
+    <TypeScriptCompile Include="src\Particles\babylon.particle.ts" />
+    <TypeScriptCompile Include="src\Particles\babylon.particleSystem.ts" />
+    <TypeScriptCompile Include="src\Particles\babylon.solidParticle.ts" />
+    <TypeScriptCompile Include="src\Particles\babylon.solidParticleSystem.ts" />
+    <TypeScriptCompile Include="src\Physics\babylon.physicsEngine.ts" />
+    <TypeScriptCompile Include="src\Physics\babylon.physicsImpostor.ts" />
+    <TypeScriptCompile Include="src\Physics\babylon.physicsJoint.ts" />
+    <TypeScriptCompile Include="src\Physics\Plugins\babylon.cannonJSPlugin.ts" />
+    <TypeScriptCompile Include="src\Physics\Plugins\babylon.oimoJSPlugin.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.anaglyphPostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.blackAndWhitePostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.blurPostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.colorCorrectionPostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.convolutionPostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.displayPassPostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.filterPostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.fxaaPostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.hdrRenderingPipeline.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.lensRenderingPipeline.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.passPostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.postProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.postProcessManager.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.refractionPostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.ssaoRenderingPipeline.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.stereoscopicInterlacePostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.tonemapPostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.volumetricLightScatteringPostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\babylon.vrDistortionCorrectionPostProcess.ts" />
+    <TypeScriptCompile Include="src\PostProcess\RenderPipeline\babylon.postProcessRenderEffect.ts" />
+    <TypeScriptCompile Include="src\PostProcess\RenderPipeline\babylon.postProcessRenderPass.ts" />
+    <TypeScriptCompile Include="src\PostProcess\RenderPipeline\babylon.postProcessRenderPipeline.ts" />
+    <TypeScriptCompile Include="src\PostProcess\RenderPipeline\babylon.postProcessRenderPipelineManager.ts" />
+    <TypeScriptCompile Include="src\Probes\babylon.reflectionProbe.ts" />
+    <TypeScriptCompile Include="src\Rendering\babylon.boundingBoxRenderer.ts" />
+    <TypeScriptCompile Include="src\Rendering\babylon.depthRenderer.ts" />
+    <TypeScriptCompile Include="src\Rendering\babylon.edgesRenderer.ts" />
+    <TypeScriptCompile Include="src\Rendering\babylon.outlineRenderer.ts" />
+    <TypeScriptCompile Include="src\Rendering\babylon.renderingGroup.ts" />
+    <TypeScriptCompile Include="src\Rendering\babylon.renderingManager.ts" />
+    <TypeScriptCompile Include="src\Sprites\babylon.sprite.ts" />
+    <TypeScriptCompile Include="src\Sprites\babylon.spriteManager.ts" />
+    <TypeScriptCompile Include="src\States\babylon.alphaCullingState.ts" />
+    <TypeScriptCompile Include="src\States\babylon.depthCullingState.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.andOrNotEvaluator.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.assetsManager.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.database.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.decorators.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.filesInput.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.gamepads.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.loadingScreen.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.sceneOptimizer.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.sceneSerializer.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.smartArray.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.smartCollection.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.tags.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.tools.dds.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.tools.tga.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.tools.ts" />
+    <TypeScriptCompile Include="src\Tools\babylon.virtualJoystick.ts" />
+    <TypeScriptCompile Include="src\Tools\HDR\babylon.tools.cubemaptosphericalpolynomial.ts" />
+    <TypeScriptCompile Include="src\Tools\HDR\babylon.tools.hdr.ts" />
+    <TypeScriptCompile Include="src\Tools\HDR\babylon.tools.panoramaToCubemap.ts" />
+    <TypeScriptCompile Include="src\Tools\HDR\babylon.tools.pmremgenerator.ts" />
+    <TypeScriptCompile Include="typescript\MainClass.ts" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{4A0DDDB5-7A95-4FBF-97CC-616D07737A77}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
+    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+  </PropertyGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
+    <TypeScriptTarget>ES5</TypeScriptTarget>
+    <TypeScriptJSXEmit>None</TypeScriptJSXEmit>
+    <TypeScriptCompileOnSaveEnabled>True</TypeScriptCompileOnSaveEnabled>
+    <TypeScriptNoImplicitAny>False</TypeScriptNoImplicitAny>
+    <TypeScriptModuleKind>None</TypeScriptModuleKind>
+    <TypeScriptRemoveComments>False</TypeScriptRemoveComments>
+    <TypeScriptOutFile />
+    <TypeScriptOutDir />
+    <TypeScriptGeneratesDeclarations>False</TypeScriptGeneratesDeclarations>
+    <TypeScriptNoEmitOnError>True</TypeScriptNoEmitOnError>
+    <TypeScriptSourceMap>True</TypeScriptSourceMap>
+    <TypeScriptExperimentalDecorators>true</TypeScriptExperimentalDecorators>
+    <TypeScriptMapRoot />
+    <TypeScriptSourceRoot />
+  </PropertyGroup>
+  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets')" />
+  <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
+  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
+  <ProjectExtensions>
+    <VisualStudio>
+      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
+        <WebProjectProperties>
+          <UseIIS>False</UseIIS>
+          <AutoAssignPort>True</AutoAssignPort>
+          <DevelopmentServerPort>58598</DevelopmentServerPort>
+          <DevelopmentServerVPath>/</DevelopmentServerVPath>
+          <IISUrl>http://localhost:58598/</IISUrl>
+          <NTLMAuthentication>False</NTLMAuthentication>
+          <UseCustomServer>False</UseCustomServer>
+          <CustomServerUrl>
+          </CustomServerUrl>
+          <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
+        </WebProjectProperties>
+      </FlavorProperties>
+    </VisualStudio>
+  </ProjectExtensions>
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('.\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '.\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props'))" />
+    <Error Condition="!Exists('.\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '.\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
+    <Error Condition="!Exists('packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
+    <Error Condition="!Exists('packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props'))" />
+  </Target>
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

+ 5 - 5
Tools/NormalHeightMapTool/NormalHeightMapTool.sln

@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 14
 VisualStudioVersion = 14.0.24720.0
 MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NormalHeightMapTool", "NormalHeightMapTool\NormalHeightMapTool.csproj", "{2F997E8B-E471-4703-AD73-366BB48AB825}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Babylon.js", "Babylon.js.csproj", "{FF5C7EB0-3C10-48A7-93AA-3EE78FDB5CA4}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -11,10 +11,10 @@ Global
 		Release|Any CPU = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{2F997E8B-E471-4703-AD73-366BB48AB825}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{2F997E8B-E471-4703-AD73-366BB48AB825}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{2F997E8B-E471-4703-AD73-366BB48AB825}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{2F997E8B-E471-4703-AD73-366BB48AB825}.Release|Any CPU.Build.0 = Release|Any CPU
+		{FF5C7EB0-3C10-48A7-93AA-3EE78FDB5CA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{FF5C7EB0-3C10-48A7-93AA-3EE78FDB5CA4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{FF5C7EB0-3C10-48A7-93AA-3EE78FDB5CA4}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{FF5C7EB0-3C10-48A7-93AA-3EE78FDB5CA4}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

BIN
Exporters/3ds Max/Max2Babylon-0.4.4.zip


BIN
Exporters/3ds Max/Max2Babylon-0.4.6.zip


+ 2 - 2
Exporters/3ds Max/Max2Babylon/Forms/CameraPropertiesForm.Designer.cs

@@ -244,7 +244,7 @@
             // 
             this.nupTo.Location = new System.Drawing.Point(47, 40);
             this.nupTo.Maximum = new decimal(new int[] {
-            1000,
+            100000,
             0,
             0,
             0});
@@ -265,7 +265,7 @@
             // 
             this.nupFrom.Location = new System.Drawing.Point(47, 14);
             this.nupFrom.Maximum = new decimal(new int[] {
-            1000,
+            100000,
             0,
             0,
             0});

+ 14 - 14
Exporters/3ds Max/Max2Babylon/Forms/LightPropertiesForm.Designer.cs

@@ -41,6 +41,7 @@
             this.groupBox4 = new System.Windows.Forms.GroupBox();
             this.chkNoExport = new System.Windows.Forms.CheckBox();
             this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.ckForceBackFaces = new System.Windows.Forms.CheckBox();
             this.grpBlurInfo = new System.Windows.Forms.GroupBox();
             this.nupBlurBoxOffset = new System.Windows.Forms.NumericUpDown();
             this.label3 = new System.Windows.Forms.Label();
@@ -50,7 +51,6 @@
             this.label6 = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
             this.cbCameraType = new System.Windows.Forms.ComboBox();
-            this.ckForceBackFaces = new System.Windows.Forms.CheckBox();
             this.groupBox3.SuspendLayout();
             this.grpAutoAnimate.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.nupTo)).BeginInit();
@@ -131,7 +131,7 @@
             // 
             this.nupTo.Location = new System.Drawing.Point(47, 40);
             this.nupTo.Maximum = new decimal(new int[] {
-            1000,
+            100000,
             0,
             0,
             0});
@@ -152,7 +152,7 @@
             // 
             this.nupFrom.Location = new System.Drawing.Point(47, 14);
             this.nupFrom.Maximum = new decimal(new int[] {
-            1000,
+            100000,
             0,
             0,
             0});
@@ -220,6 +220,17 @@
             this.groupBox1.TabStop = false;
             this.groupBox1.Text = "Shadows";
             // 
+            // ckForceBackFaces
+            // 
+            this.ckForceBackFaces.AutoSize = true;
+            this.ckForceBackFaces.Location = new System.Drawing.Point(24, 61);
+            this.ckForceBackFaces.Name = "ckForceBackFaces";
+            this.ckForceBackFaces.Size = new System.Drawing.Size(135, 17);
+            this.ckForceBackFaces.TabIndex = 14;
+            this.ckForceBackFaces.Text = "Force Back Faces only";
+            this.ckForceBackFaces.ThreeState = true;
+            this.ckForceBackFaces.UseVisualStyleBackColor = true;
+            // 
             // grpBlurInfo
             // 
             this.grpBlurInfo.Controls.Add(this.nupBlurBoxOffset);
@@ -344,17 +355,6 @@
             this.cbCameraType.TabIndex = 7;
             this.cbCameraType.SelectedIndexChanged += new System.EventHandler(this.cbCameraType_SelectedIndexChanged);
             // 
-            // ckForceBackFaces
-            // 
-            this.ckForceBackFaces.AutoSize = true;
-            this.ckForceBackFaces.Location = new System.Drawing.Point(24, 61);
-            this.ckForceBackFaces.Name = "ckForceBackFaces";
-            this.ckForceBackFaces.Size = new System.Drawing.Size(135, 17);
-            this.ckForceBackFaces.TabIndex = 14;
-            this.ckForceBackFaces.Text = "Force Back Faces only";
-            this.ckForceBackFaces.ThreeState = true;
-            this.ckForceBackFaces.UseVisualStyleBackColor = true;
-            // 
             // LightPropertiesForm
             // 
             this.AcceptButton = this.butOK;

+ 2 - 2
Exporters/3ds Max/Max2Babylon/Forms/ObjectPropertiesForm.Designer.cs

@@ -297,7 +297,7 @@
             // 
             this.nupTo.Location = new System.Drawing.Point(47, 40);
             this.nupTo.Maximum = new decimal(new int[] {
-            1000,
+            100000,
             0,
             0,
             0});
@@ -318,7 +318,7 @@
             // 
             this.nupFrom.Location = new System.Drawing.Point(47, 14);
             this.nupFrom.Maximum = new decimal(new int[] {
-            1000,
+            100000,
             0,
             0,
             0});

+ 64 - 59
Exporters/FBX/BabylonFbxNative/BabylonMesh.cpp

@@ -440,77 +440,82 @@ BabylonMesh::BabylonMesh(BabylonNode* node) :
 	}
 	pivotMatrix = ConvertToBabylonCoordinateSystem( GetGeometryTransformation(fbxNode));
 
-	auto animStack = fbxNode->GetScene()->GetCurrentAnimationStack();
-	FbxString animStackName = animStack->GetName();
-	//FbxTakeInfo* takeInfo = node->GetScene()->GetTakeInfo(animStackName);
-	auto animTimeMode = GlobalSettings::Current().AnimationsTimeMode;
-	auto animFrameRate = GlobalSettings::Current().AnimationsFrameRate();
-	auto startFrame = animStack->GetLocalTimeSpan().GetStart().GetFrameCount(animTimeMode);
-	auto endFrame = animStack->GetLocalTimeSpan().GetStop().GetFrameCount(animTimeMode);
-	auto animLengthInFrame = endFrame - startFrame + 1;
-	_visibility = static_cast<float>(node->fbxNode()->Visibility.Get());
-	auto posAnim = std::make_shared<BabylonAnimation<babylon_vector3>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"position", L"position", true, 0, static_cast<int>(animLengthInFrame), true);
-	auto rotAnim = std::make_shared<BabylonAnimation<babylon_vector4>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"rotationQuaternion", L"rotationQuaternion", true, 0, static_cast<int>(animLengthInFrame), true);
-	auto scaleAnim = std::make_shared<BabylonAnimation<babylon_vector3>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"scaling", L"scaling", true, 0, static_cast<int>(animLengthInFrame), true);
-	auto visibilityAnim = std::make_shared<BabylonAnimation<float>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"visibility", L"visibility", true, 0, static_cast<int>(animLengthInFrame), true);
 	auto mesh = fbxNode->GetMesh();
-	_isVisible = fbxNode->Show.Get();
-	
-	auto rotCurveNode = fbxNode->LclRotation.GetCurveNode();
-	auto translateCurveNode = fbxNode->LclTranslation.GetCurveNode();
-	auto scalingCurveNode = fbxNode->LclScaling.GetCurveNode();
-	auto visibilityCurveNode = fbxNode->Visibility.GetCurveNode();
-	if (rotCurveNode || translateCurveNode || scalingCurveNode) {
-		for (auto ix = 0; ix < animLengthInFrame; ix++) {
-			FbxTime currTime;
-			currTime.SetFrame(startFrame + ix, animTimeMode);
-
-			babylon_animation_key<babylon_vector3> poskey;
-			babylon_animation_key<babylon_vector4> rotkey;
-			babylon_animation_key<babylon_vector3> scalekey;
-			poskey.frame = ix;
-			rotkey.frame = ix;
-			scalekey.frame = ix;
-			auto currTransform = node->GetLocal(currTime);
-			poskey.values = currTransform.translation();
-			rotkey.values = currTransform.rotationQuaternion();
-			scalekey.values = currTransform.scaling();
-			posAnim->appendKey(poskey);
-			rotAnim->appendKey(rotkey);
-			scaleAnim->appendKey(scalekey);
+	auto animStack = fbxNode->GetScene()->GetCurrentAnimationStack();
 
+	if (animStack) {
+		FbxString animStackName = animStack->GetName();
+		//FbxTakeInfo* takeInfo = node->GetScene()->GetTakeInfo(animStackName);
+		auto animTimeMode = GlobalSettings::Current().AnimationsTimeMode;
+		auto animFrameRate = GlobalSettings::Current().AnimationsFrameRate();
+		auto startFrame = animStack->GetLocalTimeSpan().GetStart().GetFrameCount(animTimeMode);
+		auto endFrame = animStack->GetLocalTimeSpan().GetStop().GetFrameCount(animTimeMode);
+		auto animLengthInFrame = endFrame - startFrame + 1;
+		_visibility = static_cast<float>(node->fbxNode()->Visibility.Get());
+		auto posAnim = std::make_shared<BabylonAnimation<babylon_vector3>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"position", L"position", true, 0, static_cast<int>(animLengthInFrame), true);
+		auto rotAnim = std::make_shared<BabylonAnimation<babylon_vector4>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"rotationQuaternion", L"rotationQuaternion", true, 0, static_cast<int>(animLengthInFrame), true);
+		auto scaleAnim = std::make_shared<BabylonAnimation<babylon_vector3>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"scaling", L"scaling", true, 0, static_cast<int>(animLengthInFrame), true);
+		auto visibilityAnim = std::make_shared<BabylonAnimation<float>>(BabylonAnimationBase::loopBehavior_Cycle, static_cast<int>(animFrameRate), L"visibility", L"visibility", true, 0, static_cast<int>(animLengthInFrame), true);
+
+		_isVisible = fbxNode->Show.Get();
+
+		auto rotCurveNode = fbxNode->LclRotation.GetCurveNode();
+		auto translateCurveNode = fbxNode->LclTranslation.GetCurveNode();
+		auto scalingCurveNode = fbxNode->LclScaling.GetCurveNode();
+		auto visibilityCurveNode = fbxNode->Visibility.GetCurveNode();
+		if (rotCurveNode || translateCurveNode || scalingCurveNode) {
+			for (auto ix = 0; ix < animLengthInFrame; ix++) {
+				FbxTime currTime;
+				currTime.SetFrame(startFrame + ix, animTimeMode);
+
+				babylon_animation_key<babylon_vector3> poskey;
+				babylon_animation_key<babylon_vector4> rotkey;
+				babylon_animation_key<babylon_vector3> scalekey;
+				poskey.frame = ix;
+				rotkey.frame = ix;
+				scalekey.frame = ix;
+				auto currTransform = node->GetLocal(currTime);
+				poskey.values = currTransform.translation();
+				rotkey.values = currTransform.rotationQuaternion();
+				scalekey.values = currTransform.scaling();
+				posAnim->appendKey(poskey);
+				rotAnim->appendKey(rotkey);
+				scaleAnim->appendKey(scalekey);
 
+
+			}
 		}
-	}
-	if (visibilityCurveNode) {
-		for (auto ix = 0; ix < animLengthInFrame; ix++) {
-			FbxTime currTime;
-			currTime.SetFrame(startFrame + ix, animTimeMode);
+		if (visibilityCurveNode) {
+			for (auto ix = 0; ix < animLengthInFrame; ix++) {
+				FbxTime currTime;
+				currTime.SetFrame(startFrame + ix, animTimeMode);
 
-			babylon_animation_key<float> visibilityKey;
+				babylon_animation_key<float> visibilityKey;
 
-			visibilityKey.frame = ix;
+				visibilityKey.frame = ix;
 
-			visibilityKey.values = static_cast<float>(node->fbxNode()->Visibility.EvaluateValue(currTime));
+				visibilityKey.values = static_cast<float>(node->fbxNode()->Visibility.EvaluateValue(currTime));
 
-			visibilityAnim->appendKey(visibilityKey);
+				visibilityAnim->appendKey(visibilityKey);
 
 
+			}
+		}
+
+		if (!posAnim->isConstant()){
+			animations.push_back(posAnim);
+		}
+		if (!rotAnim->isConstant()){
+			animations.push_back(rotAnim);
+		}
+		if (!scaleAnim->isConstant()){
+			animations.push_back(scaleAnim);
+		}
+		if (!visibilityAnim->isConstant()) {
+			animations.push_back(visibilityAnim);
 		}
 	}
-	
-	if (!posAnim->isConstant()){
-		animations.push_back(posAnim);
-	}
-	if (!rotAnim->isConstant()){
-		animations.push_back(rotAnim);
-	}
-	if (!scaleAnim->isConstant()){
-		animations.push_back(scaleAnim);
-	}
-	if (!visibilityAnim->isConstant()) {
-		animations.push_back(visibilityAnim);
-	}
+
 	if (!mesh) {
 		return;
 	}

+ 2 - 0
Exporters/FBX/readme.md

@@ -11,6 +11,8 @@ FBX Exporter produces a babylon scene file from an FBX asset
 
 ##Prerequisites
 To use this tool, you need to download the Visual C++ 2015 redistribuable package : http://www.microsoft.com/en-us/download/details.aspx?id=48145
+
+To build from source you need to install the Autodesk FBX SDK 2016.1 and copy the lib folder from the SDK install location to 3rdParty\Fbx2016.1\
 ##Usage
 FbxExporter.exe "fbx file" "outdir" [/fps:60|30|24] [/skipemptynodes]
 - fbx file : path to the source FBX asset

+ 4 - 5
Tools/NormalHeightMapTool/NormalHeightMapTool/Properties/AssemblyInfo.cs

@@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
 // General Information about an assembly is controlled through the following 
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
-[assembly: AssemblyTitle("NormalHeightMapTool")]
+[assembly: AssemblyTitle("Babylon.js")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("NormalHeightMapTool")]
+[assembly: AssemblyProduct("Babylon.js")]
 [assembly: AssemblyCopyright("Copyright ©  2016")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
@@ -20,7 +20,7 @@ using System.Runtime.InteropServices;
 [assembly: ComVisible(false)]
 
 // The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("2f997e8b-e471-4703-ad73-366bb48ab825")]
+[assembly: Guid("ff5c7eb0-3c10-48a7-93aa-3ee78fdb5ca4")]
 
 // Version information for an assembly consists of the following four values:
 //
@@ -29,8 +29,7 @@ using System.Runtime.InteropServices;
 //      Build Number
 //      Revision
 //
-// You can specify all the values or you can default the Build and Revision Numbers 
+// You can specify all the values or you can default the Revision and Build Numbers 
 // by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyVersion("1.0.0.0")]
 [assembly: AssemblyFileVersion("1.0.0.0")]

+ 5 - 3
Tools/Gulp/config.json

@@ -22,8 +22,8 @@
       "../../src/Tools/babylon.smartArray.js",
       "../../src/Tools/babylon.smartCollection.js",
       "../../src/Tools/babylon.tools.js",      
-      "../../src/states/babylon.alphaCullingState.js",
-      "../../src/states/babylon.depthCullingState.js",
+      "../../src/States/babylon.alphaCullingState.js",
+      "../../src/States/babylon.depthCullingState.js",
       "../../src/babylon.engine.js",
       "../../src/babylon.node.js",
       "../../src/Tools/babylon.filesInput.js",
@@ -31,6 +31,7 @@
       "../../src/Culling/babylon.boundingSphere.js",
       "../../src/Culling/babylon.boundingBox.js",
       "../../src/Culling/babylon.boundingInfo.js",
+      "../../src/Culling/babylon.ray.js",
       "../../src/Mesh/babylon.abstractMesh.js",
       "../../src/Lights/babylon.light.js",
       "../../src/Lights/babylon.pointLight.js",
@@ -191,7 +192,8 @@
       "../../src/tools/hdr/babylon.tools.panoramatocubemap.js",
       "../../src/tools/hdr/babylon.tools.hdr.js",
       "../../src/tools/hdr/babylon.tools.pmremGenerator.js",
-      "../../src/materials/textures/babylon.hdrcubetexture.js"
+      "../../src/materials/textures/babylon.hdrcubetexture.js",
+      "../../src/debug/babylon.skeletonViewer.js"
     ]
   }
 }

+ 97 - 0
Tools/Gulp/gulp-removeShaderComments.js

@@ -0,0 +1,97 @@
+'use strict';
+
+var through = require('through2');
+var PluginError = require('gulp-util').PluginError;
+var singleComment = 1;
+var multiComment = 2;
+
+function uncomment(str, opts) {
+    opts = opts || {};
+
+	var currentChar;
+	var nextChar;
+	var insideString = false;
+	var insideComment = 0;
+	var offset = 0;
+	var ret = '';
+
+    str = str.replace(/\r\n/g, '\n');
+    str = str.replace(/[ \f\t\v]+/g, ' ');
+    str = str.replace(/^\s*\n/gm, '');
+    str = str.replace(/ \+ /g, '+');
+    str = str.replace(/ \- /g, '-');
+    str = str.replace(/ \/ /g, '/');
+    str = str.replace(/ \* /g, '*');
+    str = str.replace(/ > /g, '>');
+    str = str.replace(/ < /g, '<');
+    str = str.replace(/ >= /g, '>=');
+    str = str.replace(/ <= /g, '<=');
+    str = str.replace(/ \+= /g, '+=');
+    str = str.replace(/ \-= /g, '-=');
+    str = str.replace(/ \/= /g, '/=');
+    str = str.replace(/ \*= /g, '*=');
+    str = str.replace(/ = /g, '=');
+    str = str.replace(/, /g, ',');
+    str = str.replace(/\n\n/g, '\n');
+    str = str.replace(/\n /g, '\n');
+    
+	for (var i = 0; i < str.length; i++) {
+		currentChar = str[i];
+		nextChar = str[i + 1];
+
+		if (!insideComment && currentChar === '"') {
+			var escaped = str[i - 1] === '\\' && str[i - 2] !== '\\';
+			if (!escaped) {
+				insideString = !insideString;
+			}
+		}
+
+		if (insideString) {
+			continue;
+		}
+
+		if (!insideComment && currentChar + nextChar === '//') {
+			ret += str.slice(offset, i);
+			offset = i;
+			insideComment = singleComment;
+			i++;
+		} else if (insideComment === singleComment && currentChar === '\n') {
+			insideComment = 0;
+			offset = i;
+		} else if (!insideComment && currentChar + nextChar === '/*') {
+			ret += str.slice(offset, i);
+			offset = i;
+			insideComment = multiComment;
+			i++;
+			continue;
+		} else if (insideComment === multiComment && currentChar + nextChar === '*/') {
+			i++;
+			insideComment = 0;
+			offset = i + 1;
+			continue;
+		}
+	}
+
+	return ret + (insideComment ? '' : str.substr(offset));
+}
+
+function gulpUncomment(options) {
+    return main(options, uncomment);
+}
+
+function main(options, func) {
+    return through.obj(function (file, enc, cb) {
+        if (file.isNull()) {
+            cb(null, file);
+            return;
+        }
+        if (file.isStream()) {
+            cb(new PluginError("Remove Shader Comments", "Streaming not supported."));
+        }
+        file.contents = new Buffer(func(file.contents.toString(), options));
+        this.push(file);
+        return cb();
+    });
+}
+
+module.exports = gulpUncomment;

+ 7 - 2
Tools/Gulp/gulpfile.js

@@ -11,6 +11,7 @@ var cleants = require('gulp-clean-ts-extends');
 var changed = require('gulp-changed');
 var runSequence = require('run-sequence');
 var replace = require("gulp-replace");
+var uncommentShader = require("./gulp-removeShaderComments");
 
 var config = require("./config.json");
 
@@ -33,7 +34,9 @@ function includeShadersName(filename) {
 
 gulp.task("includeShaders", function (cb) {
     includeShadersStream = config.includeShadersDirectories.map(function (shadersDef) {
-        return gulp.src(shadersDef.files).pipe(srcToVariable({
+        return gulp.src(shadersDef.files).
+            pipe(uncommentShader()).
+            pipe(srcToVariable({
             variableName: shadersDef.variable, asMap: true, namingCallback: includeShadersName
         }));
     });
@@ -42,7 +45,9 @@ gulp.task("includeShaders", function (cb) {
 
 gulp.task("shaders", ["includeShaders"], function (cb) {
     shadersStream = config.shadersDirectories.map(function (shadersDef) {
-        return gulp.src(shadersDef.files).pipe(srcToVariable({
+        return gulp.src(shadersDef.files).
+            pipe(uncommentShader()).
+            pipe(srcToVariable({
             variableName: shadersDef.variable, asMap: true, namingCallback: shadersName
         }));
     });

+ 0 - 6
Tools/NormalHeightMapTool/NormalHeightMapTool/App.config

@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<configuration>
-    <startup> 
-        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
-    </startup>
-</configuration>

+ 0 - 66
Tools/NormalHeightMapTool/NormalHeightMapTool/NormalHeightMapTool.csproj

@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProjectGuid>{2F997E8B-E471-4703-AD73-366BB48AB825}</ProjectGuid>
-    <OutputType>Exe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>NormalHeightMapTool</RootNamespace>
-    <AssemblyName>NormalHeightMapTool</AssemblyName>
-    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
-    <FileAlignment>512</FileAlignment>
-    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <PlatformTarget>AnyCPU</PlatformTarget>
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <PlatformTarget>AnyCPU</PlatformTarget>
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="ImageProcessor, Version=2.3.2.0, Culture=neutral, processorArchitecture=MSIL">
-      <HintPath>..\packages\ImageProcessor.2.3.2.0\lib\net45\ImageProcessor.dll</HintPath>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="System" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Drawing" />
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="System.Data.DataSetExtensions" />
-    <Reference Include="Microsoft.CSharp" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Net.Http" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Program.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="App.config" />
-    <None Include="packages.config" />
-  </ItemGroup>
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>

+ 0 - 276
Tools/NormalHeightMapTool/NormalHeightMapTool/Program.cs

@@ -1,276 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Drawing.Imaging;
-using System.IO;
-using System.Linq;
-using ImageProcessor;
-
-namespace NormalHeightMapTool
-{
-	class Program
-	{
-		private static List<Tuple<string, string>> _switches;
-
-		static void Main(string[] args)
-		{
-			// Display Help
-			if (args.Length == 0 || args.Any(a => string.Compare(a, "-h", StringComparison.InvariantCultureIgnoreCase) == 0))
-			{
-				DisplayUsage();
-				return;
-			}
-
-			// Construct a switch list, items1 of tuple is lowercast switch value without the dash, item2 is the value (if any)
-			if (BuildSwitches(args) == false)
-			{
-				DisplayUsage();
-				return;
-			}
-
-			// Check for pack operation
-			if (_switches[0].Item1 == "pack")
-			{
-				Pack();
-			}
-
-			// Check for invert operation
-			else if (_switches[0].Item1 == "invert")
-			{
-				Invert();
-			}
-
-			// Not either one of them, display usage and quit
-			else
-			{
-				DisplayUsage();
-				return;
-			}
-		}
-
-		private static bool BuildSwitches(string[] args)
-		{
-			_switches = new List<Tuple<string, string>>();
-			foreach (var a in args)
-			{
-				if (string.IsNullOrWhiteSpace(a) || a[0] != '-')
-				{
-					return false;
-				}
-
-				var sep = a.IndexOf(":", StringComparison.Ordinal);
-				if (sep == -1)
-				{
-					_switches.Add(new Tuple<string, string>(a.Substring(1).ToLowerInvariant(), null));
-				}
-				else
-				{
-					_switches.Add(new Tuple<string, string>(a.Substring(1, sep - 1).ToLowerInvariant(), a.Substring(sep + 1)));
-				}
-			}
-			return true;
-		}
-
-		private static void Invert()
-		{
-			var pfn = _switches[0].Item2;
-			if (File.Exists(pfn) == false)
-			{
-				Console.WriteLine("Can't find file: " + pfn + "\r\nSorry...");
-				return;
-			}
-
-			var saveSwitch = _switches.FirstOrDefault(s => s.Item1 == "save");
-			if (saveSwitch == null || string.IsNullOrWhiteSpace(saveSwitch.Item2))
-			{
-				Console.WriteLine("Must contain a -save:<targetfilepathname> to save the file.Sorry...");
-				return;
-			}
-
-			try
-			{
-				var invertR = _switches.Any(s => s.Item1=="r");
-				var invertG = _switches.Any(s => s.Item1=="g");
-
-				var fileData = File.ReadAllBytes(pfn);
-				using (var stream = new MemoryStream(fileData))
-				{
-					using (var factory = new ImageFactory())
-					{
-						factory.Load(stream);
-						var img = (Bitmap)factory.Image;
-						if (img == null)
-						{
-							Console.WriteLine("Unsupported file format or corrupted. Sorry...");
-							return;
-						}
-
-						Console.WriteLine("Working...");
-						for (int y = 0; y < img.Height; y++)
-						{
-							for (int x = 0; x < img.Width; x++)
-							{
-								var p = img.GetPixel(x, y);
-
-								var r = (invertR) ? (255 - p.R) : p.R;		// This is the invert operation on R
-								var g = (invertG) ? (255 - p.G) : p.G;		//  and G...
-								
-								var np = Color.FromArgb(p.A, r, g, p.B);
-
-								img.SetPixel(x, y, np);
-
-							}
-						}
-
-						Console.WriteLine("Saving to: " + saveSwitch.Item2);
-						var spfn = saveSwitch.Item2;
-						if (string.IsNullOrWhiteSpace(Path.GetDirectoryName(spfn)))
-						{
-							spfn = Path.Combine(Directory.GetCurrentDirectory(), spfn);
-						}
-						factory.Save(spfn);
-						Console.WriteLine("Job's done! Bye...");
-					}
-				}
-			}
-			catch (Exception ex)
-			{
-				Console.WriteLine("OOOOOOOPS\r\n\r\n" + ex.ToString());
-				return;
-			}
-		}
-
-		private static void Pack()
-		{
-			var nswitch = _switches.FirstOrDefault(s => s.Item1=="normalmap");
-			if (nswitch == null || string.IsNullOrWhiteSpace(nswitch.Item2) || File.Exists(nswitch.Item2) == false)
-			{
-				Console.WriteLine("You have to specify a valid file for -normalmap. Sorry...");
-				return;
-			}
-
-			var hswitch = _switches.FirstOrDefault(s => s.Item1=="heightmap");
-			if (hswitch == null || string.IsNullOrWhiteSpace(hswitch.Item2) || File.Exists(hswitch.Item2) == false)
-			{
-				Console.WriteLine("You have to specify a valid file for -heightmap. Sorry...");
-				return;
-			}
-
-			var saveSwitch = _switches.FirstOrDefault(s => s.Item1 == "save");
-			if (saveSwitch == null || string.IsNullOrWhiteSpace(saveSwitch.Item2))
-			{
-				Console.WriteLine("Must contain a -save:<targetfilepathname> to save the file.Sorry...");
-				return;
-			}
-
-			var cswitch = _switches.FirstOrDefault(s => s.Item1=="heightmapchannel");
-			var channel = "r";
-			if (cswitch != null)
-			{
-				channel = cswitch.Item2.ToLowerInvariant();
-				switch (channel)
-				{
-					case "a":
-					case "r":
-					case "g":
-					case "b":
-						break;
-					default:
-						Console.WriteLine("You didn't specify a valid channel, only A, R, G, B are valid. Sorry...");
-						return;
-				}
-			}
-
-			var normalFileData = File.ReadAllBytes(nswitch.Item2);
-			var heightFileData = File.ReadAllBytes(hswitch.Item2);
-
-			using (var normalStream = new MemoryStream(normalFileData))
-			using (var heightStream = new MemoryStream(heightFileData))
-			{
-				using (var normalFactory = new ImageFactory()) 
-				using (var heightFactory = new ImageFactory()) 
-				{
-					normalFactory.Load(normalStream);
-					heightFactory.Load(heightStream);
-
-					var normalImg = (Bitmap)normalFactory.Image;
-					var heightImg = (Bitmap)heightFactory.Image;
-
-					if (normalImg.PixelFormat != PixelFormat.Format32bppArgb && normalImg.PixelFormat != PixelFormat.Format32bppPArgb)
-					{
-						Console.WriteLine("The normalmap source file must be argb, sorry lazy me doesn't suport rgb only...");
-						return;
-					}
-
-					try
-					{
-						Console.WriteLine("Working...");
-						for (int y = 0; y < normalImg.Height; y++)
-						{
-							for (int x = 0; x < normalImg.Width; x++)
-							{
-								var normalPix = normalImg.GetPixel(x, y);
-								var heightPix = heightImg.GetPixel(x, y);
-
-								int alpha;
-								switch (channel)
-								{
-									case "a":
-										alpha = heightPix.A;
-										break;
-									case "r":
-										alpha = heightPix.R;
-										break;
-									case "g":
-										alpha = heightPix.G;
-										break;
-									case "b":
-										alpha = heightPix.B;
-										break;
-									default:
-										alpha = heightPix.R;
-										break;
-								}
-
-								var newPixel = Color.FromArgb(alpha<<24 | (normalPix.ToArgb()&0XFFFFFF));
-								normalImg.SetPixel(x, y, newPixel);
-							}
-						}
-						Console.WriteLine("Saving to: " + saveSwitch.Item2);
-
-						var spfn = saveSwitch.Item2;
-						if (string.IsNullOrWhiteSpace(Path.GetDirectoryName(spfn)))
-						{
-							spfn = Path.Combine(Directory.GetCurrentDirectory(), spfn);
-						}
-						normalFactory.Save(spfn);
-						Console.WriteLine("Job's done! Bye...");
-					}
-					catch (Exception ex)
-					{
-						Console.WriteLine("OOOOOOOPS\r\n\r\n" + ex.ToString());
-						return;
-					}
-				}
-			}
-		}
-
-		public static void DisplayUsage()
-		{
-				var helpMessage = 
-@"
-Normal/HeightMap Tool
-=====================
-
-Usage:
- To pack a normal map file and a height map file in one single file (height map will be stored in alpha channel and the value will be taken in the Red component of the source heightmap if -heightmapchannel is not specified):
- -pack -normalmap:<filepathname> -heightmap:<filepathname> [-heightmapchannel:R|G|B|A] -save:<targetfilepathname>
-
- To invert the R &| G component of a normal map:
- -invert:<normalmapfilepathname> [-R] [-G] -save:<targetfilepathname>
-
-";
-			Console.WriteLine(helpMessage);		
-		}
-	}
-}

+ 0 - 4
Tools/NormalHeightMapTool/NormalHeightMapTool/packages.config

@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
-  <package id="ImageProcessor" version="2.3.2.0" targetFramework="net452" />
-</packages>

+ 0 - 25
Tools/NormalHeightMapTool/ReadMe.md

@@ -1,25 +0,0 @@
-Normal/Height Map Tool
-======================
-
-This little command line tool is used to perform these tasks:
-
-- Pack two distinct normal map and height map files into a single one, store the height in the alpha channel.
-
-- Perform Color based invert on R and/or G channel of a normal map to reoriente the normal vector.
-
-You can find a single .exe file in the Redist folder, if you build the project beware that the ImageProcessor.dll must be merged or bring along with the exe.
-
-
-### Command line usage:
-```
- To pack a normal map file and a height map file in one single file (height map will be stored in alpha channel and the value will be taken in the Red component of the source heightmap if -heightmapchannel is not specified):
- -pack -normalmap:<filepathname> -heightmap:<filepathname> [-heightmapchannel:R|G|B|A] -save:<targetfilepathname>
-
- To invert the R &| G component of a normal map:
- -invert:<normalmapfilepathname> [-R] [-G] -save:<targetfilepathname>
-```
-
-### Acknowledgement
-This tool use the [ImageProcessor library](http://imageprocessor.org/)
-
-Exe+dll are merged thanks to [ILMerge-GUI](http://ilmergegui.codeplex.com//)

BIN
Tools/NormalHeightMapTool/Redist/NormalHeightMapTool.exe


+ 30 - 0
Web.Debug.config

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
+
+<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
+  <!--
+    In the example below, the "SetAttributes" transform will change the value of 
+    "connectionString" to use "ReleaseSQLServer" only when the "Match" locator 
+    finds an attribute "name" that has a value of "MyDB".
+    
+    <connectionStrings>
+      <add name="MyDB" 
+        connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True" 
+        xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
+    </connectionStrings>
+  -->
+  <system.web>
+    <!--
+      In the example below, the "Replace" transform will replace the entire 
+      <customErrors> section of your web.config file.
+      Note that because there is only one customErrors section under the 
+      <system.web> node, there is no need to use the "xdt:Locator" attribute.
+      
+      <customErrors defaultRedirect="GenericError.htm"
+        mode="RemoteOnly" xdt:Transform="Replace">
+        <error statusCode="500" redirect="InternalError.htm"/>
+      </customErrors>
+    -->
+  </system.web>
+</configuration>

+ 31 - 0
Web.Release.config

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
+
+<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
+  <!--
+    In the example below, the "SetAttributes" transform will change the value of 
+    "connectionString" to use "ReleaseSQLServer" only when the "Match" locator 
+    finds an attribute "name" that has a value of "MyDB".
+    
+    <connectionStrings>
+      <add name="MyDB" 
+        connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True" 
+        xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
+    </connectionStrings>
+  -->
+  <system.web>
+    <compilation xdt:Transform="RemoveAttributes(debug)" />
+    <!--
+      In the example below, the "Replace" transform will replace the entire 
+      <customErrors> section of your web.config file.
+      Note that because there is only one customErrors section under the 
+      <system.web> node, there is no need to use the "xdt:Locator" attribute.
+      
+      <customErrors defaultRedirect="GenericError.htm"
+        mode="RemoteOnly" xdt:Transform="Replace">
+        <error statusCode="500" redirect="InternalError.htm"/>
+      </customErrors>
+    -->
+  </system.web>
+</configuration>

+ 63 - 0
Web.config

@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  For more information on how to configure your ASP.NET application, please visit
+  http://go.microsoft.com/fwlink/?LinkId=169433
+  -->
+<configuration>
+	<system.webServer>
+		<caching enabled="false"/>
+		<staticContent>
+			<mimeMap fileExtension=".hdr" mimeType="application/hdr" />
+			<mimeMap fileExtension=".obj" mimeType="application/obj" />
+			<mimeMap fileExtension=".dds" mimeType="application/dds" />
+			<mimeMap fileExtension=".tga" mimeType="application/tga" />
+			<mimeMap fileExtension=".fx" mimeType="application/fx" />
+			<mimeMap fileExtension=".babylon" mimeType="application/babylon" />
+			<mimeMap fileExtension=".babylonmeshdata" mimeType="application/babylonmeshdata" />
+			<mimeMap fileExtension=".babylonbinarymeshdata" mimeType="application/babylonbinarymeshdata" />
+			<mimeMap fileExtension=".webp" mimeType="image/webp" />
+			<mimeMap fileExtension=".wdp" mimeType="image/vnd.ms-photo" />
+		</staticContent>
+		<httpCompression>
+			<dynamicTypes>
+				<clear />
+				<add enabled="true" mimeType="text/*"/>
+				<add enabled="true" mimeType="message/*"/>
+				<add enabled="true" mimeType="application/x-javascript"/>
+				<add enabled="true" mimeType="application/javascript"/>
+				<add enabled="true" mimeType="application/json"/>
+				<add enabled="true" mimeType="application/atom+xml"/>
+				<add enabled="true" mimeType="application/atom+xml;charset=utf-8"/>
+				<add enabled="true" mimeType="application/babylonmeshdata" />
+				<add enabled="true" mimeType="application/babylon"/>
+				<add enabled="false" mimeType="*/*"/>
+			</dynamicTypes>
+			<staticTypes>
+				<clear />
+				<add enabled="true" mimeType="text/*"/>
+				<add enabled="true" mimeType="message/*"/>
+				<add enabled="true" mimeType="application/javascript"/>
+				<add enabled="true" mimeType="application/atom+xml"/>
+				<add enabled="true" mimeType="application/xaml+xml"/>
+				<add enabled="true" mimeType="application/json"/>
+				<add enabled="true" mimeType="application/babylonmeshdata" />
+				<add enabled="true" mimeType="application/babylon"/>
+				<add enabled="false" mimeType="*/*"/>
+			</staticTypes>
+		</httpCompression>
+	</system.webServer>
+  <system.web>
+    <compilation debug="true" targetFramework="4.5.2"/>
+    <httpRuntime targetFramework="4.5.2"/>
+  </system.web>
+  <system.codedom>
+    <compilers>
+      <compiler language="c#;cs;csharp" extension=".cs"
+        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
+        warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>
+      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
+        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
+        warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
+    </compilers>
+  </system.codedom>
+</configuration>

BIN
assets/BrickWall.png


BIN
assets/brickwall_nh.png


BIN
assets/rock.png


BIN
assets/rock_nh.png


ファイルの差分が大きいため隠しています
+ 22 - 23
dist/preview release/babylon.core.js


ファイルの差分が大きいため隠しています
+ 915 - 759
dist/preview release/babylon.d.ts


ファイルの差分が大きいため隠しています
+ 29 - 29
dist/preview release/babylon.js


ファイルの差分が大きいため隠しています
+ 1887 - 416
dist/preview release/babylon.max.js


ファイルの差分が大きいため隠しています
+ 29 - 29
dist/preview release/babylon.noworker.js


+ 4 - 0
dist/preview release/what's new.md

@@ -6,7 +6,11 @@
     - new mesh type : `LineSystem` ([jerome](https://github.com/jbousquie))
     - SerializationHelper for complex classes using TypeScript decorators  ([deltakosh](https://github.com/deltakosh))
     - StandardMaterial now supports Parallax and Parallax Occlusion Mapping ([nockawa](https://github.com/nockawa))
+    - Animations blending. See [demo here](http://www.babylonjs-playground.com/#2BLI9T#3). More [info here](NEED DOC!) ([deltakosh](https://github.com/deltakosh))
+    - New debuger tool: SkeletonViewer. See [demo here](Demo available here: http://www.babylonjs-playground.com/#1BZJVJ#8) (Adam & [deltakosh](https://github.com/deltakosh))
   - **Updates**
+    - Support for Layer.alphaTest ([deltakosh](https://github.com/deltakosh))
+    - New scene.pointerDownPredicate, scene.pointerMovePredicate, scene.pointerUpPredicate to define your own predicates for meshes picking selection ([deltakosh](https://github.com/deltakosh))
     - New OnPickTrigger support for spritesManager ([deltakosh](https://github.com/deltakosh))
     - New SPS method `digest()` ([jerome](https://github.com/jbousquie))    
     - New SPS property `computeBoundingBox` ([jerome](https://github.com/jbousquie))  

+ 179 - 0
index.html

@@ -0,0 +1,179 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title></title>
+    <meta charset="utf-8" />
+
+    <script src="http://www.babylonjs.com/poly2tri.js"></script>
+    <script src="src/Math/babylon.math.js"></script>
+    <script src="src/Math/babylon.math.simd.js"></script>
+    <script src="src/Tools/babylon.decorators.js"></script>
+    <script src="src/Tools/babylon.database.js"></script>
+    <script src="src/Tools/babylon.tools.tga.js"></script>
+    <script src="src/Tools/babylon.tools.dds.js"></script>
+    <script src="src/Tools/babylon.smartCollection.js"></script>
+    <script src="src/Tools/babylon.smartArray.js"></script>
+    <script src="src/Tools/babylon.tools.js"></script>
+    <script src="src/states/babylon.alphaCullingState.js"></script>
+    <script src="src/states/babylon.depthCullingState.js"></script>
+    <script src="src/babylon.engine.js"></script>
+    <script src="src/babylon.node.js"></script>
+    <script src="src/Tools/babylon.filesInput.js"></script>
+    <script src="src/Collisions/babylon.pickingInfo.js"></script>
+    <script src="src/Culling/babylon.boundingSphere.js"></script>
+    <script src="src/Culling/babylon.boundingBox.js"></script>
+    <script src="src/Culling/babylon.boundingInfo.js"></script>
+    <script src="src/Mesh/babylon.abstractMesh.js"></script>
+    <script src="src/Lights/babylon.light.js"></script>
+    <script src="src/Lights/babylon.pointLight.js"></script>
+    <script src="src/Lights/babylon.spotLight.js"></script>
+    <script src="src/Lights/babylon.hemisphericLight.js"></script>
+    <script src="src/Lights/babylon.directionalLight.js"></script>
+    <script src="src/Lights/Shadows/babylon.shadowGenerator.js"></script>
+    <script src="src/Collisions/babylon.collider.js"></script>
+    <script src="src/Collisions/babylon.collisionCoordinator.js"></script>
+    <script src="src/Collisions/babylon.collisionWorker.js"></script>
+    <script src="src/Cameras/babylon.camera.js"></script>
+    <script src="src/Cameras/babylon.targetCamera.js"></script>
+    <script src="src/Cameras/babylon.followCamera.js"></script>
+    <script src="src/Cameras/babylon.freeCamera.js"></script>
+    <script src="src/Cameras/babylon.touchCamera.js"></script>
+    <script src="src/Cameras/babylon.arcRotateCamera.js"></script>
+    <script src="src/Cameras/babylon.universalCamera.js"></script>
+    <script src="src/Cameras/babylon.deviceOrientationCamera.js"></script>
+    <script src="src/Tools/babylon.gamepads.js"></script>
+    <script src="src/Cameras/babylon.gamepadCamera.js"></script>
+    <script src="src/Rendering/babylon.renderingManager.js"></script>
+    <script src="src/Rendering/babylon.renderingGroup.js"></script>
+    <script src="src/babylon.scene.js"></script>
+    <script src="src/Mesh/babylon.vertexBuffer.js"></script>
+    <script src="src/Mesh/babylon.instancedMesh.js"></script>
+    <script src="src/Mesh/babylon.mesh.js"></script>
+    <script src="src/Mesh/babylon.meshBuilder.js"></script>
+    <script src="src/Mesh/babylon.groundMesh.js"></script>
+    <script src="src/Mesh/babylon.subMesh.js"></script>
+    <script src="src/Materials/textures/babylon.baseTexture.js"></script>
+    <script src="src/Materials/textures/babylon.texture.js"></script>
+    <script src="src/Materials/textures/babylon.cubeTexture.js"></script>
+    <script src="src/Materials/textures/babylon.renderTargetTexture.js"></script>
+    <script src="src/Materials/textures/procedurals/babylon.proceduralTexture.js"></script>
+    <script src="src/Materials/textures/procedurals/babylon.standardProceduralTexture.js"></script>
+    <script src="src/Materials/textures/procedurals/babylon.customProceduralTexture.js"></script>
+    <script src="src/Materials/textures/babylon.mirrorTexture.js"></script>
+    <script src="src/Materials/textures/babylon.refractionTexture.js"></script>
+    <script src="src/Materials/textures/babylon.dynamicTexture.js"></script>
+    <script src="src/Materials/textures/babylon.videoTexture.js"></script>
+    <script src="src/Materials/babylon.effect.js"></script>
+    <script src="src/Materials/babylon.materialHelper.js"></script>
+    <script src="src/Materials/babylon.fresnelParameters.js"></script>
+    <script src="src/Materials/babylon.material.js"></script>
+    <script src="src/Materials/babylon.standardMaterial.js"></script>
+    <script src="src/Materials/babylon.multiMaterial.js"></script>
+    <script src="src/Loading/babylon.sceneLoader.js"></script>
+    <script src="src/Loading/Plugins/babylon.babylonFileLoader.js"></script>
+    <script src="src/Sprites/babylon.spriteManager.js"></script>
+    <script src="src/Sprites/babylon.sprite.js"></script>
+    <script src="src/Layer/babylon.layer.js"></script>
+    <script src="src/Particles/babylon.particle.js"></script>
+    <script src="src/Particles/babylon.particleSystem.js"></script>
+    <script src="src/Particles/babylon.solidParticle.js"></script>
+    <script src="src/Particles/babylon.solidParticleSystem.js"></script>
+    <script src="src/Animations/babylon.animation.js"></script>
+    <script src="src/Animations/babylon.animatable.js"></script>
+    <script src="src/Animations/babylon.easing.js"></script>
+    <script src="src/Culling/Octrees/babylon.octree.js"></script>
+    <script src="src/Culling/Octrees/babylon.octreeBlock.js"></script>
+    <script src="src/Bones/babylon.bone.js"></script>
+    <script src="src/Bones/babylon.skeleton.js"></script>
+    <script src="src/PostProcess/babylon.postProcess.js"></script>
+    <script src="src/PostProcess/babylon.postProcessManager.js"></script>
+    <script src="src/PostProcess/babylon.passPostProcess.js"></script>
+    <script src="src/PostProcess/babylon.blurPostProcess.js"></script>
+    <script src="src/PostProcess/babylon.refractionPostProcess.js"></script>
+    <script src="src/PostProcess/babylon.blackAndWhitePostProcess.js"></script>
+    <script src="src/PostProcess/babylon.convolutionPostProcess.js"></script>
+    <script src="src/PostProcess/babylon.filterPostProcess.js"></script>
+    <script src="src/PostProcess/babylon.fxaaPostProcess.js"></script>
+    <script src="src/LensFlare/babylon.lensFlare.js"></script>
+    <script src="src/LensFlare/babylon.lensFlareSystem.js"></script>
+    <script src="src/Physics/Plugins/babylon.cannonJSPlugin.js"></script>
+    <script src="src/Physics/Plugins/babylon.oimoJSPlugin.js"></script>
+    <script src="src/Physics/babylon.physicsImpostor.js"></script>
+    <script src="src/Physics/babylon.physicsEngine.js"></script>
+    <script src="src/Tools/babylon.sceneSerializer.js"></script>
+    <script src="src/Mesh/babylon.csg.js"></script>
+    <script src="src/PostProcess/babylon.vrDistortionCorrectionPostProcess.js"></script>
+    <script src="src/Tools/babylon.virtualJoystick.js"></script>
+    <script src="src/Cameras/babylon.virtualJoysticksCamera.js"></script>
+    <script src="src/Materials/babylon.shaderMaterial.js"></script>
+    <script src="src/Mesh/babylon.mesh.vertexData.js"></script>
+    <script src="src/PostProcess/babylon.anaglyphPostProcess.js"></script>
+    <script src="src/Tools/babylon.tags.js"></script>
+    <script src="src/Tools/babylon.andOrNotEvaluator.js"></script>
+    <script src="src/PostProcess/RenderPipeline/babylon.postProcessRenderPass.js"></script>
+    <script src="src/PostProcess/RenderPipeline/babylon.postProcessRenderEffect.js"></script>
+    <script src="src/PostProcess/RenderPipeline/babylon.postProcessRenderPipeline.js"></script>
+    <script src="src/PostProcess/RenderPipeline/babylon.postProcessRenderPipelineManager.js"></script>
+    <script src="src/PostProcess/babylon.displayPassPostProcess.js"></script>
+    <script src="src/Rendering/babylon.boundingBoxRenderer.js"></script>
+    <script src="src/Actions/babylon.condition.js"></script>
+    <script src="src/Actions/babylon.action.js"></script>
+    <script src="src/Actions/babylon.actionManager.js"></script>
+    <script src="src/Actions/babylon.interpolateValueAction.js"></script>
+    <script src="src/Actions/babylon.directActions.js"></script>
+    <script src="src/Mesh/babylon.geometry.js"></script>
+    <script src="src/Mesh/babylon.linesMesh.js"></script>
+    <script src="src/Rendering/babylon.outlineRenderer.js"></script>
+    <script src="src/Tools/babylon.assetsManager.js"></script>
+    <script src="src/Cameras/VR/babylon.vrCameraMetrics.js"></script>
+    <script src="src/Cameras/VR/babylon.vrDeviceOrientationCamera.js"></script>
+    <script src="src/Cameras/VR/babylon.webVRCamera.js"></script>
+    <script src="src/Tools/babylon.sceneOptimizer.js"></script>
+    <script src="src/Mesh/babylon.meshLODLevel.js"></script>
+    <script src="src/Audio/babylon.audioEngine.js"></script>
+    <script src="src/Audio/babylon.sound.js"></script>
+    <script src="src/Audio/babylon.soundtrack.js"></script>
+    <script src="src/Debug/babylon.debugLayer.js"></script>
+    <script src="src/Materials/Textures/babylon.rawTexture.js"></script>
+    <script src="src/Mesh/babylon.polygonMesh.js"></script>
+    <script src="src/Mesh/babylon.meshSimplification.js"></script>
+    <script src="src/Audio/babylon.analyser.js"></script>
+    <script src="src/Rendering/babylon.depthRenderer.js"></script>
+    <script src="src/PostProcess/babylon.ssaoRenderingPipeline.js"></script>
+    <script src="src/PostProcess/babylon.volumetricLightScatteringPostProcess.js"></script>
+    <script src="src/PostProcess/babylon.lensRenderingPipeline.js"></script>
+    <script src="src/PostProcess/babylon.colorCorrectionPostProcess.js"></script>
+    <script src="src/PostProcess/babylon.stereoscopicInterlacePostProcess.js"></script>
+    <script src="src/Cameras/babylon.stereoscopicCameras.js"></script>
+    <script src="src/PostProcess/babylon.hdrRenderingPipeline.js"></script>
+    <script src="src/Rendering/babylon.edgesRenderer.js"></script>
+    <script src="src/Tools/babylon.loadingScreen.js"></script>
+    <script src="src/Materials/babylon.pbrMaterial.js"></script>
+    <script src="src/Probes/babylon.reflectionProbe.js"></script>
+    <script src="src/tools/hdr/babylon.tools.pmremGenerator.js"></script>
+    <script src="src/tools/hdr/babylon.tools.cubemapToSphericalPolynomial.js"></script>
+    <script src="src/tools/hdr/babylon.tools.panoramaToCubemap.js"></script>
+    <script src="src/tools/hdr/babylon.tools.hdr.js"></script>
+    <script src="src/materials/textures/babylon.hdrCubeTexture.js"></script>
+</head>
+<body>
+    <canvas width="600" height="600" id="renderCanvas"></canvas>
+
+    <label>Relief technique</label>
+    <select id="effectList">
+        <option value="none">None</option>
+        <option value="bump">Bump</option>
+        <option value="parallax">Parallax</option>
+        <option value="POM">Parallax Occlusion</option>
+    </select>
+
+    <label id="scaleBiasLabel"></label>
+
+    <script src="http://code.jquery.com/jquery.js"></script>
+    <script src="typescript/MainClass.js"></script>
+
+    <script type="text/ecmascript">
+        var p = new Sandbox.MainClass();
+        p.start();
+    </script>
+</html>

ファイルの差分が大きいため隠しています
+ 2 - 2
materialsLibrary/dist/babylon.fireMaterial.js


ファイルの差分が大きいため隠しています
+ 1 - 1
materialsLibrary/dist/babylon.fireMaterial.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
materialsLibrary/dist/babylon.furMaterial.js


ファイルの差分が大きいため隠しています
+ 1 - 1
materialsLibrary/dist/babylon.furMaterial.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
materialsLibrary/dist/babylon.gradientMaterial.js


ファイルの差分が大きいため隠しています
+ 1 - 1
materialsLibrary/dist/babylon.gradientMaterial.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
materialsLibrary/dist/babylon.lavaMaterial.js


ファイルの差分が大きいため隠しています
+ 1 - 1
materialsLibrary/dist/babylon.lavaMaterial.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
materialsLibrary/dist/babylon.normalMaterial.js


ファイルの差分が大きいため隠しています
+ 1 - 1
materialsLibrary/dist/babylon.normalMaterial.min.js


ファイルの差分が大きいため隠しています
+ 45 - 8
materialsLibrary/dist/babylon.pbrMaterial.js


ファイルの差分が大きいため隠しています
+ 3 - 3
materialsLibrary/dist/babylon.pbrMaterial.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
materialsLibrary/dist/babylon.simpleMaterial.js


ファイルの差分が大きいため隠しています
+ 1 - 1
materialsLibrary/dist/babylon.simpleMaterial.min.js


ファイルの差分が大きいため隠しています
+ 29 - 10
materialsLibrary/dist/babylon.skyMaterial.js


ファイルの差分が大きいため隠しています
+ 1 - 1
materialsLibrary/dist/babylon.skyMaterial.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
materialsLibrary/dist/babylon.terrainMaterial.js


ファイルの差分が大きいため隠しています
+ 1 - 1
materialsLibrary/dist/babylon.terrainMaterial.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
materialsLibrary/dist/babylon.triPlanarMaterial.js


ファイルの差分が大きいため隠しています
+ 1 - 1
materialsLibrary/dist/babylon.triPlanarMaterial.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
materialsLibrary/dist/babylon.waterMaterial.js


ファイルの差分が大きいため隠しています
+ 1 - 1
materialsLibrary/dist/babylon.waterMaterial.min.js


+ 3 - 0
materialsLibrary/dist/dts/babylon.pbrMaterial.d.ts

@@ -58,6 +58,9 @@ declare module BABYLON {
         useScalarInLinearSpace: boolean;
         usePhysicalLightFalloff: boolean;
         useRadianceOverAlpha: boolean;
+        useParallax: boolean;
+        useParallaxOcclusion: boolean;
+        parallaxScaleBias: number;
         disableLighting: boolean;
         private _renderTargets;
         private _worldViewProjectionMatrix;

+ 3 - 1
materialsLibrary/dist/dts/babylon.skyMaterial.d.ts

@@ -9,7 +9,9 @@ declare module BABYLON {
         distance: number;
         inclination: number;
         azimuth: number;
-        private _sunPosition;
+        sunPosition: Vector3;
+        useSunPosition: boolean;
+        private _cameraPosition;
         private _renderId;
         private _defines;
         private _cachedDefines;

+ 97 - 0
materialsLibrary/gulp-removeShaderComments.js

@@ -0,0 +1,97 @@
+'use strict';
+
+var through = require('through2');
+var PluginError = require('gulp-util').PluginError;
+var singleComment = 1;
+var multiComment = 2;
+
+function uncomment(str, opts) {
+    opts = opts || {};
+
+	var currentChar;
+	var nextChar;
+	var insideString = false;
+	var insideComment = 0;
+	var offset = 0;
+	var ret = '';
+
+    str = str.replace(/\r\n/g, '\n');
+    str = str.replace(/[ \f\t\v]+/g, ' ');
+    str = str.replace(/^\s*\n/gm, '');
+    str = str.replace(/ \+ /g, '+');
+    str = str.replace(/ \- /g, '-');
+    str = str.replace(/ \/ /g, '/');
+    str = str.replace(/ \* /g, '*');
+    str = str.replace(/ > /g, '>');
+    str = str.replace(/ < /g, '<');
+    str = str.replace(/ >= /g, '>=');
+    str = str.replace(/ <= /g, '<=');
+    str = str.replace(/ \+= /g, '+=');
+    str = str.replace(/ \-= /g, '-=');
+    str = str.replace(/ \/= /g, '/=');
+    str = str.replace(/ \*= /g, '*=');
+    str = str.replace(/ = /g, '=');
+    str = str.replace(/, /g, ',');
+    str = str.replace(/\n\n/g, '\n');
+    str = str.replace(/\n /g, '\n');
+    
+	for (var i = 0; i < str.length; i++) {
+		currentChar = str[i];
+		nextChar = str[i + 1];
+
+		if (!insideComment && currentChar === '"') {
+			var escaped = str[i - 1] === '\\' && str[i - 2] !== '\\';
+			if (!escaped) {
+				insideString = !insideString;
+			}
+		}
+
+		if (insideString) {
+			continue;
+		}
+
+		if (!insideComment && currentChar + nextChar === '//') {
+			ret += str.slice(offset, i);
+			offset = i;
+			insideComment = singleComment;
+			i++;
+		} else if (insideComment === singleComment && currentChar === '\n') {
+			insideComment = 0;
+			offset = i;
+		} else if (!insideComment && currentChar + nextChar === '/*') {
+			ret += str.slice(offset, i);
+			offset = i;
+			insideComment = multiComment;
+			i++;
+			continue;
+		} else if (insideComment === multiComment && currentChar + nextChar === '*/') {
+			i++;
+			insideComment = 0;
+			offset = i + 1;
+			continue;
+		}
+	}
+
+	return ret + (insideComment ? '' : str.substr(offset));
+}
+
+function gulpUncomment(options) {
+    return main(options, uncomment);
+}
+
+function main(options, func) {
+    return through.obj(function (file, enc, cb) {
+        if (file.isNull()) {
+            cb(null, file);
+            return;
+        }
+        if (file.isStream()) {
+            cb(new PluginError("Remove Shader Comments", "Streaming not supported."));
+        }
+        file.contents = new Buffer(func(file.contents.toString(), options));
+        this.push(file);
+        return cb();
+    });
+}
+
+module.exports = gulpUncomment;

+ 4 - 1
materialsLibrary/gulpfile.js

@@ -8,6 +8,7 @@ var cleants = require('gulp-clean-ts-extends');
 var replace = require("gulp-replace");
 var webserver = require('gulp-webserver');
 var uglify = require("gulp-uglify");
+var uncommentShader = require("./gulp-removeShaderComments");
 
 var config = require("./config.json");
 var extendsSearchRegex = /var\s__extends[\s\S]+?\};/g;
@@ -52,7 +53,9 @@ gulp.task('default', ["copyReference"], function () {
                 .pipe(gulp.dest(config.build.dtsOutputDirectory));
         }
         
-        var shader = gulp.src(material.shaderFiles).pipe(srcToVariable("BABYLON.Effect.ShadersStore", true, shadersName));
+        var shader = gulp.src(material.shaderFiles)
+                .pipe(uncommentShader())
+                .pipe(srcToVariable("BABYLON.Effect.ShadersStore", true, shadersName));
 
         return merge2(js, shader)
             .pipe(cleants())

+ 10 - 9
materialsLibrary/materials/gradient/gradient.fragment.fx

@@ -23,10 +23,10 @@ varying vec4 vColor;
 
 // Lights
 
-#include<light0FragmentDeclaration>
-#include<light1FragmentDeclaration>
-#include<light2FragmentDeclaration>
-#include<light3FragmentDeclaration>
+#include<lightFragmentDeclaration>[0]
+#include<lightFragmentDeclaration>[1]
+#include<lightFragmentDeclaration>[2]
+#include<lightFragmentDeclaration>[3]
 
 
 #include<lightsFragmentFunctions>
@@ -79,13 +79,14 @@ void main(void) {
 
 	// Lighting
 	vec3 diffuseBase = vec3(0., 0., 0.);
+    lightingInfo info;
 	float shadow = 1.;
     float glossiness = 0.;
     
-#include<light0Fragment>
-#include<light1Fragment>
-#include<light2Fragment>
-#include<light3Fragment>
+#include<lightFragment>[0]
+#include<lightFragment>[1]
+#include<lightFragment>[2]
+#include<lightFragment>[3]
 
 #ifdef VERTEXALPHA
 	alpha *= vColor.a;
@@ -99,4 +100,4 @@ void main(void) {
 #include<fogFragment>
 
 	gl_FragColor = color;
-}
+}

+ 9 - 8
materialsLibrary/materials/lava/lava.fragment.fx

@@ -27,10 +27,10 @@ varying vec4 vColor;
 #endif
 
 // Lights
-#include<light0FragmentDeclaration>
-#include<light1FragmentDeclaration>
-#include<light2FragmentDeclaration>
-#include<light3FragmentDeclaration>
+#include<lightFragmentDeclaration>[0]
+#include<lightFragmentDeclaration>[1]
+#include<lightFragmentDeclaration>[2]
+#include<lightFragmentDeclaration>[3]
 
 
 #include<lightsFragmentFunctions>
@@ -121,13 +121,14 @@ void main(void) {
 
 	// Lighting
 	vec3 diffuseBase = vec3(0., 0., 0.);
+    lightingInfo info;
 	float shadow = 1.;
     float glossiness = 0.;
     
-#include<light0Fragment>
-#include<light1Fragment>
-#include<light2Fragment>
-#include<light3Fragment>
+#include<lightFragment>[0]
+#include<lightFragment>[1]
+#include<lightFragment>[2]
+#include<lightFragment>[3]
 
 
 #ifdef VERTEXALPHA

+ 9 - 8
materialsLibrary/materials/normal/normal.fragment.fx

@@ -16,10 +16,10 @@ varying vec4 vColor;
 #endif
 
 // Lights
-#include<light0FragmentDeclaration>
-#include<light1FragmentDeclaration>
-#include<light2FragmentDeclaration>
-#include<light3FragmentDeclaration>
+#include<lightFragmentDeclaration>[0]
+#include<lightFragmentDeclaration>[1]
+#include<lightFragmentDeclaration>[2]
+#include<lightFragmentDeclaration>[3]
 
 
 #include<lightsFragmentFunctions>
@@ -77,13 +77,14 @@ void main(void) {
 
 	// Lighting
 	vec3 diffuseBase = vec3(0., 0., 0.);
+    lightingInfo info;
 	float shadow = 1.;
     float glossiness = 0.;
     
-#include<light0Fragment>
-#include<light1Fragment>
-#include<light2Fragment>
-#include<light3Fragment>
+#include<lightFragment>[0]
+#include<lightFragment>[1]
+#include<lightFragment>[2]
+#include<lightFragment>[3]
 
 
 #ifdef VERTEXALPHA

+ 44 - 4
materialsLibrary/materials/pbr/babylon.pbrMaterial.ts

@@ -12,6 +12,8 @@ module BABYLON {
         public EMISSIVE = false;
         public REFLECTIVITY = false;
         public BUMP = false;
+        public PARALLAX = false;
+        public PARALLAXOCCLUSION = false;
         public SPECULAROVERALPHA = false;
         public CLIPPLANE = false;
         public ALPHATEST = false;
@@ -91,6 +93,8 @@ module BABYLON {
         public LODBASEDMICROSFURACE = false;
         public USEPHYSICALLIGHTFALLOFF = false;
         public RADIANCEOVERALPHA = false;
+        public USEPMREMREFLECTION = false;
+        public USEPMREMREFRACTION = false;
 
         constructor() {
             super();
@@ -266,6 +270,15 @@ module BABYLON {
         public useRadianceOverAlpha = true;
         
         @serialize()
+        public useParallax = false;
+
+        @serialize()
+        public useParallaxOcclusion = false;
+
+        @serialize()
+        public parallaxScaleBias = 0.05;
+        
+        @serialize()
         public disableLighting = false;
         
         private _renderTargets = new SmartArray<RenderTargetTexture>(16);
@@ -517,6 +530,10 @@ module BABYLON {
                             if (this.reflectionTexture instanceof HDRCubeTexture && (<HDRCubeTexture>this.reflectionTexture)) {
                                 this._defines.USESPHERICALFROMREFLECTIONMAP = true;
                                 needNormals = true;
+                                
+                                if ((<HDRCubeTexture>this.reflectionTexture).isPMREM) {
+                                    this._defines.USEPMREMREFLECTION = true;
+                                }
                             }
                         }
                     }
@@ -558,6 +575,13 @@ module BABYLON {
                     } else {
                         needUVs = true;
                         this._defines.BUMP = true;
+                        
+                        if (this.useParallax) {
+                            this._defines.PARALLAX = true;
+                            if (this.useParallaxOcclusion) {
+                                this._defines.PARALLAXOCCLUSION = true;
+                            }
+                        }
                     }
                 }
 
@@ -574,6 +598,10 @@ module BABYLON {
                         }
                         if (this.refractionTexture instanceof HDRCubeTexture) {
                             this._defines.REFRACTIONMAPINLINEARSPACE = true;
+                            
+                            if ((<HDRCubeTexture>this.refractionTexture).isPMREM) {
+                                this._defines.USEPMREMREFRACTION = true;
+                            }
                         }
                     }
                 }
@@ -712,6 +740,10 @@ module BABYLON {
                 if (this._defines.REFLECTION) {
                     fallbacks.addFallback(0, "REFLECTION");
                 }
+                
+                if (this._defines.REFRACTION) {
+                    fallbacks.addFallback(0, "REFRACTION");
+                }
 
                 if (this._defines.REFLECTIVITY) {
                     fallbacks.addFallback(0, "REFLECTIVITY");
@@ -720,6 +752,14 @@ module BABYLON {
                 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");
@@ -897,7 +937,7 @@ module BABYLON {
                     }
 
                     if (this.reflectionTexture && StandardMaterial.ReflectionTextureEnabled) {
-                        this._microsurfaceTextureLods.x = Math.log(this.reflectionTexture.getSize().width) * Math.LOG2E;
+                        this._microsurfaceTextureLods.x = Math.round(Math.log(this.reflectionTexture.getSize().width) * Math.LOG2E);
                         
                         if (this.reflectionTexture.isCube) {
                             this._effect.setTexture("reflectionCubeSampler", this.reflectionTexture);
@@ -963,12 +1003,12 @@ module BABYLON {
                     if (this.bumpTexture && this._myScene.getEngine().getCaps().standardDerivatives && StandardMaterial.BumpTextureEnabled && !this.disableBumpMap) {
                         this._effect.setTexture("bumpSampler", this.bumpTexture);
 
-                        this._effect.setFloat2("vBumpInfos", this.bumpTexture.coordinatesIndex, 1.0 / this.bumpTexture.level);
+                        this._effect.setFloat3("vBumpInfos", this.bumpTexture.coordinatesIndex, 1.0 / this.bumpTexture.level, this.parallaxScaleBias);
                         this._effect.setMatrix("bumpMatrix", this.bumpTexture.getTextureMatrix());
                     }
 
                     if (this.refractionTexture && StandardMaterial.RefractionTextureEnabled) {
-                        this._microsurfaceTextureLods.y = Math.log(this.refractionTexture.getSize().width) * Math.LOG2E;
+                        this._microsurfaceTextureLods.y = Math.round(Math.log(this.refractionTexture.getSize().width) * Math.LOG2E);
                         
                         var depth = 1.0;
                         if (this.refractionTexture.isCube) {
@@ -984,7 +1024,7 @@ module BABYLON {
                         this._effect.setFloat4("vRefractionInfos", this.refractionTexture.level, this.indexOfRefraction, depth, this.invertRefractionY ? -1 : 1);
                     }
                     
-                    if ((this.reflectionTexture || this.refractionTexture) && this._myScene.getEngine().getCaps().textureLOD) {
+                    if ((this.reflectionTexture || this.refractionTexture)) {
                         this._effect.setFloat2("vMicrosurfaceTextureLods", this._microsurfaceTextureLods.x, this._microsurfaceTextureLods.y);
                     }
                 }

+ 4 - 4
materialsLibrary/materials/pbr/legacypbr.fragment.fx

@@ -189,10 +189,10 @@ varying vec4 vColor;
 #endif
 
 // Lights
-#include<light0FragmentDeclaration>
-#include<light1FragmentDeclaration>
-#include<light2FragmentDeclaration>
-#include<light3FragmentDeclaration>
+#include<lightFragmentDeclaration>[0]
+#include<lightFragmentDeclaration>[1]
+#include<lightFragmentDeclaration>[2]
+#include<lightFragmentDeclaration>[3]
 
 // Samplers
 #ifdef ALBEDO

+ 60 - 20
materialsLibrary/materials/pbr/pbr.fragment.fx

@@ -72,7 +72,7 @@ uniform vec4 vCameraInfos;
     }
 #endif
 
-#ifdef LODBASEDMICROSFURACE
+#if defined(REFLECTION) || defined(REFRACTION)
     uniform vec2 vMicrosurfaceTextureLods;
 #endif
 
@@ -172,6 +172,14 @@ float getMipMapIndexFromAverageSlope(float maxMipLevel, float alpha)
     return clamp(mip, 0., maxMipLevel);
 }
 
+float getMipMapIndexFromAverageSlopeWithPMREM(float maxMipLevel, float alphaG)
+{
+    float specularPower = clamp(2. / alphaG - 2., 0.000001, 2048.);
+    
+    // Based on CubeMapGen for cosine power with 2048 spec default and 0.25 dropoff 
+    return clamp(- 0.5 * log2(specularPower) + 5.5, 0., maxMipLevel);
+}
+
 // From Microfacet Models for Refraction through Rough Surfaces, Walter et al. 2007
 float smithVisibilityG1_TrowbridgeReitzGGX(float dot, float alphaG)
 {
@@ -335,10 +343,10 @@ varying vec4 vColor;
 #endif
 
 // Lights
-#include<light0FragmentDeclaration>
-#include<light1FragmentDeclaration>
-#include<light2FragmentDeclaration>
-#include<light3FragmentDeclaration>
+#include<lightFragmentDeclaration>[0]
+#include<lightFragmentDeclaration>[1]
+#include<lightFragmentDeclaration>[2]
+#include<lightFragmentDeclaration>[3]
 
 // Samplers
 #ifdef ALBEDO
@@ -794,12 +802,8 @@ void main(void) {
     #else
         vec3 normalW = vec3(1.0, 1.0, 1.0);
     #endif
-
-
-    #ifdef BUMP
-		mat3 TBN = cotangent_frame(vNormalW * vBumpInfos.y, -viewDirectionW, vBumpUV);
-		normalW = perturbNormal(viewDirectionW, TBN, vBumpUV);
-    #endif
+    
+    #include<bumpFragment>
 
     // Ambient color
     vec3 ambientColor = vec3(1., 1., 1.);
@@ -1074,15 +1078,19 @@ vec3 surfaceRefractionColor = vec3(0., 0., 0.);
 // Go mat -> blurry reflexion according to microSurface
 #ifdef LODBASEDMICROSFURACE
     float alphaG = convertRoughnessToAverageSlope(roughness);
-#else
-    float bias = 20. * (1.0 - microSurface);
 #endif
         
 #ifdef REFRACTION
-	vec3 refractionVector = normalize(refract(-viewDirectionW, normalW, vRefractionInfos.y));
+	vec3 refractionVector = refract(-viewDirectionW, normalW, vRefractionInfos.y);
     
     #ifdef LODBASEDMICROSFURACE
-        float lodRefraction = getMipMapIndexFromAverageSlope(vMicrosurfaceTextureLods.y, alphaG);
+        #ifdef USEPMREMREFRACTION
+            float lodRefraction = getMipMapIndexFromAverageSlopeWithPMREM(vMicrosurfaceTextureLods.y, alphaG);
+        #else
+            float lodRefraction = getMipMapIndexFromAverageSlope(vMicrosurfaceTextureLods.y, alphaG);
+        #endif
+    #else
+        float biasRefraction = (vMicrosurfaceTextureLods.y + 2.) * (1.0 - microSurface);
     #endif
     
     #ifdef REFRACTIONMAP_3D
@@ -1091,9 +1099,22 @@ vec3 surfaceRefractionColor = vec3(0., 0., 0.);
         if (dot(refractionVector, viewDirectionW) < 1.0)
         {
             #ifdef LODBASEDMICROSFURACE
+                #ifdef USEPMREMREFRACTION
+                    // Empiric Threshold
+                    if (microSurface > 0.5)
+                    {
+                        // Bend to not reach edges.
+                        float scaleRefraction = 1. - exp2(lodRefraction) / exp2(vMicrosurfaceTextureLods.y); // CubemapSize is the size of the base mipmap
+                        float maxRefraction = max(max(abs(refractionVector.x), abs(refractionVector.y)), abs(refractionVector.z));
+                        if (abs(refractionVector.x) != maxRefraction) refractionVector.x *= scaleRefraction;
+                        if (abs(refractionVector.y) != maxRefraction) refractionVector.y *= scaleRefraction;
+                        if (abs(refractionVector.z) != maxRefraction) refractionVector.z *= scaleRefraction;
+                    }
+                #endif
+                
                 surfaceRefractionColor = textureCubeLodEXT(refractionCubeSampler, refractionVector, lodRefraction).rgb * vRefractionInfos.x;
             #else
-                surfaceRefractionColor = textureCube(refractionCubeSampler, refractionVector, bias).rgb * vRefractionInfos.x;
+                surfaceRefractionColor = textureCube(refractionCubeSampler, refractionVector, biasRefraction).rgb * vRefractionInfos.x;
             #endif
         }
         
@@ -1110,7 +1131,7 @@ vec3 surfaceRefractionColor = vec3(0., 0., 0.);
         #ifdef LODBASEDMICROSFURACE
             surfaceRefractionColor = texture2DLodEXT(refraction2DSampler, refractionCoords, lodRefraction).rgb * vRefractionInfos.x;
         #else
-            surfaceRefractionColor = texture2D(refraction2DSampler, refractionCoords, bias).rgb * vRefractionInfos.x;
+            surfaceRefractionColor = texture2D(refraction2DSampler, refractionCoords, biasRefraction).rgb * vRefractionInfos.x;
         #endif    
         
         surfaceRefractionColor = toLinearSpace(surfaceRefractionColor.rgb); 
@@ -1125,15 +1146,34 @@ vec3 environmentIrradiance = vReflectionColor.rgb;
     vec3 vReflectionUVW = computeReflectionCoords(vec4(vPositionW, 1.0), normalW);
 
     #ifdef LODBASEDMICROSFURACE
-        float lodReflection = getMipMapIndexFromAverageSlope(vMicrosurfaceTextureLods.x, alphaG);
+        #ifdef USEPMREMREFLECTION
+            float lodReflection = getMipMapIndexFromAverageSlopeWithPMREM(vMicrosurfaceTextureLods.x, alphaG);
+        #else
+            float lodReflection = getMipMapIndexFromAverageSlope(vMicrosurfaceTextureLods.x, alphaG);
+        #endif
+    #else
+        float biasReflection = (vMicrosurfaceTextureLods.x + 2.) * (1.0 - microSurface);
     #endif
     
     #ifdef REFLECTIONMAP_3D
         
         #ifdef LODBASEDMICROSFURACE
+            #ifdef USEPMREMREFLECTION
+                // Empiric Threshold
+                if (microSurface > 0.5)
+                {
+                    // Bend to not reach edges.
+                    float scaleReflection = 1. - exp2(lodReflection) / exp2(vMicrosurfaceTextureLods.x); // CubemapSize is the size of the base mipmap
+                    float maxReflection = max(max(abs(vReflectionUVW.x), abs(vReflectionUVW.y)), abs(vReflectionUVW.z));
+                    if (abs(vReflectionUVW.x) != maxReflection) vReflectionUVW.x *= scaleReflection;
+                    if (abs(vReflectionUVW.y) != maxReflection) vReflectionUVW.y *= scaleReflection;
+                    if (abs(vReflectionUVW.z) != maxReflection) vReflectionUVW.z *= scaleReflection;
+                }
+            #endif
+                
             environmentRadiance = textureCubeLodEXT(reflectionCubeSampler, vReflectionUVW, lodReflection).rgb * vReflectionInfos.x;
         #else
-            environmentRadiance = textureCube(reflectionCubeSampler, vReflectionUVW, bias).rgb * vReflectionInfos.x;
+            environmentRadiance = textureCube(reflectionCubeSampler, vReflectionUVW, biasReflection).rgb * vReflectionInfos.x;
         #endif
         
         #ifdef PoissonSamplingEnvironment
@@ -1163,7 +1203,7 @@ vec3 environmentIrradiance = vReflectionColor.rgb;
         #ifdef LODBASEDMICROSFURACE
             environmentRadiance = texture2DLodEXT(reflection2DSampler, coords, lodReflection).rgb * vReflectionInfos.x;
         #else
-            environmentRadiance = texture2D(reflection2DSampler, coords, bias).rgb * vReflectionInfos.x;
+            environmentRadiance = texture2D(reflection2DSampler, coords, biasReflection).rgb * vReflectionInfos.x;
         #endif
     
         environmentRadiance = toLinearSpace(environmentRadiance.rgb);

+ 9 - 8
materialsLibrary/materials/simple/simple.fragment.fx

@@ -16,10 +16,10 @@ varying vec4 vColor;
 #endif
 
 // Lights
-#include<light0FragmentDeclaration>
-#include<light1FragmentDeclaration>
-#include<light2FragmentDeclaration>
-#include<light3FragmentDeclaration>
+#include<lightFragmentDeclaration>[0]
+#include<lightFragmentDeclaration>[1]
+#include<lightFragmentDeclaration>[2]
+#include<lightFragmentDeclaration>[3]
 
 
 #include<lightsFragmentFunctions>
@@ -73,13 +73,14 @@ void main(void) {
 
 	// Lighting
 	vec3 diffuseBase = vec3(0., 0., 0.);
+    lightingInfo info;
 	float shadow = 1.;
     float glossiness = 0.;
     
-#include<light0Fragment>
-#include<light1Fragment>
-#include<light2Fragment>
-#include<light3Fragment>
+#include<lightFragment>[0]
+#include<lightFragment>[1]
+#include<lightFragment>[2]
+#include<lightFragment>[3]
 
 
 #ifdef VERTEXALPHA

+ 27 - 9
materialsLibrary/materials/sky/babylon.skyMaterial.ts

@@ -40,8 +40,14 @@ module BABYLON {
         @serialize()
         public azimuth: number = 0.25;
         
+        @serializeAsVector3()
+        public sunPosition: Vector3 = new Vector3(0, 100, 0);
+        
+        @serialize()
+        public useSunPosition: boolean = false;
+        
         // Private members
-        private _sunPosition: Vector3 = Vector3.Zero();
+        private _cameraPosition: Vector3 = Vector3.Zero();
         
         private _renderId: number;
         
@@ -150,7 +156,8 @@ module BABYLON {
                     attribs,
                     ["world", "viewProjection", "view",
                         "vFogInfos", "vFogColor", "pointSize", "vClipPlane",
-                        "luminance", "turbidity", "rayleigh", "mieCoefficient", "mieDirectionalG", "sunPosition"
+                        "luminance", "turbidity", "rayleigh", "mieCoefficient", "mieDirectionalG", "sunPosition",
+                        "cameraPosition"
                     ],
                     [],
                     join, fallbacks, this.onCompiled, this.onError);
@@ -207,20 +214,31 @@ module BABYLON {
             MaterialHelper.BindFogParameters(scene, mesh, this._effect);
             
             // Sky
+            var camera = scene.activeCamera;
+            if (camera) {
+                var cameraWorldMatrix = camera.getWorldMatrix();
+                this._cameraPosition.x = cameraWorldMatrix.m[12];
+                this._cameraPosition.y = cameraWorldMatrix.m[13];
+                this._cameraPosition.z = cameraWorldMatrix.m[14];
+                this._effect.setVector3("cameraPosition", this._cameraPosition);
+            }
+            
             this._effect.setFloat("luminance", this.luminance);
 			this._effect.setFloat("turbidity", this.turbidity);
 			this._effect.setFloat("rayleigh", this.rayleigh);
 			this._effect.setFloat("mieCoefficient", this.mieCoefficient);
 			this._effect.setFloat("mieDirectionalG", this.mieDirectionalG);
             
-            var theta = Math.PI * (this.inclination - 0.5);
-			var phi = 2 * Math.PI * (this.azimuth - 0.5);
-            
-            this._sunPosition.x = this.distance * Math.cos( phi );
-			this._sunPosition.y = this.distance * Math.sin( phi ) * Math.sin( theta );
-			this._sunPosition.z = this.distance * Math.sin( phi ) * Math.cos( theta );
+            if (!this.useSunPosition) {
+                var theta = Math.PI * (this.inclination - 0.5);
+                var phi = 2 * Math.PI * (this.azimuth - 0.5);
+                
+                this.sunPosition.x = this.distance * Math.cos(phi);
+                this.sunPosition.y = this.distance * Math.sin(phi) * Math.sin(theta);
+                this.sunPosition.z = this.distance * Math.sin(phi) * Math.cos(theta);
+            }
             
-			this._effect.setVector3("sunPosition", this._sunPosition);
+			this._effect.setVector3("sunPosition", this.sunPosition);
 
             super.bind(world, mesh);
         }

+ 4 - 4
materialsLibrary/materials/sky/sky.fragment.fx

@@ -10,6 +10,7 @@ varying vec4 vColor;
 #include<clipPlaneFragmentDeclaration>
 
 // Sky
+uniform vec3 cameraPosition;
 uniform float luminance;
 uniform float turbidity;
 uniform float rayleigh;
@@ -95,18 +96,17 @@ void main(void) {
 	* Sky Color
 	*--------------------------------------------------------------------------------------------------
 	*/
-	const vec3 cameraPos = vec3(0.0, 0.0, 0.0);
 	float sunfade = 1.0 - clamp(1.0 - exp((sunPosition.y / 450000.0)), 0.0, 1.0);
 	float rayleighCoefficient = rayleigh - (1.0 * (1.0 - sunfade));
 	vec3 sunDirection = normalize(sunPosition);
 	float sunE = sunIntensity(dot(sunDirection, up));
 	vec3 betaR = simplifiedRayleigh() * rayleighCoefficient;
 	vec3 betaM = totalMie(lambda, K, turbidity) * mieCoefficient;
-	float zenithAngle = acos(max(0.0, dot(up, normalize(vPositionW - cameraPos))));
+	float zenithAngle = acos(max(0.0, dot(up, normalize(vPositionW - cameraPosition))));
 	float sR = rayleighZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));
 	float sM = mieZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));
 	vec3 Fex = exp(-(betaR * sR + betaM * sM));
-	float cosTheta = dot(normalize(vPositionW - cameraPos), sunDirection);
+	float cosTheta = dot(normalize(vPositionW - cameraPosition), sunDirection);
 	float rPhase = rayleighPhase(cosTheta*0.5+0.5);
 	vec3 betaRTheta = betaR * rPhase;
 	float mPhase = hgPhase(cosTheta, mieDirectionalG);
@@ -115,7 +115,7 @@ void main(void) {
 	vec3 Lin = pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * (1.0 - Fex),vec3(1.5));
 	Lin *= mix(vec3(1.0), pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * Fex, vec3(1.0 / 2.0)), clamp(pow(1.0-dot(up, sunDirection), 5.0), 0.0, 1.0));
 
-	vec3 direction = normalize(vPositionW - cameraPos);
+	vec3 direction = normalize(vPositionW - cameraPosition);
 	float theta = acos(direction.y);
 	float phi = atan(direction.z, direction.x);
 	vec2 uv = vec2(phi, theta) / vec2(2.0 * pi, pi) + vec2(0.5, 0.0);

+ 3 - 0
materialsLibrary/test/add/addpbr.js

@@ -6,6 +6,9 @@ window.preparePBR = function() {
 	pbr.albedoTexture.vScale = 5;
     
     var hdrTexture = new BABYLON.HDRCubeTexture("textures/hdr/environment.hdr", scene, 512);
+    
+    // Uncomment for PMREM Generation
+    // var hdrTexture = new BABYLON.HDRCubeTexture("textures/hdr/environment.hdr", scene, 128, false, true, false, true);
     pbr.reflectionTexture = hdrTexture;
     pbr.refractionTexture = hdrTexture;
     pbr.linkRefractionWithTransparency = true;

ファイルの差分が大きいため隠しています
+ 2683 - 1084
materialsLibrary/test/refs/babylon.max.js


+ 5 - 0
packages.config

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="1.0.0" targetFramework="net452" />
+  <package id="Microsoft.Net.Compilers" version="1.0.0" targetFramework="net452" developmentDependency="true" />
+</packages>

+ 17 - 0
src/Animations/babylon.animatable.js

@@ -49,6 +49,19 @@ var BABYLON;
             this._localDelayOffset = null;
             this._pausedDelay = null;
         };
+        Animatable.prototype.enableBlending = function (blendingSpeed) {
+            var animations = this._animations;
+            for (var index = 0; index < animations.length; index++) {
+                animations[index].enableBlending = true;
+                animations[index].blendingSpeed = blendingSpeed;
+            }
+        };
+        Animatable.prototype.disableBlending = function () {
+            var animations = this._animations;
+            for (var index = 0; index < animations.length; index++) {
+                animations[index].enableBlending = false;
+            }
+        };
         Animatable.prototype.goToFrame = function (frame) {
             var animations = this._animations;
             for (var index = 0; index < animations.length; index++) {
@@ -68,6 +81,10 @@ var BABYLON;
             var index = this._scene._activeAnimatables.indexOf(this);
             if (index > -1) {
                 this._scene._activeAnimatables.splice(index, 1);
+                var animations = this._animations;
+                for (var index = 0; index < animations.length; index++) {
+                    animations[index].reset();
+                }
                 if (this.onAnimationEnd) {
                     this.onAnimationEnd();
                 }

+ 21 - 0
src/Animations/babylon.animatable.ts

@@ -52,7 +52,23 @@
 
             this._localDelayOffset = null;
             this._pausedDelay = null;
+        }
+
+        public enableBlending(blendingSpeed: number): void {
+            var animations = this._animations;
 
+            for (var index = 0; index < animations.length; index++) {
+                animations[index].enableBlending = true;
+                animations[index].blendingSpeed = blendingSpeed;
+            }
+        }
+
+        public disableBlending(): void {
+            var animations = this._animations;
+
+            for (var index = 0; index < animations.length; index++) {
+                animations[index].enableBlending = false;
+            }
         }
 
         public goToFrame(frame: number): void {
@@ -80,6 +96,11 @@
             if (index > -1) {
                 this._scene._activeAnimatables.splice(index, 1);
 
+                var animations = this._animations;
+                for (var index = 0; index < animations.length; index++) {
+                    animations[index].reset();
+                }
+
                 if (this.onAnimationEnd) {
                     this.onAnimationEnd();
                 }

+ 94 - 5
src/Animations/babylon.animation.js

@@ -22,19 +22,79 @@ var BABYLON;
         return AnimationEvent;
     })();
     BABYLON.AnimationEvent = AnimationEvent;
+    var PathCursor = (function () {
+        function PathCursor(path) {
+            this.path = path;
+            this._onchange = new Array();
+            this.value = 0;
+            this.animations = new Array();
+        }
+        PathCursor.prototype.getPoint = function () {
+            var point = this.path.getPointAtLengthPosition(this.value);
+            return new BABYLON.Vector3(point.x, 0, point.y);
+        };
+        PathCursor.prototype.moveAhead = function (step) {
+            if (step === void 0) { step = 0.002; }
+            this.move(step);
+            return this;
+        };
+        PathCursor.prototype.moveBack = function (step) {
+            if (step === void 0) { step = 0.002; }
+            this.move(-step);
+            return this;
+        };
+        PathCursor.prototype.move = function (step) {
+            if (Math.abs(step) > 1) {
+                throw "step size should be less than 1.";
+            }
+            this.value += step;
+            this.ensureLimits();
+            this.raiseOnChange();
+            return this;
+        };
+        PathCursor.prototype.ensureLimits = function () {
+            while (this.value > 1) {
+                this.value -= 1;
+            }
+            while (this.value < 0) {
+                this.value += 1;
+            }
+            return this;
+        };
+        // used by animation engine
+        PathCursor.prototype.markAsDirty = function (propertyName) {
+            this.ensureLimits();
+            this.raiseOnChange();
+            return this;
+        };
+        PathCursor.prototype.raiseOnChange = function () {
+            var _this = this;
+            this._onchange.forEach(function (f) { return f(_this); });
+            return this;
+        };
+        PathCursor.prototype.onchange = function (f) {
+            this._onchange.push(f);
+            return this;
+        };
+        return PathCursor;
+    })();
+    BABYLON.PathCursor = PathCursor;
     var Animation = (function () {
-        function Animation(name, targetProperty, framePerSecond, dataType, loopMode) {
+        function Animation(name, targetProperty, framePerSecond, dataType, loopMode, enableBlending) {
             this.name = name;
             this.targetProperty = targetProperty;
             this.framePerSecond = framePerSecond;
             this.dataType = dataType;
             this.loopMode = loopMode;
+            this.enableBlending = enableBlending;
             this._offsetsCache = {};
             this._highLimitsCache = {};
             this._stopped = false;
+            this._blendingFactor = 0;
             // The set of event that will be linked to this animation
             this._events = new Array();
             this.allowMatricesInterpolation = false;
+            this.blendingSpeed = 0.01;
             this._ranges = {};
             this.targetPropertyPath = targetProperty.split(".");
             this.dataType = dataType;
@@ -127,6 +187,8 @@ var BABYLON;
             this._offsetsCache = {};
             this._highLimitsCache = {};
             this.currentFrame = 0;
+            this._blendingFactor = 0;
+            this._originalBlendValue = null;
         };
         Animation.prototype.isStopped = function () {
             return this._stopped;
@@ -277,17 +339,43 @@ var BABYLON;
             }
             return this._getKeyValue(this._keys[this._keys.length - 1].value);
         };
-        Animation.prototype.setValue = function (currentValue) {
+        Animation.prototype.setValue = function (currentValue, blend) {
+            if (blend === void 0) { blend = false; }
             // Set value
+            var path;
+            var destination;
             if (this.targetPropertyPath.length > 1) {
                 var property = this._target[this.targetPropertyPath[0]];
                 for (var index = 1; index < this.targetPropertyPath.length - 1; index++) {
                     property = property[this.targetPropertyPath[index]];
                 }
-                property[this.targetPropertyPath[this.targetPropertyPath.length - 1]] = currentValue;
+                path = this.targetPropertyPath[this.targetPropertyPath.length - 1];
+                destination = property;
+            }
+            else {
+                path = this.targetPropertyPath[0];
+                destination = this._target;
+            }
+            // Blending
+            if (this.enableBlending && this._blendingFactor <= 1.0) {
+                if (!this._originalBlendValue) {
+                    this._originalBlendValue = destination[path];
+                }
+                if (this._originalBlendValue.prototype) {
+                    if (this._originalBlendValue.prototype.Lerp) {
+                        destination[path] = this._originalBlendValue.prototype.Lerp(currentValue, this._originalBlendValue, this._blendingFactor);
+                    }
+                    else {
+                        destination[path] = currentValue;
+                    }
+                }
+                else {
+                    destination[path] = this._originalBlendValue * (1.0 - this._blendingFactor) + this._blendingFactor * currentValue;
+                }
+                this._blendingFactor += this.blendingSpeed;
             }
             else {
-                this._target[this.targetPropertyPath[0]] = currentValue;
+                destination[path] = currentValue;
             }
             if (this._target.markAsDirty) {
                 this._target.markAsDirty(this.targetProperty);
@@ -303,7 +391,8 @@ var BABYLON;
             var currentValue = this._interpolate(frame, 0, this.loopMode);
             this.setValue(currentValue);
         };
-        Animation.prototype.animate = function (delay, from, to, loop, speedRatio) {
+        Animation.prototype.animate = function (delay, from, to, loop, speedRatio, blend) {
+            if (blend === void 0) { blend = false; }
             if (!this.targetPropertyPath || this.targetPropertyPath.length < 1) {
                 this._stopped = true;
                 return false;

+ 109 - 6
src/Animations/babylon.animation.ts

@@ -13,12 +13,84 @@
         }
     }
 
+    export class PathCursor {
+        private _onchange = new Array<(cursor: PathCursor) => void>();
+
+        value: number = 0;
+        animations = new Array<Animation>();
+
+        constructor(private path: Path2) {
+        }
+
+        public getPoint(): Vector3 {
+            var point = this.path.getPointAtLengthPosition(this.value);
+            return new Vector3(point.x, 0, point.y);
+        }
+
+        public moveAhead(step: number = 0.002): PathCursor {
+            this.move(step);
+
+            return this;
+        }
+
+        public moveBack(step: number = 0.002): PathCursor {
+            this.move(-step);
+
+            return this;
+        }
+
+        public move(step: number): PathCursor {
+
+            if (Math.abs(step) > 1) {
+                throw "step size should be less than 1.";
+            }
+
+            this.value += step;
+            this.ensureLimits();
+            this.raiseOnChange();
+
+            return this;
+        }
+
+        private ensureLimits(): PathCursor {
+            while (this.value > 1) {
+                this.value -= 1;
+            }
+            while (this.value < 0) {
+                this.value += 1;
+            }
+
+            return this;
+        }
+
+        // used by animation engine
+        private markAsDirty(propertyName: string): PathCursor {
+            this.ensureLimits();
+            this.raiseOnChange();
+
+            return this;
+        }
+
+        private raiseOnChange(): PathCursor {
+            this._onchange.forEach(f => f(this));
+
+            return this;
+        }
+
+        public onchange(f: (cursor: PathCursor) => void): PathCursor {
+            this._onchange.push(f);
+
+            return this;
+        }
+    }
+
     export class Animation {
         private _keys: Array<any>;
         private _offsetsCache = {};
         private _highLimitsCache = {};
         private _stopped = false;
         public _target;
+        private _blendingFactor = 0;
         private _easingFunction: IEasingFunction;
 
         // The set of event that will be linked to this animation
@@ -29,6 +101,9 @@
 
         public allowMatricesInterpolation = false;
 
+        public blendingSpeed = 0.01;
+        private _originalBlendValue: any;
+
         private _ranges: { [name: string]: AnimationRange; } = {};
 
         static _PrepareAnimation(name: string, targetProperty: string, framePerSecond: number, totalFrame: number,
@@ -85,7 +160,7 @@
             return node.getScene().beginAnimation(node, 0, totalFrame, (animation.loopMode === 1), 1.0, onAnimationEnd);
         }
 
-        constructor(public name: string, public targetProperty: string, public framePerSecond: number, public dataType: number, public loopMode?: number) {
+        constructor(public name: string, public targetProperty: string, public framePerSecond: number, public dataType: number, public loopMode?: number, public enableBlending?: boolean) {
             this.targetPropertyPath = targetProperty.split(".");
             this.dataType = dataType;
             this.loopMode = loopMode === undefined ? Animation.ANIMATIONLOOPMODE_CYCLE : loopMode;
@@ -144,6 +219,8 @@
             this._offsetsCache = {};
             this._highLimitsCache = {};
             this.currentFrame = 0;
+            this._blendingFactor = 0;
+            this._originalBlendValue = null;
         }
 
         public isStopped(): boolean {
@@ -323,8 +400,11 @@
             return this._getKeyValue(this._keys[this._keys.length - 1].value);
         }
 
-        public setValue(currentValue: any): void {
+        public setValue(currentValue: any, blend: boolean = false): void {
             // Set value
+            var path: any;
+            var destination: any;
+
             if (this.targetPropertyPath.length > 1) {
                 var property = this._target[this.targetPropertyPath[0]];
 
@@ -332,9 +412,33 @@
                     property = property[this.targetPropertyPath[index]];
                 }
 
-                property[this.targetPropertyPath[this.targetPropertyPath.length - 1]] = currentValue;
+                path = this.targetPropertyPath[this.targetPropertyPath.length - 1]
+                destination = property;
             } else {
-                this._target[this.targetPropertyPath[0]] = currentValue;
+                path = this.targetPropertyPath[0];
+                destination = this._target;
+            }
+
+            // Blending
+            if (this.enableBlending && this._blendingFactor <= 1.0) {
+                if (!this._originalBlendValue) {
+                    this._originalBlendValue = destination[path];
+                }
+
+                if (this._originalBlendValue.prototype) { // Complex value
+                    
+                    if (this._originalBlendValue.prototype.Lerp) { // Lerp supported
+                        destination[path] = this._originalBlendValue.prototype.Lerp(currentValue, this._originalBlendValue, this._blendingFactor);
+                    } else { // Blending not supported
+                        destination[path] = currentValue;
+                    }
+
+                } else { // Direct value
+                    destination[path] = this._originalBlendValue * (1.0 - this._blendingFactor) + this._blendingFactor * currentValue;
+                }
+                this._blendingFactor += this.blendingSpeed;
+            } else {
+                destination[path] = currentValue;
             }
 
             if (this._target.markAsDirty) {
@@ -354,7 +458,7 @@
             this.setValue(currentValue);
         }
 
-        public animate(delay: number, from: number, to: number, loop: boolean, speedRatio: number): boolean {
+        public animate(delay: number, from: number, to: number, loop: boolean, speedRatio: number, blend: boolean = false): boolean {
             if (!this.targetPropertyPath || this.targetPropertyPath.length < 1) {
                 this._stopped = true;
                 return false;
@@ -633,4 +737,3 @@
 } 
 
 
-

+ 1 - 0
src/Bones/babylon.bone.js

@@ -85,6 +85,7 @@ var BABYLON;
             // all animation may be coming from a library skeleton, so may need to create animation
             if (this.animations.length === 0) {
                 this.animations.push(new BABYLON.Animation(this.name, "_matrix", source.animations[0].framePerSecond, BABYLON.Animation.ANIMATIONTYPE_MATRIX, 0));
+                this.animations[0].setKeys([{}]);
             }
             // get animation info / verify there is such a range from the source bone
             var sourceRange = source.animations[0].getRange(rangeName);

+ 1 - 0
src/Bones/babylon.bone.ts

@@ -102,6 +102,7 @@
             // all animation may be coming from a library skeleton, so may need to create animation
             if (this.animations.length === 0) {
                 this.animations.push(new Animation(this.name, "_matrix", source.animations[0].framePerSecond, Animation.ANIMATIONTYPE_MATRIX, 0));
+                this.animations[0].setKeys([{}]);
             }
 
             // get animation info / verify there is such a range from the source bone

+ 2 - 2
src/Cameras/VR/babylon.webVRCamera.js

@@ -48,9 +48,9 @@ var BABYLON;
                 this._cacheState = this._sensorDevice.getState();
                 this._cacheQuaternion.copyFromFloats(this._cacheState.orientation.x, this._cacheState.orientation.y, this._cacheState.orientation.z, this._cacheState.orientation.w);
                 this._cacheQuaternion.toEulerAnglesToRef(this._cacheRotation);
-                this.rotation.x = -this._cacheRotation.z;
+                this.rotation.x = -this._cacheRotation.x;
                 this.rotation.y = -this._cacheRotation.y;
-                this.rotation.z = this._cacheRotation.x;
+                this.rotation.z = this._cacheRotation.z;
             }
             _super.prototype._checkInputs.call(this);
         };

+ 5 - 4
src/Cameras/VR/babylon.webVRCamera.ts

@@ -12,7 +12,7 @@ module BABYLON {
 
         constructor(name: string, position: Vector3, scene: Scene, compensateDistortion = true) {
             super(name, position, scene);
-            
+
             var metrics = VRCameraMetrics.GetDefault();
             metrics.compensateDistortion = compensateDistortion;
             this.setCameraRigMode(Camera.RIG_MODE_VR, { vrCameraMetrics: metrics });
@@ -54,9 +54,9 @@ module BABYLON {
                 this._cacheQuaternion.copyFromFloats(this._cacheState.orientation.x, this._cacheState.orientation.y, this._cacheState.orientation.z, this._cacheState.orientation.w);
                 this._cacheQuaternion.toEulerAnglesToRef(this._cacheRotation);
 
-                this.rotation.x = -this._cacheRotation.z;
+                this.rotation.x = -this._cacheRotation.x;
                 this.rotation.y = -this._cacheRotation.y;
-                this.rotation.z = this._cacheRotation.x;
+                this.rotation.z = this._cacheRotation.z;
             }
 
             super._checkInputs();
@@ -82,4 +82,5 @@ module BABYLON {
             return "WebVRFreeCamera";
         }
     }
-}
+}
+

+ 5 - 5
src/Cameras/babylon.arcRotateCamera.js

@@ -399,11 +399,11 @@ var BABYLON;
                 this.inertialAlphaOffset *= this.inertia;
                 this.inertialBetaOffset *= this.inertia;
                 this.inertialRadiusOffset *= this.inertia;
-                if (Math.abs(this.inertialAlphaOffset) < BABYLON.Engine.Epsilon)
+                if (Math.abs(this.inertialAlphaOffset) < BABYLON.Epsilon)
                     this.inertialAlphaOffset = 0;
-                if (Math.abs(this.inertialBetaOffset) < BABYLON.Engine.Epsilon)
+                if (Math.abs(this.inertialBetaOffset) < BABYLON.Epsilon)
                     this.inertialBetaOffset = 0;
-                if (Math.abs(this.inertialRadiusOffset) < BABYLON.Engine.Epsilon)
+                if (Math.abs(this.inertialRadiusOffset) < BABYLON.Epsilon)
                     this.inertialRadiusOffset = 0;
             }
             // Panning inertia
@@ -414,9 +414,9 @@ var BABYLON;
                 }
                 this.inertialPanningX *= this.inertia;
                 this.inertialPanningY *= this.inertia;
-                if (Math.abs(this.inertialPanningX) < BABYLON.Engine.Epsilon)
+                if (Math.abs(this.inertialPanningX) < BABYLON.Epsilon)
                     this.inertialPanningX = 0;
-                if (Math.abs(this.inertialPanningY) < BABYLON.Engine.Epsilon)
+                if (Math.abs(this.inertialPanningY) < BABYLON.Epsilon)
                     this.inertialPanningY = 0;
                 this._localDirection.copyFromFloats(this.inertialPanningX, this.inertialPanningY, this.inertialPanningY);
                 this._localDirection.multiplyInPlace(this.panningAxis);

+ 5 - 6
src/Cameras/babylon.arcRotateCamera.ts

@@ -482,11 +482,11 @@
                 this.inertialAlphaOffset *= this.inertia;
                 this.inertialBetaOffset *= this.inertia;
                 this.inertialRadiusOffset *= this.inertia;
-                if (Math.abs(this.inertialAlphaOffset) < Engine.Epsilon)
+                if (Math.abs(this.inertialAlphaOffset) < Epsilon)
                     this.inertialAlphaOffset = 0;
-                if (Math.abs(this.inertialBetaOffset) < Engine.Epsilon)
+                if (Math.abs(this.inertialBetaOffset) < Epsilon)
                     this.inertialBetaOffset = 0;
-                if (Math.abs(this.inertialRadiusOffset) < Engine.Epsilon)
+                if (Math.abs(this.inertialRadiusOffset) < Epsilon)
                     this.inertialRadiusOffset = 0;
             }
 
@@ -500,9 +500,9 @@
                 this.inertialPanningX *= this.inertia;
                 this.inertialPanningY *= this.inertia;
 
-                if (Math.abs(this.inertialPanningX) < Engine.Epsilon)
+                if (Math.abs(this.inertialPanningX) < Epsilon)
                     this.inertialPanningX = 0;
-                if (Math.abs(this.inertialPanningY) < Engine.Epsilon)
+                if (Math.abs(this.inertialPanningY) < Epsilon)
                     this.inertialPanningY = 0;
 
                 this._localDirection.copyFromFloats(this.inertialPanningX, this.inertialPanningY, this.inertialPanningY);
@@ -745,4 +745,3 @@
         }
     }
 } 
-

+ 2 - 2
src/Cameras/babylon.camera.js

@@ -333,7 +333,7 @@ var BABYLON;
                 if (this.minZ <= 0) {
                     this.minZ = 0.1;
                 }
-                BABYLON.Matrix.PerspectiveFovLHToRef(this.fov, engine.getAspectRatio(this), this.minZ, this.maxZ, this._projectionMatrix, this.fovMode);
+                BABYLON.Matrix.PerspectiveFovLHToRef(this.fov, engine.getAspectRatio(this), this.minZ, this.maxZ, this._projectionMatrix, this.fovMode === Camera.FOVMODE_VERTICAL_FIXED);
                 return this._projectionMatrix;
             }
             var halfWidth = engine.getRenderWidth() / 2.0;
@@ -543,7 +543,7 @@ var BABYLON;
                 BABYLON.Node.ParseAnimationRanges(camera, parsedCamera, scene);
             }
             if (parsedCamera.autoAnimate) {
-                scene.beginAnimation(camera, parsedCamera.autoAnimateFrom, parsedCamera.autoAnimateTo, parsedCamera.autoAnimateLoop, 1.0);
+                scene.beginAnimation(camera, parsedCamera.autoAnimateFrom, parsedCamera.autoAnimateTo, parsedCamera.autoAnimateLoop, parsedCamera.autoAnimateSpeed || 1.0);
             }
             return camera;
         };

+ 2 - 2
src/Cameras/babylon.camera.ts

@@ -411,7 +411,7 @@
                     this.minZ = 0.1;
                 }
 
-                Matrix.PerspectiveFovLHToRef(this.fov, engine.getAspectRatio(this), this.minZ, this.maxZ, this._projectionMatrix, this.fovMode);
+                Matrix.PerspectiveFovLHToRef(this.fov, engine.getAspectRatio(this), this.minZ, this.maxZ, this._projectionMatrix, this.fovMode === Camera.FOVMODE_VERTICAL_FIXED);
                 return this._projectionMatrix;
             }
 
@@ -660,7 +660,7 @@
             }
 
             if (parsedCamera.autoAnimate) {
-                scene.beginAnimation(camera, parsedCamera.autoAnimateFrom, parsedCamera.autoAnimateTo, parsedCamera.autoAnimateLoop, 1.0);
+                scene.beginAnimation(camera, parsedCamera.autoAnimateFrom, parsedCamera.autoAnimateTo, parsedCamera.autoAnimateLoop, parsedCamera.autoAnimateSpeed || 1.0);
             }
 
             return camera;

+ 5 - 5
src/Cameras/babylon.targetCamera.js

@@ -135,22 +135,22 @@ var BABYLON;
             }
             // Inertia
             if (needToMove) {
-                if (Math.abs(this.cameraDirection.x) < BABYLON.Engine.Epsilon) {
+                if (Math.abs(this.cameraDirection.x) < BABYLON.Epsilon) {
                     this.cameraDirection.x = 0;
                 }
-                if (Math.abs(this.cameraDirection.y) < BABYLON.Engine.Epsilon) {
+                if (Math.abs(this.cameraDirection.y) < BABYLON.Epsilon) {
                     this.cameraDirection.y = 0;
                 }
-                if (Math.abs(this.cameraDirection.z) < BABYLON.Engine.Epsilon) {
+                if (Math.abs(this.cameraDirection.z) < BABYLON.Epsilon) {
                     this.cameraDirection.z = 0;
                 }
                 this.cameraDirection.scaleInPlace(this.inertia);
             }
             if (needToRotate) {
-                if (Math.abs(this.cameraRotation.x) < BABYLON.Engine.Epsilon) {
+                if (Math.abs(this.cameraRotation.x) < BABYLON.Epsilon) {
                     this.cameraRotation.x = 0;
                 }
-                if (Math.abs(this.cameraRotation.y) < BABYLON.Engine.Epsilon) {
+                if (Math.abs(this.cameraRotation.y) < BABYLON.Epsilon) {
                     this.cameraRotation.y = 0;
                 }
                 this.cameraRotation.scaleInPlace(this.inertia);

+ 7 - 7
src/Cameras/babylon.targetCamera.ts

@@ -166,26 +166,26 @@
 
             // Inertia
             if (needToMove) {
-                if (Math.abs(this.cameraDirection.x) < Engine.Epsilon) {
+                if (Math.abs(this.cameraDirection.x) < Epsilon) {
                     this.cameraDirection.x = 0;
                 }
 
-                if (Math.abs(this.cameraDirection.y) < Engine.Epsilon) {
+                if (Math.abs(this.cameraDirection.y) < Epsilon) {
                     this.cameraDirection.y = 0;
                 }
 
-                if (Math.abs(this.cameraDirection.z) < Engine.Epsilon) {
+                if (Math.abs(this.cameraDirection.z) < Epsilon) {
                     this.cameraDirection.z = 0;
                 }
 
                 this.cameraDirection.scaleInPlace(this.inertia);
             }
             if (needToRotate) {
-                if (Math.abs(this.cameraRotation.x) < Engine.Epsilon) {
+                if (Math.abs(this.cameraRotation.x) < Epsilon) {
                     this.cameraRotation.x = 0;
                 }
 
-                if (Math.abs(this.cameraRotation.y) < Engine.Epsilon) {
+                if (Math.abs(this.cameraRotation.y) < Epsilon) {
                     this.cameraRotation.y = 0;
                 }
                 this.cameraRotation.scaleInPlace(this.inertia);
@@ -265,8 +265,8 @@
                 case Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:
                 case Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:
                 case Camera.RIG_MODE_VR:
-                    var camLeft = <TargetCamera> this._rigCameras[0];
-                    var camRight = <TargetCamera> this._rigCameras[1];
+                    var camLeft = <TargetCamera>this._rigCameras[0];
+                    var camRight = <TargetCamera>this._rigCameras[1];
 
                     if (this.cameraRigMode === Camera.RIG_MODE_VR) {
                         camLeft.rotation.x = camRight.rotation.x = this.rotation.x;

+ 1 - 1
src/Culling/babylon.boundingBox.js

@@ -75,7 +75,7 @@ var BABYLON;
             return BoundingBox.IsCompletelyInFrustum(this.vectorsWorld, frustumPlanes);
         };
         BoundingBox.prototype.intersectsPoint = function (point) {
-            var delta = -BABYLON.Engine.Epsilon;
+            var delta = -BABYLON.Epsilon;
             if (this.maximumWorld.x - point.x < delta || delta > point.x - this.minimumWorld.x)
                 return false;
             if (this.maximumWorld.y - point.y < delta || delta > point.y - this.minimumWorld.y)

+ 1 - 1
src/Culling/babylon.boundingBox.ts

@@ -101,7 +101,7 @@
         }
 
         public intersectsPoint(point: Vector3): boolean {
-            var delta = -Engine.Epsilon;
+            var delta = -Epsilon;
 
             if (this.maximumWorld.x - point.x < delta || delta > point.x - this.minimumWorld.x)
                 return false;

+ 1 - 1
src/Culling/babylon.boundingSphere.js

@@ -29,7 +29,7 @@ var BABYLON;
             var y = this.centerWorld.y - point.y;
             var z = this.centerWorld.z - point.z;
             var distance = Math.sqrt((x * x) + (y * y) + (z * z));
-            if (Math.abs(this.radiusWorld - distance) < BABYLON.Engine.Epsilon)
+            if (Math.abs(this.radiusWorld - distance) < BABYLON.Epsilon)
                 return false;
             return true;
         };

+ 1 - 1
src/Culling/babylon.boundingSphere.ts

@@ -40,7 +40,7 @@
 
             var distance = Math.sqrt((x * x) + (y * y) + (z * z));
 
-            if (Math.abs(this.radiusWorld - distance) < Engine.Epsilon)
+            if (Math.abs(this.radiusWorld - distance) < Epsilon)
                 return false;
 
             return true;

+ 171 - 0
src/Culling/babylon.ray.js

@@ -0,0 +1,171 @@
+var BABYLON;
+(function (BABYLON) {
+    var Ray = (function () {
+        function Ray(origin, direction, length) {
+            if (length === void 0) { length = Number.MAX_VALUE; }
+            this.origin = origin;
+            this.direction = direction;
+            this.length = length;
+        }
+        // Methods
+        Ray.prototype.intersectsBoxMinMax = function (minimum, maximum) {
+            var d = 0.0;
+            var maxValue = Number.MAX_VALUE;
+            var inv;
+            var min;
+            var max;
+            var temp;
+            if (Math.abs(this.direction.x) < 0.0000001) {
+                if (this.origin.x < minimum.x || this.origin.x > maximum.x) {
+                    return false;
+                }
+            }
+            else {
+                inv = 1.0 / this.direction.x;
+                min = (minimum.x - this.origin.x) * inv;
+                max = (maximum.x - this.origin.x) * inv;
+                if (max === -Infinity) {
+                    max = Infinity;
+                }
+                if (min > max) {
+                    temp = min;
+                    min = max;
+                    max = temp;
+                }
+                d = Math.max(min, d);
+                maxValue = Math.min(max, maxValue);
+                if (d > maxValue) {
+                    return false;
+                }
+            }
+            if (Math.abs(this.direction.y) < 0.0000001) {
+                if (this.origin.y < minimum.y || this.origin.y > maximum.y) {
+                    return false;
+                }
+            }
+            else {
+                inv = 1.0 / this.direction.y;
+                min = (minimum.y - this.origin.y) * inv;
+                max = (maximum.y - this.origin.y) * inv;
+                if (max === -Infinity) {
+                    max = Infinity;
+                }
+                if (min > max) {
+                    temp = min;
+                    min = max;
+                    max = temp;
+                }
+                d = Math.max(min, d);
+                maxValue = Math.min(max, maxValue);
+                if (d > maxValue) {
+                    return false;
+                }
+            }
+            if (Math.abs(this.direction.z) < 0.0000001) {
+                if (this.origin.z < minimum.z || this.origin.z > maximum.z) {
+                    return false;
+                }
+            }
+            else {
+                inv = 1.0 / this.direction.z;
+                min = (minimum.z - this.origin.z) * inv;
+                max = (maximum.z - this.origin.z) * inv;
+                if (max === -Infinity) {
+                    max = Infinity;
+                }
+                if (min > max) {
+                    temp = min;
+                    min = max;
+                    max = temp;
+                }
+                d = Math.max(min, d);
+                maxValue = Math.min(max, maxValue);
+                if (d > maxValue) {
+                    return false;
+                }
+            }
+            return true;
+        };
+        Ray.prototype.intersectsBox = function (box) {
+            return this.intersectsBoxMinMax(box.minimum, box.maximum);
+        };
+        Ray.prototype.intersectsSphere = function (sphere) {
+            var x = sphere.center.x - this.origin.x;
+            var y = sphere.center.y - this.origin.y;
+            var z = sphere.center.z - this.origin.z;
+            var pyth = (x * x) + (y * y) + (z * z);
+            var rr = sphere.radius * sphere.radius;
+            if (pyth <= rr) {
+                return true;
+            }
+            var dot = (x * this.direction.x) + (y * this.direction.y) + (z * this.direction.z);
+            if (dot < 0.0) {
+                return false;
+            }
+            var temp = pyth - (dot * dot);
+            return temp <= rr;
+        };
+        Ray.prototype.intersectsTriangle = function (vertex0, vertex1, vertex2) {
+            if (!this._edge1) {
+                this._edge1 = BABYLON.Vector3.Zero();
+                this._edge2 = BABYLON.Vector3.Zero();
+                this._pvec = BABYLON.Vector3.Zero();
+                this._tvec = BABYLON.Vector3.Zero();
+                this._qvec = BABYLON.Vector3.Zero();
+            }
+            vertex1.subtractToRef(vertex0, this._edge1);
+            vertex2.subtractToRef(vertex0, this._edge2);
+            BABYLON.Vector3.CrossToRef(this.direction, this._edge2, this._pvec);
+            var det = BABYLON.Vector3.Dot(this._edge1, this._pvec);
+            if (det === 0) {
+                return null;
+            }
+            var invdet = 1 / det;
+            this.origin.subtractToRef(vertex0, this._tvec);
+            var bu = BABYLON.Vector3.Dot(this._tvec, this._pvec) * invdet;
+            if (bu < 0 || bu > 1.0) {
+                return null;
+            }
+            BABYLON.Vector3.CrossToRef(this._tvec, this._edge1, this._qvec);
+            var bv = BABYLON.Vector3.Dot(this.direction, this._qvec) * invdet;
+            if (bv < 0 || bu + bv > 1.0) {
+                return null;
+            }
+            //check if the distance is longer than the predefined length.
+            var distance = BABYLON.Vector3.Dot(this._edge2, this._qvec) * invdet;
+            if (distance > this.length) {
+                return null;
+            }
+            return new BABYLON.IntersectionInfo(bu, bv, distance);
+        };
+        // Statics
+        Ray.CreateNew = function (x, y, viewportWidth, viewportHeight, world, view, projection) {
+            var start = BABYLON.Vector3.Unproject(new BABYLON.Vector3(x, y, 0), viewportWidth, viewportHeight, world, view, projection);
+            var end = BABYLON.Vector3.Unproject(new BABYLON.Vector3(x, y, 1), viewportWidth, viewportHeight, world, view, projection);
+            var direction = end.subtract(start);
+            direction.normalize();
+            return new Ray(start, direction);
+        };
+        /**
+        * Function will create a new transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be
+        * transformed to the given world matrix.
+        * @param origin The origin point
+        * @param end The end point
+        * @param world a matrix to transform the ray to. Default is the identity matrix.
+        */
+        Ray.CreateNewFromTo = function (origin, end, world) {
+            if (world === void 0) { world = BABYLON.Matrix.Identity(); }
+            var direction = end.subtract(origin);
+            var length = Math.sqrt((direction.x * direction.x) + (direction.y * direction.y) + (direction.z * direction.z));
+            direction.normalize();
+            return Ray.Transform(new Ray(origin, direction, length), world);
+        };
+        Ray.Transform = function (ray, matrix) {
+            var newOrigin = BABYLON.Vector3.TransformCoordinates(ray.origin, matrix);
+            var newDirection = BABYLON.Vector3.TransformNormal(ray.direction, matrix);
+            return new Ray(newOrigin, newDirection, ray.length);
+        };
+        return Ray;
+    })();
+    BABYLON.Ray = Ray;
+})(BABYLON || (BABYLON = {}));

+ 208 - 0
src/Culling/babylon.ray.ts

@@ -0,0 +1,208 @@
+module BABYLON {
+    export class Ray {
+        private _edge1: Vector3;
+        private _edge2: Vector3;
+        private _pvec: Vector3;
+        private _tvec: Vector3;
+        private _qvec: Vector3;
+
+        constructor(public origin: Vector3, public direction: Vector3, public length: number = Number.MAX_VALUE) {
+        }
+
+        // Methods
+        public intersectsBoxMinMax(minimum: Vector3, maximum: Vector3): boolean {
+            var d = 0.0;
+            var maxValue = Number.MAX_VALUE;
+            var inv: number;
+            var min: number;
+            var max: number;
+            var temp: number;
+            if (Math.abs(this.direction.x) < 0.0000001) {
+                if (this.origin.x < minimum.x || this.origin.x > maximum.x) {
+                    return false;
+                }
+            }
+            else {
+                inv = 1.0 / this.direction.x;
+                min = (minimum.x - this.origin.x) * inv;
+                max = (maximum.x - this.origin.x) * inv;
+                if (max === -Infinity) {
+                    max = Infinity;
+                }
+
+                if (min > max) {
+                    temp = min;
+                    min = max;
+                    max = temp;
+                }
+
+                d = Math.max(min, d);
+                maxValue = Math.min(max, maxValue);
+
+                if (d > maxValue) {
+                    return false;
+                }
+            }
+
+            if (Math.abs(this.direction.y) < 0.0000001) {
+                if (this.origin.y < minimum.y || this.origin.y > maximum.y) {
+                    return false;
+                }
+            }
+            else {
+                inv = 1.0 / this.direction.y;
+                min = (minimum.y - this.origin.y) * inv;
+                max = (maximum.y - this.origin.y) * inv;
+
+                if (max === -Infinity) {
+                    max = Infinity;
+                }
+
+                if (min > max) {
+                    temp = min;
+                    min = max;
+                    max = temp;
+                }
+
+                d = Math.max(min, d);
+                maxValue = Math.min(max, maxValue);
+
+                if (d > maxValue) {
+                    return false;
+                }
+            }
+
+            if (Math.abs(this.direction.z) < 0.0000001) {
+                if (this.origin.z < minimum.z || this.origin.z > maximum.z) {
+                    return false;
+                }
+            }
+            else {
+                inv = 1.0 / this.direction.z;
+                min = (minimum.z - this.origin.z) * inv;
+                max = (maximum.z - this.origin.z) * inv;
+
+                if (max === -Infinity) {
+                    max = Infinity;
+                }
+
+                if (min > max) {
+                    temp = min;
+                    min = max;
+                    max = temp;
+                }
+
+                d = Math.max(min, d);
+                maxValue = Math.min(max, maxValue);
+
+                if (d > maxValue) {
+                    return false;
+                }
+            }
+            return true;
+        }
+
+        public intersectsBox(box: BoundingBox): boolean {
+            return this.intersectsBoxMinMax(box.minimum, box.maximum);
+        }
+
+        public intersectsSphere(sphere): boolean {
+            var x = sphere.center.x - this.origin.x;
+            var y = sphere.center.y - this.origin.y;
+            var z = sphere.center.z - this.origin.z;
+            var pyth = (x * x) + (y * y) + (z * z);
+            var rr = sphere.radius * sphere.radius;
+
+            if (pyth <= rr) {
+                return true;
+            }
+
+            var dot = (x * this.direction.x) + (y * this.direction.y) + (z * this.direction.z);
+            if (dot < 0.0) {
+                return false;
+            }
+
+            var temp = pyth - (dot * dot);
+
+            return temp <= rr;
+        }
+
+        public intersectsTriangle(vertex0: Vector3, vertex1: Vector3, vertex2: Vector3): IntersectionInfo {
+            if (!this._edge1) {
+                this._edge1 = Vector3.Zero();
+                this._edge2 = Vector3.Zero();
+                this._pvec = Vector3.Zero();
+                this._tvec = Vector3.Zero();
+                this._qvec = Vector3.Zero();
+            }
+
+            vertex1.subtractToRef(vertex0, this._edge1);
+            vertex2.subtractToRef(vertex0, this._edge2);
+            Vector3.CrossToRef(this.direction, this._edge2, this._pvec);
+            var det = Vector3.Dot(this._edge1, this._pvec);
+
+            if (det === 0) {
+                return null;
+            }
+
+            var invdet = 1 / det;
+
+            this.origin.subtractToRef(vertex0, this._tvec);
+
+            var bu = Vector3.Dot(this._tvec, this._pvec) * invdet;
+
+            if (bu < 0 || bu > 1.0) {
+                return null;
+            }
+
+            Vector3.CrossToRef(this._tvec, this._edge1, this._qvec);
+
+            var bv = Vector3.Dot(this.direction, this._qvec) * invdet;
+
+            if (bv < 0 || bu + bv > 1.0) {
+                return null;
+            }
+
+            //check if the distance is longer than the predefined length.
+            var distance = Vector3.Dot(this._edge2, this._qvec) * invdet;
+            if (distance > this.length) {
+                return null;
+            }
+
+            return new IntersectionInfo(bu, bv, distance);
+        }
+
+        // Statics
+        public static CreateNew(x: number, y: number, viewportWidth: number, viewportHeight: number, world: Matrix, view: Matrix, projection: Matrix): Ray {
+            var start = Vector3.Unproject(new Vector3(x, y, 0), viewportWidth, viewportHeight, world, view, projection);
+            var end = Vector3.Unproject(new Vector3(x, y, 1), viewportWidth, viewportHeight, world, view, projection);
+
+            var direction = end.subtract(start);
+            direction.normalize();
+
+            return new Ray(start, direction);
+        }
+
+        /**
+        * Function will create a new transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be
+        * transformed to the given world matrix.
+        * @param origin The origin point
+        * @param end The end point
+        * @param world a matrix to transform the ray to. Default is the identity matrix.
+        */
+        public static CreateNewFromTo(origin: Vector3, end: Vector3, world: Matrix = Matrix.Identity()): Ray {
+            var direction = end.subtract(origin);
+            var length = Math.sqrt((direction.x * direction.x) + (direction.y * direction.y) + (direction.z * direction.z));
+            direction.normalize();
+
+            return Ray.Transform(new Ray(origin, direction, length), world);
+        }
+
+        public static Transform(ray: Ray, matrix: Matrix): Ray {
+            var newOrigin = Vector3.TransformCoordinates(ray.origin, matrix);
+            var newDirection = Vector3.TransformNormal(ray.direction, matrix);
+
+            return new Ray(newOrigin, newDirection, ray.length);
+        }
+    }
+}

+ 35 - 1
src/Debug/babylon.debugLayer.js

@@ -9,6 +9,7 @@ var BABYLON;
             this._displayStatistics = true;
             this._displayTree = false;
             this._displayLogs = false;
+            this._skeletonViewers = new Array();
             this._identityMatrix = BABYLON.Matrix.Identity();
             this.axisRatio = 0.02;
             this.accentColor = "orange";
@@ -93,7 +94,7 @@ var BABYLON;
                     _this._drawingContext.clearRect(0, 0, _this._drawingCanvas.width, _this._drawingCanvas.height);
                     var engine = _this._scene.getEngine();
                     var viewport = _this._camera.viewport;
-                    var globalViewport = viewport.toGlobal(engine);
+                    var globalViewport = viewport.toGlobal(engine.getRenderWidth(), engine.getRenderHeight());
                     // Meshes
                     var meshes = _this._camera.getActiveMeshes();
                     var index;
@@ -262,6 +263,13 @@ var BABYLON;
             this._scene.renderTargetsEnabled = true;
             this._scene.probesEnabled = true;
             engine.getRenderingCanvas().removeEventListener("click", this._onCanvasClick);
+            this._clearSkeletonViewers();
+        };
+        DebugLayer.prototype._clearSkeletonViewers = function () {
+            for (var index = 0; index < this._skeletonViewers.length; index++) {
+                this._skeletonViewers[index].dispose();
+            }
+            this._skeletonViewers = [];
         };
         DebugLayer.prototype.show = function (showUI, camera, rootElement) {
             if (showUI === void 0) { showUI = true; }
@@ -556,6 +564,32 @@ var BABYLON;
                     });
                 }
                 this._optionsSubsetDiv.appendChild(document.createElement("br"));
+                this._generateTexBox(this._optionsSubsetDiv, "<b>Viewers:</b>", this.accentColor);
+                this._generateCheckBox(this._optionsSubsetDiv, "Skeletons", false, function (element) {
+                    if (!element.checked) {
+                        _this._clearSkeletonViewers();
+                        return;
+                    }
+                    for (var index = 0; index < _this._scene.meshes.length; index++) {
+                        var mesh = _this._scene.meshes[index];
+                        if (mesh.skeleton) {
+                            var found = false;
+                            for (var sIndex = 0; sIndex < _this._skeletonViewers.length; sIndex++) {
+                                if (_this._skeletonViewers[sIndex].skeleton === mesh.skeleton) {
+                                    found = true;
+                                    break;
+                                }
+                            }
+                            if (found) {
+                                continue;
+                            }
+                            var viewer = new BABYLON.Debug.SkeletonViewer(mesh.skeleton, mesh, _this._scene);
+                            viewer.isEnabled = true;
+                            _this._skeletonViewers.push(viewer);
+                        }
+                    }
+                });
+                this._optionsSubsetDiv.appendChild(document.createElement("br"));
                 this._generateTexBox(this._optionsSubsetDiv, "<b>Tools:</b>", this.accentColor);
                 this._generateButton(this._optionsSubsetDiv, "Dump rendertargets", function (element) { _this._scene.dumpNextRenderTargets = true; });
                 this._generateButton(this._optionsSubsetDiv, "Run SceneOptimizer", function (element) { BABYLON.SceneOptimizer.OptimizeAsync(_this._scene); });

+ 44 - 1
src/Debug/babylon.debugLayer.ts

@@ -21,6 +21,8 @@
         private _drawingContext: CanvasRenderingContext2D;
         private _rootElement: HTMLElement;
 
+        private _skeletonViewers = new Array<Debug.SkeletonViewer>();
+
         public _syncPositions: () => void;
         private _syncData: () => void;
         private _syncUI: () => void;
@@ -143,7 +145,7 @@
 
                     var engine = this._scene.getEngine();
                     var viewport = this._camera.viewport;
-                    var globalViewport = viewport.toGlobal(engine);
+                    var globalViewport = viewport.toGlobal(engine.getRenderWidth(), engine.getRenderHeight());
 
                     // Meshes
                     var meshes = this._camera.getActiveMeshes();
@@ -368,6 +370,16 @@
             this._scene.probesEnabled = true;
 
             engine.getRenderingCanvas().removeEventListener("click", this._onCanvasClick);
+
+            this._clearSkeletonViewers();
+        }
+
+        private _clearSkeletonViewers(): void {
+            for (var index = 0; index < this._skeletonViewers.length; index++) {
+                this._skeletonViewers[index].dispose();
+            }
+
+            this._skeletonViewers = [];
         }
 
         public show(showUI: boolean = true, camera: Camera = null, rootElement: HTMLElement = null) {
@@ -699,6 +711,37 @@
                     });
                 }
                 this._optionsSubsetDiv.appendChild(document.createElement("br"));
+                this._generateTexBox(this._optionsSubsetDiv, "<b>Viewers:</b>", this.accentColor);
+                this._generateCheckBox(this._optionsSubsetDiv, "Skeletons", false, (element) => {
+
+                    if (!element.checked) {
+                        this._clearSkeletonViewers();
+                        return;
+                    }
+
+                    for (var index = 0; index < this._scene.meshes.length; index++) {
+                        var mesh = this._scene.meshes[index];
+
+                        if (mesh.skeleton) {
+                            var found = false;
+                            for (var sIndex = 0; sIndex < this._skeletonViewers.length; sIndex++) {
+                                if (this._skeletonViewers[sIndex].skeleton === mesh.skeleton) {
+                                    found = true;
+                                    break;
+                                }
+                            }
+
+                            if (found) {
+                                continue;
+                            }
+
+                            var viewer = new BABYLON.Debug.SkeletonViewer(mesh.skeleton, mesh, this._scene);
+                            viewer.isEnabled = true;
+                            this._skeletonViewers.push(viewer);
+                        }
+                    }
+                });
+                this._optionsSubsetDiv.appendChild(document.createElement("br"));
                 this._generateTexBox(this._optionsSubsetDiv, "<b>Tools:</b>", this.accentColor);
                 this._generateButton(this._optionsSubsetDiv, "Dump rendertargets", (element) => { this._scene.dumpNextRenderTargets = true; });
                 this._generateButton(this._optionsSubsetDiv, "Run SceneOptimizer", (element) => { SceneOptimizer.OptimizeAsync(this._scene); });

+ 137 - 0
src/Debug/babylon.skeletonViewer.js

@@ -0,0 +1,137 @@
+var BABYLON;
+(function (BABYLON) {
+    var Debug;
+    (function (Debug) {
+        /**
+        * Demo available here: http://www.babylonjs-playground.com/#1BZJVJ#8
+        */
+        var SkeletonViewer = (function () {
+            function SkeletonViewer(skeleton, mesh, scene, autoUpdateBonesMatrices, renderingGroupId) {
+                if (autoUpdateBonesMatrices === void 0) { autoUpdateBonesMatrices = true; }
+                if (renderingGroupId === void 0) { renderingGroupId = 1; }
+                this.skeleton = skeleton;
+                this.mesh = mesh;
+                this.autoUpdateBonesMatrices = autoUpdateBonesMatrices;
+                this.renderingGroupId = renderingGroupId;
+                this.color = BABYLON.Color3.White();
+                this._debugLines = [];
+                this._isEnabled = false;
+                this._scene = scene;
+                this.update();
+                this._renderFunction = this.update.bind(this);
+            }
+            Object.defineProperty(SkeletonViewer.prototype, "isEnabled", {
+                get: function () {
+                    return this._isEnabled;
+                },
+                set: function (value) {
+                    if (this._isEnabled === value) {
+                        return;
+                    }
+                    this._isEnabled = value;
+                    if (value) {
+                        this._scene.registerBeforeRender(this._renderFunction);
+                    }
+                    else {
+                        this._scene.unregisterBeforeRender(this._renderFunction);
+                    }
+                },
+                enumerable: true,
+                configurable: true
+            });
+            SkeletonViewer.prototype._getBonePosition = function (position, bone, meshMat, x, y, z) {
+                if (x === void 0) { x = 0; }
+                if (y === void 0) { y = 0; }
+                if (z === void 0) { z = 0; }
+                var tmat = BABYLON.Tmp.Matrix[0];
+                var parentBone = bone.getParent();
+                tmat.copyFrom(bone.getLocalMatrix());
+                if (x !== 0 || y !== 0 || z !== 0) {
+                    var tmat2 = BABYLON.Tmp.Matrix[1];
+                    BABYLON.Matrix.IdentityToRef(tmat2);
+                    tmat2.m[12] = x;
+                    tmat2.m[13] = y;
+                    tmat2.m[14] = z;
+                    tmat2.multiplyToRef(tmat, tmat);
+                }
+                if (parentBone) {
+                    tmat.multiplyToRef(parentBone.getAbsoluteTransform(), tmat);
+                }
+                tmat.multiplyToRef(meshMat, tmat);
+                position.x = tmat.m[12];
+                position.y = tmat.m[13];
+                position.z = tmat.m[14];
+            };
+            SkeletonViewer.prototype._getLinesForBonesWithLength = function (bones, meshMat) {
+                var len = bones.length;
+                for (var i = 0; i < len; i++) {
+                    var bone = bones[i];
+                    var points = this._debugLines[i];
+                    if (!points) {
+                        points = [BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero()];
+                        this._debugLines[i] = points;
+                    }
+                    this._getBonePosition(points[0], bone, meshMat);
+                    this._getBonePosition(points[1], bone, meshMat, 0, bone.length, 0);
+                }
+            };
+            SkeletonViewer.prototype._getLinesForBonesNoLength = function (bones, meshMat) {
+                var len = bones.length;
+                var boneNum = 0;
+                for (var i = len - 1; i >= 0; i--) {
+                    var childBone = bones[i];
+                    var parentBone = childBone.getParent();
+                    if (!parentBone) {
+                        continue;
+                    }
+                    var points = this._debugLines[boneNum];
+                    if (!points) {
+                        points = [BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero()];
+                        this._debugLines[boneNum] = points;
+                    }
+                    this._getBonePosition(points[0], childBone, meshMat);
+                    this._getBonePosition(points[1], parentBone, meshMat);
+                    boneNum++;
+                }
+            };
+            SkeletonViewer.prototype.update = function () {
+                if (this.autoUpdateBonesMatrices) {
+                    this._updateBoneMatrix(this.skeleton.bones[0]);
+                }
+                if (this.skeleton.bones[0].length === undefined) {
+                    this._getLinesForBonesNoLength(this.skeleton.bones, this.mesh.getWorldMatrix());
+                }
+                else {
+                    this._getLinesForBonesWithLength(this.skeleton.bones, this.mesh.getWorldMatrix());
+                }
+                if (!this._debugMesh) {
+                    this._debugMesh = BABYLON.MeshBuilder.CreateLineSystem(null, { lines: this._debugLines, updatable: true }, this._scene);
+                    this._debugMesh.renderingGroupId = this.renderingGroupId;
+                }
+                else {
+                    BABYLON.MeshBuilder.CreateLineSystem(null, { lines: this._debugLines, updatable: true, instance: this._debugMesh }, this._scene);
+                }
+                this._debugMesh.color = this.color;
+            };
+            SkeletonViewer.prototype._updateBoneMatrix = function (bone) {
+                if (bone.getParent()) {
+                    bone.getLocalMatrix().multiplyToRef(bone.getParent().getAbsoluteTransform(), bone.getAbsoluteTransform());
+                }
+                var children = bone.children;
+                var len = children.length;
+                for (var i = 0; i < len; i++) {
+                    this._updateBoneMatrix(children[i]);
+                }
+            };
+            SkeletonViewer.prototype.dispose = function () {
+                if (this._debugMesh) {
+                    this.isEnabled = false;
+                    this._debugMesh.dispose();
+                    this._debugMesh = null;
+                }
+            };
+            return SkeletonViewer;
+        })();
+        Debug.SkeletonViewer = SkeletonViewer;
+    })(Debug = BABYLON.Debug || (BABYLON.Debug = {}));
+})(BABYLON || (BABYLON = {}));

+ 140 - 0
src/Debug/babylon.skeletonViewer.ts

@@ -0,0 +1,140 @@
+module BABYLON.Debug {
+    /**
+    * Demo available here: http://www.babylonjs-playground.com/#1BZJVJ#8
+    */
+    export class SkeletonViewer {
+        public color: Color3 = Color3.White();
+
+        private _scene: Scene;
+        private _debugLines = []; 
+        private _debugMesh: LinesMesh;
+        private _isEnabled = false;
+        private _renderFunction: () => void;
+
+        constructor(public skeleton: Skeleton, public mesh: AbstractMesh, scene: Scene, public autoUpdateBonesMatrices = true, public renderingGroupId = 1) {
+            this._scene = scene;
+
+            this.update();
+
+            this._renderFunction = this.update.bind(this);
+        }
+
+        public set isEnabled(value: boolean) {
+            if (this._isEnabled === value) {
+                return;
+            }
+
+            this._isEnabled = value;
+
+            if (value) {
+                this._scene.registerBeforeRender(this._renderFunction);
+            } else {
+                this._scene.unregisterBeforeRender(this._renderFunction);
+            }
+        }
+
+        public get isEnabled(): boolean {
+            return this._isEnabled;
+        }
+
+        private _getBonePosition(position: Vector3, bone: Bone, meshMat: Matrix, x = 0, y = 0, z = 0): void {
+            var tmat = Tmp.Matrix[0];
+            var parentBone = bone.getParent();
+            tmat.copyFrom(bone.getLocalMatrix());
+
+            if (x !== 0 || y !== 0 || z !== 0) {
+                var tmat2 = Tmp.Matrix[1];
+                BABYLON.Matrix.IdentityToRef(tmat2);
+                tmat2.m[12] = x;
+                tmat2.m[13] = y;
+                tmat2.m[14] = z;
+                tmat2.multiplyToRef(tmat, tmat);
+            }
+
+            if (parentBone) {
+                tmat.multiplyToRef(parentBone.getAbsoluteTransform(), tmat);
+            }
+
+            tmat.multiplyToRef(meshMat, tmat);
+
+            position.x = tmat.m[12];
+            position.y = tmat.m[13];
+            position.z = tmat.m[14];
+        }
+
+        private _getLinesForBonesWithLength(bones: Bone[], meshMat: Matrix): void {
+            var len = bones.length;
+            for (var i = 0; i < len; i++) {
+                var bone = bones[i];
+                var points = this._debugLines[i];
+                if (!points) {
+                    points = [Vector3.Zero(), Vector3.Zero()];
+                    this._debugLines[i] = points;
+                }
+                this._getBonePosition(points[0], bone, meshMat);
+                this._getBonePosition(points[1], bone, meshMat, 0, bone.length, 0);
+            }
+        }
+
+        private _getLinesForBonesNoLength(bones: Bone[], meshMat: Matrix): void {
+            var len = bones.length;
+            var boneNum = 0;
+            for (var i = len - 1; i >= 0; i--) {
+                var childBone = bones[i];
+                var parentBone = childBone.getParent();
+                if (!parentBone) {
+                    continue;
+                }
+                var points = this._debugLines[boneNum];
+                if (!points) {
+                    points = [Vector3.Zero(), Vector3.Zero()];
+                    this._debugLines[boneNum] = points;
+                }
+                this._getBonePosition(points[0], childBone, meshMat);
+                this._getBonePosition(points[1], parentBone, meshMat);
+                boneNum++;
+            }
+        }
+
+        public update() {
+            if (this.autoUpdateBonesMatrices) {
+                this._updateBoneMatrix(this.skeleton.bones[0]);
+            }
+
+            if (this.skeleton.bones[0].length === undefined) {
+                this._getLinesForBonesNoLength(this.skeleton.bones, this.mesh.getWorldMatrix());
+            } else {
+                this._getLinesForBonesWithLength(this.skeleton.bones, this.mesh.getWorldMatrix());
+            }
+
+            if (!this._debugMesh) {
+                this._debugMesh = BABYLON.MeshBuilder.CreateLineSystem(null, { lines: this._debugLines, updatable: true }, this._scene);
+                this._debugMesh.renderingGroupId = this.renderingGroupId;
+            } else {
+                BABYLON.MeshBuilder.CreateLineSystem(null, { lines: this._debugLines, updatable: true, instance: this._debugMesh }, this._scene);
+            }
+            this._debugMesh.color = this.color;
+        }
+
+        private _updateBoneMatrix(bone: Bone) {
+            if (bone.getParent()) {
+                bone.getLocalMatrix().multiplyToRef(bone.getParent().getAbsoluteTransform(), bone.getAbsoluteTransform());
+            }
+
+            var children = bone.children;
+            var len = children.length;
+
+            for (var i = 0; i < len; i++) {
+                this._updateBoneMatrix(children[i]);
+            }
+        }
+
+        public dispose() {
+            if (this._debugMesh) {
+                this.isEnabled = false;
+                this._debugMesh.dispose();
+                this._debugMesh = null;
+            }
+        }
+    }
+}

+ 24 - 11
src/Layer/babylon.layer.js

@@ -31,29 +31,42 @@ var BABYLON;
             this._indexBuffer = scene.getEngine().createIndexBuffer(indices);
             // Effects
             this._effect = this._scene.getEngine().createEffect("layer", ["position"], ["textureMatrix", "color", "scale", "offset"], ["textureSampler"], "");
+            this._alphaTestEffect = this._scene.getEngine().createEffect("layer", ["position"], ["textureMatrix", "color", "scale", "offset"], ["textureSampler"], "#define ALPHATEST");
         }
         Layer.prototype.render = function () {
+            var currentEffect = this.alphaTest ? this._alphaTestEffect : this._effect;
             // Check
-            if (!this._effect.isReady() || !this.texture || !this.texture.isReady())
+            if (!currentEffect.isReady() || !this.texture || !this.texture.isReady())
                 return;
             var engine = this._scene.getEngine();
+            if (this.onBeforeRender) {
+                this.onBeforeRender();
+            }
             // Render
-            engine.enableEffect(this._effect);
+            engine.enableEffect(currentEffect);
             engine.setState(false);
             // Texture
-            this._effect.setTexture("textureSampler", this.texture);
-            this._effect.setMatrix("textureMatrix", this.texture.getTextureMatrix());
+            currentEffect.setTexture("textureSampler", this.texture);
+            currentEffect.setMatrix("textureMatrix", this.texture.getTextureMatrix());
             // Color
-            this._effect.setFloat4("color", this.color.r, this.color.g, this.color.b, this.color.a);
+            currentEffect.setFloat4("color", this.color.r, this.color.g, this.color.b, this.color.a);
             // Scale / offset
-            this._effect.setVector2("offset", this.offset);
-            this._effect.setVector2("scale", this.scale);
+            currentEffect.setVector2("offset", this.offset);
+            currentEffect.setVector2("scale", this.scale);
             // VBOs
-            engine.bindBuffers(this._vertexBuffer, this._indexBuffer, this._vertexDeclaration, this._vertexStrideSize, this._effect);
+            engine.bindBuffers(this._vertexBuffer, this._indexBuffer, this._vertexDeclaration, this._vertexStrideSize, currentEffect);
             // Draw order
-            engine.setAlphaMode(this.alphaBlendingMode);
-            engine.draw(true, 0, 6);
-            engine.setAlphaMode(BABYLON.Engine.ALPHA_DISABLE);
+            if (!this._alphaTestEffect) {
+                engine.setAlphaMode(this.alphaBlendingMode);
+                engine.draw(true, 0, 6);
+                engine.setAlphaMode(BABYLON.Engine.ALPHA_DISABLE);
+            }
+            else {
+                engine.draw(true, 0, 6);
+            }
+            if (this.onAfterRender) {
+                this.onAfterRender();
+            }
         };
         Layer.prototype.dispose = function () {
             if (this._vertexBuffer) {

+ 36 - 11
src/Layer/babylon.layer.ts

@@ -6,7 +6,10 @@
         public scale = new Vector2(1, 1);
         public offset = new Vector2(0, 0);
         public onDispose: () => void;
+        public onBeforeRender: () => void;
+        public onAfterRender: () => void;
         public alphaBlendingMode = Engine.ALPHA_COMBINE;
+        public alphaTest: boolean;
 
         private _scene: Scene;
         private _vertexDeclaration = [2];
@@ -14,6 +17,7 @@
         private _vertexBuffer: WebGLBuffer;
         private _indexBuffer: WebGLBuffer;
         private _effect: Effect;
+        private _alphaTestEffect: Effect;
 
         constructor(public name: string, imgUrl: string, scene: Scene, isBackground?: boolean, color?: Color4) {
             this.texture = imgUrl ? new Texture(imgUrl, scene, true) : null;
@@ -49,37 +53,58 @@
                 ["position"],
                 ["textureMatrix", "color", "scale", "offset"],
                 ["textureSampler"], "");
+
+            this._alphaTestEffect = this._scene.getEngine().createEffect("layer",
+                ["position"],
+                ["textureMatrix", "color", "scale", "offset"],
+                ["textureSampler"], "#define ALPHATEST");
         }
 
         public render(): void {
+            var currentEffect = this.alphaTest ? this._alphaTestEffect : this._effect;
+
             // Check
-            if (!this._effect.isReady() || !this.texture || !this.texture.isReady())
+            if (!currentEffect.isReady() || !this.texture || !this.texture.isReady())
                 return;
 
             var engine = this._scene.getEngine();
 
+            if (this.onBeforeRender) {
+                this.onBeforeRender();
+            }
+
             // Render
-            engine.enableEffect(this._effect);
+            engine.enableEffect(currentEffect);
             engine.setState(false);
 
+
             // Texture
-            this._effect.setTexture("textureSampler", this.texture);
-            this._effect.setMatrix("textureMatrix", this.texture.getTextureMatrix());
+            currentEffect.setTexture("textureSampler", this.texture);
+            currentEffect.setMatrix("textureMatrix", this.texture.getTextureMatrix());
 
             // Color
-            this._effect.setFloat4("color", this.color.r, this.color.g, this.color.b, this.color.a);
+            currentEffect.setFloat4("color", this.color.r, this.color.g, this.color.b, this.color.a);
 
             // Scale / offset
-            this._effect.setVector2("offset", this.offset);
-            this._effect.setVector2("scale", this.scale);
+            currentEffect.setVector2("offset", this.offset);
+            currentEffect.setVector2("scale", this.scale);
 
             // VBOs
-            engine.bindBuffers(this._vertexBuffer, this._indexBuffer, this._vertexDeclaration, this._vertexStrideSize, this._effect);
+            engine.bindBuffers(this._vertexBuffer, this._indexBuffer, this._vertexDeclaration, this._vertexStrideSize, currentEffect);
 
             // Draw order
-            engine.setAlphaMode(this.alphaBlendingMode);
-            engine.draw(true, 0, 6);
-            engine.setAlphaMode(Engine.ALPHA_DISABLE);
+            if (!this._alphaTestEffect) {
+                engine.setAlphaMode(this.alphaBlendingMode);
+                engine.draw(true, 0, 6);
+                engine.setAlphaMode(Engine.ALPHA_DISABLE);
+            }
+            else {
+                engine.draw(true, 0, 6);
+            }
+
+            if (this.onAfterRender) {
+                this.onAfterRender();
+            }
         }
 
         public dispose(): void {

+ 1 - 1
src/LensFlare/babylon.lensFlareSystem.js

@@ -85,7 +85,7 @@ var BABYLON;
                 return false;
             var engine = this._scene.getEngine();
             var viewport = this._scene.activeCamera.viewport;
-            var globalViewport = viewport.toScreenGlobal(engine);
+            var globalViewport = viewport.toGlobal(engine.getRenderWidth(true), engine.getRenderHeight(true));
             // Position
             if (!this.computeEffectivePosition(globalViewport)) {
                 return false;

+ 1 - 1
src/LensFlare/babylon.lensFlareSystem.ts

@@ -118,7 +118,7 @@
 
             var engine = this._scene.getEngine();
             var viewport = this._scene.activeCamera.viewport;
-            var globalViewport = viewport.toScreenGlobal(engine);
+            var globalViewport = viewport.toGlobal(engine.getRenderWidth(true), engine.getRenderHeight(true));
 
             // Position
             if (!this.computeEffectivePosition(globalViewport)) {

+ 0 - 0
src/Lights/babylon.light.js


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません