Time Nick Message 11:56 lissobone Greetings. 11:56 hare_hare_yukai Greetings. 17:50 mazes_83 long time I didn't add new node, I modeled a very basic thing in blender, UV points to 4 different textures, but when I put node in world only first texture is taken in account 17:54 erle mazes_83 show test case pls 17:54 MTDiscord My guess is you didnt export material groups 17:56 mazes_83 ah greenxenith, I bet it is the correct answer. 18:05 mazes_83 ty greenxenith, that was the correct guess 18:05 MTDiscord Awesome, glad it worked 19:28 MTDiscord erle : the CJK variant handling is typically done by getting the language someone is using and show the variant appropriately 19:29 MTDiscord though in terms of using with signs, maybe have a way for the library to know what language they're writing on said sign?? 19:29 MTDiscord CJK variant is how one font can be used for all three languages and still appear correctly based on language 19:40 erle mnh48 so how should i change the API? 19:42 MTDiscord probably finding a way to know what language the user who write the sign is using?? 19:42 MTDiscord or maybe just put dropbox in the sign menu asking for language lol 19:42 erle that's not a good answer for a TEXT RENDERING LIBRARY 19:42 erle look, my interface right now is like this 19:43 erle text_bitmap_1 = hexdraw.render_text("wð♥𐍈😀!🂐겫") 19:45 MTDiscord if it's that then add parameter for language code?? 19:45 MTDiscord maybe like 19:45 MTDiscord text_bitmap_1 = hexdraw.render_text("早上好中国,现在我有冰淇淋","zh-Hans") 19:45 MTDiscord then use the language code to decide which variant is used 19:48 MTDiscord for reference on CJK Variant, this page is displayed with Noto Sans CJK (one font) except for Vietnamese part, look at how the character is different because it's in different language (in HTML, the language can be specified with lang= like ) 19:48 MTDiscord https://cdn.discordapp.com/attachments/749727888659447960/1147981512373960794/2023-09-04_03-42-56_vivaldi.png 19:49 muurkha erle: this is indeed a major problem with CJK unification in Unicode 19:49 muurkha the character codes themselves do not provide enough information to allow you to render text properly 19:49 muurkha imagine if ß were encoded in ISO-8859-1 as "ss" 19:50 muurkha I guess that's not quite right, because "ss" does occur in German in a few cases 19:50 erle hexdraw.render_text("早上好中国,现在我有冰淇淋","zh-Hans") is a bad API design 19:51 erle the second parameter is a dictionary, which makes extensibility much easier 19:51 erle muurkha, switzerland encodes ß as ss, because they have no letter ß AFAIK 19:52 MTDiscord I'm just giving example of how language information could be passed on for actual processing, basically do what you want for the actual implementation 19:52 erle so the jokes write themselves basically 19:53 erle “genießen in maßen” (enjoy in moderation) vs. “genießen in massen” (enjoy en masse) 19:53 erle the funniest thing is that a popular book on german words and grammar DER GROẞE DUDEN for a long time had a ß in it but there was no ẞ (capital letter ß) 19:54 erle so by the rules of the book, it's own entirely uppercase title may have not been legal 19:55 MTDiscord also this is just CJK variant, which is considerably easier than say, positional glyph like in Arabic lmao .. since it's just one-to-one on what to show for which language 19:56 MTDiscord for positional glyph, in addition to language, you also need to know what character came before or after what character, and to know if current character need to be join to before, to after, to both, or to none surrounding characters 19:56 muurkha I feel like positional variants are less of a problem 19:56 erle yes, so how do you propose i get the CJK variant of a .hex font file 19:56 erle i mean out of 19:57 muurkha I mean a medial or final alef is still a medial or final alef whether you're writing in Arabic, Farsi, or Urdu, right? 19:57 muurkha so even though you don't have enough information in a single code point, you have enough information in the string 19:57 erle muurkha have you seen the shitty rendering i do with my pure lua unicode renderer? the arabic letters are not joined at all 19:57 erle i can trivially check out the previous or next letter obv 19:57 erle like, isn't this like one preprocessing step or so? 19:57 MTDiscord yes, but final yeh (ي) is different in some languages, as in some language drops the two dots while others retain it 19:58 muurkha hmm, I didn't realize that 19:58 muurkha erle: I have terminals that do that too 19:58 erle so to summarize: a language tag given to the rendering function is a good idea. 19:58 muurkha unfortunately I don't speak any languages written in Arabic script 19:58 erle the problem remains how i do anything with it 19:59 erle mnh48 give me a way to figure out which variant character i need and where it is in unifont, then i put it in 19:59 erle i do actually query the unicode database for stuff 19:59 erle so assume i have it 19:59 erle (see source code) 20:06 MTDiscord I'm not sure if unifont even carry the variant data like other fonts (they do have a separate Unifont JP font to cover Japanese specifically but that's it) 20:06 MTDiscord https://unifoundry.com/unifont/index.html 20:06 MTDiscord see "Unifont Limitations" 20:23 erle mnh48 but do i really need a language tag then, if the user could just load the japanese glyphs? 20:24 erle i have drawn a lot of emoji for unifont, but that was a long time ago 20:26 MTDiscord not all font release separate versions for different languages, some only release one version for all 20:26 MTDiscord in which that one version contained the variants in it 20:26 erle yeah but i only have a loader for the hex font file format 20:26 erle and given the state of existing sign libraries, i doubt anyone else is going to write a font loader soon 20:26 erle so i will defer this right now ig 20:26 erle but thanks for the pointers 20:27 erle anything else API-wise that you'd like? 20:27 erle i mean i have tab width 20:27 erle and kerning yes/no 20:27 erle though the kerning algorithm is really stupid 20:29 MTDiscord hmmm.. nothing else for now 20:31 erle did you look at the example rendering? 20:32 Krock rendering stuff is freetype's business, not Minetest's 20:32 erle i think you are mistaken 20:33 erle Krock have you looked at my thing? 20:33 Krock please be more specific 20:33 erle Krock https://git.minetest.land/erlehmann/tga_unicode_encoder 20:33 erle waid 20:33 erle wait 20:33 erle wrong link 20:34 erle Krock https://git.minetest.land/erlehmann/tga_unicode_renderer 20:34 erle Krock here is some sample output: https://mister-muffin.de/p/_TxA.png 20:35 Krock did you implement a font library in Lua? 20:35 erle yes 20:36 erle i also accidentally found out that you can reduce the size of textures by 30% over the most optimized optipng by supporting tga.z as a format (and sending normal tga to older clients) 20:36 erle basically, i found that quake etc. were always right 20:36 erle for the size of the textures we are talking about 20:37 Krock I see. The server builds rarely or never come with freetype 20:37 erle Krock i did it half a year ago, but depression and controlling partner … i released it 6 months after writing 20:37 erle the goal is unicode on signs 20:37 erle since i do not have a clue of arabic or hebrew, the thing still sucks for bidirectional text (numbers in hebrew text) or connected letters (arabic) 20:38 erle but otherwise, i think i am FAR ahead of every signs library 20:38 Krock I suppose font parsing and rendering is a good exercise for parsing files but it's already possible to generate text on top of Irrlicht-type Images and load those as textures 20:38 Krock it just hasn't been implemented yet. afaik there's an open PR for that 20:38 erle okay, but i HAVE implemented something 20:38 erle my thing is there and it works 20:39 erle and i have seen the issues and decided it this way because it's actually not too slow 20:39 erle also this is 100% backwards compatible 20:39 erle after all, i just generate a texture 20:39 erle Krock, i'd appreciate input regarding the shape of the API. any suggestions? so far i have the suggestion of a language tag. 20:40 erle it's only that i can't do much with it right now 20:40 erle also look into my texture compression benchmarks, shaving 30% of transfer size is no joke 20:41 Krock that's a good achievement regarding the tools that you're working with 20:41 erle you mean lua? 20:41 erle i initially thought lua would be in the way 20:41 Krock Lua and server-side generated textures that would optimally be sent in text form to clients for rendering on the fly rather than caching every single texutre 20:42 erle wait what how 20:43 erle i am pretty sure whatever you envision is only possible if you allow the lua code to execute on the client, which is a bit oof 20:43 erle i mean, how would you render the funny colored text otherwise 20:43 Krock there's not much needed to introduce client-sided support: https://github.com/minetest/minetest/pull/12084 20:43 erle i am pretty sure this does not do what i do 20:44 erle like it can do less and also got closed 20:44 Krock colored text can already be created as string and sent 20:44 erle i am doing pixel operations on a bitmap that i rendered text in. how are you going to do this in a performant, backwards-compatible way which allows the server to choose the font 20:44 erle cora has a game that uses the conlang toki pona, she may want her signs to have a toki pona font 20:45 erle as i said, i looked at existing approaches and rejected them (not said: due to constraints regarding the use of the thing) 20:45 Krock features in Minetest rarely have been backwards-compatible. old clients are mostly guaranteed to end up with an incomplete experience 20:45 erle still, i don't get it 20:46 erle i mean you can do it all using new texmods, but it's not particularly useful 20:46 Krock you'd rather send the font file as media and not every generated texture 20:47 erle that's multiple megabytes. a sign texture is probably hundreds of bytes at most. 20:47 Krock that would also allow texture generation/composition on the fly without manual generation 20:47 erle you have to make a lot of signs until you get to the point where it makes sense. 20:47 erle also last time pixel fonts were supported they were ripped out, so i have zero hope for pixel-accurate rendering on the client 20:47 Krock you'd likely download the font once and use it on multiple servers. over time this will pay out 20:48 erle people say that for websites that download 2MB js as well lol 20:48 Krock anyway it's good to see that you found a solution that works for you :) 20:48 erle look, i could have done it differently actually, using a huge texture and indexing into it using texmods 20:49 erle but i'm pretty sure huge textures + not-too-modern GPUs = little graphics RAM left 20:49 erle for example, there is this intel thing where if your GPU memory is nearly full, font rendering goes wonky 20:49 erle anyways 20:49 erle Krock API-wise, any ideas? 20:50 erle Krock you put in utf-8 encoded text and get out a pixel array, any improvements you'd like to see regarding parameters or so? 20:50 Krock can you generate `[png:` data yet? 20:52 Krock API-wise I suppose it is pretty intuitive. 20:52 erle i can not. you can do that, but you will find that a) minetest.encode_png() does not support remotely as many useful features as tga_encoder (for example, you may want your text colormapped or monochrome after all) b) your files get too big with minetest.encode_png() c) geeting to reasonable filesizes (still above tga.z) takes a long encoding time 20:53 erle basically, there is *no* way this is going to be performant with PNG than with tga or tga.z 20:53 erle as performant i mean 20:53 erle (you can try to prove me wrong, but i suggest to try to understand what i did first) 20:54 erle if you want to put the pixel array in [png, i am not hindering you. i am just saying it's not the best use of your, your players, or your servers time. 20:55 erle Krock, is there any caching reason for [png maybe? 20:55 erle like is the cache evicted of the generated texture once it is no longer referenced? 20:56 Krock AFAIK the resulting texture is kept in memory until leaving to the main menu. that's the case for any loaded or generated texture 20:56 erle so, do you have any other reason to use it? 20:56 Krock you'd however gain the flexibility to use a greater variety of characters to e.g. write text on a sign 20:57 erle as i said, if i wanted to use texmods i'd probably index a huge texture rather than create a lot of smaller ones ig? 20:57 Krock the signs mod currently uses a sort of character map (flatten out as individual files) which are then put together 20:57 erle yes, i know 20:57 erle this approach is pretty limited 20:58 erle and in fact, you get a much larger overhead than using a single picture that you index into 20:58 Krock I thought that texmods would use more space than a [png: data blob? 20:58 erle not sure, but [png has a minimum overhead, of … let me calculate 20:59 erle probably around 95 useless bytes everytime you use it before you get to the payload 20:59 erle not sure how many texmods you can put into that 21:00 Sokomine by any chance tenplus1 hanging around currently? 21:00 erle depends on your thing 21:01 erle Krock in any case, how would you do the thing i do where i render text and then apply effects to the texture? 21:02 erle at the bottom of test.lua i do this 21:03 Krock in a hacky manner? `[png:` so that it could be used dynamically. in a proper manner? implement it in Minetest. 21:03 mazes_83 @greenxenith: ty again: https://content.minetest.net/uploads/070998b66e.png 21:04 MTDiscord Nice 👌 21:04 erle Krock again, HOW would you implement this 21:05 erle Krock if you use [png that does not solve “i want to render text to a bitmap and then modify the bitmap” 21:05 erle because texmods are very limited for the purpose 21:05 Krock if you already "render" it, what do you need to modify afterwards? 21:06 erle the pixels 21:06 Krock no shit sherlock 21:06 erle e.g. to create outlines, shadows etc. 21:06 erle same way i do in xmaps 21:06 erle i render a bitmap, then i iterate over the pixels and modify it using filters 21:06 erle the water texture in xmaps is created that way 21:07 Krock if this were a new texmod (with font media sending I mentioned earlier), it would need some sort of flags or options to specify the way it is supposed to be rendered. of course, this would no longer allow fine-grained server-side control 21:07 erle please no new knee-jerk reactions lol 21:08 erle [png was bad enough 21:08 erle https://git.minetest.land/erlehmann/tga_unicode_renderer/src/branch/main/test.lua look at line 69 ff 21:08 erle i doubt you could do this with a texmod 21:09 erle and about the fonts, how highly do you rate the chance that minetest will support hexfonts? i'd say about zero. 21:09 erle as last time we had pixel fonts, they got removed 21:09 Krock text colorization is already a Minetest feature 21:09 erle look, i am 110% sure it can't do what i do there 21:09 erle i am not colorizing letters 21:09 Sokomine ah. working on the display of text ingame? that's good. thanks for doing so! may help a lot 21:09 erle yes 21:10 erle Sokomine it is not yet on cdb because i want to have API kinks ironed out 21:10 erle Sokomine if you look at the examples, anything you might want to have? 21:10 erle primarily for rendering text on signs 21:11 erle Sokomine, see https://git.minetest.land/erlehmann/tga_unicode_renderer/src/branch/main/examples.lua line 58 ff 21:11 Sokomine can't tell yet as i'm not really into it. i only know that it seems to strain the clients a lot 21:12 Sokomine any improvements in that regard are highly welcome 21:12 erle what exactly strains the clients, the texmod orgys? 21:12 erle orgies 21:12 Sokomine i'm currently a bit busy doing the final polish for yl_speak_up and adding a mod that adds some actual npc (or at least makes them able to be talked to) 21:13 Sokomine text on signs, posters etc. seems to be part of the problem. there are more factors involved 21:13 erle well i'd appreciate your input then 21:13 erle i mean i just spit out pixels and that's it 21:13 Sokomine in general, servers over time become...hard to bear at spawn due to stress for client and connection 21:14 erle well i have a pretty shitty pc and so far i have not found any problem with having lots of small textures in cache … but texmods, yeah 21:15 Sokomine merchant street on the your land server is something to just run away from as fast as possible - which is a pity because it's nicely built. but it's still a horror performance-wise. there are diffrent theories why that is so. everything that improves that is highly welcome 21:15 erle pretty sure texmods can also be used to crash or hang clients 21:15 Sokomine and that's not the only server spawn suffering over time. to some degree they all do 21:15 erle Sokomine so would you be so kind and try to render some text or give me some text you render so i can see if my library can handle it well? 21:16 Sokomine i'm not rendering any text as such. but if you want to see much text - go to the your land server? has enough posters and signs 21:16 erle so you do not use signs or posters at all? 21:16 erle i know that server 21:16 erle spawn is laggy laggy laggy 21:16 erle but i never thought it was the signs 21:18 erle Krock Sokomine here is another rendering that shows why i want it pixel-perfect https://mister-muffin.de/p/nkfF.png 21:18 erle (the math signs error was there in the source file) 21:18 erle (or is it an error? i did not modify it) 21:18 Sokomine i'm currently mostly working with npc and letting them talk. has been quite a while...but that mod is nearing completition (finally!) 21:19 erle hmm, i should probably get my library into “this week in minetest” right? 21:19 erle or this month or so 21:19 erle whatever its called 21:19 Sokomine looks nice, yes 21:19 erle what do i need to do for that? 21:20 MTDiscord https://github.com/minetest/blog/issues/new/choose 21:20 erle when is the next issue due? 21:21 MTDiscord The post usually gets published midway through the month 21:21 erle that leaves a bit of time to get the API right lol 21:21 erle greenxenith you have any opinions on my text rendering thing? 21:21 erle if so, extrapolate your onions 21:22 MTDiscord Sorry, im a little busy with my own project at the moment 21:22 erle no problem 21:22 erle Sokomine do you see any other scenarios for text rendering than signs that i should consider? 21:26 Sokomine signs come in many variants. in the end they're all signs, but from a ton of diffrent mods and in very diffrent style. there are those long ones used for train-stations or shop advertisement, then the posters (very popular), homedecor signs, signs with arrows etc... 21:27 Sokomine there are also name tags of mobs that...exist. i have no idea in which...relation...or how relevant that is. if you met an npc now and then with a name tag, that probably doesn't matter at all. if you have a scout invasion with hundreds of them - or just someone gone crazy with breeding chicken or ducks... 21:27 erle name tags are not textures though, or are they? 21:28 Sokomine i have no idea! they are text. no idea how they're handled engine-wise 21:30 erle Sokomine btw, i also want to improve xmaps to allow custom maps. any idea for that? 21:30 erle i mean i prob just need a callback for an algorithm that writes a bitmap 21:40 Sokomine don't know offhand what xmaps is 21:41 Sokomine sorry :-( can't help you there. it's a diffrent area of work. but i'm thankful that you do it! 21:41 erle Sokomine, xmaps is the ”generate ingame maps” mod that is not mcl_maps 21:41 erle Sokomine https://content.minetest.net/packages/erlehmann/xmaps/ 21:41 Sokomine ah. can't say that i have any expertise at all there 21:42 erle you can pick up the map and it shows your position on it 21:42 erle and you can put it on the wall 21:42 erle and it lets you make treasure maps 21:42 Sokomine ah! that sounds very nice 21:42 erle see here https://content.minetest.net/uploads/bbb9c6276e.png 21:42 erle right now it has only one renderer for maps 21:42 erle which makes this treasure-map-style thing 21:43 Sokomine might even be something the your land server might like. or almost any survival server for that matter 21:43 erle yeah but they probably want a different renderer 21:44 erle i mean the cheapest is just to take the node color 21:44 erle i think the engine exposed that, right? 21:44 erle the second-cheapest is taking the node color and elevation into account, like mcl_maps does 21:44 erle mine is actually pretty convoluted, as you can see from the tree and grass placement on the map 21:46 erle i also render houses on the maps if there are doors ;>