00:27 <+bridge> [ddnet] ^ is not extra its a common lang feature 00:27 <+bridge> [ddnet] what other symbol would you use? 01:45 <+bridge> [ddnet] XOR is an operation lost to users of newer languages 02:39 <+bridge> [ddnet] its not lost, its just hidden 02:39 <+bridge> [ddnet] in general, its hidden in the `==` operator 02:43 <+bridge> [ddnet] return !(a == a) 03:31 <+bridge> [ddnet] newer languages? 03:31 <+bridge> [ddnet] javascript has xor 04:59 <+bridge> [ddnet] c has 07:19 <+bridge> [ddnet] Is there a way to do this in c++, where the metaphorical list is a list of the 4 cl laser color channels? so i don't have to a long if else chain? 07:19 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/998459019926712330/unknown.png 07:20 <+bridge> [ddnet] i did this in ms paint because it was the fastest way i could get the idea out of my head 07:55 <+bridge> [ddnet] not sure what ur asking but maybe switch statements could help 07:55 <+bridge> [ddnet] is there a switch in c++? i dont remember 08:48 <+ChillerDragon> stemyes 08:48 <+ChillerDragon> a 08:48 <+ChillerDragon> yes tere is switch 08:59 <+bridge> [ddnet] Is PROJECTILE things like non-spinning / spinning laser? 08:59 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/998484083921395742/unknown.png 09:00 <+bridge> [ddnet] also what is ENTITIYCLASS_LIGHT 09:22 <+bridge> [ddnet] ???? visual studio is yelling at me for the variable being uninitialized, but isnt it literally initialized at the top of this segment? 09:22 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/998490008484839434/unknown.png 09:23 <+bridge> [ddnet] also update on the laser renderer: 09:23 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/998490276320522290/unknown.png 09:29 <+bridge> [ddnet] which variable 09:30 <+bridge> [ddnet] `int ColorMode;` 09:30 <+bridge> [ddnet] hmm 09:30 <+bridge> [ddnet] does it compile? 09:31 <+bridge> [ddnet] It compiles, but if I join a server with lasers, the switch function just outputs `default:` and if I join something like fng, that's when it yells at me. 09:32 <+bridge> [ddnet] oh visual studio is complaining because you give it a value inside an ``if`` block so it may not have a value always 09:32 <+bridge> [ddnet] which would make it random memory I think 09:32 <+bridge> [ddnet] That's weird. 09:32 <+bridge> [ddnet] yeah c++ 09:33 <+bridge> [ddnet] so i would have to put it all the way up here? 09:33 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/998492648140714004/unknown.png 09:33 <+bridge> [ddnet] I'll try that 09:34 <+bridge> [ddnet] just do ``int ColorMode = 0;`` 09:37 <+bridge> [ddnet] That fixed it! 09:39 <+bridge> [ddnet] Now I just need to figure out how to handle the switch function. All inputs are correct numbers, but it doesn't recognize any. 09:41 <+bridge> [ddnet] Never really coded in c++ but since color mode is an int shouldn’t it be 09:41 <+bridge> [ddnet] case 1 09:41 <+bridge> [ddnet] Instead of 09:41 <+bridge> [ddnet] case ‘1’ 09:42 <+bridge> [ddnet] i'll try that 09:42 <+bridge> [ddnet] oh yeah lol 09:42 <+bridge> [ddnet] I thought it might be some c++ thing I didn’t know haha 09:43 <+bridge> [ddnet] oh my god. 09:43 <+bridge> [ddnet] oh my god this is beautiful 09:43 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/998495145253146634/unknown.png 09:43 <+bridge> [ddnet] Nice! 09:43 <+bridge> [ddnet] i'll send over a demo 09:52 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/998497427919216720/Watch_your_time_MULTICOLORED.demo.mp4 09:52 <+bridge> [ddnet] Shotgun was rendered as 2 in game, but for some reason, probably goes to `default` 09:53 <+bridge> [ddnet] @Souly 09:53 <+bridge> [ddnet] :feelsamazingman: 10:02 <+bridge> [ddnet] That looks great and honestly I think it’d help, I’ve mistaken those a few times at least 10:03 <+bridge> [ddnet] why now i can't use "pgdn" to hides the background layer 10:04 <+bridge> [ddnet] before , in some dark maps use "pgdn" to hides the background layer.You can see maps more clearly.but now i can't do it. 10:08 <+bridge> [ddnet] You can rebind it by typing in f1 10:08 <+bridge> [ddnet] `bind pgdown cl_showquads` 10:08 <+bridge> [ddnet] oh 10:08 <+bridge> [ddnet] thanks 10:08 <+bridge> [ddnet] yea it got renamed to prevent any accidental clicks from new players 10:10 <+bridge> [ddnet] hm.not pgdown , i try some word, it is pagedown. 10:10 <+bridge> [ddnet] yea maybe 10:11 <+bridge> [ddnet] how can i setting swtich it? 10:11 <+bridge> [ddnet] that? i do not know 10:11 <+bridge> [ddnet] (on key to switch) 10:11 <+bridge> [ddnet] okay 10:12 <+bridge> [ddnet] i'm going to try 10:13 * bridge [ddnet] bind pagedown +toggle cl_showquads 0 1 10:14 <+bridge> [ddnet] hm 10:14 * bridge [ddnet] bind pagedown +toggle cl_showquads 0 1 10:15 <+bridge> [ddnet] yea, just replace the old show quads thing with new 10:15 <+bridge> [ddnet] Press and hold it to display, but release will become as is 10:16 <+bridge> [ddnet] It can also be used 10:31 <+bridge> [ddnet] use *toggle* instead of *+toggle* if you don't want to hold the key 10:42 <+bridge> [ddnet] there is a kog map that has it written. maybe pillars. it says this map has high res quads. press pgdown to disable 10:43 <+bridge> [ddnet] Nice! Btw, if you need help you can also dm me :) 10:45 <+bridge> [ddnet] Hi! I hosted a server with maps from ddnet-maps repo, but when i select it in list, it just passes and doing nothing. When doing exec storage.cfg manually, it says that add_path is unknown command 10:45 <+bridge> [ddnet] which is now broken i guess 12:04 <+bridge> [ddnet] @Not Keks how much should I care about what I put into which group/binding in shaders? 12:04 <+bridge> [ddnet] like, if I nearly always have the camera buffer bound, should it always be in the same slot, and if a few shaders don't use the camera should I leave that slot unused? 12:07 <+bridge> [ddnet] or is that super irrelevant? I remember reading that the lower bindings are supposed to be used for things that change least frequently (or the other way around, not sure anymore) 16:57 <+bridge> [ddnet] chillerdragon whats the state of your ddnet command line client? 17:15 <+ChillerDragon> @cauldron inputs are solid: rcon, chat, local, console, team chat supporting tab completion for names and commands and keyboard shortcuts for navigation and history search 17:15 <+ChillerDragon> there is a verrrrry cursed ascii world renderer 17:15 <+ChillerDragon> scoreboard works most of the time 17:16 <+ChillerDragon> serverbrowser is okay unless some utf8 chinese characters mess up indentation 17:16 <+ChillerDragon> oh and its linux only and probably will stay so 17:17 <+ChillerDragon> https://zillyhuhn.com/cs/.1658157436.png 17:17 <+ChillerDragon> me search for "chill" in "internet" tab 17:18 <+ChillerDragon> downloading a map: 17:18 <+ChillerDragon> https://zillyhuhn.com/cs/.1658157489.png 17:19 <+ChillerDragon> the spawn of multimap using the crappy renderer: xd 17:19 <+ChillerDragon> https://zillyhuhn.com/cs/.1658157536.png 17:19 <+bridge> [ddnet] camera sounds like a push constant to me, is more efficient, but dunno if wgpu has that 17:20 <+bridge> [ddnet] generally, minimize state changes always 😄 17:21 <+ChillerDragon> typing in "fire" in local console then "tab" to iterate all search mates like in the gui client 17:21 <+ChillerDragon> https://zillyhuhn.com/cs/.1658157633.png 17:21 <+ChillerDragon> player scoreboard: 17:21 <+ChillerDragon> https://zillyhuhn.com/cs/.1658157696.png 17:22 <+ChillerDragon> help page and thats about it: 17:22 <+ChillerDragon> https://zillyhuhn.com/cs/.1658157730.png 17:28 <+ChillerDragon> @cauldron you can build this boi https://github.com/chillerbot/chillerbot-ux/ using ``cmake .. -DHEADLESS_CLIENT=ON -DCURSES_CLIENT=ON`` to run it your self :) 18:14 <+bridge> [ddnet] @Not Keks @heinrich5991 I think I'll give up on the reuse-optimization for now, tried to get the performance of having to just render 1 line of vertical line of pixels each frame, but it still got less fps than the original https://gitlab.com/Patiga/twgpu/-/tree/tilemap-reuse-optimization 18:15 <+bridge> [ddnet] (it doesn't render properly yet, but I think the performance should be representative) 18:15 <+bridge> [ddnet] @Not Keks maybe a simple good optimization could be just calculating the bounding box of the tilemap? 18:16 <+bridge> [ddnet] -> and then adjust the clipping 18:16 <+bridge> [ddnet] heh, that could actually result in higher fps on zooming out 18:16 <+bridge> [ddnet] dont u already have the boundingbox 18:17 <+bridge> [ddnet] not yet, no 18:17 <+bridge> [ddnet] i mean the tilemap itself is a bounding box 18:17 <+bridge> [ddnet] well the edges extend outwards, and so far I handle air mostly the same as any other tile 18:17 <+bridge> [ddnet] the bounding box should ignore air 18:18 <+bridge> [ddnet] i think my understanding of a bounding box is smth different than yours xD 18:19 <+bridge> [ddnet] hm my understanding of a bounding box is an estimation of the real size of a thing 18:19 <+bridge> [ddnet] but what does it help here? 18:19 <+bridge> [ddnet] like if you have a model, you could put a box around it to have simpler calculations for some stuff 18:20 <+bridge> [ddnet] here my bounding box could be the smallest rectangle (still aligned with bothes axis) in which all tiles of the tilemap are 18:20 <+bridge> [ddnet] the bounding box can extend into infinity in a direction by having a tile on the outer edge of the tilemap 18:21 <+bridge> [ddnet] I could then see how much of the bounding box actually overlaps with the camera view 18:21 <+bridge> [ddnet] and calculate how much of the screen I can clip off 18:21 <+bridge> [ddnet] clip/scissor 18:22 <+bridge> [ddnet] maybe I'm misusing the word 'bounding box', unsure about that ^^ 18:23 <+bridge> [ddnet] yeah but how often does it happen that the tilemap size is not equal to the tiles used 18:23 <+bridge> [ddnet] i mean sure some mappers just make width & height too big, but i assume its not too often 18:23 <+bridge> [ddnet] hm good question 18:24 <+bridge> [ddnet] I guess I could write a python script to figure out if that is the case 18:24 <+bridge> [ddnet] but clipping/scissoring more should improve the performance, no? that should be a cheap operation 18:25 <+bridge> [ddnet] u know what could work? render the first 8 layers at once 18:26 <+bridge> [ddnet] u have 16 texture units garantueed in the fragment shader, and the first layer knows the background layer(the clear color) 18:26 <+bridge> [ddnet] what are texture units? 18:27 <+bridge> [ddnet] texture slots 18:27 <+bridge> [ddnet] samplers 18:27 <+bridge> [ddnet] ah, the bindings? 18:27 <+bridge> [ddnet] yeah sampler binding 18:28 <+bridge> [ddnet] oh so you are proposing creating a shader that renders multiple layers at once? 18:28 <+bridge> [ddnet] would at least lower the amount of calls to the webgl API 18:28 <+bridge> [ddnet] bcs that is still insane xD 18:29 <+bridge> [ddnet] hm, I guess I could also try understand the webgl api and improve the wgpu webgl-backend code ^^ 18:29 <+bridge> [ddnet] are you sure that that many calls are actually a problem? shouldn't they mostly be cpu-based calls? 18:29 <+bridge> [ddnet] well they just spam out all state changes, i dunno how well the webgl "drivers" are 18:30 <+bridge> [ddnet] but assuming they are rather bad, that sounds like some overhead 18:30 <+bridge> [ddnet] a well written opengl driver might check all states before trying to apply them 18:31 <+bridge> [ddnet] tho that ofc can come with overhead in case the dev writes well written backends 😄 18:31 <+bridge> [ddnet] vulkan is just better xD then its ur fault if it sucks 18:33 <+bridge> [ddnet] hm yea 18:33 <+bridge> [ddnet] btw @Patiga sadly i cannot test ddnet rendering on webgl without vsync. dunno why, but seems SDL hasnt implemented it yet and is always default on 18:33 <+bridge> [ddnet] :/ 18:33 <+bridge> [ddnet] ah darn 18:48 <+bridge> [ddnet] @Patiga does wgpu generally have no geometry/tesselation shader? or just the webgl backend not 18:48 <+bridge> [ddnet] not at all as of yet 18:48 <+bridge> [ddnet] too bad 18:49 <+bridge> [ddnet] bcs then u could move bit of your fragment code to the geometry shader stage already 18:49 <+bridge> [ddnet] but probably when zooming out far enough it doesnt matter anymore anyway, bcs then 1 pixel = 1 tile 18:50 <+bridge> [ddnet] so RIP 18:50 <+bridge> [ddnet] I think their current goal is putting out like a MVP version 18:50 <+bridge> [ddnet] https://github.com/gpuweb/gpuweb/wiki/Implementation-Status 18:50 <+bridge> [ddnet] until they get version 1 out I doubt they will add more shader stages as I understand it 22:04 <+bridge> [ddnet] u know when u start reading wikipedia and get deeper and deeper, today i found this experience on stack overflow 22:04 <+bridge> [ddnet] there is one guy that posts a lot in x86 22:05 <+bridge> [ddnet] he knows way too much stuff 22:05 <+bridge> [ddnet] i cant remember the name rn 22:06 <+bridge> [ddnet] found it 22:06 <+bridge> [ddnet] https://stackoverflow.com/users/224132/peter-cordes 22:06 <+bridge> [ddnet] https://stackoverflow.com/questions/40354978/why-does-c-code-for-testing-the-collatz-conjecture-run-faster-than-hand-writte/40355466#40355466 22:06 <+bridge> [ddnet] example casual answer from him 22:06 <+bridge> [ddnet] insane xD 22:06 <+bridge> [ddnet] pog 22:06 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/998682218518028318/unknown.png 22:25 <+bridge> [ddnet] Now do such detailed answers for GPUs thx xd 22:32 <+bridge> [ddnet] xd 22:34 <+bridge> [ddnet] well, who uses div instruction for dividing by 2? 22:34 <+bridge> [ddnet] people learning assembly and that dont know these details? 22:34 <+bridge> [ddnet] why not? 🙂 22:35 <+bridge> [ddnet] if i knew nothing about cycles etc i would use div too 22:35 <+bridge> [ddnet] its the most logical thing 22:35 <+bridge> [ddnet] use the div mnemonic to divide 22:35 <+bridge> [ddnet] obviously, but the guy looked more advanced than beginners 22:35 <+bridge> [ddnet] its highly inefficient 22:35 <+bridge> [ddnet] ye 22:35 <+bridge> [ddnet] check the answer 22:36 <+bridge> [ddnet] for a detailed explanation 22:36 <+bridge> [ddnet] xdd 22:36 <+bridge> [ddnet] > On Intel Haswell, div r64 is 36 uops, with a latency of 32-96 cycles, and a throughput of one per 21-74 cycles. (Plus the 2 uops to set up RBX and zero RDX, but out-of-order execution can run those early). High-uop-count instructions like DIV are microcoded, which can also cause front-end bottlenecks. In this case, latency is the most relevant factor because it's part of a loop-carried dependency chain. 22:36 <+bridge> [ddnet] > 22:36 <+bridge> [ddnet] > shr rax, 1 does the same unsigned division: It's 1 uop, with 1c latency, and can run 2 per clock cycle. 22:36 <+bridge> [ddnet] I misunderstood the conversation, didn't read enough messages 22:36 <+bridge> [ddnet] he also has a rly in depth explanation about why zeroing with xor is the best option 22:36 <+bridge> [ddnet] i gotta find it 22:37 <+bridge> [ddnet] because it's hardcoded into the processor 22:37 <+bridge> [ddnet] as a free operation, even 22:37 <+bridge> [ddnet] only limited by instruction decoding 22:38 <+bridge> [ddnet] https://stackoverflow.com/questions/33666617/what-is-the-best-way-to-set-a-register-to-zero-in-x86-assembly-xor-mov-or-and 22:38 <+bridge> [ddnet] here 22:38 <+bridge> [ddnet] you can execute as many `xor R, R` as you want per cycle 😛 22:38 <+bridge> [ddnet] > TL;DR summary: xor same, same is the best choice for all CPUs. No other method has any advantage over it, and it has at least some advantage over any other method. It's officially recommended by Intel and AMD, and what compilers do. In 64-bit mode, still use xor r32, r32, because writing a 32-bit reg zeros the upper 32. xor r64, r64 is a waste of a byte, because it needs a REX prefix. 22:38 <+bridge> [ddnet] > 22:38 <+bridge> [ddnet] > Even worse than that, Silvermont only recognizes xor r32,r32 as dep-breaking, not 64-bit operand-size. Thus even when a REX prefix is still required because you're zeroing r8..r15, use xor r10d,r10d, not xor r10,r10. 22:39 <+bridge> [ddnet] @heinrich5991 but he mentions that the only useful case is when u dont want to alter flags 22:39 <+bridge> [ddnet] iirc 22:39 <+bridge> [ddnet] i read it this morning xd 22:39 <+bridge> [ddnet] the only useful case to not use xor* 22:40 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/998690720519032923/unknown.png 22:40 <+bridge> [ddnet] xd 22:40 <+bridge> [ddnet] boo images 22:40 <+bridge> [ddnet] i felt it would spam irc too much :c 22:41 <+bridge> [ddnet] he knows so much, always mentioning this x cpu family does this and that other that 22:41 <+bridge> [ddnet] truly years of knowledge 22:44 <+bridge> [ddnet] guy just memorized all intel documentation 😄 22:44 <+bridge> [ddnet] xd