convert hdr to env
HTML
<script src="https://cdn.babylonjs.com/babylon.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Babylon.js sample code</title>
<!-- Babylon.js -->
<script src="https://cdn.babylonjs.com/babylon.js"></script>
<style>
html,
body {
overflow: hidden;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
#renderCanvas {
width: 100%;
height: 100%;
touch-action: none;
}
</style>
</head>
<body>
<canvas id="renderCanvas"></canvas>
<script>
var canvas = document.getElementById("renderCanvas");
var engine = null;
var scene = null;
var sceneToRender = null;
var createDefaultEngine = function () {
return new BABYLON.Engine(canvas, true, {
premultipliedAlpha: false, preserveDrawingBuffer: true, stencil: true, disableWebGL2Support: false
});
};
class Playground {
static CreateScene(engine, canvas) {
// This creates a basic Babylon Scene object (non-mesh)
var scene = new BABYLON.Scene(engine);
// // This creates and positions a free camera (non-mesh)
// var camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(0, 5, -10), scene);
// // This targets the camera to scene origin
// camera.setTarget(BABYLON.Vector3.Zero());
// // This attaches the camera to the canvas
// camera.attachControl(canvas, true);
var path = "14.hdr";
scene.environmentTexture = new BABYLON.HDRCubeTexture(
path,
scene,
256,
false,
true,
false,
true
);
BABYLON.EnvironmentTextureTools.CreateEnvTextureAsync(
scene.environmentTexture
)
.then(function (buffer) {
var blob =...