Skip to content

Archive for October, 2007

31
Oct

Fixed point math in pure CPP

NOTE
This post has been previously published on 2007/Oct/31: due to my move to another server i’m now in the process to manually recover the comments for this article.
Fixed!

Some time ago i was asked to publish my implementation of fixed-point math, mainly regarding embedded architectures where IEEE floating point computations have really bad performances. What i want to give you here is a pure-c++, template-based implementation of a fixed-point datatype: this thing is more of a test in order to see how much an object-oriented implementation can perform, being in contrast to a more traditional implementation. As expected, operator overloading and temporary object creation overhead are the main issues with a full-oo implementation as this one, anyway, its a damn nice way to exercise yourself in writing c++ policy-based templated code ;)

Read moreRead more

17
Oct

An AS3 profiler

NOTE
This post has been previously published on 2007/Oct/17: due to my move to another server i’m now in the process to manually recover the comments for this article.
Fixed!

I’m currently working on an early-stage, more of a proof-of-concept thing, but i needed to know more about the code performances: googling for an ActionScript profiler just showed up ASProf, an AS2 profiler. So i decided to port to AS3 the C++ profiler i wrote for Aqua, the cross-platform framework i was working on until April: the original C++ implementation has been developed after being inspired by an article of Steve Rabin in the Game Programming Gems 1 book, that’s a nice one to have on the shelf together with some other great books of which i could post something about them later.
It is always wise to remember that if you are serious about code profiling, you’ll be better to search for some professional tools: in the C++ arena my choice would be this one, but if you plan to have lunch and dinner for the next couple of months give Eletric’s one a try, it really deserves a look.
Unfortunately for the AS3 world, i just haven’t found anything really usable for it up to now, so i just thought to release it under a zlib/png license and some hints on how it works here.

ProfilerConfig.Width = stage.stageWidth;
ProfilerConfig.ShowMinMax = true;
prof = new Profiler( 32 );
addChild( prof );

Read moreRead more

3
Oct

Hydra considerations

While experimenting with the AIF toolkit i noticed some glitches that could be taken into consideration by the AIF team before going final with the release:

  • it seems that image-type function parameters are bound to the selected images according to their alphabetical order, instead of the natural user-defined one: for instance, create a new kernel as here, select two images and refresh; you should be now looking at the image you loaded via “Load Image 2…”: now rename “in image4 srca” to be “in image4 srcc” and refresh. Wrongly, you are now looking at the first image
  • the GUI doesn’t release cpu/gpu resources while minimized in order to relieve the machine from the rendering process

Aside that, i’m looking forward to try all this cool stuff with Astro!

2
Oct

Hydra is here!

Glassy look through
Finally the Adobe team released the Hydra’s tech-preview package, available for download right here: reading the documentation, there are some cool things that aren’t expected to work in the Flash player, anyway Hydra signify a huge step forward for the Flash technology, enabling the next Flash Player for custom bitmap filters, blend modes and a bunch of exciting new stuff! Also, congrats to Joa as he wrote the first non-Adobe hydra filter!

I had some difficulties installing the package since it was keep asking to terminate another Adobe installation, anyway i managed to install the beast and give it a try: i wanted to simulate a “glassy look-through” effect (as you are watching something outside of a glass door): it goes without saying there is the need to use some of the “region needed” magic in order to crop the black borders out, but i have no time at the moment, so here it is.
In order to use this filter you’ll have to download the kernel source and these three images:

ShowerNormal1Normal2

Basically, once you launched the AIF Toolkit, you load the hydra source, then the shower as the first image, and then choose one of the two normal maps as the second image, press F5 and try play with the parameters.