Wednesday, November 25, 2009

Anamorphosis Gamebryo LightSpeed Logo

We all love Anamorphosis, and have seen it done wonderfully before ([edit] even spectacularly). Well, I've done a few simple things around the office, here's one I just did:

Vimeo and YouTube videos.




That was done with painter's masking tape, with the help of Cat, in about 2.5 hours.

Here's an earlier project, the old Gamebryo logo done with post-it notes:



Post-it notes were handy after a late night in the office and no prep. The masking tape is obviously much better. Both were done by setting up an image on my laptop and using a projector to cast it into the room. The perspective for both is just in a doorway, to help guide viewers to the right position. Both also are cast in a way that the image is heavily distorted as soon as you move slightly away from the right point.

Share links if you've done similar projects, or know of good ones. ;)

[Edit:]
Falice Varini is the link you want to follow! See e.g. this.

Tuesday, October 20, 2009

Pixelated Martini Roller - Game Jam Video

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:



Best watched in High Definition / full screen, with vimeo or youtube.

If you don't recall, it's one of the Triangle Game Jam games I've worked on, this one from 2008.

Three.5 of us made the game in 2 days, based on the madlibs jam theme that randomly made the title "Pixelated Martini Roller".

You're an olive. You like martinis. You roll around and get to umbrellas for checkpoints. Sitting in a martini glass gets you a bit tipsy. You've got more energy and can jump higher. But watch out, stay too long and you get sloppy. You'll stagger around, and your jumps won't land you where you want to go.

As you get tipsy the screen gets pixelated, and the music sounds like it's had too much to drink too.

The world was created with an in-game level editor. The objects are just a few images that represent the visual and collision texels.

We've noted how fun it is to implement hacky collision over and over again in a weekend, but I liked coming up with and working on the pixel based collision we did for this one. I also enjoyed writing the post FX pixels and rushing out the level design in the last hour. ;)

Thanks for Michael Noland and Adrienne Walker for working together on this game with me, and Brad for the title screen.

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.

E.g. in GPU Gems 3, The Importance of Being Linear two spheres are shown, similar to these:

Two spheres lit by a directional light. Which has gamma correct math?


A small thought occurred to me: there's an object people are familiar with that will help them to understand, the moon:
Two spheres lit by a directional light, compared with an image of the moon.
Which has gamma correct math?


Still don't see it.. yes, it's subtle... shall we make it obvious with a gradient?


Yes, it is but one example, there are many more. But it's a good basic visual example.

If you'd like to read more on gamma correct rendering:
[EDIT: See the comments for some nice thoughts from people who've spent more time on this.

Naty points out another good example in Real Time Rendering.]

Thanks to "ComputerHotline" on openphoto.net for the image of the moon.

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.

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)
}
}
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.

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

Previous readers know about the Beautiful Pixels API game jam concept. I'm tickled whenever I see others with the same idea. Such as

Post It Shooter, an experimental game by Petri Purho:
A Space Invaders mini game rendered with a post it note style. ;) Well worth seeing it in motion... download or youtube video (it lessens the effect since it's a downsampled resolution, at least watch in HQ).

Frameranger, the winning demo at Assembly 2009 by CNDC, orange, & Fairlight:

At 5 minutes in, there's a great shift to 8-bit music style and a block push pixelated render target. Check out the capped.tv video.

oh, demos... i love you, you make the most beautiful pixels.

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



Video links (Recommended viewing in H.D.): youtube, vimeo.

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)

The theme was Music Game, similar to how music and video can be used to make a music video experience. The theme was inspired by Reset.

In Diving, the gameplay is subtle. The game is primarily delivering an experience well tuned to the music. I'm pleased that our design captured the mood of the music, synchronized to the lyrics, and also the piano notes.

The actual gameplay mechanics allow you to steer left and right as you chase the ring down into the depths. While that's a bit simple, the concept of the woman at the railing, jumping after the ring, and swimming down after it ever deeper, is the real point. The game is designed to never let you actually catch the ring, it's always just out of reach and lands on the ground always at the end of the song. As the song closes and the woman just about reaches the ring, there's a fade to black.

The song and concept seed were Adrienne Walker's, and I contributed significantly to the final design we presented.

Contributers:
Brett Brown (Title Art) (Electronic Arts)
Derek Ehrman (Programming) (Atomic Games)
Vincent Scheib (Gameplay Art/Programming) (Emergnt Game Technologies)
Adrienne Walker (Programming) (Emergnt Game Technologies)

The song was Feathers by Man Man.