I'm trying to implement shadow mapping with cube maps. I believe I've done the first stage by filling the cube map, but for the final shading pass I am unsure how to exactly calculate the cubemap coordinates. Any pointers?
Take the 2-minute tour
×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.
Cube maps are using direction as their texture coordinates. A quote from the OpenGL wiki:
You have to calculate the direction of the fragment is pointing at to get a cube map direction. You could use the vertex normals for that, or some other mechanism. In your case of shadows, I'm guessing (I've not actually done that yet myself, I am a learner too) you could get the direction from the camera to the fragment to get the correct depth texel, or at least something similar to that. Read a tutorial about cube maps. |
|||
|