Sign in to follow this  
Funkymunky

CubeMap Coordinates

Recommended Posts

Funkymunky    1413

I'm trying to manually render the mipmap levels of a cubemap.  First I rendered level 0 of the cubemap by setting up a framebuffer and passing 6 projection/modelview matrices to a geometry shader, duplicating the triangles for each face.  Next I attached level 1 of the cubemap and bound the same texture as the input to the pixel shader.

 

And then i realized that I need a float3/vec3 to sample the cubemap.  Is there a good way to create this to sample the 6 faces cleanly?  Or do I need to re-evaluate my setup and attach each face independently...?

Share this post


Link to post
Share on other sites
Funkymunky    1413

Either OpenGL 4+ or DX11.  I've realized that I also put together a little skybox class when I was testing the cubemap which does basically what I'm trying to do already.  And on your suggestion I found this page:

 

http://msdn.microsoft.com/en-us/library/windows/desktop/ff476906(v=vs.85).aspx#Texture2D_Resource

 

which says "A 2D texture array that contains 6 textures may be read from within shaders with the cube map intrinsic functions, after they are bound to the pipeline with a cube-texture view."

 

Perfect.  Thanks!

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