Sam Moore [Thu, 23 Oct 2014 11:28:36 +0000 (19:28 +0800)]
About to break everything with a merge
David Gow [Fri, 10 Oct 2014 04:16:13 +0000 (12:16 +0800)]
Merge branch 'master' of git.ucc.asn.au:ipdf/code
David Gow [Fri, 10 Oct 2014 04:15:21 +0000 (12:15 +0800)]
Fix GL version detection.
Sam Moore [Thu, 9 Oct 2014 16:39:48 +0000 (00:39 +0800)]
FPS measurement in debugscript, more python analysis
David Gow [Thu, 9 Oct 2014 11:57:47 +0000 (19:57 +0800)]
Fix debugscript, some quadtree stuff and don't intersect vertical/horz lines when useless.
Sam Moore [Thu, 9 Oct 2014 10:30:50 +0000 (18:30 +0800)]
Really hacky python performance scripts!
DebugScript can be controlled by stdin
Python subprocess lets us control IPDF without having to make DebugScript turing complete.
Sam Moore [Wed, 8 Oct 2014 14:50:58 +0000 (22:50 +0800)]
Mostly features added to DebugScript
Also got MPFR C++ reals to work
Should allow for a quantitative comparison between Rationals and Arbitrary Precision Floats
Just... overwhelming amounts of results that it would be nice to get, so I don't know where to start...
David Gow [Mon, 6 Oct 2014 08:25:17 +0000 (16:25 +0800)]
Merge branch 'master' of git.ucc.asn.au:ipdf/code
David Gow [Mon, 6 Oct 2014 08:23:41 +0000 (16:23 +0800)]
Quadtree addition to root node now functions (w/out Qt)
Apologies, etc.
Sam Moore [Sun, 5 Oct 2014 08:21:06 +0000 (16:21 +0800)]
Invalid array indices are not cool
Sam Moore [Sun, 5 Oct 2014 08:12:05 +0000 (16:12 +0800)]
Add objects without quadtree
Even when disabled the quadtree manages to break things
Sam Moore [Sun, 5 Oct 2014 06:32:12 +0000 (14:32 +0800)]
Don't sigfpe as much
David Gow [Sun, 5 Oct 2014 04:33:48 +0000 (12:33 +0800)]
Painfully merge branch 'master' of git.ucc.asn.au:ipdf/code
Conflicts:
src/document.cpp
David Gow [Sun, 5 Oct 2014 04:29:14 +0000 (12:29 +0800)]
Adding things to quadtree is implemented but segfaulty.
(i.e. it segfaults all of the time, and even if it didn't, it'd
crash if you zoomed in, and also you can still only add things to node 0
and really this breaks a lot more than it fixes)
For the prosecution, segfaults except:
- When run in valgrind
- When run in gdb on nvidia hardware
Infinite loops when:
- You zoom in, zoom out, add an object, and zoom in again.
Sam Moore [Sat, 4 Oct 2014 16:31:08 +0000 (00:31 +0800)]
Add MinGW Win32 Cross Compiling
Not tested with Qt4 yet, but works with QUADTREE_DISABLED
Build procedure:
1. Put source for GMP and SDL2 in ipdf/code/contrib/
Do 2. and 3. for both
2. Run `./configure --host=i686-w64-mingw32 --prefix="ipdf/code/contrib/win32"`
3. `make; make install`
4. In ipdf/code/src, run `make ARCH=win32 CONTROLPANEL=disabled`
5. Download SDL2.dll for the binary
Will try and get Qt4 support in the morning I guess.
I am doing this because I want it to be easy for marker(s) to run the software.
So I will make a precompiled ipdf.exe for windows in addition to the linux binary.
Tested under wine, seems to work.
ALSO
Why the hell is there a goto in document.cpp
David Gow [Sat, 4 Oct 2014 13:09:49 +0000 (21:09 +0800)]
Merge branch 'master' of git.ucc.asn.au:ipdf/code
David Gow [Sat, 4 Oct 2014 13:08:59 +0000 (21:08 +0800)]
Improve adding things to quadtree (still broken, though)
Sam Moore [Sat, 4 Oct 2014 13:04:57 +0000 (21:04 +0800)]
More turtles
Also we can't take logarithms of negative numbers, dur
David Gow [Sat, 4 Oct 2014 10:47:43 +0000 (18:47 +0800)]
Compile with float/double again.
David Gow [Sat, 4 Oct 2014 10:44:57 +0000 (18:44 +0800)]
Merge branch 'master' of git.ucc.asn.au:ipdf/code
David Gow [Sat, 4 Oct 2014 10:42:33 +0000 (18:42 +0800)]
Panning for gold, with the Quadtree!
Sulix celebrates the panning in the quadtree finally working*
with the worst pun yet!
* The segfault doesn't count.
Sam Moore [Sat, 4 Oct 2014 07:18:27 +0000 (15:18 +0800)]
Turtles all the way down
Also fix up DebugScript's performance data
I can actually plot things!
Still haven't actually plotted things, but in theory I can.
Sam Moore [Fri, 3 Oct 2014 08:38:01 +0000 (16:38 +0800)]
Gmprat logarithms now O(1) not O(N)
... Where the "1" is determined log(3), don't get too excited
So we can finally actually print values outside DBL_MIN->DBL_MAX
Now to go through and remove all the cast to doubles...
Sam Moore [Fri, 3 Oct 2014 06:25:06 +0000 (14:25 +0800)]
Keeping it Real, add Gmprat::Str, Gmprat::Log10
Fixed* all those horrible compile errors.
View can now use VReal and Path can now use PReal
and at the moment they are Gmprat unless the quadtree is enabled.
For Gmprat::Log10 there are problems.
Using: log(a/b) = log(a) - log(b)
log(a*b) = log(a) + log(b)
Unfortunately mpz_div_ui quickly becomes a massive performance issue.
Even when well within the range of IEEE singles.
Need to rewrite Gmprat::Log10 but may as well commit since it works* slowly at least.
Sam Moore [Thu, 2 Oct 2014 10:40:19 +0000 (18:40 +0800)]
Totally FITH everything
I'm trying to get it so that Path and View can use a different number
representation to Bezier.
It's not going well.
David Gow [Mon, 29 Sep 2014 04:28:22 +0000 (12:28 +0800)]
Merge branch 'master' of git.ucc.asn.au:ipdf/code
Conflicts:
src/bezier.cpp
src/view.h
David Gow [Mon, 29 Sep 2014 04:20:55 +0000 (12:20 +0800)]
Critics are panning the quadtree's panning.
(It's broken)
Sam Moore [Sat, 27 Sep 2014 16:08:19 +0000 (00:08 +0800)]
Use Gmprat for Path bounds with TRANSFORM_BEZIERS_TO_PATH
So, the bounds of Paths are stored with Gmprat
The Bezier's are all stored relative to the Path, as floats
The transformations are only applied to the Path Gmprat bounds.
This seems to work rather well.
In other news, the DeCasteljau algorithm in the CPU
renderer had no upper limit, which is why it was slowing down so much.
The CPU renderer tends to suffer from SIGFPE-itis when using floats,
because when you do a cast there is a SIGFPE if the resultant type can't represent the operand.
This occurs in a few places that don't actually affect the rendering...
Sam Moore [Sat, 27 Sep 2014 14:10:06 +0000 (22:10 +0800)]
Define for Transformations on Path only, also fixed segfault due to GraphicsBuffer
The "invalidated" is used to recycle memory in the GraphicsBuffer,
but that can only be done if there is actually enough memory.
This was causing a segfault if the document was initially empty and had things added to it.
Can now remove the hack in main.cpp where documents started with a {0,0,0,0} RECT in them.
We can now (ab)use the Path for transformations.
The idea was that Arbitrary precision stuff might be faster if we only care about the bounds of the paths.
Unfortunately the way Real was used everywhere will make it a bit difficult to actually use this.
We need Beziers and their bounds to be stored with floats, but the Path bounds to be stored with GMPrat or some other arbitrary type.
It probably won't help that much, but evaluating those Beziers with GMPrat really slows down the CPU renderer.
It's also a giant hack because I still use BezierRenderer for GPU rendering but I now use PathRenderer for CPU rendering of Beziers.
Le sigh.
We can now store Bezier bounds relative to Path bounds and apply transformations only to the Path bounds.
Sam Moore [Thu, 25 Sep 2014 07:43:21 +0000 (15:43 +0800)]
More debugscript things, sanity fading fast
Sam Moore [Thu, 25 Sep 2014 12:31:29 +0000 (20:31 +0800)]
Script should still work after loadsvg is used
This is why I always use "<= 0" not "== 0"...
Although if loops were unsigned that still wouldn't help.
Sam Moore [Thu, 25 Sep 2014 12:16:13 +0000 (20:16 +0800)]
Add loadsvg script command, fix ParanoidNumber size limiting*
Need to write some scripts and performance test them now I guess?
Maybe add commands for scripts to output information for plotting.
David Gow [Thu, 25 Sep 2014 02:54:57 +0000 (10:54 +0800)]
Lazy + CPU/GPU rendering toggle in script.
David Gow [Wed, 24 Sep 2014 13:59:02 +0000 (21:59 +0800)]
Initial support for scripting actions.
David Gow [Wed, 24 Sep 2014 13:05:49 +0000 (21:05 +0800)]
Merge branch 'master' of git.ucc.asn.au:ipdf/code
David Gow [Wed, 24 Sep 2014 13:05:04 +0000 (21:05 +0800)]
Some quadtree stuff: bugfix + mutation
Sam Moore [Wed, 24 Sep 2014 11:48:20 +0000 (19:48 +0800)]
Doomed to failure
BLasdfuywetraefrdg
Sam Moore [Wed, 24 Sep 2014 08:54:33 +0000 (16:54 +0800)]
Allow for negative Paranoid Numbers
Specifically, when constructed off a string I wasn't checking for a leading '-' sign.
That's kind of important.
Also 'e' notations will probably have to be included at some point.
I am really bad at this...
Sam Moore [Wed, 24 Sep 2014 06:27:26 +0000 (14:27 +0800)]
Add #define to transform Object bounds on the fly
View model: Object bounds are fixed, transforming view transforms the View bounds,
Object bounds transformed to coordinates in View bounds before rendering.
Mutable Objects model (?) : Object bounds are transformed by operations, no transformation to View bounds necessary
The equivelant view bounds are still printed for comparison, but it is effectively (0,0,1,1)
First approach requires one transformation when altering view and then a *lot* during rendering
Second approach requires a lot of transformations when altering view and then <not as many> during rendering
Second approach also means we don't need a dedicated CPU renderer. Coordinates within bounds can be expressed as floats.
ALSO
- Added cat and panda test images
- Fixed segfault due to empty paths in cat.svg ... by not including empty paths...
- ipdf will now run if the window can't be created so I can run it on the bus without X
- Not much you can actually do without X though...
- ParanoidNumbers got considerably more #defines for debugging and trying to make them less generally shit
- Fixed some bugs in PN not revealed by realops tester
- There are still bugs in PN that aren't revealed by anything
- Despite it basically being exactly equivelant to doubles at the moment :S
- Having bugs in basic mathematics operations is actually really really really hard to fix
- Want to fix all the bugs so I can make PN faster
- They are slow, they spend about 30% of their time doing std::vector stuff
- And that's when the std::vector is *empty*
ALSO
- The new approach to rendering means that the loss of precision is nowhere near as bad
- This means we need to make new tests to demonstrate that there is in fact still a point to using arbitrary precision
- Because floats are actually quite amazingly good if you aren't a moron about how you apply operations.
- Really panicking now
ALSO
- I'm sure I did something else but I forgot what it was.
Sam Moore [Sun, 21 Sep 2014 10:34:08 +0000 (18:34 +0800)]
Commit before breaking everything
Trying to make ParanoidNumber less shit.
Spends a lot of time in std::vector
Sam Moore [Thu, 18 Sep 2014 17:11:37 +0000 (01:11 +0800)]
All of the things and none of the sleep
GMPrat is a type that works (un)surprisingly well, until you start changing the view.
ParanoidNumbers explode more dramatically but actually simplify for certain things.
Simplify seems to end up adding operations that don't cancel twice, eg:
debug: TestRandomisedOps (tests/paranoidtester.cpp:152) - Test 1000*1 randomised ops (max digits = 4)
ERROR: TestRandomisedOps (tests/paranoidtester.cpp:208) - {7+(7/10)} *= {119}
ERROR: TestRandomisedOps (tests/paranoidtester.cpp:209) - {7*119+(99127/10)}
ERROR: TestRandomisedOps (tests/paranoidtester.cpp:210) - double Yields: 916.
2999773025512695312500000000000000000000
ERROR: TestRandomisedOps (tests/paranoidtester.cpp:211) - PN Yields: 10745.
7001953125000000000000000000000000000000
FATAL: int)() (tests/paranoidtester.cpp:212) - Failed on case 102
Note 7*119 * 119 = 99127, so the *119 is being applied extra times
Probably because of reasons that hopefully the cold light of morning will reveal.
Sam Moore [Wed, 17 Sep 2014 16:10:57 +0000 (00:10 +0800)]
Make it run on motsugo
Motsugo has a fake X11 server, which allegedly supports OpenGL extensions.
But it doesn't quite work and things tend to segfault.
It works for CPU rendering though.
Sam Moore [Wed, 17 Sep 2014 16:09:00 +0000 (00:09 +0800)]
Animation of precision_vs_zoom
Sam Moore [Wed, 17 Sep 2014 11:47:33 +0000 (19:47 +0800)]
Some sort of vague ipython analysis
Should probably be split into .py files and just use ipython to do the plots.
Should probably see if we can get Jenkins to run things... oh what am I saying.
Sam Moore [Mon, 15 Sep 2014 17:26:00 +0000 (01:26 +0800)]
Change to things to make performance testing easier
- Saving of CPU and GPU BMPs
- OverlayBMP doesn't overlay a BMP which is good because we don't want it to...
- SVG loads in centre of view
- This will break the Quad tree, probably
- tests/bmpdiff allows us to quantitatively compare output bmp images.
- I didn't say it was a good metric, there's just a metric now.
- Arguments to set rendering and transform type, argument to set maximum number of frames to render,
argument to turn off the lazy rendering.
Will make some kind of ipython notebook next I guess.
Sam Moore [Tue, 16 Sep 2014 10:46:43 +0000 (18:46 +0800)]
Merge branch 'master' of git.ucc.asn.au:/ipdf/code
sulix fixed the quad trees and I forgot about `git stash` again.
Sam Moore [Tue, 16 Sep 2014 10:43:39 +0000 (18:43 +0800)]
Slightly better results
Assuming we can trust Wolfram's Giant Ego, err, I mean Wolfram Alpha, to give exact results,
it is generally giving a better result than doubles.
Try simplifying the "a/b + c/d" cases next?
Also at the moment "(a + b)*c" does not simplify to "a*c + b*c" even if
a*c is exact.
Have to be careful because sometimes making the representation more exact
ends up making the conversion back to double have a bigger error.
Sam Moore [Tue, 16 Sep 2014 09:26:46 +0000 (17:26 +0800)]
ParanoidNumbers work except for the simplifying bit...
I really really hope they work anyway.
Tester doesn't fail too disastrously, but PN gives a worse result than doubles.
David Gow [Mon, 15 Sep 2014 05:38:27 +0000 (13:38 +0800)]
Add quadtree back to the Makefile
Sam Moore [Sat, 13 Sep 2014 18:36:12 +0000 (02:36 +0800)]
Nope.avi
Sam Moore [Thu, 11 Sep 2014 17:33:37 +0000 (01:33 +0800)]
Break maths some more
CombineTerms is somewhat horribly broken
But it works well enough to beat doubles at "0.3 + 0.3 + 0.3"
...
And nothing else I've tried. In fact it's worse or equal to doubles at everything else so far.
But I haven't done many operations because CombineTerms breaks everything. Maybe it will get better if that isn't broken horribly.
Sam Moore [Thu, 11 Sep 2014 16:37:35 +0000 (00:37 +0800)]
Paranoia is setting in
Paranoid Numbers are hard to simplify properly. But they work. Kind of...
David Gow [Thu, 11 Sep 2014 12:44:19 +0000 (20:44 +0800)]
Heinous Quadtree crimes.
"The bézier tiptoed out of bed. What an adventure it would be to go beyond the
quadtree node in which it had lived its entire life. Its mother had told it
sternly that it was dangerous to wander the dark wastes beyond the root node.
Bobby Bézier had never believed the stories, though: there were no such things
as wild NaNs that ate all of the coefficients of naughty boys. Bobby looked up
at the sky: the infinite void of night penetrated only by the debug text high
above. Tentatively, he inched one of his endpoints over the quadtree node
boundary. But alas: his mother had perhaps been right all along. She would scald
him so... how would he hide the fact that his endpoint had been clipped right
off!"
David Gow [Thu, 11 Sep 2014 12:08:49 +0000 (20:08 +0800)]
Merge branch 'master' of git.ucc.asn.au:ipdf/code
David Gow [Thu, 11 Sep 2014 12:08:27 +0000 (20:08 +0800)]
Because merging is going to be fun.
David Gow [Thu, 11 Sep 2014 12:04:59 +0000 (20:04 +0800)]
Some really horrible utility Quadtree functions.
Who writes a recursive function with four switch statements in it?
(Apparently, I do...)
David Gow [Wed, 10 Sep 2014 07:30:55 +0000 (15:30 +0800)]
The QuadTree is ~72% more amazing.
Sam Moore [Wed, 10 Sep 2014 04:45:00 +0000 (12:45 +0800)]
Add MPFRC++ mpreal type
It's slow but less slow than Rationals.
Project complete.
Haha I wish.
Sam Moore [Thu, 4 Sep 2014 18:14:52 +0000 (02:14 +0800)]
Fix compiling with non doubles
Added really terrible number representation as a series of operations on floats.
It currently gets a few things wrong...
David Gow [Thu, 4 Sep 2014 08:38:28 +0000 (16:38 +0800)]
// there is no elegance here. only sleep deprivation and regret.
Basically, clipping Béziers now actually works, because De Casteljau is
no longer totally back to front. (In fact, I think I just made it more back to front,
which cancelled the original out?)
Also disabled zoom out in the quadtree and some dodgy disabled debug in the bezier shader.
Sam Moore [Tue, 2 Sep 2014 10:43:40 +0000 (18:43 +0800)]
Compositing on CPU sort of kind of works if we ignore Alpha*
*Alpha is hard and I'm just going to ignore it.
Hacky fix to "overflood" problem where the fill point is outside the boundary;
since it can't be more than 1 pixel outside, check the neighbours before starting
the fill.
Unfortunately this means if the fill point is only one pixel *inside* the boundary,
there is no fill.
Tried brute force approach for low resolution paths, but that doesn't really work.
Path::PointInside doesn't seem to succeed where it should...
Other things might have happened.
Not much happened towards actually getting infinite precision,
starting to run out of time, panic mode engaged...
PANIC MODE ENGAGED
PANIC LEVELS AT 100%
EMERGENCY ANTIPROCRASTINATION MEASURES FAILED
PANIC LEVELS AT 200%
ENGAGE SHUT UP AND FIX EVERYTHING MODE
FAILED TO SHUT UP
PANIC LEVELS AT 300%
ENGAGE DINNER TIME
DINNER TIME SUCCESSFUL
PANIC LEVELS STILL AT 300%
apathy levels at 1000%
Sam Moore [Mon, 1 Sep 2014 12:55:55 +0000 (20:55 +0800)]
Classify Beziers, use DeCasteljau for CPU renderer
I don't know how glDrawLines does it, but I can't get rid of the wiggles in straight lines done using CPU renderer.
So I switched to DeCasteljau.
Then I made it classify the lines and only use one Bresenham instead of 100 anyway.
Sam Moore [Thu, 28 Aug 2014 23:05:41 +0000 (07:05 +0800)]
Careful, you may have to shade your eyes
Except for all the things that don't quite work, shading works perfectly.
David Gow [Thu, 28 Aug 2014 11:57:09 +0000 (19:57 +0800)]
Mostly working, optimize curves completely within nodes.
David Gow [Thu, 28 Aug 2014 05:53:50 +0000 (13:53 +0800)]
Slighlymoreworkingish
David Gow [Thu, 28 Aug 2014 03:47:43 +0000 (11:47 +0800)]
Crash instead of generating NaN. This breaks everything.
David Gow [Wed, 27 Aug 2014 15:13:47 +0000 (23:13 +0800)]
Infinite Quadtree precision now works with some Béziers
You can zoom in a long way on some, others exhibit precision problems after
quite a long way. Probably the curve cannot be further simplified or something?
David Gow [Wed, 27 Aug 2014 08:24:25 +0000 (16:24 +0800)]
Add a vec2 struct.
Sam Moore [Tue, 26 Aug 2014 10:42:33 +0000 (18:42 +0800)]
A Song of Floodfills and Segfaults
Ok, just need to make the FloodFillOnCPU not stack overflow...
David Gow [Mon, 25 Aug 2014 08:54:46 +0000 (16:54 +0800)]
Merge branch 'master' of git.ucc.asn.au:ipdf/code
Conflicts:
src/document.cpp
Sam Moore [Mon, 25 Aug 2014 14:44:33 +0000 (22:44 +0800)]
Shading still doesn't work
Actually it's supposed to be "filling" shading implies the colour changes.
Whatever.
David Gow [Mon, 25 Aug 2014 08:30:00 +0000 (16:30 +0800)]
Some half-done quadtree experiments.
Sam Moore [Sun, 24 Aug 2014 10:30:32 +0000 (18:30 +0800)]
Support colours in shading
Shading doesn't actually work still but that's of minor concern
David Gow [Thu, 21 Aug 2014 10:58:24 +0000 (18:58 +0800)]
Béziers magically work with the QuadTree (sometimes)
Also maybe broke qt. It fixed it for my laptop.`
David Gow [Thu, 21 Aug 2014 05:15:22 +0000 (13:15 +0800)]
More broken quadtree monstrosity.
David Gow [Wed, 20 Aug 2014 17:13:22 +0000 (01:13 +0800)]
Totally break Quadtree Béziers.
David Gow [Wed, 20 Aug 2014 15:06:40 +0000 (23:06 +0800)]
Added a Bezier::ReParametrise() function.
This returns a bezier equivalent to the segment from t0 -> t1 of the
original bezier.
Derivation at: http://davidgow.net/stuff/cubic_bezier_reparam.pdf
for now. If it's not too embarrasing, it might end up in the documents repo.
David Gow [Tue, 19 Aug 2014 12:11:57 +0000 (20:11 +0800)]
Fix adding text.
(And remove some Debug printing)
Sam Moore [Mon, 18 Aug 2014 13:47:51 +0000 (21:47 +0800)]
Merge branch 'master' of git.ucc.asn.au:/ipdf/code
Noooo
Sam Moore [Mon, 18 Aug 2014 14:47:00 +0000 (22:47 +0800)]
Go nuts with Qt
We can do all the things I promised!*
And we can do it without having to implement a vim style stdio based interface!
Or adding 16 extra mouse buttons!
Qt can parse XML or even SVG all by itself though...
I'm going to ignore that and just keep treating it as a menu system.
* Commit --amend
Well, the set of things we can do is neither a subset nor a superset of the things I promised.
David Gow [Mon, 18 Aug 2014 13:18:31 +0000 (21:18 +0800)]
Fix kerning for the first pair of characters
David Gow [Mon, 18 Aug 2014 13:08:18 +0000 (21:08 +0800)]
Terrible hacky SolveCubic.
(I'm sorry, but I'm going to need more sleep before I tackle
complex numbers here)
David Gow [Mon, 18 Aug 2014 08:59:28 +0000 (16:59 +0800)]
Slightly better kerning maybe?
Sam Moore [Mon, 18 Aug 2014 05:18:39 +0000 (13:18 +0800)]
Make Qt4 work
Needed to generate a special "moc" cpp file from the header file
Sam Moore [Sun, 17 Aug 2014 09:28:51 +0000 (17:28 +0800)]
Inflict Qt4 upon the codebase
I'm getting issues compiling it though
Qt seems to expect some magical auto-generated Makefile
Remove the not-very-functional control panel with a "CONTROLPANEL_DISABLED" define.
Sam Moore [Sun, 17 Aug 2014 05:59:26 +0000 (13:59 +0800)]
Make project relevant to Mechatronics
Also fix missing actually setting the origin with the "moveto" path command.
David Gow [Fri, 15 Aug 2014 04:38:08 +0000 (12:38 +0800)]
Don't write past the end of a GPU mem buffer.
(It causes crashiness)
David Gow [Thu, 14 Aug 2014 13:44:14 +0000 (21:44 +0800)]
Re-fix QuadTree GPU rendering, discard groups
Sam Moore [Thu, 14 Aug 2014 20:20:37 +0000 (04:20 +0800)]
Attempt Shading + Bezier Bounds (hopefully) correct
Turns out I can't do high school calculus despite 4 years of Physics study.
The shading algorithm I envisioned has several rather hilarious
things wrong with it...
Although that 'j' does look damn good if you set the zoom *just* right...
Sam Moore [Thu, 14 Aug 2014 16:48:03 +0000 (00:48 +0800)]
Make bezier control point coordinates relative
So the quad tree should just have to care about bounding rectangles.
Also so the GPU renderer now doesn't need transforming but CPU renderer does now.
AddBezier assumes absolute coordinates and transforms to relative coordinates
AddBezierData is assuming relative coordinates.
Totally clear.
PS: Basically whatever is convenient/efficient for the GPU is inconvenient/inefficient for the CPU
and vice versa. Fun!
Sam Moore [Thu, 14 Aug 2014 04:54:57 +0000 (12:54 +0800)]
Fix ymax in GROUP bounding box
svg-tests/circlepath.svg has the right box now
BTW: Segfaults in previous commit occur only for quadtree enabled
Sam Moore [Thu, 14 Aug 2014 04:48:04 +0000 (12:48 +0800)]
SVG tests are 100% less symlinky
That's the good news.
The bad news is that somewhere along the way a bunch of them became 100% more segfaulty.
Sam Moore [Thu, 14 Aug 2014 04:34:55 +0000 (12:34 +0800)]
Groups are a thing and sort of have a bounding box now
That was what I forgot in the last commit; I added "GROUP".
So, the idea is that GROUP can be used to shade a path.
Maybe. Eventually.
Or, it could just be used to make quad tree magic easier (?)
Or it could do both! (Since you can pretty easily just turn off the shading...
but we're getting ahead of ourselves a bit there)
Or, if it gets given a name, then it can be used to implement the <use> SVG tag.
And then we can allow recursion (which regular SVG doesn't support).
Wouldn't it be nice...
Sam Moore [Thu, 14 Aug 2014 04:21:31 +0000 (12:21 +0800)]
Bezier bounds rectangles are calculated correctly
CPU rendering and SVG parsing uses absolute coordinates.
GPU rendering uses relative coordinates (relative to the bounding box).
The Objects struct stores the absolute bounding boxes now.
Previously it was just using {0,0,1,1} (and thus the GPU's relative coordinates were
equivelant to the CPU's absolute coordinates).
I might have fixed some other things but I can't remember.
David Gow [Wed, 13 Aug 2014 13:38:56 +0000 (21:38 +0800)]
Support some more SVG stuff.
Can now get a dodgy, slightly hacked bit of gnuplot output to
render.
David Gow [Wed, 13 Aug 2014 13:09:59 +0000 (21:09 +0800)]
Clipping for RECT types. Breaks a little.
When using QuadTrees, RECT_OUTLINE and RECT_FILLED are clipped to
the quadtree node.
This lets you zoom in forever on rectangles with a couple of caveats:
1. This is technically wrong for RECT_OUTLINE, as more lines will be added.
2. There are a couple of issues related to the fact that only one node is
visible at a time. Notably:
(a) You lose the infinite precision when stradling a quadtree boundary,
which will happen eventually.
(b) Zooming out will show random broken things.
However, if you look at shape.svg, you can see how moving the camera around when
both the RECT and the BEZIER are in view, the RECT moves smoothly and the BEZIER
doesn't.
David Gow [Wed, 13 Aug 2014 12:52:57 +0000 (20:52 +0800)]
Use correct font metrics from truetype files.
Kerning, etc. should now be correct, but we use a monospace font
so it doesn't matter.
David Gow [Wed, 13 Aug 2014 11:49:33 +0000 (19:49 +0800)]
Automatically generate quadtree children.
This mostly works, and does the view reparenting. It doesn't do any clipping,
so we still hit precision issues as (for example) bézier control points are
outside the quadtree node's coordinate system, and become very, very large.
There are some issues with the boundaries of quadtree nodes, as the system
currently can't display two nodes at once. To compensate, it traverses up the
tree until it finds a single node which contains both, though this will be
a distant anscestor if the nodes are distantly related.
Quadtrees are still disabled by default. There are also a couple of minor
changes to the GL code to make it spit out fewer error messages and run
slightly faster on some hardware.
David Gow [Wed, 13 Aug 2014 08:05:38 +0000 (16:05 +0800)]
I am an idiot: the quadtree code is now fixed.
tl;dr: needed more * by 2.
iab;wtd*: The index buffers on the GPU contain _two_ elements per object,
one for the top left of the object's bounding box, one for the bottom-right.
We were taking that into account when computing the number of indices to give
the DrawElements() call, but not when calculating the offset into the buffer.
Oops.
*: I am bored; want tedious detail
David Gow [Wed, 13 Aug 2014 04:45:26 +0000 (12:45 +0800)]
A bunch of OpenGL debug annotations.
(Which will probably break compiling on cabellera)
UCC git Repository :: git.ucc.asn.au