Jump to content

  • Log In with Google      Sign In   
  • Create Account


Shadow Mapping Blending with Multi-pass Render


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 DJTN   Members   -  Reputation: 207

Like
0Likes
Like

Posted 11 April 2011 - 06:54 PM

I have multiple shadow maps (one per light – 5 total) and at first, I wanted to render the shadow maps in one shader pass and separate my shadows from my lights but the hardware limitations from older cards quickly rid me of that approach. I'm still separating my shadowing from lighting but I have to do multiple passes for each shadow map. The problem is that I cannot get the SRC and DEST alpha blending to work correctly. In my shader I’m only rendering the shadows with the basic material (texture) for the geometry. No lights, nothing…

What are the standard blend settings for rendering shadow maps with a multi-pass rendering for good dark shadows?






Sponsor:

#2 DJTN   Members   -  Reputation: 207

Like
3Likes
Like

Posted 12 April 2011 - 10:53 AM

Again, no help from this forum… not complaining, just saying. Am I on a black list or is my question not worthy or worded correctly?

Anyway, I solved my problem on my own. For anyone who is having the same/similar issue:

My rendering process uses multi-passes to render lighting- this means I’m using additive blending for each light. When I started to add shadow mapping I was rigging my light shader to also calculate the shadow. This left me with a decent shadow for the first light but after that each shadow was blended using the same blending algorithm used by my additional lights- making the shadow too light (barely visible) and not consistent with the first shadow. I also started noticing how limiting the coupling of lights and shadows were. To decouple them and solve my issue I first render the scene with ambient light only. Then I render my shadows in the next pass (for each light) using additive blending. Source blend = ZERO and Destination Blend = SOURCE COLOR. In my shadow rendering shader I returned white for non shadowed areas and black for shadowed areas. Then I render each light with Blend ONE for both Destination and Source. This is working well but there’s more tweaking that needs to be done (i.e. handing transparency for the shadow as well as billboards with transparency).

Hope this helps someone.

Cheers,
Dj

#3 Jason Z   Crossbones+   -  Reputation: 4858

Like
0Likes
Like

Posted 12 April 2011 - 03:05 PM

I am happy that you figured out your problem, and sorry that someone else didn't help you out before hand. However, looking at the dates/times of your post it looks like they were about 16 hours apart. That is normally enough time for someone to bite, but it isn't unusual to have to bump a topic over several days until someone with experience on your specific problem finds your post.

I also don't see anything wrong with the way you worded your post, although I didn't really understand initially what the issue was until I read your resolution. The fact that you shared your solution is a good thing - I don't think you are blacklisted, and contributing back to the community in this way will only help you get more answers down the line... You just have to be patient and understand that sometimes the right people aren't around at the right time.

In any case, I'll keep an eye out for your next post :P

#4 DJTN   Members   -  Reputation: 207

Like
0Likes
Like

Posted 16 April 2011 - 12:41 PM

Thanks Jason. Sorry for the late reply, didn’t have notifications turned on for this post. The reason I'm back is I ran into another problem and wanted to add to my post.


Flicker Issues:

After I got my shadowing algorithm linked up I started noticing sever artifacts with my normal mapping and reflection materials. This was due to depth fighting. For anyone else having this issue, it's because of the precession (or lack of precision) in the zbuffer. There is a render state you can adjust when doing occlusion or multi-passes that allows you to adjust the depth. It's called "DEPTHBIAS".

I set it to 1 during the occlusion portion of my render then I set it back to 0.

Hope this helps someone...

Cheers,
Dj







Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS