pointlight shadowmaps

I finally found an example code for shadowmap implementon which is not 4500 lines long ( I have better to do that kill my self with those).
So, as I have understood, shadowmaps can only be used for spotlights to generate a depthmap and so on, but how to make shadows from a point light?
I have heard that it can be done using cubemaps (which I don’t know really).
Does that mean simply that you generate 6 depth maps from every direction in the pointlight’s of view and then handle them all? Six passes, doesn’t that crash down the performance?

Secondly´: are shadowmaps better for hi-polygon model that stencil hadows then talking about speed?
What about when using shadowmaps with pointlights?

highly flameable topic.

you can do it with cubemaps by rendering the six sides, bind this cubemap and use it. doing it on todays hw is a) quite overkill due the 6 passes and b) quite difficult due the normally quite lowprecision depthvalues. hacking that is difficult and not that useful as we soon have floatingpoint anyways…

using shadowvolumes on highresmeshes is rather simple, as there you normally be able to use the hw accelerated faked shadow volume. and the resolution of the mesh doesn’t affect the fillrate by much => its not really slower to draw the volume (except if the mesh i so detailed that you can’t draw it smooth anyways…)

my flameable opinion: shadowmaps are crap. they got much bether due the postperspectivespace mapping => much more detailed, but i still stay with shadowvolumes. they are now generic usable for all sort of (hard) shadows.

as long as i can’t render directly in one pass on a cubemap i don’t think about shadowmaps for anything but possibly some sweet spotlights (wich i rarely use…)

Anyway, I’m a little bit interested about shadowmapping, so could you tell me more specificly about using cubemaps for pointlights.

BTW, have any of you played/seen Hitman: codename 47 or incoming Mafia?
They have realtime soft shadows, any idea how they’re done?
I got soft shadows (from characters) in Hitman with Gf2 MX, and I think the shadows are fast; up to 4 shadows from each character and no hit to performance that I could notice.

possibly they just render the mesh in black onto the texture, and project that onto the world. due to bilinear filtering you get faked softshadows then.
i bet they don’t selfshadow, do they?

No. But could it be possible to project the texture also on the model so it could self-shadow?

Check out my tutorial here: http://www.ronfrazier.net/apparition/research/advanced_per_pixel_lighting.html

One of the limitations of the method discussed in my tutorial is that you are limited to 8 bit precision. Since I wrote that article, I haven’t yet had a chance to play with newer hardware. It may now be possible using 4 texture units and/or fragment programs to use much better 16 bit.

As a general note, personally I like shadow mapping a lot more than shadow volumes in the ideal case. However, I don’t see it being very realistic to expect hardware to be able to handle these very well in games for at least a few more years. In a few special cases, it is just now starting to become reasonable, but not for the general case.

What about new world order -game, there are some fine shadows, but I doubt they are realtime. What do you think?

Shadow maps are pretty good, many examples suffer from poor “percentage closer filtering” or even no PCS filtering (which is central to the algorithm), and insufficient shadowmap resolution. Yes they are lower frequency as you move away from the light in some circumstances this is a GOOD thing not a bad thing.

Hey! What shadowing capabilities does the Radeon 8500 have compaired to the GeForce cards? Could somebody list a couple shadowing sceems and tell what is good about each one? Which one is easiest to implement?

shadowmaps suck see shrek, toystory etc of sucky examples
to answer the original poster yes unfortunatley u will have to render the scene from various viewpoints (usually 6) when using shadowmaps. this normally creates a big speedhit, thus like stenciled shadows the more lights the bigger the hit. ouch. if u have a scene with heaps of lights u might be better with radiosity etc (though this usually runs like a dog also but doesnt have a problem with heaps of lights)

sorry, dude, but i’m looking at hitman currently on the screenies all around the web. most pics dont have realtime shadows at all, and those THAT have simply have stencil shadows (shadow volumes? one of them looks more like simple projected stencilshadow…)

have you some screenies that PROVE that there are real shadowmaps wich work with depthtests? i dont think there are…

http://mazy.annat.nu/images/opengl/

some of them has some “jagginess” in them, but i think they works fine.

addition: and yes, they are in realtime, even the ‘multishadow.jpg’ with 77 renderpasses ( due to the reflective balls )

[This message has been edited by Mazy (edited 08-19-2002).]

Edit: Oh… Sorry zed, you were being sarcastic weren’t you :slight_smile:

Mazy it’s the jaggies that people object to and you can help there with bilinear filtering to give percentage closer filtering on the shadow map.

[This message has been edited by dorbie (edited 08-19-2002).]

davepermen, I know for sure that hitman has soft shadows (only casted by characters), but as someone told they might be done so models are rendered to a texture as black and then it is projected on the environment.
Also in hitman there can be even 4 shadows from each character and their alpha changes.

I don’t know if this is interesting for you but I wrote an algorithm that takes a depthmap and uses a scanline algo to create shadow volumes in real time.

The depth map is then filtered by a “border shrink” filter (my own name) and then used to generate a second shadow volume and so on.

The number of shinks could be used proportional to the radius of the light source and you will get when you combine all shadow volumes a soft shadow in real time.

I have some sample pictures on my page…
www.tooltech-software.com

and on
http://www.tooltech-software.com/gizmo3d_screenshots.htm

perhaps not the best pictures but they illustrate that a fast extension in HW could be created to make the shadow volumes right on the HW without transfer the depth map to the CPU. This would give us soft shadows with a very easy implementation.

Even in my software version I get framerates about 50-100 HZ depdning on how many passes and how big the depthmap should be.

ToolTech: Is it just me, or in that first picture, are the shadows of the 2 evergreen tree/bushes (the ones in front of the white car on the road) at a different angle from all the other trees? Nice images though.

I think you are right. Those images are made by Pixxim in France, a customer of us that are using Gizmo3D.

:wink:

hey tooltech, i think you know that the new hardware supports displacementmapping… actually your shadowvolume is a displacement mapped quad, with the depthtexture as displacement, sort of, isn’t it? just as hint for your future…

Very nice images, ToolTech. Have you seen the paper “Shadow Volume Reconstruction from Depth Maps” by Michael McCool (http://www.cgl.uwaterloo.ca/Projects/rendering/shadow.html)? McCool uses an edge detection filter on his depth map to generate the shadow volume edges. Sounds similar to your approach?

– Tom