X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fdocuments.git;a=blobdiff_plain;f=irc%2F%23ipdf.log;h=4c414215acf0746810a44c18e2ddd024d97508e0;hp=c9ad2dc9f97f3f92af1d33774e9a6d16cb95a544;hb=b4b47317861fac274b98877486bbba4de2419246;hpb=d2c2e63b709c81b797faa4e8c1ed70269339fe1b diff --git a/irc/#ipdf.log b/irc/#ipdf.log index c9ad2dc..4c41421 100644 --- a/irc/#ipdf.log +++ b/irc/#ipdf.log @@ -1974,3 +1974,89 @@ 22:11 <@matches> But they won't be fixed size 22:12 <@matches> Anyway I will see if you have magically solved the problem for me in the morning :P 22:14 <@sulix> I wouldn't count on it... +--- Day changed Wed Jun 18 2014 +16:50 <@matches> Behold, the glory of Beziers and Bresenham! +16:50 <@matches> Breseniers I shall call them +16:54 <@matches> I'm getting a very strong vibe of "Reinventing graphics technologies from the 1990s" at the moment +16:55 <@matches> I should probably look at floating point some more +16:55 <@matches> And reinvent numerical computation technologies from the 1980s +16:56 <@matches> We need a GPU renderer for the Beziers, and we need to fix save/load to not assume everything is a fixed size, and ... +16:56 <@matches> Argh +16:56 <@matches> All the things +17:00 <@matches> Maybe I'll multithread the CPU rendering too, just to make things more difficult :P +22:48 <@sulix> So I got some béziers rendering on the GPU. +22:48 <@sulix> They're not the ones in the document, and they're not in the right spots, though. +23:12 <@sulix> First 3 béziers are rendering properly on the GPU, then we get corrupted memory or something. +23:14 <@sulix> Ah: I see, I need some way of uploading which bézier IDs are being used. +23:41 <@sulix> Okay, Béziers now render on the GPU as well. +23:43 <@sulix> The code is a little bit ugly, and for that I am sorry, but blame the fact that the GL feature that makes this nice is only about a year old and so nothing supports it. +23:43 <@sulix> So we're basically uploading all of the raw document data into a huge texture. +23:47 <@sulix> (If you ask me, the GPU ones also look slightly nicer, though that's probably a bug) +--- Day changed Thu Jun 19 2014 +13:55 <@matches> From those papers I was under the impression just rendering a bezier on a GPU was an impressive feat, so well done :P +13:57 <@sulix> (It's basically just a direct port of your CPU implementation, tbh) +13:59 <@matches> When I zoom out the GPU ones look nicer, there's probably something wrong with my Bresenham implementation +13:59 <@matches> Although it was mostly shamelessly copied from "Computer Graphics" +13:59 <@matches> Except they were like "Here it is for 0 < m < 1, the rest can be done by symmetry" +14:02 <@matches> The lines definitely have gaps on the CPU, and they also seem too thick as you zoom out +14:02 <@matches> Having said that, I don't think the GPU starts at x0,y0 +14:03 <@matches> Anyway I'm going to implement a Rational number type and see if anything exciting happens (that's how you do research right?) +14:06 <@matches> Fortunately I sort of did most of this for one of the codejam problems (where it turned out I didn't really need Rational numbers but I thought I did) +14:20 <@sulix> Fixed the missing bit off the end. +16:43 <@matches> I suspect Rationals are either not a very good idea, or there is a bug in one of my fundamental operations +16:43 <@matches> +, -, *, / are hard +16:56 <@sulix> Is it at least a pretty bug? +16:59 <@matches> Um... +16:59 <@matches> No +17:00 <@matches> It seems buggy for anything other than the {0,0,1,1} starting view +17:14 <@matches> I suspect it's the expf in the mouse wheel scrolling +17:14 <@matches> Since you know, exp is definitely not a rational number... +17:15 <@matches> Hmm, but it shouldn't matter because it will just convert to the nearest rational number +17:16 <@matches> ie: p = (int64_t)(whatever*1e10) q = (int64_t)1e10 +17:28 <@matches> Oh +17:28 <@matches> Oh +17:28 <@matches> Head -> Desk +17:28 <@matches> Rational & operator*=(const Rational & r) {this->operator=(*this*r); return *this;} +17:28 <@matches> Rational & operator/=(const Rational & r) {this->operator=(*this*r); return *this;} +17:29 <@matches> Rational & operator-=(const Rational & r) {this->operator=(*this+r); return *this;} +17:29 <@matches> I think the worst part is that I actually said "It is probably a bug in my +,-,*,/ +17:29 <@matches> And it still took me this long to notice +17:30 <@matches> The second worst thing is I've made that sort of mistake like 1000 times before +17:30 <@matches> The third worst thing is I am recalling that article where the guy says "At least plus and times are sort of the same thing" +17:30 <@sulix> Feel the power of copy and paste flowing through you. +17:32 <@matches> Well let's not celebrate just yet, the view still goes to shit. Just slightly slower :P +17:33 -!- matches changed the topic of #ipdf to: NaNpdf +17:33 <@matches> Our document supports a view of {-inf,-inf,nan,nan} thus making it truly infinite precision +17:34 <@sulix> I had that happen a lot when I was writing the original zoom code. +18:19 <@matches> So I suspect that Rationals are just a really shitty number representation :P +18:20 <@matches> Specifically, you get integer overflows really really fast +18:20 <@matches> And if you are going to have a Rational that's BigInt / BigInt you may as well just have a BigFloat +18:21 <@matches> The ancients were probably right. +18:21 <@matches> When they decided not to use rationals. +18:23 <@matches> I guess floats are rationals technically, I mean the representation using P/Q +18:23 <@matches> I kind of wish I'd done some pure maths here... +18:23 <@matches> Or paid more attention in second year +18:28 <@matches> At least I sort of have conclusive evidence that rationals suck. As opposed to "it should be obvious to anyone with half a brain" +19:00 <@sulix> Floats are not rationals. +19:00 <@sulix> Not exactly. +19:01 <@sulix> Something which can be stored in a finite amount of space as a rational cannot always be stored in a finite amount of space as a float, but not vice-versa. +19:01 <@sulix> e.g.: 1/3 +19:04 <@sulix> Basically floats = rationals where the denominator must be a power of two. +19:05 <@sulix> (Of course, these are all the same in the limit, but the limit of a cauchy sequence of rationals gives the reals, so the point is kinda moot, there, anyway) +19:18 <@matches> Yeah floats are a subset of the rationals I think I meant +--- Day changed Sat Jun 21 2014 +16:22 <@matches> So I got a new smartphone today... I'm having fun trying to zoom in on things +16:24 <@matches> Actually the zooming isn't annoying so much as the needing to pan around to view all the text in a pdf +16:25 <@matches> This is what I get for buying the cheapest phone with the lowest resolution they had :P +16:26 <@matches> I didn't want to get one more expensive than my old one because I'm still convinced I will get around to fixing it one of these days +16:26 <@matches> Or months. Or years. But eventually. +--- Day changed Mon Jun 23 2014 +11:51 <@matches> The meeting happened at ~11:30 +12:49 <@sulix> Oh damn. I thought there wasn't going to be one today. +12:49 <@sulix> What did I miss? +13:04 <@matches> Basically I told him what we'd done +13:05 <@matches> Which was rendering on CPU or GPU, and Beziers (but only degree 2) +13:06 <@matches> And I implemented Rationals but they are terrible, so he sent me some code from an ACM competition about approximating things with Rationals +13:13 <@sulix> Some javascript guy is trying to convince people that the only numeric data type should be some custom 64-bit decimal thing. +13:13 <@sulix> A lot of people have started quoting Kahan at him. +13:20 <@matches> Haha