-
-
- (575)
-
premium membership
-
Posts
436
|
|
Looking through the docs for the Avatar support, I can't see the support for self-shadowing maps. Am I looking in the wrong place?
Also, I can't see how you are supposed to be able to render the avatar to a shadow map that would be used for the rest of the scene - is this even possible?
|
|
-
-
- (12511)
-
Team XNA
-
Posts
8,442
|
Re: Avatars and shadow maps
|
Avatars don't support custom shaders, which includes shadow maps.
To cast shadows onto an avatar, stencil shadows should work ok, but I don't think shadow maps are possible.
To cast shadows from an avatar onto the environment, depth based shadow maps are out, but you could use an ID based shadow map.
XNA Framework Developer -
blog - homepage
|
|
-
-
- (8409)
-
premium membership
-
Posts
3,568
|
Re: Avatars and shadow maps
|
Shawn Hargreaves:
To cast shadows from an avatar onto the environment, depth based shadow maps are out, but you could use an ID based shadow map.
So what would be our options for casting shadows from Avatars onto objects?
I mean, this is the Xbox 360. Aren't we past the N64 era (Wii-era too, actually) of circular darkened quads stuck to the feet of our characters? ;-)
"Software is never finished, it is in varying states of 'less broken'" because "If it ain't broke, it doesn't have enough features yet" The signature that was too big for the 512 char limit
|
|
-
-
- (12511)
-
Team XNA
-
Posts
8,442
|
Re: Avatars and shadow maps
|
UberGeekGames:
So what would be our options for casting shadows from Avatars onto objects?
ID based shadow maps are the most practical option I can think of.
But yes, you do lose a lot of control over rendering and shading when you decide to use avatars. The avatar system has more of a cartoony graphical style, which is great for some games, but not so appropriate for others that are going for more realistic character models and lighting.
XNA Framework Developer -
blog - homepage
|
|
-
-
- (1540)
-
premium membership
-
Posts
318
|
Re: Avatars and shadow maps
|
Wait, why are depth-based shadow techniques out for having avatars cast (not receive) shadows? As long as the avatar writes to the depth buffer when rendered, it seems like you would have all you need. Though perhaps I need to brush up on my shadow mapping algorithms?
|
|
-
-
- (14386)
-
premium membership
Team XNA
-
Posts
9,236
|
Re: Avatars and shadow maps
|
Sowaz:Wait, why are depth-based shadow techniques out for having avatars cast (not receive) shadows? As long as the avatar writes to the depth buffer when rendered, it seems like you would have all you need. Though perhaps I need to brush up on my shadow mapping algorithms?
Because you have no read access to the depth buffer, so there's no way to get that depth information. To implement shadow maps you normally render the object's depth (using your own pixel shader) to a render target. Since you can't use custom shaders with avatars, such approach is not possible.
|
|
-
-
- (1892)
-
premium membership
-
Posts
632
|
Re: Avatars and shadow maps
|
UberGeekGames: Shawn Hargreaves:
To cast shadows from an avatar onto the environment, depth based shadow maps are out, but you could use an ID based shadow map.
So what would be our options for casting shadows from Avatars onto objects?
I mean, this is the Xbox 360. Aren't we past the N64 era (Wii-era too, actually) of circular darkened quads stuck to the feet of our characters? ;-)
My plan is to build a dummy avatar model and use it for shadow mapping. The shadow will not be 100% accurate but I think most people won't be able to tell.
I do have a game I'm working on that does use the circular darkened quads for shadows ( Not avatar related ). They look good too. :)
|
|
-
-
- (8179)
-
premium membership
MVP
-
Posts
6,081
|
Re: Avatars and shadow maps
|
You can flatten the avatar and render to a stencil map to get an area of "stuff to shadow" if you want. In fact, you can render your depth map that way:
0) from the point of view of the light
1) render to stencil buffer, setting any pixel touched by avatar
2) re-render, writing a "central" depth to a render target where the stencil buffer is touched (typically the plane through the center of the avatar)
This doesn't give you self-shadowing on the avatar, but it does give you depth shadows on anything beyond the avatar.
Jon Watte, Direct3D MVP Tweets, occasionallykW X-port 3ds Max .X exporter kW Animation source code
|
|
-
-
- (384)
-
premium membership
MVP
-
Posts
322
|
Re: Avatars and shadow maps
|
|
|
-
|
|
Re: Avatars and shadow maps
|
|
|
-
|
|
Re: Avatars and shadow maps
|
I suppose you could use this technique to implement stencil volume shadows as well, that would give self shadowing. I wonder if the hard edges of the shadows though would make it more obvious that the shadow caster is a stand-in. I don't suppose there is a way to get access to the geometry of the avatar for creating the shadow volumes eh?
- Fourth floor - Guns, Toys, Keys to Super Weapons
|
|
-
-
- (606)
-
premium membership
-
Posts
325
|
Re: Avatars and shadow maps
|
UberGeekGames:Aren't we past the N64 era (Wii-era too, actually) of circular darkened quads stuck to the feet of our characters? ;-)
This worked fine for World of Warcraft for almost 4 years :-D
|
|
-
-
- (12)
-
premium membership
-
Posts
28
|
Re: Avatars and shadow maps
|
XTatic:
Could you please explain the "trick or two"? ;)
I think i understood you used a fake avatar model, but what else?
Did anyone noticed that in the "1 against 100" beta testing avatars have soft self shadows? :s
|
|
-
-
- (164)
-
premium membership
-
Posts
32
|
Re: Avatars and shadow maps
|
The problem with shadow maps and avatars is that even if you manage to render the depth in some way (dummy model, center-plane-depth), you'll not be able to do self-shadowing since it requires depth tests when rendering the
actual avatar. Combining a dummy model (that has thicker geometry than the avatar) and the stencil buffer (as jwatte said) would produce quite good results though. Always rendering the dummy model depths while using a stencil mask created by solely the avatar
to render the avatar parts of the depth maps / final comparison map.
I didn't see any self-shadowing in X-tatic's screenshot but this might be what he is doing/planning to do though :P
|
|
|