jagenjo / webglstudio.js

A full open source 3D graphics editor in the browser, with scene editor, coding pad, graph editor, virtual file system, and many features more.
MIT License
5.23k stars 607 forks source link

Cubemap problems #10

Open magadan opened 9 years ago

magadan commented 9 years ago

Hi, im trying to put my own cubemaps, when i use the default cubemaps from webgl.org demo, works ok, when i used mine im getting a half black circle on top and bottom

The problem: http://i.imgur.com/EE5eXjS.jpg

My cubemap if someone can verify. http://i.imgur.com/bPKrt5R.jpg

thanks.

jagenjo commented 9 years ago

Hi Cristian:

Cubemaps could come in four forms, an image in polar coordinates (the default one), an image with the 6 sides arranged vertically, a cross image, or a DDS cubemap.

The problem is that with 2d images (the three first ways) it is hard to detect just by having the image. So I came up with this strange way: if the image is 6 times higher than taller then its the second type, if the file has the string CUBECROSSL then its a cross leaning left. Otherwise a polar image is assumed.

In the image width divided by six is not a integer number then it asumes its a polar image. Thats what happened to your image.

There is a tool in the Actions menu to create cubemaps from the scene or from files. Play with it and give me some feedback.

I have improved it so it gives more feedback when creating cubemaps, please update the webglstudio to the github.

I understand it is hard to deal with this problems, I will make tutorials soon.

Cheers!

magadan commented 9 years ago

Got it, thanks to reply. Im using this software Pano2VR ( http://ggnome.com/ ), in my first test im converting HDR Irradiance format (from NOEMITION website) to 6 sides arranged horizontally. I will try to convert with vertically arrange as you inform. I will post my result if success here.