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.
User avatar
Nash
 
 
Posts: 17465
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

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

Post by Nash »



Sprite shadows are now built directly into the engine as of GZDoom 4.6.0!

You can enable it in the Display Options menu, or you can use SpriteShadows v2.0 to enable sprite shadows without user intervention (user still has the option to turn them off).

Lastly, you can enable or disable sprite shadows on actors individually by using the +CASTSPRITESHADOW and +NOSPRITESHADOW flag!

Requires GZDoom 4.6.0 or higher!

Update May 23rd 2021 (version 2.0)

- Update mod to utilize engine-native sprite shadow rendering.
- Relicense to MIT.
Spoiler: Old Updates
Have fun!

Though not required, I would appreciate it if you credit "Nash Muhandes" if you add the event handler-based mod (SpriteShadow v2.0) into your mods or standalone games. No need to ask for my permission to use it; just credit me!

Download latest version / Github repository

Image
Thank you for the previous 9000+ downloads!

Wanna chat about my mods? Join my studio's Discord server, Mischief Donut!
Image

I spend an uncountable amount of hours making mods. Consider supporting me on Patreon for cool benefits!
Image
You do not have the required permissions to view the files attached to this post.
Last edited by Nash on Sun Apr 07, 2024 10:23 am, edited 44 times in total.
User avatar
Rachael
Posts: 13793
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: [ZScript] Duke3D-style Actor Shadows [WIP]

Post by Rachael »

Glad to see you didn't give up on this despite the guy who originally asked giving up on it so quickly. :)
D2JK
Posts: 545
Joined: Sat Aug 30, 2014 8:21 am

Re: [ZScript] Duke3D-style Actor Shadows [WIP]

Post by D2JK »

I don't remember how it was in Duke3D, but if there's a ledge, won't part of the shadow end up hovering in the air?
User avatar
Kinsie
Posts: 7402
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33

Re: [ZScript] Duke3D-style Actor Shadows [WIP]

Post by Kinsie »

Yessss! I've wanted something like this for a long, long time!
Nash wrote:Since extending Actor isn't allowed in ZScript, making this work with ANY monster in any mod is going to be tricky
Honestly, making this work with EVERY actor may not actually be a good idea - not every actor will look good with this, resulting in weird things like shadows for fire on torches etc.
User avatar
TerminusEst13
Posts: 1625
Joined: Mon Nov 09, 2009 3:08 pm

Re: [ZScript] Duke3D-style Actor Shadows [WIP]

Post by TerminusEst13 »

Fucking hell, this is incredible.

Dumb question, but just to make sure, would it be all right if I nicked it for use in my own projects?
User avatar
Nash
 
 
Posts: 17465
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: [ZScript] Duke3D-style Actor Shadows [WIP]

Post by Nash »

Kinsie: I think I can limit it to actual living monsters by just doing a check for the +ISMONSTER (bIsMonster in ZScript) flag, although of course this won't be 100% fool proof against people who are doing hacky things with Things that aren't supposed to be monsters but are still flagged as such...

TerminusEst13: Have fun! When/if I update this to be more modular, I'll update this thread. I don't think the way I did it in that proof of concept is the best way (I can't imagine copy/pasting all that into every monster definition... a better way would be if this thing just works in the background with minimal code)

Additionally, I'm not feeling too good about that hack I did to force the shadow to be drawn under the monster (that is, spawning the shadow -> spawning a copy of said monster -> destroying original/map-placed copy of monster, in that order)... o_O
User avatar
TerminusEst13
Posts: 1625
Joined: Mon Nov 09, 2009 3:08 pm

Re: [ZScript] Duke3D-style Actor Shadows [WIP]

Post by TerminusEst13 »

Yeah, there's definitely a lot of avenue for tweaking to make things more streamlined, but I think that's half the fun of things like this. It's like a puzzle game!

You'll probably solve it first, but I still like fiddling and experimenting. :D

Thank you very much again for this!
Last edited by TerminusEst13 on Wed Jan 18, 2017 4:22 pm, edited 1 time in total.
User avatar
zrrion the insect
Posts: 2432
Joined: Thu Jun 25, 2009 1:58 pm
Location: Time Station 1: Moon of Glendale

Re: [ZScript] Duke3D-style Actor Shadows [WIP]

Post by zrrion the insect »

This looks very interesting! Hopefully you figure out a way to do this for everything.
User avatar
Nash
 
 
Posts: 17465
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Duke3D-style Actor Shadows [WIP] - Doom monsters done

Post by Nash »

New version in OP!
User avatar
Jimmy
 
 
Posts: 4725
Joined: Mon Apr 10, 2006 1:49 pm
Preferred Pronouns: He/Him

Re: Duke3D-style Actor Shadows [WIP] - Doom monsters done

Post by Jimmy »

Do you really need to extend Actor to do this across the board? It's only monsters that generate this effect in Duke, right?

(/me might be posting without any real idea of how much ZScript is/isn't capable of)
User avatar
Nash
 
 
Posts: 17465
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Duke3D-style Actor Shadows [WIP] - Doom monsters done

Post by Nash »

Yes, because if I don't extend Actor, I'd have to end up coding the functionality and a bunch of "replaces" for EVERY kind of monster (what I am doing in the latest version of the WAD in the OP). And it won't cover mod monsters without manual intervention.

The whole point of putting it in Actor is so that every monster in any mod, ever, will have the functionality, because when it boils down to it, everything you place in the map descends from Actor.

Simply checking for bIsMonster is enough to filter the effect to only happen on actual, living monsters... should be a non-issue, in most cases. So don't worry, the shadows won't be spawned for items, decorative stuff, etc...

(and again, I am already doing a monster check in the WAD in the OP - this shadow won't appear on the player, even if you give yourself the item - it will only appear on monsters)
User avatar
Tormentor667
Posts: 13549
Joined: Wed Jul 16, 2003 3:52 am

Re: Duke3D-style Actor Shadows [WIP] - Doom monsters done

Post by Tormentor667 »

Very impressive work, congraulations for this showcase of the capabilities ZScript has :)
osjclatchford
Posts: 2059
Joined: Mon Feb 07, 2011 5:02 am

Re: Duke3D-style Actor Shadows [WIP] - Doom monsters done

Post by osjclatchford »

looks great! this is something that I felt should always been apart of zdoom. nice to see it done with such skill
User avatar
Caligari87
Admin
Posts: 6191
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him

Re: Duke3D-style Actor Shadows [WIP] - Doom monsters done

Post by Caligari87 »

Nash, I gotta say this is a gamechanger. It looks good in screenshots, but actually playing is incredible. I never knew how much I needed this until now. This tiny change makes Doom look so much better.

8-)
User avatar
Nash
 
 
Posts: 17465
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Duke3D-style Actor Shadows [WIP] - Doom monsters done

Post by Nash »

Thank you! I really want to make this modular and be autoload-friendly, so I'll just wait for "extends Actor" to be possible.

I also could submit it as a GZDoom feature but I think that's way out of scope for base engine functionality.

EDIT: Found a bug

Monsters that disappear when dying (Lost Soul, Pain Elemental) will leave their shadows behind despite their corpse not existing anymore. Will be fixed for next version

Return to “Graphic/Audio Patches”