Jump to content
  • Advertisement
Sign in to follow this  
thallish

DirectX Cube Map Question

This topic is 4241 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 I was wondering what is the inner workings of the intrinsic function texCUBE() work? I know what it does but how does it do it? A link to an explanation will suffice[wink] Regards

Share this post


Link to post
Share on other sites
Advertisement
As far as I'm aware it'll just perform a standard cube-map lookup, but I can't remember how much of that is left to the implementation (i.e. the driver/GPU) or the actual runtime...

The process uses the component with the largest magnitude to select the face (e.g. <3,4,-1> would select the +Y face), then uses the magnitude to generate a 2D coordinate in [-1..+1] by dividing through (<3/4, -1/4> = <0.75, -0.25>) and it then adjusts them to be in [0..1] instead of [-1..+1] using a simple (x+1)/2 operation...

hth
Jack

Share this post


Link to post
Share on other sites
Hi Jack

Yep that is what I got as well, but wouldn't that mean that the texture needs to be horizontally flipped?

if the (u,v) coordinates are like:

---------> u
|
|
|
|
v
v

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!