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
WARCHILD_89
Posts: 452
Joined: Sun Nov 17, 2013 12:27 pm
Graphics Processor: nVidia with Vulkan support
Location: MIA between doomed dimensions

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

Post by WARCHILD_89 »

looking forward to its development! Would be great to just use it for any actor
User avatar
Nash
 
 
Posts: 17429
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Duke3D-style Actor Shadows 1.0

Post by Nash »

New version added to the OP. Works with all monsters in Doom and Heretic.

Note: currently breaks the monster scripting in Hexen and Strife. You will see the shadows, but the level scripting will break. I don't know how to fix this yet. I suggest only playing with Doom and Heretic (and their mods) for now.
User avatar
Expect No Mercy
Posts: 45
Joined: Sun Mar 18, 2012 1:43 am

Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m

Post by Expect No Mercy »

v1.0 works fine for me! Thanks!
Last edited by Expect No Mercy on Wed Mar 01, 2017 8:05 am, edited 1 time in total.
User avatar
Hipnotic Rogue
Posts: 110
Joined: Fri Jul 15, 2016 5:06 am

Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m

Post by Hipnotic Rogue »

This is great! I started a new game of Heretic Episode 5. Seeing all those pesky gargoyles hovering in the air casting shadows was quite lovely. It certainly added to the air of menace at the opening of the level. :)
Gez
 
 
Posts: 17828
Joined: Fri Jul 06, 2007 3:22 pm

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

Post by Gez »

Nash wrote: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
Is that why the actor scripting in Hexen or Strife breaks?
User avatar
Nash
 
 
Posts: 17429
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m

Post by Nash »

Gez: I suspect just as much. It seems that shit just breaks horribly if I do that. There's currently no way to make the shadows draw behind the monsters, because they are spawned after the monsters... so I may have to ditch that concept and just accept the shadows being drawn in front of the monster sprites... >_<
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m

Post by The Zombie Killer »

Could you spawn a dummy actor after the shadow that copies the position, sprite, frame, etc. of the real actor?
User avatar
Nash
 
 
Posts: 17429
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m

Post by Nash »

So what do I do with the real actor? Make it invisible? That won't work too well, if a modder has scripted the monster's visibility and renderstyle FX.
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m

Post by The Zombie Killer »

If they're synced up properly, whether the original is visible or not shouldn't matter. (I can confirm the method works at least, it's just getting the positions synced perfectly that's painful)
EDIT: Got it, will update my shadow example in a sec, feel free to take a look and copy the solution here (although it's rather simple to do anyways)
iamthemithras
Posts: 4
Joined: Sat Jan 28, 2017 7:28 pm

Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m

Post by iamthemithras »

Thanks for this nash. tested it with gzdoom-g2.4pre-693-g4a87a59 and it worked perfectly - I didn't know this dev version existed! The monsters' movement are so smooth now like Risen3D! :shock:

Played with a personal weapons mod. You're a genius, you know that?
User avatar
Nash
 
 
Posts: 17429
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m

Post by Nash »

The Zombie Killer wrote:whether the original is visible or not shouldn't matter.
Actually this isn't really a solution. So you're allowing the monster to be drawn twice, correct? For monsters with render style effects (like stealth monsters, or monsters with fancy translucency) you're basically overdrawing the sprite twice. The effect will look wrong.
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m

Post by The Zombie Killer »

Nash wrote:
The Zombie Killer wrote:whether the original is visible or not shouldn't matter.
Actually this isn't really a solution. So you're allowing the monster to be drawn twice, correct? For monsters with render style effects (like stealth monsters, or monsters with fancy translucency) you're basically overdrawing the sprite twice. The effect will look wrong.
Hrmm, good point. Will need to think of a way to cleanly hide the original actor without breaking any renderstyle scripting then.
Gez
 
 
Posts: 17828
Joined: Fri Jul 06, 2007 3:22 pm

Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m

Post by Gez »

Should translucent monsters have a shadow anyway?
User avatar
Nash
 
 
Posts: 17429
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m

Post by Nash »

Here's what I found: setting bInvisible on the original monster is a huge NOPE because that messes up the AI and targeting mechanics (monsters will not infight anymore, for example). So you can kiss bInvisible goodbye.

Setting alpha = 0 or RenderStyle None of the original monster also is bad because then you'd just nullify all the RenderStyle effects the monster was defined with.

And after a lot of thinking, everything we're trying to do here is a huge hack. I mean, come on, seriously? Spawning a duplicate of the visible monster? Sheesh. There needs to be a way to natively draw an Actor before other Actors.

Overriding RenderFrame has already been shut down, so, hmm. Maybe a dedicated flag and a StatNum to go along with it that tells the Actor to always draw behind normal ticking Actors. Requires work in the source code.

At this point, I wonder if I should just delete all my hacks related to trying to position the shadow behind the Actor, and just release it as-is, with the shadows being drawn in front of the Actors. This is the cleanest and safest way to do it - ie, normal gameplay isn't interrupted, scripting/AI does not break, etc.
User avatar
Nash
 
 
Posts: 17429
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Duke3D-style Shadows v1.1 [final, It Just Works™]

Post by Nash »

Final version added into the OP.

Return to “Graphic/Audio Patches”