3 registered members (AndrewAMD, wandaluciaia, 1 invisible),
798
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Shadows / Render Stencil and Saving/Loading levels
[Re: Dooley]
#460346
06/26/16 20:14
06/26/16 20:14
|
Malice
Unregistered
|
Malice
Unregistered
|
What are the shadow types shadow_stencil =?? and the 'problems' like. I don't have a off the top answer.. sorry With PSSM shadow_stencil =8; there maybe some issue -> just looking at the manual. http://www.conitec.net/beta/shadows_c.htm--PSSM shadows must be deactivated before changing the video resolution or video mode, or when loading a level or changing the level size. Activate them again one frame afterwards. --On the other hand, PSSM shadows require careful adjustment of the shadow bias (pssm_fbias, see below) and the camera clip_far value to the level size and type. Wrong values can cause artefacts such as "surface acne" or displaced shadows.
--The light source is the sun, as set up in the level map or in the script (sun_angle).
--Only objects that cast PSSM shadows can receive PSSM shadows. For this reason, the SHADOW flag should be set for level geometry and terrain.
--PSSM shadows must be deactivated before changing the video resolution or video mode, or when loading a level or changing the level size. Activate them again one frame afterwards.
--They should be deactivated when the player enters an indoor area (otherwise, everything indoor would be in shadow).
--Before activating PSSM shadows, set shadow_stencil at 8, and set camera.clip_near as high and camera.clip_far as low as possible. Make sure that level_ent.max_x and level_ent.min_x reflects the final level size. Also Try doing game save in flag list one by one. Not SV_ALL. Just start with one flag and add the next like
game_save("info",0,SV_INFO+SV_STRINGS+SV_BMAPS);
The will help find a problem type to look deeper into
Last edited by Malice; 06/26/16 20:34.
|
|
|
Re: Shadows / Render Stencil and Saving/Loading levels
[Re: Dooley]
#460360
06/27/16 23:57
06/27/16 23:57
|
Joined: May 2005
Posts: 868 Chicago, IL
Dooley
OP
User
|
OP
User
Joined: May 2005
Posts: 868
Chicago, IL
|
I am using A7 - stencil_shadows set to 2 - Z-Fail Stencil Shadows They need to be set before level_load. This is what I call before loading, or reloading my levels: shadow_stencil = 2; // activate z-fail accelerated stencil shadows stencil_blur(1); // activate blurred shadows mat_shadow.alpha = shadow_alpha; shadow_range = 10;
Right now, to avoid shadow artifacts coming back to the spaceship level, which does not use stancil shadows, I call: ssView.material = NULL; camera.stage = NULL; shadow_stencil = -1; // deactivate z-fail accelerated stencil shadows stencil_blur(0); // deactivate blurred shadows mat_shadow.alpha = 0; shadow_range = 0;
Going back to the ship uses a game_load function, but landing on the planet uses my own reloading function. Right now, if I land on a planet, then return to the ship, everything is fine. However, if I return to the planet again, there appears to be two versions of the stencil_shadows. One is blurred and one is not, and they are at slightly different angles, as if there are two light sources casting shadows. Also, there are self shadows cast of objects that are not even assigned the "shadow" flag. To make things more interesting, if I leave the game, and then come back and reload the planet, the shadows work fine.
|
|
|
Re: Shadows / Render Stencil and Saving/Loading levels
[Re: Dooley]
#460370
06/28/16 09:59
06/28/16 09:59
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
Serious User
|
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
To make things more interesting, if I leave the game, and then come back and reload the planet, the shadows work fine.
, perhaps it is some bug with level load and game_load and stencil shadows? (might be something specific to A7) Also alternative would be skipping stencil shadows and take a shadow shader from this forum. E.g. from Slin or such.
|
|
|
Re: Shadows / Render Stencil and Saving/Loading levels
[Re: Reconnoiter]
#460371
06/28/16 10:46
06/28/16 10:46
|
Joined: Jul 2008
Posts: 2,107 Germany
rayp
X
|
X
Joined: Jul 2008
Posts: 2,107
Germany
|
However, there is one main level which I'm still using game_save/load Just wanted to mention again: Dont use those functions, they just wont work correct. Many users ( including me ) faced that problem ( in some kind of variation ).:D I just tryed again to use those functions in my ZombieFPS project, bug-hell broke loose Anyway... Try with this game_save - flag Does it help? Often solves shader/shadow props. U checked out Malice's post yes? Cause he mentioned to use some flags and gave usefull tips. Btw: Std. 3dgs stencil shadows are slow like hell.Performance tip: Useand let the LOD models of your entity cast the shadows.
Acknex umgibt uns...zwischen Dir, mir, dem Stein dort... "Hey Griswold ... where u gonna put a tree that big ?" 1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected rayp.flags |= UNTOUCHABLE;
|
|
|
Re: Shadows / Render Stencil and Saving/Loading levels
[Re: Dooley]
#460390
06/28/16 22:33
06/28/16 22:33
|
Malice
Unregistered
|
Malice
Unregistered
|
@Malice - It sounds like you are referring to the A8 engine/manual. Sorry, I should have mentioned it was A7 in my original post. Indeed was...! I've got nothing for the last gen. However my game_save with flags advice is relevant all the way back to A5. A game save/load system isn't to hard . It's just a (load) level_load and a for_loop to 'adjust' the world. (Save) it's just a for_loop to record(in a form you choose) states for things, and only what you'd like to save.
|
|
|
|