3 registered members (AndrewAMD, Akow, 1 invisible),
1,499
guests, and 11
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
[SUB] Deferred PSSM Shadows Workaround
#413821
12/18/12 18:03
12/18/12 18:03
|
Joined: Jun 2007
Posts: 1,337 Hiporope and its pain
txesmi
OP
Serious User
|
OP
Serious User
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
|
Hi friends! I have been introducing myself into deferred rendering techniques and my first workaround comes around pssm shadows. First I thought on rendering that 'fDistance' value into a 32bit floating point bitmap, but finally I rendered the pixel world coordinates into a 4x32bits floating point bitmap, so the gates are opened to compute dynamic light rediance or dof blurring from those same values. I built a scenery that fully remarks the rendering speed improvements because of its high density of overlapping polygons. I fit the shadow splits to four and deleted all the gpu bones computation stuff. DOWNLOAD (SM3.0!) Hope it helps Salud!
|
|
|
Re: [SUB] Deferred PSSM Shadows Workaround
[Re: txesmi]
#413829
12/18/12 20:25
12/18/12 20:25
|
Joined: Jul 2004
Posts: 1,710
MMike
Serious User
|
Serious User
Joined: Jul 2004
Posts: 1,710
|
it looks weird for me!
My GPU is quite fast, and this runs with 4.5 FPS!?
Look to this artifact:
[img]https://skydrive.live.com/redir?resid=FD0C3A71DD42E9BC!586&authkey=!ALssaqjwvaBt3Ls[/img]
Last edited by MMike; 12/18/12 20:25.
|
|
|
Re: [SUB] Deferred PSSM Shadows Workaround
[Re: MMike]
#413850
12/18/12 22:26
12/18/12 22:26
|
Joined: Jun 2007
Posts: 1,337 Hiporope and its pain
txesmi
OP
Serious User
|
OP
Serious User
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
|
Yes, it look very weird for you. It should look like this: I can't imagine what happens to be so dark... That arfifact is a well known texture projection artifact, and should disapear increasing the pssm_bias value. In my old NVidiaGTX285 deferred shadows runs over 60 fps, and object shader shadows below 20 fps. It is not concibed to run smooth, but to remark the process timing difference. Ity renders more than 1 million polygons indeed! Does your graphic card support sm3.0?
|
|
|
Re: [SUB] Deferred PSSM Shadows Workaround
[Re: txesmi]
#413851
12/18/12 22:47
12/18/12 22:47
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
for me it works perfectly got 120-140 fps when running the pp-shadows - which is around 4-5x faster than the object pssm shadows. nice!
POTATO-MAN saves the day! - Random
|
|
|
Re: [SUB] Deferred PSSM Shadows Workaround
[Re: txesmi]
#413907
12/19/12 14:55
12/19/12 14:55
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
well I think he means the overall performance. an ATI HD 7670M isn't that bad and should be faster than 20 fps.
I'm using an ATI HD 7850 and get ~7x more fps than sivan.
POTATO-MAN saves the day! - Random
|
|
|
Re: [SUB] Deferred PSSM Shadows Workaround
[Re: sivan]
#413908
12/19/12 14:55
12/19/12 14:55
|
Joined: May 2005
Posts: 2,713 Lübeck
Slin
Expert
|
Expert
Joined: May 2005
Posts: 2,713
Lübeck
|
Try this for both:
float DoPCF(sampler2D sMap,float4 vShadowTexCoord,int iSqrtSamples,float fBias)
{
float fShadowTerm = 0.0f;
float fRadius = (iSqrtSamples - 1.0f) / 2;
for (float y = -fRadius; y <= fRadius; y++)
{
for (float x = -fRadius; x <= fRadius; x++)
{
float2 vOffset = float2(x,y)/pssm_res_var;
float fDepth = tex2Dlod(sMap, float4(vShadowTexCoord.xy + vOffset, 0.0f, 0.0f)).x;
float fSample = (vShadowTexCoord.z < fDepth + fBias);
float xWeight = 1, yWeight = 1;
if (x == -fRadius)
xWeight = 1 - frac(vShadowTexCoord.x * pssm_res_var);
else if (x == fRadius)
xWeight = frac(vShadowTexCoord.x * pssm_res_var);
if (y == -fRadius)
yWeight = 1 - frac(vShadowTexCoord.y * pssm_res_var);
else if (y == fRadius)
yWeight = frac(vShadowTexCoord.y * pssm_res_var);
fShadowTerm += fSample * xWeight * yWeight;
}
}
return fShadowTerm / (iSqrtSamples * iSqrtSamples);
}
|
|
|
|