• Advertisement
Sign in to follow this  

[dx9] Cube texture mapping coordinates

This topic is 2422 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement