Skybox graphic dimensions?

Hi all,



This should be a simple thing but I’m stumped…



What are the dimensions that should be used for a skybox image as a single image?



I’d have though it was 4 units wide, by 3 units tall (e.g. 400x300px), but I keep getting the following error:

“”"

Cubemap textures must contain 6 data units.

21/02/2012 2:46:23 PM com.jme3.renderer.lwjgl.LwjglRenderer updateTexImageData

WARNING: Invalid texture: Image[size=400x300, format=BGR8, id=5]

“”"



The “skybox example” link from the tutorial doesn’t work either. (It appears to have 2 skyboxes in the one image, but even when I cut one of them out I still get the error above)



Am I missing something obvious?? Or could someone upload a sample image that works?



Thanks in advance for a clue.

Jon.

1 Like

The width and height must be equal and the cubemap must have exactly 6 images.

Hmmm. I am confused about the following two methods…



[java]public static Spatial createSky(AssetManager assetManager, Texture west, Texture east, Texture north, Texture south, Texture up, Texture down)



public static Spatial createSky(AssetManager assetManager, Texture texture, boolean sphereMap)[/java]



The docs say “JME3 supports cube maps in PNG, JPG, or (compressed) DDS format”



I had assumed the “cube map” was simply an image, like the following…



http://www.codeproject.com/KB/windows-phone-7/3DGraphicsWP7/en_cube.png



So, what do I need to do to get that image used as my skybox?

Nope, in fact it is a image containing 6 images, that usually represented as above,

you can either use a dds with cubebox format, or use this factory



skygeom = SkyFactory.createSky(assetManager, west, east, north, south, up, down);

skygeom.setQueueBucket(Bucket.Sky);

skygeom.setLocalScale(500);

skygeom.setCullHint(CullHint.Never);

Okay, finally got it working…



After much hair-pulling with loading individual textures (which resulted in terrible artifacts), I used a util from this link to generate .dds cubeMap, and it worked like a charm!



Thanks for your help.

Ah yes, taht tool is quite nice, it will get outofmemory however if you do stuff like a 8kx8k skybox XD

While I’ve got you here… any tips for the optimal settings when exporting the .dds (there’s so many!), or indeed the image size I ought to use?



Also, it occurred to me that the reason the individual-image method was producing artifacts might have been that the dimensions of my images weren’t square numbers… I seem to remember reading something about this in my travels through Google. Is that a requirement of Jmonkey’s SkyFactory.createsky() method?



Cheers,

Jon.

I’m not sure, but it could make sense, if it wee like that, I suggest to test it.

→ Usually you always want to use textures with that sizes, simple because later if you are texture heavy you can use dds compression for other textures as well, it saves 8 or with alpha 4 times the size of the raw image. (dds is the only compression format graficcards are able to store compressed in vram)

→ Even if not, you can get great grafics by just useing a image with 8times as much pixels and dds than uncompressed, at no additional runtime cost

Thanks for the reply… I need to let that sink in, and clearly read up on .dds compression / vram.



:wink:

There’s no point in using a 8k skybox … You’re not going to see any of that detail unless your monitor has a resolution of 8k. Most high end monitors are around 1920x1200 so using a 2k skybox will have the best detail. Not to mention that an uncompressed 8k skybox is about 1.5 GB…

It depends, if you have zoom for weapons or similar implemented via fov changes you could have fov down to 20 degree, than you want to make sure, that 20% of the skybox are still fullhd (or whatever is targeted)