|
@@ -20,6 +20,7 @@ if (BABYLON.Engine.isSupported()) {
|
|
|
var currentSkybox;
|
|
|
var enableDebugLayer = false;
|
|
|
var currentPluginName;
|
|
|
+ var skyboxPath = "Assets/environment.dds";
|
|
|
|
|
|
canvas.addEventListener("contextmenu", function (evt) {
|
|
|
evt.preventDefault();
|
|
@@ -98,7 +99,7 @@ if (BABYLON.Engine.isSupported()) {
|
|
|
|
|
|
// Environment
|
|
|
if (currentPluginName === "gltf") {
|
|
|
- var hdrTexture = BABYLON.CubeTexture.CreateFromPrefilteredData("Assets/environment.dds", currentScene);
|
|
|
+ var hdrTexture = BABYLON.CubeTexture.CreateFromPrefilteredData(skyboxPath, currentScene);
|
|
|
currentSkybox = currentScene.createDefaultSkybox(hdrTexture, true, (currentScene.activeCamera.maxZ - currentScene.activeCamera.minZ) / 2, 0.3);
|
|
|
|
|
|
// glTF assets use a +Z forward convention while the default camera faces +Z. Rotate the camera to look at the front of the asset.
|
|
@@ -147,6 +148,14 @@ if (BABYLON.Engine.isSupported()) {
|
|
|
};
|
|
|
|
|
|
filesInput = new BABYLON.FilesInput(engine, null, sceneLoaded, null, null, null, function () { BABYLON.Tools.ClearLogCache() }, null, sceneError);
|
|
|
+ filesInput.onProcessFileCallback = (function (file, name, extension) {
|
|
|
+ if (filesInput._filesToLoad && filesInput._filesToLoad.length === 1 && extension && extension.toLowerCase() === "dds") {
|
|
|
+ BABYLON.FilesInput.FilesToLoad[name] = file;
|
|
|
+ skyboxPath = "file:" + file.correctName;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }).bind(this);
|
|
|
filesInput.monitorElementForDragNDrop(canvas);
|
|
|
|
|
|
window.addEventListener("keydown", function (evt) {
|