Shadowmaps being weird with 3D weapon models

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
skornedemon
Posts: 154
Joined: Mon Aug 02, 2010 11:10 am

Shadowmaps being weird with 3D weapon models

Post by skornedemon »

See Topic name. The Shadowmap hitting the model has all sorts of lighting issues, like the game
doesn't know exactly where the model is originating maybe?

I have an example wad all set up along with screenshots.

https://cdn.discordapp.com/attachments/ ... nknown.png

https://www.mediafire.com/file/si0q9k7d ... ponBug.pk3



AlsoIReallyLoveShadowmapsSoIfYouCouldEnableThemOnTwoSidedLinedefsThat'dBeJustGre-
dpJudas
 
 
Posts: 3036
Joined: Sat May 28, 2016 1:01 pm

Re: Shadowmaps being weird with 3D weapon models

Post by dpJudas »

Ah, crap. Because the weapon sprite isn't drawn in its true world position the shadowmap lookup fails. :(
skornedemon
Posts: 154
Joined: Mon Aug 02, 2010 11:10 am

Re: Shadowmaps being weird with 3D weapon models

Post by skornedemon »

dpJudas wrote:Ah, crap. Because the weapon sprite isn't drawn in its true world position the shadowmap lookup fails. :(
I take it that isn't exactly easy to correct? That's really too bad, gzdoom is pretty gorgeous right now. Once shadowmaps came out I began
to make one of the best looking mods out there, and I was looking forward to it. Besides this, bump mapping on 3d models(yes I'm aware
dynamic lights only would affect it) and shadowmaps only being used on one-sided linedefs I really cant complain at all for this port now.

Hope something can be done!
dpJudas
 
 
Posts: 3036
Joined: Sat May 28, 2016 1:01 pm

Re: Shadowmaps being weird with 3D weapon models

Post by dpJudas »

Thank you, glad you like the shadowmaps. :)

I managed to fix it, but it meant I had to repair some old code first. It should be working in the next nightly build.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Shadowmaps being weird with 3D weapon models

Post by Graf Zahl »

Good to see that this positioning hack is gone. I never liked how this was implemented because it was nearly inevitable that it'd cause problems down the line.
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Shadowmaps being weird with 3D weapon models

Post by Nash »

Quick question (not being able to check myself at the moment): by "positioning it in the world", does that mean the HUD weapon model will clip into level geometry (as seen in almost every amateur Unreal Engine 4 game)?
dpJudas
 
 
Posts: 3036
Joined: Sat May 28, 2016 1:01 pm

Re: Shadowmaps being weird with 3D weapon models

Post by dpJudas »

No, it clears the zbuffer before drawing it.

Before my fix it was drawing the weapon with coordinates in view space (eye's perspective) with the camera pointing straight ahead at (0,0,0). Now it is drawing it in world space with the camera positioned correctly in the world. Visually you can't tell the difference, but it meant that pixelpos wasn't getting the proper values it needed to project into light shadowmap space.
Post Reply

Return to “Closed Bugs [GZDoom]”