Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (1 invisible), 1,374 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
PSSM Shadows produce a crash on published version #436466
01/27/14 17:05
01/27/14 17:05
Joined: Aug 2008
Posts: 394
Germany
Benni003 Offline OP
Senior Member
Benni003  Offline OP
Senior Member

Joined: Aug 2008
Posts: 394
Germany
Hey there, I have a big problem with PSSM shadows... Currently my Game is tested on different Systems. Now my problem - With activated pssm shadows the engine crashes!
The crash just happens in the published version and just on systems with radeon grafic cards (always).
It makes me confused, because I'm not a expert in this, but one thing I found out. If I cut the following line from shadows.c no crash is happening, but also shadows are not visible then. I really hope that someone can help me, because I have to fix in withing two days smirk

Here the line:

D3DXMatrixMultiply(&matSplit[i],&matSplit[i],pssm_texscale(pssm_res));

Code:
for(i=0; i<pssm_numsplits; i++) 
			{
				// look from the sun onto the scene			
				viewSplit[i]->pan = 180 + sun_angle.pan;
				viewSplit[i]->tilt = -sun_angle.tilt;
				vec_set(viewSplit[i]->x,sun_pos);

				//				vec_normalize(viewSplit[i]->x,200);

				// calculate the split view clipping borders and transformation matrix			
				view_to_split(camera,pssm_splitdist[i],pssm_splitdist[i+1],viewSplit[i],&matSplit[i]);
				LPD3DXEFFECT fx = viewSplit[i]->material->d3deffect; 
				if(fx) fx->SetMatrix("matSplitViewProj",&matSplit[i]);
				
				// create a texture matrix from the split view proj matrix			
				D3DXMatrixMultiply(&matSplit[i],&matSplit[i],pssm_texscale(pssm_res));
				
				#ifdef DEBUG_PSSM		
					DEBUG_BMAP(viewSplit[i]->bmap,300 + i*220,0.2);
					var pssm_fps = 16/time_frame;
					DEBUG_VAR(pssm_fps,200);
					DEBUG_VAR(pssm_splitdist[i+1],220 + i*20);
				#endif			
			}


Re: PSSM Shadows produce a crash on published version [Re: Benni003] #436467
01/27/14 17:11
01/27/14 17:11
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline
Expert
oliver2s  Offline
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
Maybe "pssm_res" is "0"? Because this would cause a division by zero in "pssm_texscale()".

Re: PSSM Shadows produce a crash on published version [Re: oliver2s] #436469
01/27/14 17:15
01/27/14 17:15
Joined: Aug 2008
Posts: 394
Germany
Benni003 Offline OP
Senior Member
Benni003  Offline OP
Senior Member

Joined: Aug 2008
Posts: 394
Germany
No, It's not 0 tongue The crash just happens at a published version and just on systems with radeon cards. I wrote it wink

Re: PSSM Shadows produce a crash on published version [Re: Benni003] #436470
01/27/14 17:17
01/27/14 17:17
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline
Expert
oliver2s  Offline
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
Originally Posted By: Benni003
No, It's not 0 tongue The crash just happens at a published version and just on systems with radeon cards. I wrote it wink


I know, but nevertheless all possibilities should be checked tongue

Do you have the same FX files in your published game as you use while development?

Re: PSSM Shadows produce a crash on published version [Re: oliver2s] #436475
01/27/14 18:35
01/27/14 18:35
Joined: Aug 2008
Posts: 394
Germany
Benni003 Offline OP
Senior Member
Benni003  Offline OP
Senior Member

Joined: Aug 2008
Posts: 394
Germany
Originally Posted By: oliver2s
I know, but nevertheless all possibilities should be checked tongue

OK grin
Originally Posted By: oliver2s
Do you have the same FX files in your published game as you use while development?

Yes I have and one time I removed every code in vp_pssm.fx and vp_depth.fx. I just wrote technique name {pass { }} in every shader so that the engine isn't angry wink But still the crash. The game was tested on a group of systems... with nvidia grafic cards no problem. with radeon -> crash. I think the code crashes because of this line: D3DXMatrixMultiply(&matSplit[i],&matSplit[i],pssm_texscale(pssm_res));


Last edited by Benni003; 01/27/14 18:36.
Re: PSSM Shadows produce a crash on published version [Re: Benni003] #436476
01/27/14 18:43
01/27/14 18:43
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Okay, then let's get cracking!

With what error message does it crash? Are you sure you are not reading past the array bounds? Might there be any SIMD alignment issues at work (I see that pssm_texscale() returns statically allocated memory and I don't know how good the Lite-C compiler is in regards to alignment rules... I know for a fact that it doesn't care about padding)

In short, more source code please with declaration of all relevant variables!


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: PSSM Shadows produce a crash on published version [Re: WretchedSid] #436480
01/27/14 20:03
01/27/14 20:03
Joined: Aug 2008
Posts: 394
Germany
Benni003 Offline OP
Senior Member
Benni003  Offline OP
Senior Member

Joined: Aug 2008
Posts: 394
Germany
I made a small demo based on the crowed of the 3dgs folder. I used the original code from Crowed.c, shadows.c, vp_pssm.fx and vp_depth.fx.
Here is the File:

PSSM Test Demo

On my system (and other systems) with nvidia graphic card:
source code: WORKING
published exe: WORKING

On my second system (and other systems) with radeon graphic card:
source code: WORKING
published exe: NOT WORKING - the engine crashes without error message.

I hope we will find the Problem and can fix it...

Last edited by Benni003; 01/27/14 20:04.
Re: PSSM Shadows produce a crash on published version [Re: Benni003] #436483
01/27/14 20:38
01/27/14 20:38
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline
Expert
oliver2s  Offline
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
On my ATI system it WORKS.

Have you tried the following:
- copied "d3dx9_30.dll" and "d3dx9_32.dll" in the published exe folder?
- updated or reinstalled DirectX (9)?
- used other drivers?
- does your video card support shader model 3?

Re: PSSM Shadows produce a crash on published version [Re: oliver2s] #436490
01/27/14 22:16
01/27/14 22:16
Joined: Aug 2008
Posts: 394
Germany
Benni003 Offline OP
Senior Member
Benni003  Offline OP
Senior Member

Joined: Aug 2008
Posts: 394
Germany
Hey, it's working!!!! yes laugh I added "d3dx9_30.dll" and "d3dx9_32.dll" I had just d3dx9_42.dll in the folder and I thought that would be enough.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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