PDA

View Full Version : Depth Shadows



Jan
12-25-2003, 12:30 PM
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.
Jan.

jwatte
12-25-2003, 02:46 PM
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.

V-man
12-25-2003, 06:47 PM
How did you put 6 depth maps in a cubemap?
The current ARB extension is limited to 2D depth maps.

Jan
12-26-2003, 04:51 AM
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 :-(

Jan.

Jan
12-26-2003, 05:34 AM
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.

Jan.

jwatte
12-26-2003, 09:57 AM
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?

JustHanging
12-27-2003, 04:07 AM
Hi,

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: http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/010233.html

-Ilkka