SpriteShadow v2.0 (now built into GZDoom 4.6.0!)

For high-res texture/sprite projects, sprite-fix patches, music add-ons, music randomizers, and other graphic/sound-only projects.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
Tekish
Posts: 151
Joined: Tue Jun 28, 2016 6:31 pm

Re: SpriteShadow: Duke3D-like Shadows v1.7a [performance upd

Post by Tekish »

When 1.7a is used with Universal Gibs, this happens whenever a monster is gibbed:

Image
User avatar
Nash
 
 
Posts: 17450
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: SpriteShadow (Duke3D Shadows) v1.8 [slaughtermap friendl

Post by Nash »

Update December 20th 2018 (version 1.8)

- Implemented max shadow distance to help performance with slaughtermaps
- Fixed a null pointer access

HolyHell.wad, MAP05 with 20,000 monsters, is now actually playable on my machine!
User avatar
AFADoomer
Posts: 1335
Joined: Tue Jul 15, 2003 4:18 pm

Re: SpriteShadow: Duke3D-like Shadows v1.7a [performance upd

Post by AFADoomer »

This line...

Code: Select all

		else if (caster.CheckIfSeen())
...causes an effect where if the centerline of a monster is out of the player's sight, but a portion of the body and/or the shadow is still in view, the shadow will freeze in the current location (despite the monster still moving) until the centerline of the monster is back in view. Maybe use CheckSightOrRange instead, so that the shadow always draws within a certain distance of the player?

EDIT: OK, that was with 1.7a, but 1.8 has the same issue...

EDIT2: I've changed the check to

Code: Select all

		else if (caster && caster.CheckSightOrRange(512))
with no issues - you could probably reuse the cvShadowDistance CVar here instead of 512.
Last edited by AFADoomer on Wed Dec 19, 2018 1:18 pm, edited 1 time in total.
Tekish
Posts: 151
Joined: Tue Jun 28, 2016 6:31 pm

Re: SpriteShadow (Duke3D Shadows) v1.8 [slaughtermap friendl

Post by Tekish »

Yes, I saw this happen in 1.8 as well.
User avatar
Armaetus
Posts: 1255
Joined: Fri Mar 13, 2009 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10 Home
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: New York State

Re: SpriteShadow (Duke3D Shadows) v1.8 [slaughtermap friendl

Post by Armaetus »

Oh nice, perhaps higher monster count monsters combined with Droplets would improve performance now :) Would actually be useful to me, especially when recording.
User avatar
m8f
 
 
Posts: 1445
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Manjaro Linux
Location: Siberia (UTC+7)

Re: SpriteShadow (Duke3D Shadows) v1.8 [slaughtermap friendl

Post by m8f »

I wonder if there is any sane way to make shadows not be visible from below. Right now this is my only nitpick for this mod.
User avatar
Nash
 
 
Posts: 17450
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: SpriteShadow: Duke3D-like Shadows v1.7a [performance upd

Post by Nash »

AFADoomer wrote:This line...

Code: Select all

		else if (caster.CheckIfSeen())
...causes an effect where if the centerline of a monster is out of the player's sight, but a portion of the body and/or the shadow is still in view, the shadow will freeze in the current location (despite the monster still moving) until the centerline of the monster is back in view. Maybe use CheckSightOrRange instead, so that the shadow always draws within a certain distance of the player?

EDIT: OK, that was with 1.7a, but 1.8 has the same issue...

EDIT2: I've changed the check to

Code: Select all

		else if (caster && caster.CheckSightOrRange(512))
with no issues - you could probably reuse the cvShadowDistance CVar here instead of 512.
CheckSightOrRange call is quite expensive, though... think time shoots up a lot just by doing this.
User avatar
Nash
 
 
Posts: 17450
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: SpriteShadow (Duke3D Shadows) v1.85 [more optimization!]

Post by Nash »

Update December 29th 2018 (version 1.85)

- Declaring this mod to now require GZDoom version 3.7.0 to fully take advantage of JIT compiler
- Updated ZScript directive to 3.7.0
- Fixed shadows to update properly when partially blocked from your line of sight
- Even more optimizations, it runs even faster now!
- Don't draw shadows when your view is under them
m8f wrote:I wonder if there is any sane way to make shadows not be visible from below. Right now this is my only nitpick for this mod.
Let me know if what I added in v1.85 solves this issue.
User avatar
m8f
 
 
Posts: 1445
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Manjaro Linux
Location: Siberia (UTC+7)

Re: SpriteShadow (Duke3D Shadows) v1.85 [more optimization!]

Post by m8f »

Wow, great!
Nash wrote:Let me know if what I added in v1.85 solves this issue.
Yes, it does.

One question: if early return is added after "bInvisible = true;", will it mess with clean-up? If not, it will probably improve performance even more.
User avatar
Firebrand
Posts: 58
Joined: Wed Jul 16, 2003 10:54 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Location: Mexico

Re: SpriteShadow (Duke3D Shadows) v1.85 [more optimization!]

Post by Firebrand »

This looks quite good :) and it doesn't add too much of a performance hit when being used on big maps, nice work!
MrJohnny
Posts: 212
Joined: Fri Aug 05, 2016 8:41 am

Re: SpriteShadow (Duke3D Shadows) v1.85 [more optimization!]

Post by MrJohnny »

Just noticed that all it takes for shadows to spawn is for an actor to have the +ISMONSTER flag. Some mods make use of this to achieve certain effects, so it might be worth adding other conditions that must be met before the shadows are spawned to avoid conflict with other mods. A flag like "+COUNTKILL" should do the trick.
User avatar
Nash
 
 
Posts: 17450
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: SpriteShadow (Duke3D Shadows) v1.85 [more optimization!]

Post by Nash »

Pompous Seed wrote:Just noticed that all it takes for shadows to spawn is for an actor to have the +ISMONSTER flag. Some mods make use of this to achieve certain effects, so it might be worth adding other conditions that must be met before the shadows are spawned to avoid conflict with other mods. A flag like "+COUNTKILL" should do the trick.
Using a monster flag on something that's not meant to be a monster. Coming from this community; why am I not surprised?

This is the kind of stuff that makes Graf's blood boil... :mrgreen:
Gez
 
 
Posts: 17840
Joined: Fri Jul 06, 2007 3:22 pm

Re: SpriteShadow (Duke3D Shadows) v1.85 [more optimization!]

Post by Gez »

But then monsters that don't count for kills (and yeah, those exist and are legitimate, for example for passive wandering creatures, or invincible turrets, etc.) wouldn't get shadows. So it'd still not be compatible with mods.
User avatar
Rip and Tear
Posts: 185
Joined: Tue May 02, 2017 3:54 pm

Re: SpriteShadow (Duke3D Shadows) v1.85 [more optimization!]

Post by Rip and Tear »

I have found an issue: Hexen’s Stalkers still have shadows when they are underwater. I haven’t look into the code yet so I’m not sure, but I suspect that the +INVISIBLE flag not being accounted for.
User avatar
NightFright
Spotlight Team
Posts: 1345
Joined: Fri May 02, 2008 12:29 pm
Location: Germany

Re: SpriteShadow (Duke3D Shadows) v1.85 [more optimization!]

Post by NightFright »

Is it possible to have a version without the menu entries actually (maybe with values you can edit directly in the script files instead)? Somehow I preferred the "load and forget" approach from the 1.6 release. I like autoload stuff to be invisible.

Return to “Graphic/Audio Patches”