Jump to content
  • Advertisement
Sign in to follow this  
ilflyer12

Filling a Cube Map's faces from an array of values

This topic is 4173 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

Alright, what i have is a bunch of precomputed BRDF values stored in a 2d array in which one of the dimensions corresponds to the faces of a cubemap. Now i am trying to put these values into a cubemap so that they can be used in computations on the gpu. To do this I am trying to use the D3DXFillCubeTexture function. What i am running into problems with is determining what side of the cubemap corresponds to the texture coordinate provided by the callback function. Here is the callback function definition so you dont have to look it up.
void WINAPI brdfCubeFill(D3DXVECTOR4* pOut, 
                       CONST D3DXVECTOR3* pTexCoord, 
                       CONST D3DXVECTOR3* pTexelSize, 
                       LPVOID pData)
Does anyone know how to determine which face a certain value corresponds to and also if possible where on that face it would map to. Thanks for the help since i am really confused on DirectX's cubemap texture coordinate system.

Share this post


Link to post
Share on other sites
Advertisement
Well actually after taking a step away for like 30 minutes from this, i realized that the texture coordinate for the face currently being updated was set to either 1 or -1 (based on which side of the cube its on) so its really easy to know the face. Now all i have to do is determine where on the face it is drawing to but i dont think that should be too hard. Thanks to those who looked at this and maybe it will help someone else out.

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!