Archive for the ‘status’ tag
No new work on LxEngine in the last couple weeks, unfortunately. Aggravating not being able to finish off that last chunk of work on normal mapping!
I’ve been busy consulting on a web project. I do have to say that taking up a totally different kind of programming (say, small website programming versus the lower-level desktop graphics) really does work well to break the tendency towards tunnel-vision in solving problems. For example, I still think JQuery is a fantastic example of an API that violates many of the “rules” about a good API that I previously held; yet, the API is great in many regards, so that’s a clear sign that those rules – like all rules – have exceptions. A change in perspective is almost always helpful.
Also, have been reading Essential Mathematics for Games and Interactive Applications: A Programmer’s Guide at Christophe Riccio’s recommendation. So far it’s been an excellent book reminding me of the pure math behind all those math classes I use. I have to say the Google e-book version could have used a little more editing though…definitely numerous typographical errors in there that could / should be fixed.
What I’ve been working on today…
Created a stub for lxcore.lib
Currently, LxEngine is composed of the following:
- glgeom (header-only library of math functions)
- lxengine.lib (where the vast majority of the code is)
- lxengineapp.exe (a small front-end that drives the code in lxengine.lib)
What I’d like it to be is:
- glgeom (same as before)
- lxcore.lib (low-level, standalone functions and data types from lxengine.lib)
- lxframework.lib (the higher-level framework of Engine, Document, View, Element, classes)
- lxengine.exe (slightly larger front-end that drives the framework in a flexible, configurable form)
That’s a bit of an over simplification since there’s also extension libraries like lxrasterizer.lib and plug-ins like soundAL.dll, which exist now and will continue to exist.
The general point however is that I want make the framework “leaner.” Right now it has too many specific features (mostly from early development when things weren’t very modular) and it should really be a rather bare but flexible MVC framework. Those features belong in plug-ins and extensions. Even the utility stand-alone functions belong elsewhere (lxcore.lib). The end goal is a smaller framework is much better: frameworks are useful – right up until the point they become bloated and hard to understand (and thus defect prone and with steep learning curves).
GLGeom Error Handling
Long story short: all this time, I’ve been using “assert(0)” as an error handling mechanism in GLGeom to keep from tying in any dependencies. That’s not a very valid approach…
So I’m added a simple, but flexible error handling mechanism instead: docs here.
GLGeom Compute Primitive Buffer Adjacency Info
Still a work-in-progress, I’m trying to port over some old code that is pretty fast at computing adjacency from a polygon soup. This is also stressing GLGeom from a new angle, which is helping me fill in the blanks on some of the functionality in this currently-version-0.0.5-library.
Better get back to working on it…
While most updates thus far has come at the completion of a sub-feature of sorts, this update is more of a general status report (largely due to my lack of time of late to complete a noteworthy sub-feature).
The lxengine code now compiles in Release builds. This required a short Perl script to generate the Visual Studio vcproj files since the code previously only built correctly in Debug. The long and short of it is that I wanted to minimize the amount of time spent in project setup and it seems that Visual Studio is more tailored for creating a new project than adapting it to an existing one. With this project, I intend to have many small sub-projects with identical build settings (link to the same libraries, produce output files in a similar directory structure, reference the same data files) as well as desire flexibility to easily relocate project source and destination files (without updating dozens of project files). It seemed easier to write a short script to auto-generate near skeleton vcproj files and work with the Visual Studio Properties (vsprops) files to manage all the common settings.
In any case, I now have a profile-able Release build of the lxengine code and hopefully will need to do minimal project setup to add new samples and tests. If it turns out I do, it seems that CMake is a growing favorite in the project build tools these days. That may be the best eventual destination.
With the Release build, I experimented with several optimizations that I should do a write up on: namely, discovering several ways not to do transform caches in a ray-tracer (the uncached version beat both my naive transformation caches), and that if you plan to squeeze every bit of performance out of the Microsoft VC 9.0 compiler, be prepared to use the __forceinline compiler-specific keyword (the C++ keyword inline may not be enough to sway cl.exe’s internal algorithm to actually inline the code).
This project, as all projects do, is reminding me of how features compound upon features. In this case, the ray tracer is (in my mind) already “too slow” (despite performance not being a primary objective of this project) and soon I’ll need to get interested in spatial indexing structures, fully optimized intersection algorithms, multi-threading, and other performance-oriented functionality. Or this might be the time to make the leap to progressive rendering using hybrid rasterization / ray tracing techniques…
I would like to add some experiments with procedural geometry to the project. Procedural geometry at the object level for entire meshes (e.g. a tree) as well as geometry and maps for materials (e.g. wood bark) would be interesting. I’ve given a look into Perlin noise as well as an algorithm for natural rock procedural geometry and textures, though I haven’t experimented yet with either.
For now, with the bit of time I’ve had, I’ve been a bit distracted by polygonal mesh modeling with Blender. This isn’t an area I have any expertise in. I did stumble upon the page about the newest blender open move project, Durian; it will be interesting to see the results. As for myself, I’m still pecking at the keyboard trying to learn the Blender interface to construct the building facade that I’ve begun:
I found what seems to be an excellent set of freely available Blender video tutorials by David Allen Ward (homepage). I don’t think many tutorial writers appreciate the value in actually watching someone work. A fundamental part of the process includes an appreciation for how much tweaking goes into it, what actions are done over and over, and all the details that are not seen in the final product. Anyone who has learned a task by literally looking over someone else’s shoulder as they work knows that there are all sorts of practical tips, tricks, and general information that get picked up and otherwise would likely never be shared.