Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by M_D. 04/26/24 20:22
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (M_D, AndrewAMD, Quad, Ayumi), 806 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
[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 Offline OP
Serious User
txesmi  Offline 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 grin
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 Offline
Serious User
MMike  Offline
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 Offline OP
Serious User
txesmi  Offline 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 Offline
Expert
Kartoffel  Offline
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! laugh


POTATO-MAN saves the day! - Random
Re: [SUB] Deferred PSSM Shadows Workaround [Re: Kartoffel] #413894
12/19/12 12:34
12/19/12 12:34
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
nice but slow here, pp is 20 fps on my ATI HD 7670M, obj is only 10.


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: [SUB] Deferred PSSM Shadows Workaround [Re: sivan] #413904
12/19/12 14:40
12/19/12 14:40
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline OP
Serious User
txesmi  Offline OP
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
2x faster, is not that good?

Re: [SUB] Deferred PSSM Shadows Workaround [Re: txesmi] #413906
12/19/12 14:53
12/19/12 14:53
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
the relative value is okay of course, but the absolute speed is not good for my hardware...


Free world editor for 3D Gamestudio: MapBuilder Editor
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 Offline
Expert
Kartoffel  Offline
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 Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Try this for both:
Code:
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);
}


Re: [SUB] Deferred PSSM Shadows Workaround [Re: txesmi] #413909
12/19/12 15:03
12/19/12 15:03
Joined: Dec 2002
Posts: 3,363
Vindobona (Ostarichi)
Harry Potter Offline
Expert
Harry Potter  Offline
Expert

Joined: Dec 2002
Posts: 3,363
Vindobona (Ostarichi)

On my NVIDIA GeForce GTX 580 it runs with 81 fps (Object Shader Shadows: 25 fps).

Page 1 of 2 1 2

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1