Manual Layout for spheremap and cubemap?

How would I go about manually laying out a cubemap and a spheremap for environmental mapping in Unity? Here are a couple of examples of layouts that I’m used to with different engines, but I’m not sure what to expect with unity.

Spheremaps are pretty important to some of the stuff I’m doing (and are easier to work with than cubemaps for a number of reasons), which is why I’m also interested in those.

76329--2905--$graphics__skybox_140.png

Here’s an example layout for a spheremap.

76330--2906--$gl_sphere_map_2d_899.gif

Actually, I would like to know this for cubemaps too, because if you use the standard layout described in the first post, the top and bottom map are reversed, and you actually have to invert the whole map horizontally, or it is upside down.

Has anyone made any manual spheremaps or cubemaps for unity games that we could see as a comparison?

kind of related :wink:
In Unity Import settings we find:
GL spheremap
Cylindrical map
Normal Spheremap
Nice Sphere map

-what is the difference in the layout (like Docks first post)

What to use where and when?

I’ve just been searching through all the documentation and the Wiki, and I can’t find any mentions of this anywhere.

If you select a cubemap in the project view and right click to get import settings, this is where you can adjust these settings.

nordadninja:

Yes we know :wink:
But I am looking for a graphical layout, if there is a general layout, or how Unity read these, still as layout as the first post for all of these:

I don’t know their differences!

Cheers

Those are for turning a single, normal texture into a cubemap. You can try each one with an image and see what the results are. Obviously there’s no way to get a cubemap this way that can compare with a “real” cubemap, but sometimes it’s quite adequate and you save a fair bit of space (1 texture vs. 6).

–Eric

Hi Eric5h5

I have tried them out to the difference. But I can only see a diffrence in the Z Y possitions.
So I was just wondering why a so many to choose from and what they looked like in the 2d layout.

Cheers

Different choices give you different results for the cubemap. In case you don’t like one, you can try another and see if it’s more to your liking. If you click on the generatedCubemap object you get after generating a cubemap this way, you can see the results in the Inspector.

–Eric

hehe as graphic artist its just that I would like to see the 2d layout for each of them and get som tech info about the deeper differences, not just click and look and choose.

But thanks :wink:

Well…but looking and choosing is all there is to it. :slight_smile: As a graphic artist, I don’t really care about the technical aspect of the differences, all I care about is how it looks (which IS the only difference), so clicking and looking works for me… They’re just different methods of generating cubemaps from single images, that’s all. Looking at the results in the Inspector tells you all you need to know, since you do see the layout there.

–Eric

Lol this is fun…

-as I wrote in a previous post “docks” first post is what I would lik to see for each of the other.

:wink: not for me, might do for you, and thats why Im asking…
I like to get a deeper understanding of things so I can progress in this fast moving industry…

Okay, so I’m still having trouble with this.

I’ve attached the spheremap I want to use, but all the reflective shaders refuse to accept anything other than pre-calculated cube-maps.

Is there anything that can be done to force a material to just be a simple diffuse with spheremap, nothing else?

87426--3393--$spheremap_bar_403.jpg

None of the built-in Reflective shaders use sphere mapping, but it is possible to write your own.

On a texture, specify TexGen=SphereMap option, then it will use sphere mapping coordinates for texturing.

Here’s a variant of Reflective/VertexLit shader that uses sphere map instead of cubemap:

Shader "Reflective/VertexLit Spheremap" {
Properties {
    _Color ("Main Color", Color) = (1,1,1,1)
    _SpecColor ("Spec Color", Color) = (1,1,1,1)
    _Shininess ("Shininess", Range (0.03, 1)) = 0.7
    _MainTex ("Base (RGB) RefStrength (A)", 2D) = "white" {} 
    _Spheremap ("Reflection Spheremap", 2D) = "white" { TexGen SphereMap }
}

Category {
    Tags { "RenderType"="Opaque" }
    Blend AppSrcAdd AppDstAdd
    Fog { Color [_AddFog] }

    SubShader {
        Pass { 
            Name "BASE"
            Tags {"LightMode" = "Always"}
            Material {
                Diffuse [_Color]
                Ambient (1,1,1,1)
                Shininess [_Shininess]
                Specular [_SpecColor]
            }
            Lighting On
            SeparateSpecular on
            SetTexture [_MainTex] {
                combine texture * primary DOUBLE,
                    texture * primary
            }
            SetTexture [_Spheremap] {
                combine texture * previous alpha + previous,
                    previous
            }
        }
    }
}
FallBack "VertexLit"
}

Ah, perfect - I’ll give it a try and see what I can come up with! Thanks Aras.