Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Self-shadowing landscapes..... nasty  (Read 713 times)
AriusEso
Customers
Community Member
*****
Posts: 377

Esoteric


« on: June 03, 2008, 09:12:14 PM »

Hey all,

I have a problem. I've managed to get some simple, point-based, shadow mapping with splatting on landscapes. It's self-shadowing, which is good, but it's also ugly as hell. I'm not really sure how to work a solution. I thought about blurring it - but I only know how to do that in screen-space( is it even possible in an object shader? ). I'm also not entirely sure how that method would work anyway - reverse the image so the shadows are white, blur, reverse the image back, render it to screen.... wouldn't this bleed badly?

So, my question is, any ideas on a decent solution?

[click for big]
Logged

Lenn
Customers
Community Member
*****
Posts: 454

Ivan Miskelic


« Reply #1 on: June 08, 2008, 11:23:18 AM »

It's pretty simple to get a shadowmap of a terrain for selfshadowing. It's just a matter of how you apply it and combine it with other shaders, that's the tricky part.

Read here:
http://www.gamedev.net/reference/articles/article1817.asp

I make shadowmaps in code, as 2d maps based on those calculations (easily converted to a bitmap or rendersurface). Then blur them in 2d, not screen space, for example using Zaks gaussian blur shader applied to a rendersurface.
« Last Edit: June 08, 2008, 11:27:07 AM by Lenn » Logged

AriusEso
Customers
Community Member
*****
Posts: 377

Esoteric


« Reply #2 on: June 08, 2008, 11:49:47 AM »

It's pretty simple to get a shadowmap of a terrain for selfshadowing. It's just a matter of how you apply it and combine it with other shaders, that's the tricky part.

Read here:
http://www.gamedev.net/reference/articles/article1817.asp

I make shadowmaps in code, as 2d maps based on those calculations (easily converted to a bitmap or rendersurface). Then blur them in 2d, not screen space, for example using Zaks gaussian blur shader applied to a rendersurface.

Yea, the difficulty I have is that I am not doing this in post. I am actually calculating the shadow maps in an object shader - which is then applied to the CTVLandscape geometry. That is not TV splatting, it is my own. I'm currently working on SSAO, so this is on hold, but I thank you for your input and I have bookmarked that url for a later date Smiley. Thanks again Lenn, I appreciate your input Wink. Although, I have used gaussian blurs before, I don't understand quite how to do it in a case such as this. I have tried rendering everything as black(shadow) and white(non-shadowed geom), inverting, then blurring it, reverting, etc and then rendering as post. But the result never seems correct. Like, hmm, it is hard to explain. But yes, what I'm trying to say is, blurring shadow maps seems like the best solution. But my efforts to do so currently have not yielded good results. So if you have any further advice I would appreciate it. Thanks Lenn Wink.
Logged

Lenn
Customers
Community Member
*****
Posts: 454

Ivan Miskelic


« Reply #3 on: June 08, 2008, 07:23:47 PM »

Uhhuh well I'm not sure I understand (or how helpful this really is). If I understand correctly, based on object space then, the accuracy of a shadow map will be based on the positions of source/terrain and their angles. You will then end up polling the landscape for occulsion in a "stretched" way if the light source is low? This may be why you get the jagged looking shadows which not even bluring would really fix. So, you would need to create (my guess is) a more even field so that you test for shadows each square unit of the landscape equally. Basing your calculations on the Y axis (viewed from above) is likely to give the most balanced and simple results, similar to the 2d solution.

Shadows never look good if you apply blur at post imho. Like the bleeding of "soft stencil shadows", if that's a similar method to what you're talking about, and if I understand correctly.

Can't you calculate the shadow based on the horizontal grid basis using the aforementioned technique and then plug that more balanced result (in a per-texel sense) back to your shader?
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks