Sign in to follow this  
cebugdev

[dx9] Cube texture mapping coordinates

Recommended Posts

Hi all,

Im trying to implement my own cubic shadow mapping for my point light, I am new to cubic texturing,

How does the texture coordinates of a cubic texture works?
Is it similar to UV texture of a basic 2D coordinate or different?

If its different then how to specify the texture coordinate then?

thanks,

Share this post


Link to post
Share on other sites
hi cebugdev,

Cubic textures are actually very easy to impliment. Instead of 2d (U, V) coordinates, they use 3D (U, V, W) coordinates. I think this is what your asking.

Think of a cube with 6 sides, each representing a square texture, two on each axis (+x, -x, +y, -y, +z, -z). Say you would like to texture a sphere using a cubic texture. imagine placing this sphere inside the cube. then for each pixel on the cube, imagine a vector, or ray from the center of the sphere to the pixel you want to texture, and think about that ray continuing its course until it reaches a point on the cube. whatever "texel" (like a pixel on the texture) the ray (from the center of the sphere, to the pixel you want to color) points to, is the color the pixel on the sphere will be. Then imagine doing this for every pixel on the sphere.

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