Jump to content

Environment Map Generator HDR inside *.babylon


Hersir
 Share

Recommended Posts

Hi, I used EnvironmentMapGenerator to generate hdr texture.

I tried to use it from code it works great but I would like to add it inside babylon file.

{
   customType: "BABYLON.HDRCubeTexture",
   name: "some.babylon.hdr",
   size: 256
}

If I add size I get error Bad HDR Format but without size option I get byte length of Int32Array should be a multiple of 4. (standard hdr works great).

Link to comment
Share on other sites

@Hersir, I don't have the chance to test it out, try this and report back, as it seems to work for other people:

{

      "reflectionTexture":
      {
        "customType": "BABYLON.HDRCubeTexture",
        "name":"some.babylon.hdr",
        "level":1,
        "hasAlpha":0,
        "coordinatesMode":3,
        "size":512,
        "uOffset":0,
        "vOffset":0,
        "uScale":1,
        "vScale":1,
        "uAng":0,
        "vAng":0,
        "wAng":0,
        "wrapU":true,
        "wrapV":true,
        "coordinatesIndex":0
      }

}

 

Link to comment
Share on other sites

@Hersir, here is the line (https://github.com/BabylonJS/Babylon.js/blob/master/src/Tools/HDR/babylon.hdr.ts#L87)

 var line = this.readStringLine(uint8array, 0);
            if (line[0] != '#' || line[1] != '?') {
                throw "Bad HDR Format.";
            }

First character should be "#" or the second one "?". Could you upload the HDR file you are trying to use? I think the problem is there and not on babylon side.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...