Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Nymphodora, Quad), 923 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Whats happening with this PSSM Shadow? (video included) #465666
05/09/17 03:16
05/09/17 03:16
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
Hi everyone, Im having a small problem with PSSM shadows.

[video:youtube]https://youtu.be/u5pWD222IrQ[/video]


If you watch the video, at a certain angle, the shadows disappear on the objects, but returns when the camera is rotated back.

Any idea what could be going on? Im using the default PSSM shader. Here are my settings:



Code:
#ifdef PSSM
	shadow_stencil = 8; // activate external shadows
// all objects get the SHADOW flag
	for(you = ent_next(NULL); you; you = ent_next(you)) 
	set(you,SHADOW);
	
	pssm_transparency=.5;
	
	
//	 camera.clip_far = 10000;
 camera.clip_near = 1;
 
 pssm_fbias = 0.0001;
	
	vec_set(sun_angle,vector(-90,60,1000));
	
	pssm_splitweight=.5;
	
	pssm_res=1024;
	
	pssm_run(3);
#else  
	camera.material = mtlShadow; // render all objects with the mtlShadow material
	viewDepth.stage = camera;    // use the Depth view as a preprocessor for the camera view
#endif


Last edited by jumpman; 05/09/17 03:23.
Re: Whats happening with this PSSM? (video included) [Re: jumpman] #465667
05/09/17 03:17
05/09/17 03:17
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
If the sun position is to the right of the camera, and I rotate it low, many shadows disappear. But if the sun is to the left of the camera and I rotate it low, shadows do not disappear. Im confused.

Re: Whats happening with this PSSM? (video included) [Re: jumpman] #465669
05/09/17 05:17
05/09/17 05:17
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
Update, there seems to be a trigger based on whether there is a terrain in the level! When i remove the terrain and rebuild the level, the shadows never disappear like in the video. But when I place the terrain back in the level, whether it has a shader or not, the shadows begin disappearing that certain angles. This is very strange.

Re: Whats happening with this PSSM? (video included) [Re: jumpman] #465671
05/09/17 07:10
05/09/17 07:10
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
it can happen because of translucent stuff or mirror shaders too, I don't remember exactly... does the terrain have a single RGB texture or RGBA?


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: Whats happening with this PSSM? (video included) [Re: sivan] #465682
05/09/17 13:58
05/09/17 13:58
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
Hey Sivan,

The terrain at the time had an RGBA texture i think, whatever the default multitexture shader needed. However, even if I put a blank texture or a simple bmp, these shadows still disappeared.

However, when i deleted the terrain and rebuilt the level, shadows returned and didnt disappear. I made a test level and imported the terrain again, and there the problem happened again.

But one thing I noticed was that my terrain was very small by default, and I normally scaled it up very big to fit the level. When I scaled it up, the shadow error happened, but when I left it at its default size the shadows stayed. When I made a new test terrain where by default it was very big, the shadows seemed to work correctly.

Does the scaled size of the terrain effect the PSSM shader? Bounding volume or something? Im not sure.

Re: Whats happening with this PSSM? (video included) [Re: jumpman] #465684
05/09/17 16:26
05/09/17 16:26
Joined: Aug 2003
Posts: 118
Deutschland
E
Ezzett Offline
Member
Ezzett  Offline
Member
E

Joined: Aug 2003
Posts: 118
Deutschland
Yesterday there was a problem with disappearing models because the level_ent.min_x/max_x were to small. Is this maybe the same issue you experienced?

http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=465655

Re: Whats happening with this PSSM? (video included) [Re: Ezzett] #465685
05/09/17 17:11
05/09/17 17:11
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
hey Ezzett!

I saw that post and changed my level_ent sizes to no avail. The actual models themselves werent disappearing, it was just their shadows disappearing.

Re: Whats happening with this PSSM? (video included) [Re: jumpman] #465688
05/09/17 19:45
05/09/17 19:45
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Hey,

I had something similar once with stencil shadows though it was when objects were more at the edge of the screen (so not exactly the same). Try tweaking the shader top (/tweak) variables and try tweaking shadow variables (shadow_lod, shadow_range etc, floor_range maybe too).
Maybe its a bug with chunked terrain or such. Have you tried scaling the terrain model in MED and lowering the entity scale?

Re: Whats happening with this PSSM? (video included) [Re: Reconnoiter] #465696
05/10/17 00:18
05/10/17 00:18
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
Hey Reconnoiter!

Ive been playing with the tweak variables, it didnt do anything.

So far it works when I scaled the terrain in MED like you said.

Is there an XYZ limit to the shadow? I zoomed far away from the level and noticed that an object wont produce shadows anymore past a certain position. Is this a floating point problem? Though nothing is shaking or losing accuracy....

Re: Whats happening with this PSSM? (video included) [Re: jumpman] #465702
05/10/17 07:49
05/10/17 07:49
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
as I remember scaling a terrain has an effect of level_ent. in past it was bad, but I think I reported the issue and was fixed, but you can print level_ent size on screen. it has effect on pssm shadow cascade settings.


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: Whats happening with this PSSM? (video included) [Re: sivan] #465715
05/10/17 14:15
05/10/17 14:15
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
thank you Sivan, thats what Im noticing! laugh

Re: Whats happening with this PSSM? (video included) [Re: jumpman] #465736
05/10/17 19:58
05/10/17 19:58
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
is there a way to disable Decal shadows while PSSM shadows are active?

Re: Whats happening with this PSSM? (video included) [Re: jumpman] #465738
05/10/17 21:35
05/10/17 21:35
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Hey!

stensil_shadow = 8; - if I remember correctly

Best regards!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Whats happening with this PSSM? (video included) [Re: 3run] #465740
05/10/17 23:14
05/10/17 23:14
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
Thank you 3run, you are correct, although its possible to have both decal and PSSM shadows at the same time!

The problem was that I was doing wait (18) before activating PSSM shadows, meanwhile any entities in the level that already had their shadow flag on, defaulted to the decal shadow. Once the PSSM began to run, the new dynamic shadow as well as the decal shadow were both active!

Re: Whats happening with this PSSM? (video included) [Re: jumpman] #465751
05/11/17 07:22
05/11/17 07:22
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
black magic!


Free world editor for 3D Gamestudio: MapBuilder Editor
Page 1 of 2 1 2

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