Depth Shadows

Well, i´d like to add shadows to my engine and i´d like to use depth-maps.
Now i read some stuff about it and know the basics. However i came across one thing which i couldn´t get an answer to in those beginner tutorials:

I want to use the depth-shadows for point-lights, so i have to use 6 textures. Now i was thinking, that i could put those 6 textures into one cubemap.
Now i read a tutorial, which used ONE texture (for a spotlight) but already needed all four texture-coordinates! But when i use a cubemap, wouldn´t i need another texture-coordinate, which means 5!? I don´t think it´s possible to use 5 texture-coordinates for one texture-access, so i am a bit confused at the moment.

Could someone tell me, if this is true, or if it works compeletely different?

And could someone tell me how good the quality is? I only saw a lot of demos, which usually looked quite good, but i am interessted in using it as an alround-solution, and certainly then there are a lot more quality issues.

Thanks, and merry Christmas.

Just draw up the math. When you use a cube map, all you need is the vector from the point light to the fragment being colored, which means three coordinate values. It’s also trivially simple to extract in the shader, as opposed to the projected spot light case which requires homogenous projection.

How did you put 6 depth maps in a cubemap?
The current ARB extension is limited to 2D depth maps.

Originally posted by V-man:
How did you put 6 depth maps in a cubemap?
The current ARB extension is limited to 2D depth maps.

I didn´t, because i didn´t try it yet. I was simply thinking, that there should be no limitation of this kind.

That´s really bad news :frowning:


Well, what alternatives do i have now? If i use depth-shadows, i need 6 additional passes for shadows, which COULD be done in one pass (together with lighting!), if the extension would support cubemaps. Who the hell decided, that cubemaps should not be supported???

That means, that depth-shadows are quite useless, as long as i stick to the dumb idea, to create an engine, that does support other types than only spotlights.

So, stencil-shadows, eh? No, i don´t like them.

Damn, i´m really really upset. Did noone ever think about adding cubemap-support?

The guys at nVidia and ATI should stop writing tech-demos, they should try to do some real stuff, then they would know what one needs.


You can encode depth values as color values, or you can use ID shadow maps (which are very similar to depth shadow maps); again with encoding into the color channel.

Note that, sadly, this is easier to set up and get working in Direct3D. Where are those superbuffers when you need them?


One option is also to use dual paraboloid shadow mapping (search), there you only need 2 normal depth textures for a point light. It requires some extra work, though, since you need to tesselate large polygons, but you can get it running pretty fast if you design the whole engine to support it. For information how I made it work in my engine, as well as a lot of discussion on shadow methods, see this thread: