I've posted about Pixelated Martini Roller before, including a cell phone video recording of an IGDA presentation and a description of the collision. But dear blog readers you've never been able to see a high quality video. Here it is:
Tuesday, October 20, 2009
Pixelated Martini Roller - Game Jam Video
Wednesday, October 14, 2009
Gamma Correct Lighting, On The Moon!
When I explain gamma correct lighting to people, sometimes they look at images and aren't certain which is supposed to be better.
Which has gamma correct math?

- Chris Tchou, HDR The Bungie Way
- Larry Gritz & Eugene d'Eon, The Importance of Being Linear in GPU Gems 3
- Steve Smith Picture Perfect: Gamma through the Rendering Pipeline presentation
(A better article version is available in the Xbox 360 documentation) - Alex Vlachos, Post Processing in The Orange Box, GDC 2008 presentation
Sunday, August 30, 2009
A Weak Smart Pointer, or a Smart Weak Pointer
Smart pointers simplify many lifetime management scenarios, especially when designing modular components and systems with a multitude of lifetime dependency options available to final applications. Weak pointers are also useful, but are flawed in a multithreaded environment.
The other day a hybrid smart/weak pointer occurred to me, I'll present it here.
A refresher:
- A smart pointer is an object that acts like a native pointer, but whose lifetime controls a dynamically allocated object's lifetime. As long as you hold a smart pointer to an object, it continues to live. Multiple smart pointers can point to one dynamically allocated object, and it will not be deallocated until all smart pointers are released. Implementations typically maintain a reference count and delete the dynamic object when that ref count goes to zero.
- A weak pointer is an object that acts like a native pointer, but whose value is changed to NULL if the object pointed to is deallocated. Holding onto this type of pointer does not keep an object alive, but you can check it's value and see that it is NULL when the object has been destroyed (a normal pointer would still point to the memory the object used to reside in).
Discussion:
Smart pointers are sometimes used for code safety, even when a system does not desire lifetime management responsibility. Weak pointers are a better solution here, allowing a system to keep a reference that will go NULL when the object dies.
In multithreaded systems weak pointers lose their benefit if the dynamic object can be freed from another thread. A portion of code may check the value of the weak pointer and find the object exists. However, as the object is accessed another thread may free it.
One work around is to use a short lived smart pointer, which will keep the dynamic object alive from the weak pointer dereference until work is complete. This requires a smart and weak pointer pair implementation designed to support this use case in a multithreaded system, and is also likely quite a performance burden due to the additional reference count manipulation.
For code that runs infrequently, the smart & weak pointer pair is a good option though. Without any smart or weak pointers the system would need to implement thread-safe API to register and deregister objects, and the systems would need to be tightly coupled (or perhaps use a message system).
My Idea:
A smart weak pointer to the rescue? It would be nice to have the same functionality of a smart pointer, knowing that as long as you hold it the object will live, but also indicate to the system that you're willing to let the object die. The only catch is that you need to let the object die at a convenient time for you, so that you can safely handle the situation, but not be required to safely handle it everywhere you use the object.
Start with a smart pointer implementation. Add an additional ref counter for the smart weak pointers, call it WeakRef. Any smart pointer pointing to an object acts as before. Any smart weak pointer acts the same as a smart pointer, but also increments WeakRef counter. Add a method to check the ref and WeakRef counters to see if they are equal, and if so set the smart weak pointer to NULL and decrement the two counters.
A system then could use the smart weak pointers just as if they were typical smart pointers, and occasionally check if the smart weak pointer should release it's reference.
This works out well for a multithreaded system that accesses a large number of smart pointers frequently, and has a regular opportunity to release them.
System::OnTick()
{
for (lots of work to do)
{
Look up the right smart weak pointers to dereference, and use them as normal
}
for (all smart weak pointers)
{
CheckForRelease(p)
}
}
If your system only infrequently dereferences pointers, is single threaded, or performance isn't an issue; the discussion's example of weak pointers with temporary smart pointers would be great for you.
Wednesday, August 12, 2009
Beautiful Pixels in Post-It Notes and Assembly

Wednesday, August 5, 2009
A Light Field and Microphone Array Teleconference Idea

Paul Mecklenburg and I were chatting, and the thought of really cheap cell phone cameras led us to day dreaming about a teleconference system.
Line up a dense array of cheap CCD sensors and microphones into a video conferncing wall you're projecting onto. Now you've got a light field, which permits rich virtual camera re-imaging (movement, rotation, zooming, depth of field). The microphones can be used to triangulate sound sources. Sources from e.g. table locations can be dampened (see "hush zone" in picture). Sources distant from mics can have an audio boost to account for volume fall off (see "audio boost"). The speaking locations can also be used to drive an automatic virtual camera which focuses on subjects doing the speaking.
Wednesday, July 15, 2009
Diving - Triangle Game Jam 3 - Music Game
The 3rd Triangle Game Jam was last weekend! Hot off the presses, the game I worked on: Diving. (The other games have not yet been posted on that website yet -- we're all busy catching up after speding the whole weekend making games)
Tuesday, July 14, 2009
An Email Organization Scheme for Outlook 2007: How I Efficiently Triage Email

I process a lot of email. (Beautiful pixels take a lot of email to make these days.)
Many emails are in conversation threads. Some emails are very important, and must be responded to, while others I can soak up when I have time or choose to skip over.
I'll discuss the system I use in Microsoft Outlook 2007.
Here's what it looks like:
The mechanics of it:
- I leave email marked Unread until I explicitly mark it read (CTRL-Q)
- I turn off automatic marking as read (Menu: Tools: Options: Other Tab: Reading Pane...)
- I flag message for Follow Up (with times, e.g. Today, Tomorrow, Next Week, or a specific date).
- I read email from the "Unread or For Follow Up" folder.
- (You'll find this under your Mailbox tree, in "Search Folders")
- This displays all messages not yet read, or flagged for follow up.
- I use a custom view:
- Make a a new view by copying one and making changes
- Menu: View: Current View: Define: Copy "Messages with Auto Preview"
- Group By...
- (set "Select available fields from" to "All Mail fields")
- Start Date (Ascending)
- Importance (Descending)
- In Folder (Ascending)
- Conversation (Ascending)
- Sort...
- (set "Select available fields from" to "All Document fields")
- Category (Ascending)
- Received (Ascending)
- (say "No" when closing window and asked if you want to show Category field)
- Other Settings
- Auto Preview: Preview unread items
- Reading Pane: Right
- Automatic Formatting...
- Only Me
- Condition: Where I am "the only person on the To line"
- Font: Underline
- I make important email folders "Favorites"
- Our teams use many public folders, and I make them favorite folders for the ones I track
- (You must make the public folder a favorite public folder, then a favorite email folder)
- I use several rules to presort items
- Route emails to topic specific folders whenever possible
- e.g. sales staff, partner companies, email lists
- Flag items for follow up later
- e.g. items I need to review weekly are flagged "next week"
- Delete means "trash it, I don't need it any more, but just in case keep ~6 months of deleted items"
- I purge deleted items manually
- My Inbox means "I haven't bothered to sort this", and accumulates lots of email
- I don't read out of the inbox, so it doesn't matter much if it builds up
- I do periodically move everything in the inbox to a folder "_save-generic"
Now, how do I use this?
- Emails arrive and I triage them.
- I select the "Unread or For Follow Up" folder.
- I hit the Home key to get to the top.
- I scan over the large pile of unread messages, and first at a quick glance:
- Delete anything obviously not important.
- Move to Folder anything that should be sorted
- This greatly improves grouping of items in this "Unread or For Follow Up" view, beyond just filing things away for later.
- I use the toolbar icon which remembers the most recent folders I've put things into.
- Mark as read (CTRL Q) anything trivial I can ignore .
- Flag for follow up anything substantial I can't handle right now.
- Tomorrow, this week, next week, or a specific calendar day if needed..
- Anything remaining I need to handle right now.
- I flag these by just clicking on the "flag", which is effectively "Today".
- My email I should handle is now all sorted by a follow up date.
- I hit F5 to refresh the view - hiding all messages marked Read and with no flag.
- After triage, emails are displayed in groups sorted by the time frame I need to review them.
- I read emails, and after doing so mark them as read, leaving them flagged if I still need follow up.
- As emails are dealt with, I delete them if appropriate, or click their flag to mark them as complete (which removes them from this list).
- I can easily push items futher away in time if I'm getting backed up, or "read ahead" if I'm ahead of things
The major benefits:
- I can easily push items into the future and not deal with them right now - they'll come back to my view at an appropriate time.
- Long conversations are all grouped together, automatically. And they can easily be hidden/rolled up from the view.
- I can easily sort several emails into folders, which groups them together in my view. Thus related emails can be grouped together, even when they have unrelated subjects lines.
- Public folders allow me to go to that topic at an appropriate frequency (every few hours, daily, weekly), and making them favorite favorites makes them easy to see.
- New High Importance emails are at the top of the list, while ones I've look at can be pushed down for later.
- Emails will never "fall through the cracks".
The shock to new users:
- The email view is padded out vertically quite a bit.
- True, but the sorting and grouping benefits are worth it when you're tracking dozens to hundreds of emails.
- You get used to it pretty quickly.
- For select folders I use a different view that has 1 email per line. You can always toggle 2 views for your need.
- Explicitly marking all emails as read is a pain.
- Multi-select and marking entire conversations read at a time helps.
- This is what keeps emails from falling through the cracks.
- thanks technabob.com for the cc image of the hamster shredder.

