IRC logs of Libera.Chat #BZFlag for Wednesday, 2022-08-31

*** bradw_ <bradw_!~brad@ipsw-05-b2-v4wan-162355-cust86.vm17.cable.virginm.net> has quit IRC (Ping timeout: 264 seconds)00:00
*** bradw <bradw!~brad@user/bradw> has joined #bzflag00:32
*** Cobra_Fast is now away: vacant01:36
*** Cobra_Fast is back01:36
*** I_Died_Once <I_Died_Once!~I_Died_On@c-73-184-170-223.hsd1.ga.comcast.net> has quit IRC (Ping timeout: 255 seconds)01:55
Agathatupone: I skimmed through the updated code, but nothing immediately jumped out at me as being wrong. Could it be a caching issue with the saved map; the texture gets serialized to disk in a funky way . . .02:50
AgathaAlso, the project versions for MSVC seem to be VS 2017. It's difficult to even *download* VS 2017 anymore. The build seems to work fine with VS 2022. Let's upgrade, hey?02:52
blast007Agatha: no, it's definitely something with the code change.  Simply compiling from the commit prior to that commit works fine.02:52
blast007it's also not difficult to download 2017  https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=1502:53
AgathaThat's the page that shows . . . if you download VS 2022. I poked around a bit; the older versions aren't there. If you really want to download them, you have to search for it specifically, to get the deliberately orphaned page https://visualstudio.microsoft.com/vs/older-downloads/02:55
AgathaIt's worth noting that VS 2022 supports the VS 2017 build tools seamlessly, so this amounts to an editor upgrade at worst.02:55
blast007is there something in 2022 that we need?02:58
AgathaBy the same token as it working in both, technically no . . . albeit, one expects the VS 2022 build to be faster and more standards-compliant, in a better editor that they don't have to take the extra step to retarget builds to . . .03:01
blast007also doesn't support Windows 703:04
blast007and can't target Vista03:06
blast007we still have at least one or two players still running on XP, though that will break once I enforce HTTPS03:07
blast007(since the last XP build was 2.4.2 I think?)03:07
*** Sgeo_ <Sgeo_!~Sgeo@user/sgeo> has joined #bzflag03:26
*** Sgeo <Sgeo!~Sgeo@user/sgeo> has quit IRC (Ping timeout: 268 seconds)03:27
Agatha@tupone, @blast007: aight I think I know the problem with the textures. TL;DR add `glPixelStorei(GL_UNPACK_ALIGNMENT,1);` somewhere (I suggest you add it, along with the `glPixelStorei(GL_PACK_ALIGNMENT,1);` in "clientCommands.cxx", to some sort of global OpenGL initialization).03:48
AgathaThe reason you need this call is pretty simple: the default is 4, meaning GL expects a multiple of 4 bytes per row. Your new texture code compacts the memory from RGBA to RGB / L / L+A if possible, which can result in a different alignment. In this case, the texture is 739 pixels across. You new code compacts this from 739*4=2956 bytes RGBA to 739*3=2217 bytes RGB, which is not a multiple of 4. OpenGL rounds up to the next multiple of 4, skipping what it 03:48
Agathaassumes are intentional padding bytes, before starting on the next line. In this case, that's three bytes. However, those three bytes are not padding; they *should* have been the next pixel. These are skipped, so OpenGL is effectively skipping one pixel. One pixel is skipped on every row, so you get a 45 degree angle. The thing doesn't segfault because the original memory store never got shrunk. This problem didn't happen with the previous code because the 03:48
Agathaprevious code used RGBA for the upload, which is a multiple of 4.03:48
SpringTankoh so that's why the textures on some maps are shifted!03:54
*** Sgeo__ <Sgeo__!~Sgeo@user/sgeo> has joined #bzflag04:16
*** Sgeo_ <Sgeo_!~Sgeo@user/sgeo> has quit IRC (Ping timeout: 255 seconds)04:19
AgathaI've noticed this general category of bug for a long time, even reported one. I long suspected it was this kind of issue; this should fix it for good.04:44
Agatha(Here's that issue I alluded to, BTW:   https://github.com/BZFlag-Dev/bzflag/issues/258   I wouldn't be surprised if this is caused by a similar problem.)06:08
*** Sgeo__ <Sgeo__!~Sgeo@user/sgeo> has quit IRC (Read error: Connection reset by peer)07:09
*** FastLizard4 is back08:09
*** blast007[m] <blast007[m]!~blast007m@2001:470:69fc:105::7ec> has quit IRC (Quit: You have been kicked for being idle)08:52
*** I_Died_Once <I_Died_Once!~I_Died_On@c-73-184-170-223.hsd1.ga.comcast.net> has joined #bzflag09:01
*** FastLizard4 is now away: AWAY from keyboard09:01
*** FastLizard4 is now away: GONE - Screen Detached and Disconnected from IRC (I'm probably asleep, at work, or doing something in real life)09:27
blast007Agatha: in the function that takes a screenshot?10:17
*** blast007[m] <blast007[m]!~blast007m@2001:470:69fc:105::7ec> has joined #bzflag10:17
macsformegreat analysis, Agatha... thank you13:51
Agatha@blast007 yes. An analogous potential issue exists reading data *from* OpenGL as well (e.g. taking a screenshot), which one solves by setting the *pack* alignment.14:29
AgathaAnywho, the parameters are global GL state, so I'd put them both into some initializer somewhere.14:30
*** FastLizard4 is back18:36
*** Cobra_Fast is now away: vacant19:03
*** Cobra_Fast is back19:03
*** FastLizard4 is now away: AWAY from keyboard19:06
SpringTankhave you been able to test this and recompile?19:25
tuponeI did19:34
AgathaYeah I put a `glPixelStorei(GL_UNPACK_ALIGNMENT,1);` somewhere and confirmed it fixes the problem, at least on that map.19:34
BZNotify2.4 @ bzflag: atupone pushed 1 commit (https://github.com/BZFlag-Dev/bzflag/compare/ec6fff321415...1dcf6ebf029e):19:35
BZNotify2.4 @ bzflag: atupone 1dcf6e: Fix packing of texture, thanks to Agatha (https://github.com/BZFlag-Dev/bzflag/commit/1dcf6ebf029ee095685e0f6c183ae0a4ad0f0117)19:35
AgathaNice :)   Note the other pack alignment setting in "clientCommands.cxx" is now redundant, and so should be removed.19:37
SpringTankwhy I never learned openGL https://i.redd.it/gyufhogm52l91.jpg19:54
BZNotify2.4 @ bzflag: atupone pushed 1 commit (https://github.com/BZFlag-Dev/bzflag/compare/1dcf6ebf029e...04788c541f72):20:03
BZNotify2.4 @ bzflag: atupone 04788c: Remove pack alignment, global now (https://github.com/BZFlag-Dev/bzflag/commit/04788c541f72882d3083e26c23434bb42e3ee384)20:03
*** Sgeo <Sgeo!~Sgeo@user/sgeo> has joined #bzflag22:33
*** yuitimothy_ is back23:02
*** Cobra_Fast is now away: vacant23:28
*** Cobra_Fast is back23:28

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!