Producing .ktx images for skyboxes


#1

Is there any information available to produce proper skybox images like the SKY-SOT-Test-180.ktx used in the sandbox ?
I tried with some png or jpg images, even tried converting the .ktx to .png, but the sky remained dark black, so I think there are some strange thing to do to have a valid image for skybox zones.

I tried to convert .png or .jpg images to .ktx format using the (quite huge) PVRTexTool, but it didn’t work.

Thanks for any help on this :slight_smile:


#2

If you have a valid skybox texture (ie. if you can put your raw .png/.jpg/… image on a zone and have it work) then you can use the Oven tool that is included in the full Interface + Sandbox installer (Not the client-only one) to convert your texture to a ktx.

If your domain is using an Asset Server and you upload that texture to it, as soon as you use it as a skybox, the Asset Server will detect it and automatically convert the texture to a ktx for you and then it’ll swap it in the background for people visiting your domain.


#3

Can you elaborate on a valid skybox texture? Ho must it be produce? Can i produce it via blender or other programs? IS there already a librari of dome usabile skybox textures? I forward these questioni bere because People in our Class teaching high fidelity are very entusiasta about the features but the dont understand how to create or use differenti textures


#4

is the only requisite here that it must be equirectangular and the height must be exactly halft the width?


#5

I think I solved it, the prerequisites are to have equirectangular images (but I’ve seen that also cubic might work), and that the height is exactly the half of the width, and in this way it seems working.
The only problem I’m keeping in crossing is that the interface often stops in uploading valid images, so that I need to quit from interface and enter again to make it correctly change the skybox. This is a pain :frowning:


#6

I’m not really familiar with how to generate them. Maybe @sam can weigh in here?

All I can tell you is that we support a few different layouts, they are described here with some nice ascii art:

Basically, the aspect ratio of the texture will dictate which layout we pick.


#7

that is fantastic (!) Thanks for the link it is quite clear and instructive. I was very confused by the various formats I found scattered around each one with a different layout and could not understand how they relate each other.


#8

What constitutes a proper skybox? I have a PNG but when I try to use it, Hifi ignores it and only uses the solid colour. Is there a dimensions requirement?


#9

not every png can be valid skybox, I learned by experience. If you want them to be good skyboxes they must be equirectangular, with sizes width = 2x, height = x
If you find on internet some images equirectangular for instance from http://photopin.com/free-photos/equirectangular you can then download them and resize them with a graphic editor to have proper size, and then you can use them.


#10

As far as I know, the only requirement, is the aspect ratio.

The supported aspect ratios and associated expected layouts are listed at the link I posted above.


#11

This format is also supported:

ratio 4:3


#12

for instance this image taken from the link I gave you is not x 2x so I used gimp to resize it to a proper x : 2x

changed to 3840x1920:


at this point copy to a web server or test locally,

here is the result. Apparently it is still not a good skybox image, but at least you can see it.


if you want to check yourself you can use this link https://edu3d.ovh/skybox/skybox1.jpg


#13

Now I have a further question… So equirectangular is not enough, since taking a generic equirectangular image from image gives distorted results… :frowning:


#14

It probably doesn’t have the right projection. (Which is why it didn’t have the proper ratio to begin with)


#15

other pictures taken from the same list are ok. see

I think that you can understand more or less if it’s correct checking if the horizon is flat and not curving as in the previous image…


#16

anyway @c i did rescale other images which were not 1:2 rescaling them and they worked perfectly, so it is not always the case if the ratio was not 1:2 that they are not representing a true skybox ready picture.


#17

I think the problem with the water / sail boat picture is that the horizon is not centred vertically. Skyboxes are projected onto spheres and if the horizon is not at ground level, it will appear like it does in your result.

Think of what you would see if you were standing in a bowl where the edge of the bowl is above you. The edge of the bowl would appear curved.

I have used both cubemap and 2*4 skyboxes in HiFi. Some I took myself and others I found online. Not all are good but after awhile you can sort of tell which ones will work and which will not.