[Fixed] Shadowmaps being weird with 3D weapon models

Bugs that have been investigated and resolved somehow.

Moderators: Developers, ZDoom.org Team

Shadowmaps being weird with 3D weapon models

Postby skornedemon » Sun Nov 05, 2017 2:22 am

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-
skornedemon
Doom modder since 2000.
 
Joined: 02 Aug 2010

Re: Shadowmaps being weird with 3D weapon models

Postby dpJudas » Sun Nov 05, 2017 7:37 am

Ah, crap. Because the weapon sprite isn't drawn in its true world position the shadowmap lookup fails. :(
dpJudas
 
Joined: 28 May 2016

Re: Shadowmaps being weird with 3D weapon models

Postby skornedemon » Sun Nov 05, 2017 8:26 am

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!
skornedemon
Doom modder since 2000.
 
Joined: 02 Aug 2010

Re: Shadowmaps being weird with 3D weapon models

Postby dpJudas » Sun Nov 05, 2017 9:41 am

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.
dpJudas
 
Joined: 28 May 2016

Re: Shadowmaps being weird with 3D weapon models

Postby Graf Zahl » Sun Nov 05, 2017 10:04 am

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
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Shadowmaps being weird with 3D weapon models

Postby Nash » Sun Nov 05, 2017 11:57 am

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)?
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: Shadowmaps being weird with 3D weapon models

Postby dpJudas » Sun Nov 05, 2017 12:06 pm

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.
dpJudas
 
Joined: 28 May 2016


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 1 guest