SpriteShadow v2.0 (now built into GZDoom 4.6.0!)
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.
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.
-
- 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
looking forward to its development! Would be great to just use it for any actor
-
-
- Posts: 17454
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Duke3D-style Actor Shadows 1.0
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.
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.
-
- Posts: 45
- Joined: Sun Mar 18, 2012 1:43 am
Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m
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.
-
- Posts: 110
- Joined: Fri Jul 15, 2016 5:06 am
Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m
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.
-
-
- Posts: 17906
- Joined: Fri Jul 06, 2007 3:22 pm
Re: [ZScript] Duke3D-style Actor Shadows [WIP]
Is that why the actor scripting in Hexen or Strife breaks?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
-
-
- Posts: 17454
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m
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... >_<
-
- 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
Could you spawn a dummy actor after the shadow that copies the position, sprite, frame, etc. of the real actor?
-
-
- Posts: 17454
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m
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.
-
- 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
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)
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)
-
- Posts: 4
- Joined: Sat Jan 28, 2017 7:28 pm
Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m
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!
Played with a personal weapons mod. You're a genius, you know that?
Played with a personal weapons mod. You're a genius, you know that?
-
-
- Posts: 17454
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m
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.The Zombie Killer wrote:whether the original is visible or not shouldn't matter.
-
- 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
Hrmm, good point. Will need to think of a way to cleanly hide the original actor without breaking any renderstyle scripting then.Nash wrote: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.The Zombie Killer wrote:whether the original is visible or not shouldn't matter.
-
-
- Posts: 17906
- Joined: Fri Jul 06, 2007 3:22 pm
Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m
Should translucent monsters have a shadow anyway?
-
-
- Posts: 17454
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m
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.
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.
-
-
- Posts: 17454
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: Duke3D-style Shadows v1.1 [final, It Just Works™]
Final version added into the OP.