Home Technical Talk

Skymap workflow

polycounter lvl 12
Offline / Send Message
divi polycounter lvl 12
When I was working on my UC entry I tried to figure out how Epic did their skymaps and why they did it that way. I know now how but not entirely why since there is a bit of waste UV wise. They could be used as reflection maps, but a proper cubemap would be a better option due to it actually having a ground in the map.

Anyway, here's how I'll do my skymaps from now on if I don't need to use them for anything other than a skybox.

Get a 360° sky texture from somewhere (cgtextures.com, make it yourself, etc) at best resolution possible. Expand the canvas downward so it sits at a 2:1 ratio, add it to a material's diffuse with 100% self illumination. Apply that material to a sphere with a radius of 100 and 32 segments that sits at 0;0;0, turn to an editable poly and delete the lower half.

Make it planar and move all of it down to 0 in the Z axis. Space all of the edge verts evenly so it forms a square. Apply a relax modifier to it with 200 iterations and "keep boundary pts fixed" checked. Should look like that
flattenedsphere.jpg

Place a target cam in the scene with the target points at 0,0,0 and the cam sitting at 0,0,240. Render it out a 2048² pixels. Make a new material with it with the same settings as the first.
skyrenderlow.jpg

Make another sphere like the first one, delete the lower half, apply a planar UVW Map modifier in Z axis and an Unwrap UVW Modifier and the new material to it. Flip it's faces and edit the UVWs to look like this which should be fairly easy with the space evenly function. Relax it by Centres with "keep boundary pts fixed" checked to get the same topology the texture is based on.
uvs.jpg

You should end up with something like that.
geometry.jpg
Export to your target engine.

An additional note: with some textures there will be some errors at the top of the sphere. Just check on the first sphere before you do anything after applying the material for a visible star-esque artifact at the top of the sphere. Depending on the Sky it's not always visible. You can paint it out in photoshop or similar or do the whole process again with a higher segmented sphere and comp the resulting map with the original map. 64 might be enough, 80 will remove almost all artifacts.

That probably concludes it. I'm rather sure I forgot to explain some parts, but it's not all that complicated. Maybe someone will have a use for this :).

Replies

Sign In or Register to comment.