Cube mapping tutorial

Tutorials for Halo CE.
Post Reply
User avatar
llamaboy772





Posts: 729
Joined: Mon Apr 05, 2004 2:29 pm
Location: The diamond in the rough...
Contact:

Cube mapping tutorial

Post by llamaboy772 »

I couldn't find a tutorial for this anywhere so i'll make a tutorial for it. Cube maps add luster and shininess to objects as shown here.(look at the wood)


Image

Now I'm FAR from being this good so don't expect me to show you how to create works of art. (bare with me, I suck at paintshop and this will be my first cube map other then a gel map) We will be using paintshop for this tutorial, but even paint will do the same thing we need to do. First off we need a templet so we know what were doing. This templet is located at data\levels\C10\bitmaps on your computer. If it's not there simply download it off this page.


Image

One thing to note about cube maps is they don't need to follow the power of 2 restriction of other bitmaps, however the boxes within them MUST. This bitmap is composed of 6 separate images, one for each side of a box. (hence the name cube map) Each cube has 64 x 64 pixles so it's fairly low quality. We are going to to make a higher resolution bitmap so open up the image in paintshop and rescale it as shown in the pics. Oh and if your wondering why the bitmap size is 256 x 192 it's because 64 x 4 (how many cubes there are across) = 256 and 64 x 3 (how many cube are down) = 192.

Image

Change that to this for a higher res cubes. (128 x 128)

Image

Now that we have our templet ready we can begin making our bitmap. Now this bungie made bitmap is already a perfect example but for the sake of this tutorial i'll make one anyway. (remember I suck at paintshop so go easy on me) We are going to be making a forest cubemap so select everything that isn't white and turn it into a solid blue color. (blue is the sky)

Image

Now before we continue you need to know why the bitmap in shaped the way it is. Image by biocroc, cube map in the picture by me.

Image

The only thing to note here is that there are four cubes in the center row, one for each side of a cube. Now we need not worry about separating the center row cubes from each other when we draw the bitmap but we do need to do something different for the top and bottom. (we will see later) Here is one more example made by crowpath.
Image

If you want it to be totally accurate, it's laid out like this according to the orientation of the map in Max:

1: Ceiling
2: X+
3: Floor
4: Y+
5: X-
6: Y-
Now enough of this chit-chat, let make this thing already. First off draw your hills on the middle row.

Image

Next draw trees. (i'm going to do one per block for easiness)

Image

I told you it would suck! But that doesn't matter because i'm just showing you how to make a cube map not a good cube map. Ok now fill in the bottom block which will be ground, draw the bush part of the middle tree in the top cube, and draw the trunk of the middle tree in the bottom cube.(and add some texture)

Image

Now let me explain why I did this. If you just imagine folding this bitmap into a cube you would see why I put the bush continuation on the top up the upper cube. The very middle cube with the giant tree would be folded behind the cube so in order to make the top of the tree line up you must put the tree top upside down at the very top. (same goes for the trunk except reversed) Everything must line up perfectly or it will look like crap ingame. (on the middle row the hills on the very left match the hight of the hills of the very right). Ok now thats the bitmap is made simply compile in tool. (it will come up with a error but thats normal) After it compiles open the bitmap in Guerilla and change the type to cube map and the format to 32 bit color, then save it and compile in tool again.

Image

There you go! Just add your cube to your shader tag and your set to go! I hope I helped a few people with this tutorial even though the bitmap I made sucked. God bless and happy modding! :twisted:
Image
User avatar
TomClancey





Posts: 2565
Joined: Sat Jan 28, 2006 6:49 am
Location: Ohio
Contact:

Post by TomClancey »

Very nice tutorial. Maybe an in-game pic to see where this cube map would be placed?
User avatar
llamaboy772





Posts: 729
Joined: Mon Apr 05, 2004 2:29 pm
Location: The diamond in the rough...
Contact:

Post by llamaboy772 »

I'm very surprised, my crappy paint drawn cube map doesn't really look that bad ingame!

Image

Image
Image
User avatar
TomClancey





Posts: 2565
Joined: Sat Jan 28, 2006 6:49 am
Location: Ohio
Contact:

Post by TomClancey »

So..the cubemap, is just making a super-blurry reflection on medal surfaces? Wierd..I thought it was something totally different.
User avatar
llamaboy772





Posts: 729
Joined: Mon Apr 05, 2004 2:29 pm
Location: The diamond in the rough...
Contact:

Post by llamaboy772 »

TomClancey wrote:So..the cubemap, is just making a super-blurry reflection on medal surfaces? Wierd..I thought it was something totally different.
Wha..? It's just blurry because it's a crappy cube map, what did you think cube maps were? (anything in halo that changes color when you move has a cube map on it)
Image
User avatar
TomClancey





Posts: 2565
Joined: Sat Jan 28, 2006 6:49 am
Location: Ohio
Contact:

Post by TomClancey »

lol, ya I never really payed attention to anything related to cubemaps etc. because I hadn't gotten than deep into map making. So, if you could explain what a cubemap is that would be nice. (I know thats like the dumbest question ever, but still, im a bit confused) :|
User avatar
V0Lt4Ge




Collaborator Snitch! Socialist

Posts: 3602
Joined: Wed May 12, 2004 4:56 pm
Location: California
Contact:

Post by V0Lt4Ge »

It's basically a fake reflection.
User avatar
TomClancey





Posts: 2565
Joined: Sat Jan 28, 2006 6:49 am
Location: Ohio
Contact:

Post by TomClancey »

Or in the case its a gel map, its a light with fake light casting?
User avatar
llamaboy772





Posts: 729
Joined: Mon Apr 05, 2004 2:29 pm
Location: The diamond in the rough...
Contact:

Post by llamaboy772 »

TomClancey wrote:Or in the case its a gel map, its a light with fake light casting?
No with a gel map it's real time light casting, for real time reflections however you need dynamic mirrors.
Image
User avatar
FleetAdmiralBacon




Critic Pyre Articulatist 500

Posts: 2377
Joined: Sat Nov 26, 2005 7:01 pm
Location: Ohio
Contact:

Post by FleetAdmiralBacon »

It's only blurry because of the size.
Cube maps are used by most game engines up until now, when hardware can easily handle real time reflections on non-flat surfaces.

It's always good to make new cube maps for custom skies and in maps where you use water.
Example:
Image

The water reflects a custom cube map made from renders of the sky box.
Image
Everything you'll ever need to know about me.
Need help with Linux, C#, C, Python, Java, PHP, Javascript, CSS, or VB? I'm available from 3:00PM-8:00PM EST on weekdays.
User avatar
TomClancey





Posts: 2565
Joined: Sat Jan 28, 2006 6:49 am
Location: Ohio
Contact:

Post by TomClancey »

llamaboy772 wrote:
TomClancey wrote:Or in the case its a gel map, its a light with fake light casting?
No with a gel map it's real time light casting, for real time reflections however you need dynamic mirrors.
Then how come for your gel-map on your map, your cubemap had the exact pattern of the shadow? If its real-time-light-casting, wouldn't you just need a gel-map and not a cube-map with gel-map properties?

BTW: I'm not even sure if anything I said is true or if it makes anysense.
User avatar
llamaboy772





Posts: 729
Joined: Mon Apr 05, 2004 2:29 pm
Location: The diamond in the rough...
Contact:

Post by llamaboy772 »

TomClancey wrote:
llamaboy772 wrote:
TomClancey wrote:Or in the case its a gel map, its a light with fake light casting?
No with a gel map it's real time light casting, for real time reflections however you need dynamic mirrors.
Then how come for your gel-map on your map, your cubemap had the exact pattern of the shadow? If its real-time-light-casting, wouldn't you just need a gel-map and not a cube-map with gel-map properties?

BTW: I'm not even sure if anything I said is true or if it makes anysense.
I'm not positive what your saying but i'll try to explain. Dynamic light in halo isn't effected by collision. That meens it will go right through any model it touches. By creating a gel map in the shape of the bars is tells the dynamic light how to cast itself out of the light bulb, which makes it look as if the light is being blocked by the bars. The light is still fully dynamic and if a animated the light the shadows would move with it. If anybody else is wondering what i'm talking about it's this thing I made.

Image
Image
User avatar
TomClancey





Posts: 2565
Joined: Sat Jan 28, 2006 6:49 am
Location: Ohio
Contact:

Post by TomClancey »

Ok, so you have to "tell" the gel-map to pass through the bars via a bitmap.
I gotcha. Does Halo 2 have Dynamic Lighting where light stops at objects? Also does Halo 2 have Dynamic Reflections on a non-planer surface?
Last edited by TomClancey on Tue Feb 06, 2007 2:52 pm, edited 1 time in total.
User avatar
FleetAdmiralBacon




Critic Pyre Articulatist 500

Posts: 2377
Joined: Sat Nov 26, 2005 7:01 pm
Location: Ohio
Contact:

Post by FleetAdmiralBacon »

TomClancey wrote:Ok, so you have to "tell" the gel-map to pass through the bars? It wont automaically do that? Like real dynamic lighting and shadows?
Lights. Do. Not. Produce. Shadows. In. Halo.
The light you see in his picture is a bitmap that looks somewhat like this:
Image
Image
Everything you'll ever need to know about me.
Need help with Linux, C#, C, Python, Java, PHP, Javascript, CSS, or VB? I'm available from 3:00PM-8:00PM EST on weekdays.
User avatar
TomClancey





Posts: 2565
Joined: Sat Jan 28, 2006 6:49 am
Location: Ohio
Contact:

Post by TomClancey »

I. Know. That.
I was just posting that to reasure my self, but I not relize my post made no cence at all.
Post Reply