XNA Creators Club Online
Page 1 of 1 (6 items)
Sort Posts: Previous Next

shadow mapping sample

Last post 08/07/2009 13:17 by aLk. 5 replies.
  • 04/07/2009 10:39

    shadow mapping sample

    Hello,

    I'm pretty new to shadow mapping and I've been tweaking the shadow sample to get the result I want before I port it to my engine.

    I'm having few problems with the light distance. It's suppose to be an orthographic view but the light seems really far away and even when I increase the resolution the change aren't really obvious.

    So I Was wondering if someone manage to get some improvement with this sample, or if I could get a way to reduce the zone where the light is looking.

    Also I'm not familiar at all with the custompom processor so it's a little confusing.
  • 06/07/2009 10:46 In reply to

    Re: shadow mapping sample

    Hi,

    If you are newer to shadow maps, the sample of creators club maybe is too much simpler for you, because it dont solve the most common problems in shadow maps, maybe you want to look for samples with most of problems solved, like this tutorials:

    http://www.ziggyware.com/readarticle.php?article_id=235

    http://www.ziggyware.com/readarticle.php?article_id=235

    The sample of creator club is nice to learn the basics, but now you maybe you want to go to next level, including filtering and solving some of aliasing problems and others, above tutorials are very good, but much advanced, look for it with time and attention:p

    Answering to your question, you can reduce the zone change camera parameters, like lookAt and position and dimensions of ortho volume, but to get better results you will need to follow some of CC stuff advices, present in documentation of sample, and use more advanced techniques, like PCF or others to perform some kind of filtering, to reduce visible aliasing.

    (sorry abou english)

    Regards
    Vando
    Like games? Like Programming? 3D Gaming and Programming
  • 07/07/2009 0:35 In reply to

    Re: shadow mapping sample

    I already look into this tutorial but I didn't try it because of the deferred rendering. I don't really think it's a good idea to try out a advanced technique when I'm not really confortable with hlsl.

    anyway I found a workaround using the sample and some other tutorial.
  • 07/07/2009 9:13 In reply to

    Re: shadow mapping sample

    Sorry, I pasted twice the same link, but here you have another tutorial without deferred shading:

    http://www.ziggyware.com/readarticle.php?article_id=161

    If you are interested in deferred shading + shadow maps, you can look for sample that I did from two ziggy tutorials, check it on blog in my signature.

    But one advice, you only will feel confortable with hlsl when you put your hands on it:p So go on it,  don't be afraid=D

    Anyway, to get shadow maps working well, you will need to change effect, because samples are very specific and work on a wonderland scenario, make for they work without too much extra complexity.

    Back to deferred shadow maps, you can use it with forward rendering, the sample using forward rendering for draw tank and plane, only shadow is deferred, take a look it's a very cool sample. The only cons that i've found in sample, is that it only works well with super HD Shadow maps, 2048*2048:| I've tried with low resolution maps, and i got very poor results, but nowadays a map with that resolution isn't a problem for any graphics card, even for my HD3450 mobile:p
    Like games? Like Programming? 3D Gaming and Programming
  • 07/07/2009 11:25 In reply to

    Re: shadow mapping sample

    yea you are right I really need to put my hands on it but I've been busy creating assets. anyways, I always hear about problem with deferred rendering, like alpha map don't work, what does it means ? You can't have particles and billboard ? If so there is no point using such a technique. I'm doing an action game and I planned to add some particule effect, so I guess this technique is not for me.

    I did use that tutorial but I di'nt not want a spotlight I was looking for a directional light( which is use in the deferred shadow tutorial) . It's easier if you planned to do an outdoor scene.

    Anyway I have few question after watching your video on your website.

    you are using few lightcameras ? how do you set which one is rendering the model ? Do you set it according to the distance ?
  • 08/07/2009 13:17 In reply to

    Re: shadow mapping sample

    This means that you can't use transparent objects with deferred shading, but like you can see in my video you can draw transparent objects after deferred draw. As you can see too, i'm using particles and billboards for particles:p In resume, you can do everything, because if it isn't compatible with deferred shading, you can do one render pass after it to do that "incompatible stuff".

    The only difference between directional and spot, is that spot has a position and a range, but the technique for rendering shadow maps is the same, but you need change some things in hlsl, you can compare two hlsl from both samples and try adapt one to other.

    In my video i used only one shadow caster and only one camera. But now, i got how much cameras as I need, for each light shadow caster, i need to make a render to project the shadow. After that i'm drawing the various shadows. Of course, its nice to have only one light that cast shadows active at each time, because shadows are expensive.

    I'm not sure, if i expressed me as I wanted:p Sorry I got some limitations with english:p

    Like games? Like Programming? 3D Gaming and Programming
Page 1 of 1 (6 items) Previous Next