Stencil shadows vs. Shadowmapping
by Florian Ross · in Torque Game Engine Advanced · 08/01/2005 (3:08 pm) · 20 replies
Hi,
I currently evaluate all technical necessarities for our game project.
When it comes to shadow techniques i just dont know where the boat is headed to.
I know that it is completely unclear of what shadow technique will be implemented
in MS 4. If i look at Matts recent Blog and John Kabus lates Lighting Pack for TSE
Screenshots and Videos i tend to get the impression of preferance for stencil shadowing :).
For our project i prefer Shadowmapping for a few reasons so my question is:
would it be hard (if we really get stencilshadows in MS4) to add Shadowmapping to the Engine?
I currently evaluate all technical necessarities for our game project.
When it comes to shadow techniques i just dont know where the boat is headed to.
I know that it is completely unclear of what shadow technique will be implemented
in MS 4. If i look at Matts recent Blog and John Kabus lates Lighting Pack for TSE
Screenshots and Videos i tend to get the impression of preferance for stencil shadowing :).
For our project i prefer Shadowmapping for a few reasons so my question is:
would it be hard (if we really get stencilshadows in MS4) to add Shadowmapping to the Engine?
About the author
#2
08/01/2005 (8:43 pm)
Hm.. Please tell me they will look good though. :) Shadow mapping always comes out with those awful artifacts on the edges.. I've seen some examples on smooth shadow mapping with HLSL shaders. Would be so awesome if you guys went on a route like that!
#3
@Jacob i suspect that GG will use some form of "perspective shadow mapping" for shadowing. So i dont think they
will allow artifacts to occur
very exciting stuff indeed :)
08/02/2005 (12:52 am)
Thats definetely good new to hear@Jacob i suspect that GG will use some form of "perspective shadow mapping" for shadowing. So i dont think they
will allow artifacts to occur
very exciting stuff indeed :)
#4
I have an idea for a shadow system for a future game, that is mostly indoors, using shadow mapping, but using a different approach for managing details instead of the 'ol "render everything from light view point" and using lightmaps in the mix. By having interiors and static geometry use good old lightmaps, and each static lights using pre-calculated depth maps taken from the static geometry around them.
These pre-calculated maps are only to be projected on dynamic models (like moving players), and are only loaded into memory if a dynamic object is in the light's range. The dynamic objects' self shadowing is handled in another pass, when dynamic objects will self-shadow using a orthographic projection of themselves based on the direction of the most relevant light (similar in the way the new TGE lighting pack changes the shadow direction), allowing for more detailed self shadowing, while the envronment shadows still project on themselves.
Then the dynamic objects' shadows would be projected on the envronment, in a GPU-ish version of stock TGE shadows (but with a shadow per light). There are a few issues I must solve (like managing all those depth textures and finding ways to batch passes), but this would, in theory, allow for higher resolution shadows where it matters.
08/26/2005 (10:04 am)
IMO, shadows are done best when they are tailored for the game they are going to be used at. Right now there isn't a magical shadowing solution that can cover *all* shadowing needs and run at awesome performance at the same time. Specialized solutions are the best route.I have an idea for a shadow system for a future game, that is mostly indoors, using shadow mapping, but using a different approach for managing details instead of the 'ol "render everything from light view point" and using lightmaps in the mix. By having interiors and static geometry use good old lightmaps, and each static lights using pre-calculated depth maps taken from the static geometry around them.
These pre-calculated maps are only to be projected on dynamic models (like moving players), and are only loaded into memory if a dynamic object is in the light's range. The dynamic objects' self shadowing is handled in another pass, when dynamic objects will self-shadow using a orthographic projection of themselves based on the direction of the most relevant light (similar in the way the new TGE lighting pack changes the shadow direction), allowing for more detailed self shadowing, while the envronment shadows still project on themselves.
Then the dynamic objects' shadows would be projected on the envronment, in a GPU-ish version of stock TGE shadows (but with a shadow per light). There are a few issues I must solve (like managing all those depth textures and finding ways to batch passes), but this would, in theory, allow for higher resolution shadows where it matters.
#5
08/26/2005 (11:11 am)
Wow shadowmapping? So TSE is going all the way with being a next generation indie game engine. I am very impressed.
#6
08/26/2005 (12:14 pm)
I suspect when Brian says shadow mapping he means only for dynamic objects and not as general replacement for lightmaps.
#7
08/26/2005 (12:33 pm)
Well, I hope so.. I really need the full dynamic shadows on interiors and terrains alike, but fall very short of having the ability to do it myself.
#8
08/26/2005 (1:08 pm)
Full dynamic shadows on everything would be insane. I'm hoping to at least see dynamic shadows for interiors, but I'm not holding my breath when it comes to terrain.
#9
I also look forward to seeing what Carmack does in the next engine as he's publicly discussed moving to shadow buffers.
08/26/2005 (1:08 pm)
If i ever get a chance to tackle the unified light and shadow system everyone seems to be seeking i'd start from Tom Forsyth's work here and results here. He makes the point that we've fundamentally been thinking of the shadow map issue incorrectly... we've been caster focused while a receiver focused system is more stable and much simpler.I also look forward to seeing what Carmack does in the next engine as he's publicly discussed moving to shadow buffers.
#10
No worse then Doom 3, which even had them on its terrain. And if you hope to show up anywhere on the map of next-generation work, thats what you want to aim for. Most new things comming out now are all dynamic and I know I'll need it myself. I couldn't care less about if low-end comps could handle it.
If GG doesn't go on the fully dynamic route though, not sure what I'll do.. :/
08/26/2005 (1:16 pm)
Quote:Full dynamic shadows on everything would be insane. I'm hoping to at least see dynamic shadows for interiors, but I'm not holding my breath when it comes to terrain.
No worse then Doom 3, which even had them on its terrain. And if you hope to show up anywhere on the map of next-generation work, thats what you want to aim for. Most new things comming out now are all dynamic and I know I'll need it myself. I couldn't care less about if low-end comps could handle it.
If GG doesn't go on the fully dynamic route though, not sure what I'll do.. :/
#11
@Jacob - Do them yourself and resource it. =)
08/26/2005 (1:28 pm)
@Josh - Actually terrain is easier than interiors. Terrain has generally one projection plane and one distant light source. If you partition your shadow buffer into different resolutions and distances around the camera you get very good results in comparison to a single buffer solution people have done in the past. See Jonathan Blow's work here and here.@Jacob - Do them yourself and resource it. =)
#12
Oh, and Tom, already said. I can't. I have nowhere near the ability.
08/26/2005 (1:32 pm)
Well basically I'd just like to see GG offer up all dynamic shadows so I no longer have to worry about lightmaps. I'm going to have a game that uses alot of day/night cycles and having the shadows able to shift on their own would make things so much easier then having to do one of the rather ugly other methods.Oh, and Tom, already said. I can't. I have nowhere near the ability.
#13
08/26/2005 (1:34 pm)
Same reason as Jacob here. But I'm sure it will work out in the end.
#14
I would love to see them do this as well, but we have to be realistic about it.
As Stefan says it will all get worked out in the end.
08/26/2005 (1:39 pm)
@Jacob - Well name a game with fully dynamic indoor and outdoor lighting and shadows with day night cycles? So far there are only a few instances of people getting something near this working with limitations... so it's all really cutting edge stuff. A unified light and shadow system generalized enough to work in any game a TSE licensee would use it for would be a huge undertaking. The GG staff can only do so much with their limited resources and it's up to the community members to contribute things they do not have the man power or time to get to.I would love to see them do this as well, but we have to be realistic about it.
As Stefan says it will all get worked out in the end.
#15
08/26/2005 (1:48 pm)
@Tom: I didn't know that about terrain shadowing(well, I don't really know anything, heh). I'm nto sure how it'd work out with the way I want to use Atlas. Think canyons made up of different terrains for the bottom, sides, and ridges, allowing for all kinds of detail.
#16
Although I think we'll just hold off on such talk until maybe a GG worker gives the word on it.
08/26/2005 (1:49 pm)
Well from what I've seen on the lighting pack screenshots from way back when, looked like dynamic interior lights. That leaves terrain, which I'm sure couldn't be too bad.Although I think we'll just hold off on such talk until maybe a GG worker gives the word on it.
#17
08/26/2005 (2:33 pm)
Speaking of terrain lighting..(I was reading this and thought i'd interject), I've been messing around with getting normal maps working with atlas. A 4096x4096 (pixel for pixel with atlas texture) normal map brings the mission down to a crawl..:) So im going to have to dig into ben's chunker code to see how he did it economically. I was, however, able to add a smaller normalmap (similar to the detail 1 and 2 textures) working. Had to loose 1 of the detail textures tho to get it to fit in SM 1.4, but other than that, it worked pretty well. As far as actually lighting atlas..For now, we are adding lighting (static) by hand painting onto a lightmap texture then blending that in the shader. For an iterim solution, that kind of system works pretty good. For your day night cycles I'm sure you could work out something similar, Swapping out lightmap textures ala www.garagegames.com/mg/forums/result.thread.php?qt=29185 - although i havent really looked too far into this.
#18
Then we'll look at shadowing the outside of interiors onto terrain, since that would save us some grief with re-shadowing Atlas terrain lightmaps, and it also looks damn cool when you walk into the shadow of a building in games like BF2.
There will be some experiementation on dynamic shadows inside interiors. If we can make it work in a general way and still get good performance, then we'll officially put it in.
With Constructor coming up, we're completely reworking the lightmapping system which has been loooong overdue. I think you will all be pleased with the results when we have high quality radiosity lightmaps combined with dynamic shadowing. Think a notch up from what HL2 is doing. They took a good approach there because it runs on lower end systems than Doom3, and it's more flexible for different types of games.
08/29/2005 (12:59 pm)
It would be very difficult to come up with a full dynamic shadow system that would cover interiors, dynamic objects, and terrain and still perform well. This will be the eventual goal with TSE, but we're going to start off with just using shadow buffers with dynamic objects.Then we'll look at shadowing the outside of interiors onto terrain, since that would save us some grief with re-shadowing Atlas terrain lightmaps, and it also looks damn cool when you walk into the shadow of a building in games like BF2.
There will be some experiementation on dynamic shadows inside interiors. If we can make it work in a general way and still get good performance, then we'll officially put it in.
With Constructor coming up, we're completely reworking the lightmapping system which has been loooong overdue. I think you will all be pleased with the results when we have high quality radiosity lightmaps combined with dynamic shadowing. Think a notch up from what HL2 is doing. They took a good approach there because it runs on lower end systems than Doom3, and it's more flexible for different types of games.
#19
Guess its all a matter of priority.
08/29/2005 (1:15 pm)
Hm.. Sounds ok, but still a bit unfortunate because I have no conerns whatsoever about performance. If requirements go well over Doom 3's I wouldn't mind a bit.Guess its all a matter of priority.
#20
08/30/2005 (2:08 pm)
I wish I had the same luxury, but probably a lot of others are in the same boat as me... TSE has to perform well on an average computer (ok, average computer by summer 2006 terms since that's my release goal). Not everyone isn't concerned with performance.... maybe you need a render engine not a game engine if you're not concerned with performance :p
Torque Owner Brian Ramage
Black Jacket Games