What is the standard format for Cube maps?

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
Valmond
Posts: 308
Joined: Thu Apr 12, 2007 3:26 pm

What is the standard format for Cube maps?

Post by Valmond »

Hi everyone!

Just wanted to know why cube maps often (but not always) comes in this sort of a cross texture?
Is there a standard to it or is is -"it has always been done like that son."?

Like

Code: Select all

OOXO
XXXX
OOXO
Where X is the "texture" and O is empty.

I mean, it will be copied down on 6 textures anyway, right? And the graphic guy doing it must 'seem' all the sides to other sides anyway...


Cheers!
fmx

Post by fmx »

It's easier to visualise it that way, the horizontal faces all in a line producing a panorama type result.
This also makes it easier to produce in the first place

When I was messing about with cubemaps I packed the faces to conserve texture-space, something like

Code: Select all

XXXO
XXXO
OOOO
All that empty space around the edges can be cropped away

As long as your code knows which face is which, it makes no difference
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

I use a 2:1 proportion for CubeMaps. It only wastes 25% percent of the texture space.

Code: Select all

XXX0
XXX0
but, as FMX suggests, it is all a matter of how you encode your cubemaps, and how you access them later. That panorama setup has one big advantage when you are sampling consecutive pixels, it can be tiled in the direction where you have all the samples together.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Valmond
Posts: 308
Joined: Thu Apr 12, 2007 3:26 pm

Post by Valmond »

Well but don't you like 'always' (except with those "weird" shaders that don't use 6 textures :p ) do more or less like this:

Load up texture T
Create 6 new ones (Up, Left, Front, Right, Back, Down)
Discard T

Right?

Which means the savings are just for disk space (or load-up time as compressed white usually doesn't take very much disk space).

I'm asking because I've done a cube mapping thingy and I'd like to go with the most used / best format or
something but I don't have a clue why I'm not just sticking those 6 textures one after another in a predefined way ?
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

Do what you think is best. Or you can have 6 textures, load them, and arrange them in memory how you think is best. Think, not obstant, that those arrangements are done with the sampling process in mind, and samples which are not together in the image will lead to seams, or incorrect samplings. I really don't know how the storage of those textures is done in disk, but i guess they go correlative, and are arranged when they are loaded.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Valmond
Posts: 308
Joined: Thu Apr 12, 2007 3:26 pm

Post by Valmond »

OK thanks!
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

Hey mel, i use your layout except i scale the cubmap texture into the nearest square texture, this allows irrlicht's defualt mipmapping to work.
"Irrlicht is obese"

If you want modern rendering techniques learn how to make them or go to the engine next door =p
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

Hmm... it makes sense, then the mipmaps are always aligned... Thanks for the tip! :)
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Post Reply