FlashBrighton wins Strongest Community award

FlashBrighton win DiMA:S Strongest Community award.

I’m delighted and surprised that my local user group, FlashBrighton, won the award for Strongest Digital Community at the DIMA:s on Thursday night! We’ve been going for roughly three years and I manage the group along with Jo Summers, Richard Willis, and the rest of the team.

FlashBrighton win DiMA:S Strongest Community award.

There are over 200 Flash developers and designers on the mailing list, all local, and we meet every Tuesday at the Werks.

We also run special events like last year’s day long conference Big Day Out and our twice yearly Big Screen Bonanza film nights. The next one is on the 9th of December so it’s really worth coming along if you’re anywhere near us! Sign up here : http://upcoming.yahoo.com/event/1367599

Plug-in Media's glow stick voting system at work

And my fellow Plug-in Media boffins were there in force to set up the glow stick voting system. Video and more details to follow!

Plug-in scientists at work

[UPDATE] of course what I forgot to mention are the individual FlashBrighton members that also did well at the awards. More information on Matt and Richard’s blogs. As Richard says, we were all over the DiMA:S “like a rash” 🙂 We had 3 winners and overall 7 projects that our members’ were involved in were shortlisted.

Memory leaks in Papervision3D patched up!

We all know how stable and optimised Papervision3D is. But a small number of developers who need to constantly create and discard 3D objects will have encountered a particularly tricky little memory leak.

There have been several workarounds and custom destroy functions, which have helped to patch up the leak, but I can now announce that, with the help of the rest of the team, and the Papervision3D mailing list, I have finally fixed the problem once and for all! (subject to further testing 🙂 )

And the reason for the memory leak? Dictionary objects.

I’m sure most of you have heard of Dictionaries already but for those who haven’t, it’s like an array, except instead of index numbers to reference a value you use an object:

var myDict : Dictionary = new Dictionary();
myDict["hello"] = "greeting";
myDict[stage] = "stage";
myDict[42] = "number";
//outputs "greeting"
//outputs "stage"
//outputs "number"

OK, so that’s a pretty nasty example, but you get the point. Or if you don’t, my friend Grant, has explained it much more eloquently.

There’s a parameter in the constructor for a Dictionary; a Boolean called weakKeys that is false by default. This means that if you use an object as a key in the dictionary, the object will never be discarded by the garbage collector, even if all other references to that object are lost. If you set the flag to true, and you have no other references to the key object in your code, the garbage collector will destroy that object, and that key in the dictionary will be lost.

In Papervision, dictionaries are used to store the references between objects and their materials. So materials create a list of objects that they’ve been applied to. And the dictionary object for the material uses weakKeys so that if a DisplayObject3D is later discarded, that entry in the Dictionary will also be lost, and the Garbage Collector destroys it.

Or does it…?

Continue reading “Memory leaks in Papervision3D patched up!”

Papervision’s dirty little secret (rectangle) now cleaned up!

Any of you using Andy’s ViewportLayers (see his post here) to selectively render separate layers will now find a fairly significant improvement in performance. And it’s because we’ve managed to shrink Flash’s dirty rectangle!

The dirty rectangle is the area of the screen that is being redrawn by the Flash Player every frame, and you can see it by turning on “Show Redraw Regions” in the right click menu of the debug player. One of the optimisations in the player is that it only redraws the rectangle that contains everything that has changed between frames, and the smaller the rectangle is, the faster it renders.

So if you have a very complicated background with lots of shapes, but only move a small object across it, it only renders the area around the small object, and you should get a fast frame rate.

By default, Papervision3D re-renders the entire scene every frame, even if you’re not moving the camera. But using Andy’s viewport layers system, you can put objects into different layers and then selectively render them. (Using renderer.renderLayers(…))

So let’s say you have a room, and in that room are several items of furniture. And in the middle there’s a spinning Jedi training orb (that one’s for John Grden 🙂 ).

If the only thing in the room that’s moving is the training sphere, then there’s no point in rendering everything else. So you put the sphere in its own viewport layer and call renderer.renderLayers and pass it through an array with the sphere viewport layer in. And now you’re only rendering the sphere! Or are you…?
Continue reading “Papervision’s dirty little secret (rectangle) now cleaned up!”