Xbox LIVE Indie Games
Sort Discussions: Previous Discussion Next Discussion
Page 1 of 1 (17 posts)

Avatars and shadow maps

Last post 3/14/2011 5:00 PM by Life Projects. 16 replies.
  • 6/15/2009 4:38 PM

    Avatars and shadow maps

    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?
  • 6/15/2009 4:45 PM In reply to

    Re: Avatars and shadow maps

    Answer
    Reply Quote
    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.
  • 6/15/2009 4:53 PM In reply to

    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? ;-)
  • 6/15/2009 5:18 PM In reply to

    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.
  • 6/15/2009 5:35 PM In reply to

    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?
  • 6/15/2009 5:47 PM In reply to

    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.
  • 6/15/2009 6:17 PM In reply to

    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.  :)
  • 6/15/2009 6:52 PM In reply to

    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.


  • 7/5/2009 11:09 PM In reply to

    Re: Avatars and shadow maps

    It's not the method described by Jon but it could work ok for simple games:

    http://amapplease.blogspot.com/2009/07/xnavatars-part-2-no-shadows.html
  • 7/23/2009 7:27 AM In reply to

    Re: Avatars and shadow maps

    Just thought I'd chime in here and say that shadow mapping with avatars IS possible, with a trick or two:

    http://www.x-tatic.net/images/AvatarShadowMapBox.jpg
  • 7/24/2009 5:57 PM In reply to

    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?
  • 7/24/2009 9:33 PM In reply to

    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
  • 7/26/2009 11:38 AM In reply to

    Re: Avatars and shadow maps

    XTatic:
    Just thought I'd chime in here and say that shadow mapping with avatars IS possible, with a trick or two:
    http://www.x-tatic.net/images/AvatarShadowMapBox.jpg

    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
  • 7/26/2009 7:10 PM In reply to

    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
  • 3/14/2011 11:35 AM In reply to

    Re: Avatars and shadow maps

    I do apologize but avatar shadows are very possible self shadowing is tricky but full dynamic avatar shadows are possible even with deferred rendering using their alpha channel

  • 3/14/2011 12:38 PM In reply to

    Re: Avatars and shadow maps

    ItsQ:
    I do apologize but avatar shadows are very possible self shadowing is tricky but full dynamic avatar shadows are possible even with deferred rendering using their alpha channel


    This is quite an old thread you've replied to. I'm sure a fair few developers have used shadowing techniques in their avatar games now. The avatars in our own games cast shadows (using the stencil / write depth method (deferred renderer).
  • 3/14/2011 5:00 PM In reply to

    Re: Avatars and shadow maps

    This thread is old because nobody but synapse gaming can do it if you do know someone please post their site because alot of programmer would like this knowledge but have forgot it because of the support.  please provide pictures of avatar (non planar )shadows or website links. I have done the research..
Page 1 of 1 (17 posts) Previous Discussion Next Discussion