[dx9] Cube texture mapping coordinates

Started by
0 comments, last by iedoc 12 years, 10 months ago
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,
Advertisement
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.

This topic is closed to new replies.

Advertisement