Explorar el Código

Fix default HDR texture rotation

sebavan hace 5 años
padre
commit
80184f4739

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

@@ -4,6 +4,7 @@
 
 - Added particle editor to the Inspector ([Deltakosh](https://github.com/deltakosh))
 - Added the `ShadowDepthWrapper` class to support accurate shadow generation for custom as well as node material shaders. [Doc](https://doc.babylonjs.com/babylon101/shadows#custom-shadow-map-shaders) ([Popov72](https://github.com/Popov72))
+- Added Babylon.js Texture [tools](https://www.babylonjs.com/tools/ibl) to prefilter HDR files ([Sebavan](https://github.com/sebavan/))
 
 ## Updates
 
@@ -171,3 +172,4 @@
 
 - `EffectRenderer.render` now takes a `RenderTargetTexture` or an `InternalTexture` as the output texture and only a single `EffectWrapper` for its first argument ([Popov72](https://github.com/Popov72))
 - Sound's `updateOptions` takes `options.length` and `options.offset` as seconds and not milliseconds ([RaananW](https://github.com/RaananW))
+- HDRCubeTexture default rotation is now similar to the industry one. You might need to add a rotation on y of 90 degrees if you scene changes ([Sebavan](https://github.com/sebavan/))

+ 8 - 8
src/Misc/HighDynamicRange/panoramaToCubemap.ts

@@ -74,41 +74,41 @@ export interface CubeMapInfo {
  */
 export class PanoramaToCubeMapTools {
 
-    private static FACE_FRONT = [
+    private static FACE_LEFT = [
         new Vector3(-1.0, -1.0, -1.0),
         new Vector3(1.0, -1.0, -1.0),
         new Vector3(-1.0, 1.0, -1.0),
         new Vector3(1.0, 1.0, -1.0)
     ];
-    private static FACE_BACK = [
+    private static FACE_RIGHT = [
         new Vector3(1.0, -1.0, 1.0),
         new Vector3(-1.0, -1.0, 1.0),
         new Vector3(1.0, 1.0, 1.0),
         new Vector3(-1.0, 1.0, 1.0)
     ];
-    private static FACE_RIGHT = [
+    private static FACE_FRONT = [
         new Vector3(1.0, -1.0, -1.0),
         new Vector3(1.0, -1.0, 1.0),
         new Vector3(1.0, 1.0, -1.0),
         new Vector3(1.0, 1.0, 1.0)
     ];
-    private static FACE_LEFT = [
+    private static FACE_BACK = [
         new Vector3(-1.0, -1.0, 1.0),
         new Vector3(-1.0, -1.0, -1.0),
         new Vector3(-1.0, 1.0, 1.0),
         new Vector3(-1.0, 1.0, -1.0)
     ];
     private static FACE_DOWN = [
-        new Vector3(-1.0, 1.0, -1.0),
         new Vector3(1.0, 1.0, -1.0),
+        new Vector3(1.0, 1.0, 1.0),
+        new Vector3(-1.0, 1.0, -1.0),
         new Vector3(-1.0, 1.0, 1.0),
-        new Vector3(1.0, 1.0, 1.0)
     ];
     private static FACE_UP = [
+        new Vector3(-1.0, -1.0, -1.0),
         new Vector3(-1.0, -1.0, 1.0),
+        new Vector3(1.0, -1.0, -1.0),
         new Vector3(1.0, -1.0, 1.0),
-        new Vector3(-1.0, -1.0, -1.0),
-        new Vector3(1.0, -1.0, -1.0)
     ];
 
     /**