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 15344 times)
Mietze
Community Member
*
Posts: 412

Pleeease, don't let it crash!


WWW
« Reply #40 on: March 31, 2009, 03:50:41 PM »

Just a shot in the wild: Did you try outputting the depth map projected on the actor to see if it's there?
Logged

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


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

Yeah he seems to be there on all four splits. its rather weird Tongue I think its something to do with the UV's maybe? idk..
Logged

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

Pleeease, don't let it crash!


WWW
« Reply #42 on: March 31, 2009, 04:14:21 PM »

And what happens if you only output the respective color channel (current split) of the depth map?
Logged

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


WWW
« Reply #43 on: March 31, 2009, 04:20:23 PM »

Not sure how to do that. Tongue lol Would that mean rendering only one split to the surface? Thanks for all the help so far! Smiley

-Toaster
Logged

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

Pleeease, don't let it crash!


WWW
« Reply #44 on: March 31, 2009, 04:43:49 PM »

Code:
float4 PS_Shadowed(VS_SHADOWED_OUTPUT IN) : COLOR
{
  half fSplitIndex = GetSplitByDepth(IN.vDepthAndTextureUV.z);
  float fColor = tex2D(sampShadowMap, faSplitUV[fSplitIndex].xy)[fSplitIndex];
  return float4(fColor.rrr, 1.0f);
}

Cheesy
Logged

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


WWW
« Reply #45 on: March 31, 2009, 05:01:27 PM »

Hmm that renders the actor black. Least we are getting closer. lol

Edit:
Im running into light bleeding problems when using the shadows in screenspace. As you can see from this screenshot:



Now I know I need to somehow check the depth map to fix this but im not entirely sure how I can do this. In my composite shader I do..

Code:
float4 colors =  Color * ShadowFinal;

and even without a blur I still have light bleeding. Can I even run a check in the composite shader? If so how can I do this?

Thanks for all the help so far! Cheesy

-Toaster
« Last Edit: April 01, 2009, 03:01:34 PM by Toaster » Logged

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


WWW
« Reply #46 on: April 02, 2009, 11:39:56 AM »

I already spoke a bit with him about this on MSN, but here goes : the point of ESM/VSM is to be able to blur the depth map instead of performing a screen-space blur afterwards. This also fixes the problem that all depths from the camera have the same amount of blur. So you should blur the depth map instead of the composite.
Logged

Mietze
Community Member
*
Posts: 412

Pleeease, don't let it crash!


WWW
« Reply #47 on: April 04, 2009, 09:23:06 AM »

So you should blur the depth map instead of the composite.
Agreed Smiley
Logged

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


WWW
« Reply #48 on: April 17, 2009, 04:38:30 PM »

I finally got it!  Smiley PSESM with a Gaussian blur shader on the depth map.

Blurred is on the right and no blur is on the left.
http://img4.imageshack.us/img4/1282/psesm.jpg

This is using a 1024 depth map and a 9 tap Gaussian blur.

Thanks to Mietze for all his help specially with the PSSM/ESM and thanks to Zak for the Gaussian blur shader and helping me to apply it to the depth map properly. Smiley

-Toaster

Logged

Visit my site at: Unknown Abstraction
sybixsus
Customers
Community Member
*****
Posts: 1339


WWW
« Reply #49 on: April 17, 2009, 05:38:02 PM »

When you say a 9 tap blur, do you mean 9x9 or 3x3? If it's the latter, I must be doing something wrong with my blur.
Logged
Toaster
Community Member
*
Posts: 332


WWW
« Reply #50 on: April 17, 2009, 07:52:22 PM »

I believe its a 9x9. I don't know for sure cause I'm using zak's shader. Tongue Also make sure your depth map sampler(in your mesh/terrain shader) is setup to at least use linear filtering. Like:

Code:
texture texShadowMap;
sampler2D sampShadowMap  =
sampler_state
{
Texture = (texShadowMap);
MinFilter = Linear; //None, Point, Linear, Anisotropic(not sure what cards support which)
MagFilter = Linear;
MipFilter = Linear;
AddressU = Border;
AddressV = Border;
AddressW = Border;
BorderColor = 0x000000;
};

With that set to none it looks horrible. Tongue

-Toaster
« Last Edit: April 17, 2009, 07:54:29 PM by Toaster » Logged

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


WWW
« Reply #51 on: April 17, 2009, 10:56:47 PM »

Yep, it's 9x9, and the shader's here : http://www.truevision3d.com/forums/showcase/post_processing_sample_componentservice_architecture-t18038.0.html;msg123793#msg123793

It goes up to 17x17 in a single pass! (well, horizontal + vertical, so I guess that's two passes)
Logged

Mietze
Community Member
*
Posts: 412

Pleeease, don't let it crash!


WWW
« Reply #52 on: April 18, 2009, 06:45:22 AM »

@Toaster: What about the per split kernel size? Smiley
Logged

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


WWW
« Reply #53 on: April 18, 2009, 05:15:35 PM »

Ah there is no per split kernel size yet. So right now I get ugly lines where the splits meet up. Tongue

You can see it here:
http://img4.imageshack.us/img4/1038/linesw.jpg

I don't really get any other errors besides this line and its not top on my list of things to fix. I'm not even sure really how I would change the kernel size based on the split. Pretty sure with more hard work I can eventually figure it out though. lol

-Toaster
Logged

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

Pleeease, don't let it crash!


WWW
« Reply #54 on: April 18, 2009, 05:42:30 PM »

However, I'm glad that you've got it working Smiley
Logged

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


« Reply #55 on: June 10, 2009, 06:28:31 AM »

hi there,
i am trying to modify the light pos,but the light/shadow map's color is keeping changing,why?how to fix this?
« Last Edit: June 10, 2009, 06:31:08 AM by winspy » Logged
Mietze
Community Member
*
Posts: 412

Pleeease, don't let it crash!


WWW
« Reply #56 on: June 10, 2009, 10:27:23 AM »

Since its using a directional light, there is no light position at all!
Logged

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


« Reply #57 on: June 10, 2009, 08:05:32 PM »

wrong input,i mean change the light direction vector
Logged
Mietze
Community Member
*
Posts: 412

Pleeease, don't let it crash!


WWW
« Reply #58 on: June 10, 2009, 11:16:38 PM »

When you move the lights direction, the shadow maps color will also change. Since its a representation of depth, this should make sense, shouldnt it? If I didnt understand your problem, please point me in the right direction with screenshots or something Grin
Logged

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


« Reply #59 on: June 11, 2009, 02:53:23 AM »

just curious,so when the light direction changed we can just see some colorful shadows??
what should i do when i want to use this in my game?
that's weird to see colurful shadow(usually we see black/gray shadow)!!!
sorry may be i am too new to understand this!!(just use tv for a little while)
Logged
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