Sign in to follow this  
cannonicus

Cube maps

Recommended Posts

cannonicus    136
Hello all Im trying to implement a skybox using the interface IDirect3DCubeTexture9. What I cant seem to find out is how this is supposed to be used, ie how the different faces are ordered inside of the texture. What texels am i to use to view the different faces? Thanks in advance. //Emil

Share this post


Link to post
Share on other sites
dave    2187
Hey bud,

The way i make my textures is to use the tool called the DirectX Texture Tool that comes with the SDK. To use this you first create all six faces manually, in Photoshop or something similar. Next you go into the texture tool and create a new cube map texture. Then to set the faces you simply select the face you want to set using the View menu, once you have done that you use then file menu option to open 1 of the six textures you created manually onto the this surface. You do this for each of the six faces. Then save the texture as a DDS file or something.

You can open up then cube map texture in paint or Photoshop and view then layout of the textures for the faces.

Hope that helps,

Dave

Share this post


Link to post
Share on other sites
cannonicus    136
Hmm, im still not able to use the cube texture correctly. Right now im treating the cube texture like a normal texture, with the different faces stapeled above each others. Texel values i use for the right face are for example: (0,0) (1,0) (0,1/6) (1,1/6). But when rendering using these texels the skybox is very distorted. I resorted to using an ordinary texture, with the same images as in the cube texture, and in the same order. That worked perfectly fine. I guess im just missing some very basic imformation about how to actually use the IDirect3DCubeTexture9.

If someone could post some code where you use this interface to render a skybox i would be much obliged. Links to skybox tutorials are appreciated to.

And one other thing to. How do you prevent the seems between the different faces in the skybox to show? I guess i could just add some pixels from neighbouring faces to form a border around each face to fix this. Is this a good way?

Thanks

//Emil

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this