Jump to content
  • Advertisement
Sign in to follow this  
wolf

Blit from Cube to Cube map

This topic is 4085 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 thinking today about how to blit from one cube map face to the cube map face of another cube map. Unfortunately without hacking around the cube map, there seems to be no "right" solution. As soon as you fetch the face with the incident vector, you have to correct the fetch by approximating a kind of sphere like look-up or something else (isoCube). If you want to build a kind of postfx for cube maps this is not satisfying, because there is an on-going quality decrease. So I assume many will now suggest to treat the cube map as a series of 2D textures ... but this also does not sound like a great and generic solution. Does anyone has a good idea on how to blit from a cube map to a cube map without treating it as an array of 2D textures and without using stuff like isoCubes? Thanks in advance, - Wolf

Share this post


Link to post
Share on other sites
Advertisement

The DX way is something like this:


for( int i=0; i<6; i++ )
{
IDirect3DSurface9* pSrc;
IDirect3DSurface9* pDst;
pSrcCube->GetSurfaceLevel( i, 0, &pSrc );
pDstCube->GetSurfaceLevel( i, 0, &pDst );
pD3DDevice->StretchRect( pDst, pSrc );
}


I dont know if thats right, as its just off the top of my head, but you get the idea.

If you want to do an arbitrary post-processing trick on the cubemap, just bind the surfaces as render targets and render full-screen quads into each of them.

Share this post


Link to post
Share on other sites
Thanks a lot. I need to find out how this fits onto my current hardware platform :-)

- Wolf

[Edited by - wolf on March 20, 2007 7:11:43 PM]

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!