Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: 1 [2] 3 4 5
  Print  
Author Topic: [Source, Library, Sample] Parallel Split Shadow Mapping that you can re-USE  (Read 15343 times)
Mietze
Community Member
*
Posts: 412

Pleeease, don't let it crash!


WWW
« Reply #20 on: February 15, 2009, 11:47:56 AM »

Hi there,

I think I will add some things to the library the next time. I've been into ESM (Exponential Shadow Maps) for a while and the result is quite nice. ESM is similar to VSM (Variance Shadow Maps), but don't suffer from light bleeding (instead, it suffers from shadow bleeding.. lol) and they don't require two channels per depth map. I'm not done 100% with my implementation, but .. see yourself:





The standard ESM is nice, but the shadow colors are far from constant. Shadow bleeding is also a problem. I modified the ESM algorithm a bit, to face this problems. Here is my version:



And filtered!



The filtered version has the problem that the different ARGB channels need to be filtered with a different kernel, since every channel represents a different depth level from the scene cameras view. I gonna focus this later Smiley
Logged

Check out my blog at www.e-studioz.de - The finest in gross trash Wink
Mietze
Community Member
*
Posts: 412

Pleeease, don't let it crash!


WWW
« Reply #21 on: February 16, 2009, 04:33:44 PM »

Here is the the good kernel scaled filterd ESM:



The HLSL code is very unoptimized at the moment, but I will adress this problem soon.

By the way: This is only ONE 256px² RGBA-FP32 shadow map!
Logged

Check out my blog at www.e-studioz.de - The finest in gross trash Wink
Toaster
Community Member
*
Posts: 332


WWW
« Reply #22 on: February 16, 2009, 04:46:30 PM »

This looks awesome! Cheesy I love how it looks and I cant wait to play around with directional soft shadows. Wink It looks like you get amazing FPS even with the blur and the shadows dont look bad for only 256 sized map. Good work!!

-Toaster
Logged

Visit my site at: Unknown Abstraction
Zaknafein
Customers
Community Member
*****
Posts: 2935


WWW
« Reply #23 on: February 16, 2009, 06:27:56 PM »

Fantastic stuff. ESM + PCSS PSSM (edit: oops, wrong acronymn) sounds like the best thing that can be done right now!
« Last Edit: February 16, 2009, 11:37:25 PM by Zaknafein » Logged

Mietze
Community Member
*
Posts: 412

Pleeease, don't let it crash!


WWW
« Reply #24 on: February 17, 2009, 02:36:56 PM »

Hehe ya, those abbrevations are confusing Smiley

I did some testing of the whole stuff with different kernel sizes of the blur filter compared to different shadow map sizes. The result is .. as expected:



A 1024px² shadow map is a bad choice, if you want some uber blurriness. In addition, you gain the best performance (who'd expect that?) with low-resolution shadow maps, saving a lot of samples per (blur) pass. The 512px2 map is also doing very well at performance's view. Overall, low-resolution shadow maps suffer from filtering artefacts (as my kernel scale can't help there). In other words: The higher the resolution, the lower the artefacts count, but the higher the kernel size, the higher the shadow bleeding. Though we have:

Shadow Bleeding ~ Kernel Size
Artefact Count ~ Shadow Map Size

So it's up to you to find a good balanced middle.

But who cares about great performance, when the graphical result sucks? My favourites are:

Performance + Blurry = 9x9 kernel + 256px² shadow map
Performance + Sharp = 5x5 kernel + 512px² shadow map

But see yourself: Klick 4 Big



Overall, I think this single page here in the TV3D forum is a very valueable source for everyone who wanna implement his own ESM core. And for the lazy ones: Stay tuned until I release a new sample + source Smiley

Btw: Don't care about the FPS in the screenshots. I penetraded my print key for a while Smiley For some reason it doesn't work the first times (??)


EDIT: sh**... just realized, that I had 16x Anti Aliasing enabled while testing.. Add ca. 300fps per result to get non-AA performance.. Sad

« Last Edit: February 17, 2009, 03:06:58 PM by Mietze » Logged

Check out my blog at www.e-studioz.de - The finest in gross trash Wink
joshendy
Community Member
*
Posts: 20


WWW
« Reply #25 on: February 18, 2009, 12:01:13 AM »

Wow Mietze you dont stop do yah Tongue Great looking shadows! In my opinion I think the 9x9 kernel + 512px² shadow map looks wicked.

Will this new technique you're using allow multiple spot/point lights in the scene which cast shadows?
Logged
Gamecode
Customers
Community Member
*****
Posts: 460


WWW
« Reply #26 on: February 18, 2009, 07:01:09 AM »

aaagrr i need this in VB6 for my game Smiley
Logged

aiR Captains - RC aircraft project TV65
SylvainTV
Administrator
Community Member
*****
Posts: 4894


WWW
« Reply #27 on: February 18, 2009, 07:13:29 AM »

Good job Eichi !
Can we integrate it to the next tv version ? Cheesy ( I wish we could )
Logged

Regards

Sylvain Dupont
TrueVision3D Developer
sylvain@truevision3d.com

TV3D IRC at http://chat.truevision3d.com or on server irc.truevision3d.com #Truevision3D. Come talk with us !
Zaknafein
Customers
Community Member
*****
Posts: 2935


WWW
« Reply #28 on: February 18, 2009, 11:37:38 AM »

Hey by the way... 33x33 kernel size?? How the hell did you achieve that? The best I could do was 17 samples in my latest Gaussian Blur implementation.
Logged

Mietze
Community Member
*
Posts: 412

Pleeease, don't let it crash!


WWW
« Reply #29 on: February 18, 2009, 01:31:54 PM »

Good job Eichi !
Can we integrate it to the next tv version ? Cheesy ( I wish we could )
Sure! It' be a real pleasure to me! Smiley

Hey by the way... 33x33 kernel size?? How the hell did you achieve that? The best I could do was 17 samples in my latest Gaussian Blur implementation.
Its a pure pixel shader and SM3 makes it possible. Though, the blur shader REALLY sucks, but I'm outta ideas how to optimize it.. yet. I hope you could grab me on IRC, maybe you have an idea about it.
Logged

Check out my blog at www.e-studioz.de - The finest in gross trash Wink
Gamecode
Customers
Community Member
*****
Posts: 460


WWW
« Reply #30 on: February 19, 2009, 01:17:53 AM »

Good job Eichi !
Can we integrate it to the next tv version ? Cheesy ( I wish we could )

yes yes sylvain Smiley
Logged

aiR Captains - RC aircraft project TV65
lovetv3d
Community Member
*
Posts: 140


« Reply #31 on: March 04, 2009, 02:08:36 AM »

AddActorToSceneBoundingBox
why?
Logged

Sorry for poor English
Mietze
Community Member
*
Posts: 412

Pleeease, don't let it crash!


WWW
« Reply #32 on: March 05, 2009, 11:26:14 AM »

AddActorToSceneBoundingBox
why?
Heh? Its not in there! Smiley
Logged

Check out my blog at www.e-studioz.de - The finest in gross trash Wink
Shadowsong
Customers
Community Member
*****
Posts: 304


« Reply #33 on: March 10, 2009, 02:13:53 AM »

Quote
The answer is: no. Custom shaders override the internal ones, but normal mapping and parallax stuff is very trivial and widely spread over the internet Smiley

Ok just for getting it right, I can't use internal specular lighting when I use any custom shader (like this shadowmapping shader), right?
Logged
SylvainTV
Administrator
Community Member
*****
Posts: 4894


WWW
« Reply #34 on: March 10, 2009, 04:42:51 AM »

Yep unfortunately!
Logged

Regards

Sylvain Dupont
TrueVision3D Developer
sylvain@truevision3d.com

TV3D IRC at http://chat.truevision3d.com or on server irc.truevision3d.com #Truevision3D. Come talk with us !
Toaster
Community Member
*
Posts: 332


WWW
« Reply #35 on: March 31, 2009, 12:46:03 PM »

Just yesterday I started adding this to my project. First thing I wanted to do was rewrite some parts since I wanted it to adapt better to my program. I also wanted to add support for Actors as well as landscapes which I easily did. I use the shadows in screenspace so I don't have to worry about outputting the correct color I can just use TV's lighting. Then in a combining Postprocess I simply do FinalColor = Color * Shadows; This allows me to apply a 9 tap Gaussian blur to the shadows as well. I do have a bit of a problem with light bleeding but its not really a concern of mine. Anyways here's what I have so far:

http://img17.imageshack.us/img17/825/pssmshadowmapping.jpg
http://img15.imageshack.us/img15/3221/actorshadows.jpg

I added the bounding box of the landscapes/actors to your scenes bounding box. I also render the actors with their own custom shader.
Now everything looks pretty great but im running into problems with the splits and with the actors self shadows. Its rather hard to describe so I made a video of it.

You can watch the video online here:
http://tinypic.com/player.php?v=10qkitv&s=5

or you can download here:
http://www.megaupload.com/?d=3DX93FR1

I've tried changing the far plane of the shadows but no matter how big or small I make it I still get the same effect. I also tried tweaking some of the other values but I cant seem to fix it. I was wondering if you had any ideas as to why this might happen? As for the actors self shadows they just simply do not exist they cast but they don't receive.

Thanks for any help and thanks for making such a wonderful shader! Smiley

-Toaster
Logged

Visit my site at: Unknown Abstraction
Mietze
Community Member
*
Posts: 412

Pleeease, don't let it crash!


WWW
« Reply #36 on: March 31, 2009, 01:22:32 PM »

Try to tweak your depth bias that is causing the self shadowing artefacts. If there are no self shadows on actors, then the bias is way to high. The actor disappearing on the landscape is due to the light cameras distance to the center of the frustum split. Try increasing the PSSM.ExtraDistance property to increase the distance.

Thanks for any help and thanks for making such a wonderful shader! Smiley
The shader was the easiest part, believe me Smiley

PS: Eh.. and btw: adding actors the a scene bounding box doesn't make as that sense, does it?
« Last Edit: March 31, 2009, 01:24:56 PM by Mietze » Logged

Check out my blog at www.e-studioz.de - The finest in gross trash Wink
Toaster
Community Member
*
Posts: 332


WWW
« Reply #37 on: March 31, 2009, 03:02:31 PM »

Thanks I was able to fix the split issue. I set the extra distance to 200. I was trying to use linear depth to fix some of the aliasing on the landscape but I ended up just using a custom landscape shader so I could set the bias different. Actors wont receive shadows no matter what bias though. I've tried everything from 1f to .0000001f no luck. I don't know maybe you can take a look at the actor shader?

http://www.nomorepasting.com/getpaste.php?pasteid=25369

I probably missed something or did one little thing wrong. Tongue

Thanks for all the help so far! Grin

-Toaster
Logged

Visit my site at: Unknown Abstraction
Mietze
Community Member
*
Posts: 412

Pleeease, don't let it crash!


WWW
« Reply #38 on: March 31, 2009, 03:31:58 PM »

So shader looks good so far. The only thing that could be one error source is that the semantics WORLD and VIEWPROJECTION are used two times. Maybe TV3D will only fill the first one (so the light matrices are broken afterwards). Do the actors receive shadows from other objects? Or are the self shadows the only stuff missing?
Logged

Check out my blog at www.e-studioz.de - The finest in gross trash Wink
Toaster
Community Member
*
Posts: 332


WWW
« Reply #39 on: March 31, 2009, 03:45:40 PM »

hmm okay I got rid of the other WORLD and VIEWPROJECTION just using one now that was bad coding I just did it fast wanted it to work. lol Still no shadows on actors and I put the actor under the landscape and he renders white.

-Toaster
Logged

Visit my site at: Unknown Abstraction
Pages: 1 [2] 3 4 5
  Print  
 
Jump to:  

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