Anton's Research Ramblings


I've been working on my skill-base by making lots of little mini-libraries. The latest additions are the memory allocation wrapper, and data structures library, GLSL parser. I mentioned the interpolation work in the previous post. The other libraries are older and have been updated.

apg_malloc experimental malloc() and free() wrapper for accounting and leak checking
apg_data_structures light-weight c99 data structures library
apg_glsl experimental GLSL pre-processor supporting #include
apg_interp interpolation functions aka "tweening" or "easing"
apg_mesh converter and viewer for custom animated 3d mesh format
apg_maths minimalist vector/matrix/quaternion maths header for 3d graphics

The memory allocation wrapper was an experiment to see if I could wrap extant calls to built-in functions in a convenient way (answer=yes). I basically just created a linked list accounting for all memory allocations versus all freeing operations. A better solution would be to put these little accounting structures on the end of the actual blocks to reduce fragmentation, but I found this was vulnerable to segfaults - probably due to memory overflows somewhere in the code base I was testing, which is a separate issue. It did it's job well at reporting leaks, but I do an order O(n) search in each freeing operation, which would go away with the end-of-block idea which can be address-indexed.

The data structures library for C99 was an attempt to help get rid of old STL vector reliance, which I would use when being lazy. These were introducing segfault bugs due to unsafe random item erasure, so it's better to have an on-hand linked list or dynamic array ready to go. Having a single point of failure and improvement seems like a good idea.

I have had lingering issues with AJAX loading of shaders from files for WebGL, so my GLSL parser was an experiment to get around asynchronous issues by reading shaders from HTML5 script blocks instead of files, with some additional pre-processor features like support for #include from other scripts to make code re-use less of a pain (repeating changes to lighting algorithms for each shader in a project is a pain). I added additional error checking, and also supporting single-file splits for vertex and fragment shaders using #vert and #frag to indicate sub-sections.

I made some clarifications to my mesh format. I feel that this should really be turned into a tech report or workshop paper, as it's a common question, especially for beginners, and is really quite simple and not well addressed anywhere.


I made another mock-up of a page of text with analytics for my visualisation project. WebGL was far superior to SVG, D3, and canvas2d in terms of performance, so I wanted to try a 2d vector graphics display with some nice bars, and some pointless but eye-catchy interpolated animations, using my library.

We're busy breaking down the linked data processes, with provenance, into a formalisation that might be easier to make into a nice visualisation tool.