[4.6.0] Camera texture aspect ratio broken

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!

[4.6.0] Camera texture aspect ratio broken

Postby Matt » Sat May 22, 2021 4:18 pm

This commit broke existing mods that assumed Doom's 1.2 in the playsim.

Example: HD's scopes naïvely assume that whatever the camera picks up is scaled correctly, and thus scales everything as a square.

Results: Left screenshots taken from 4.5.0; right screenshots with 4.6.0.

As can be seen in the comment on that linked line, I was going to just update HD for this, but it occurred to me that this update probably breaks other mods as well.
You do not have the required permissions to view the files attached to this post.
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: [4.6.0] Camera texture aspect ratio broken

Postby phantombeta » Sat May 22, 2021 4:49 pm

Shouldn't scaling as a square maintain the correct aspect ratio of 1.2? This looks more like the fix was applied incorrectly in that commit.
User avatar
phantombeta
Tired of being treated like trash by control freaks
 
Joined: 02 May 2013

Re: [4.6.0] Camera texture aspect ratio broken

Postby phantombeta » Sat May 22, 2021 5:04 pm

(Double-post so that this actually gets seen)

Yeah, that fix is most certainly incorrect. The pixel stretch is applied by HWDrawInfo::SetViewMatrix, which is called by HWDrawInfo::SetupView. This is, in turn, called by RenderViewpoint itself. The pixel stretch is also applied there as a multiply. All of this implies that "fix" is disabling the effects of pixelstretch and it should be reverted.
User avatar
phantombeta
Tired of being treated like trash by control freaks
 
Joined: 02 May 2013

Re: [4.6.0] Camera texture aspect ratio broken

Postby Graf Zahl » Sun May 23, 2021 12:31 am

I think the problem here is that the fix does the proper thing when the camera texture gets used in the world on a monitor - because the monitor again gets stretched back when being rendered, but not when being used on the 2D HUD.

Obviously the latter is the far less frequent use case. I've never seen many mods using camera textures this way.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [4.6.0] Camera texture aspect ratio broken

Postby Matt » Sun May 23, 2021 11:59 am

The other two I can think of off the top of my head are the blur sphere effect in High Noon Drifter and the scopes in Delta Force.

HND's scaling is affected the same way as HD's.

Delta Force's, however, is also subject to the hud_aspectscale cvar. (not shown in sample: 4.6.0 hud_aspectscale false, which shows the armour bonus as being squished.)

I don't know why these two are different since (unlike HD) they both use ACS to call the camera texture, but I think it's best to treat this as a bug on part of Delta Force since for that mod this changes materially based on user settings in either 4.5.0 or 4.6.0.
You do not have the required permissions to view the files attached to this post.
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: [4.6.0] Camera texture aspect ratio broken

Postby Matt » Sun May 23, 2021 3:42 pm

How many maps are there right now that have both in-world cameratextures and custom pixelstretch values? I'm wondering if anyone's already done this, and has already done something with those in-world textures to compensate, which might be broken by the way 4.6.0 handles this.

EDIT: Tried this in KDiZD, the current situation actually fixes that without issue at least.
You do not have the required permissions to view the files attached to this post.
Last edited by Matt on Sun May 23, 2021 4:00 pm, edited 1 time in total.
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: [4.6.0] Camera texture aspect ratio broken

Postby Graf Zahl » Sun May 23, 2021 3:53 pm

None, where they 'have done something to compensate', but lots that use camera textures as-is. And they all had them stretched a bit. KDiZD comes to mind.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [4.6.0] Camera texture aspect ratio broken

Postby Matt » Sun May 23, 2021 4:09 pm

Welp.

So of the four use cases I can think of we've got:

- one doesn't matter at all and might arguably be better (HND's blur effect)
- one was broken anyway
- one is actually fixed
- one is being actively maintained and updated, it's just a concern about continued compatibility with LZDoom

Are there any others?

EDIT: there's DeusDoom but I can't figure out how to get the drone.
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: [4.6.0] Camera texture aspect ratio broken

Postby Matt » Tue May 25, 2021 9:45 am

phantombeta wrote:The pixel stretch is applied by HWDrawInfo::SetViewMatrix... as a multiply. All of this implies that "fix" is disabling the effects of pixelstretch...

This has me wondering if the current cameratexture fix might be optimized. Right now every single frame this floating point value is being multiplied, then divided again.

Does anything else use the multiplied, pre-divided value?
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: [4.6.0] Camera texture aspect ratio broken

Postby Marisa Kirisame » Mon May 31, 2021 2:16 am

I must add that this aspect ratio breakage has somewhat benefitted me in Doom Tournament, making some camera texture hackery less, well, hacky.
User avatar
Marisa Kirisame
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: MarisaDOOM
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: [4.6.0] Camera texture aspect ratio broken

Postby Matt » Thu Jun 03, 2021 11:21 am

Marisa Kirisame wrote:I must add that this aspect ratio breakage has somewhat benefitted me in Doom Tournament, making some camera texture hackery less, well, hacky.
Can you elaborate? The only HUD cameratextures I can find are the ammo counters and they look like they were last updated in January while they look fine in 4.6.0.
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: [4.6.0] Camera texture aspect ratio broken

Postby Marisa Kirisame » Thu Jun 03, 2021 4:42 pm

Before I updated them, there was a noticeable misalignment on elements because the scaling didn't add up, and you could catch a glimpse of the sky around the top of the camera texture. The fix was done four days ago.
User avatar
Marisa Kirisame
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: MarisaDOOM
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support


Return to Bugs

Who is online

Users browsing this forum: No registered users and 0 guests