Sign in to follow this  
thallish

DirectX Cube Map Question

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

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