Author Archives: Andrew Glassner

“Home Security” Published!

Home-Security-A-Novel-Kindle I’m thrilled to announce that my first novel, Home Security, is now available on Amazon! Woohoo!

Home Security is a funny, fast-moving book with a cast of characters pursuing oversized dreams.

Dr. Nora is a radio therapist who seems to specialize in awful advice. But some people find her brilliant, and they have made her show popular. Unfortunately for Nora, one of her fans is a weasly little con man named Torrelious Fulture, who owes millions to the mob. His problem is that they want their money now, and he hasn’t got it. He’s got his eye on one big score that would save him, but the mark isn’t biting. So Fulture has sent his hit man to kidnap Nora and bring her to a house in the woods, where he imagines she will counsel him one-on-one and help him close his deal.

Jenny Jetrowski is a nice person with dreams of serious journalism. A tight job market has made her Nora’s assistant producer, but after two weeks she needs to move up to something better, like shoveling elephant poop. But before she can give notice, Nora gets been kidnapped, and Jenny must take over for her boss on the air (good), and organize her rescue (bad).

Meanwhile, Chet Weinhard has found himself at the Seattle airport with nothing but a gym bag and a check from his parents, who have just flown away to an unknown destination with a shadowy television evangelist.

With the help of neighbors and friends, Jenny and Chet design their own elaborate, high-stakes con to bring in Fulture and rescue Dr. Nora.

This funny story is populated with colorful characters and a sense that, no matter how bad things seem, they can always get more ridiculous.

And you can download it now!

Setting Up RenderMan on OS X

prman-sheepPixar has made their RenderMan product free for non-commercial use! Huzzah! This is great news for anyone who likes to mess around with shaders and shapes.

If you’re not using Maya or Kantana, then you need to run RenderMan from the command line. Which is fine, but I found that there were a few hoops I had to jump through to get it turn on my Mac running OS X 10 (Yosemite). Here’s what I did.

Continue reading

Writing

1867exposition If Star Trek was written by the guy who wrote the book I’m reading now:

“Hello again for the ten-thousandth time, Mr. Data.”
“Hello Captain Picard. Welcome back to the bridge of the Enterprise, the ship you are the captain of.”
“Indeed I am. And you are my trusted science officer, even though you are a robot.”
“But I am a robot that strives to understand people.”
“As we have discussed so many times, Mr. Data. Please point the ship towards danger.”
“Of course, Captain. I am bound to follow your orders, as I am a member of Star Fleet, a military-like organization with a strict chain of command.”
“As am I, Mister Data. But you would follow my orders anyway, as we have a bond of mutual respect.”
“Forged in many close calls in which we have come to each other’s assistance.”
“True. And though we carry weapons on this ship, we are a peaceful organization.”
“Of course we are, sir.”

Interpreting Alpha

Writing-TechNotes-Inst-Note-10 Everyone knows about using alpha to create composite images. But what does alpha really mean? Is it how much of a pixel is covered by a fragment? Is it the opacity of the color in that pixel? Is it some combination of these things, or maybe even something else?

The graphics literature is very fluid on this question, interpreting alpha pretty much in whatever way is most convenient on a moment-to-moment basis. In this technical note, we look closely at alpha and the compositing process using the over operator, and come to a clear understanding of what alpha represents.

Parentheses: more than emoticon mouths

emoticonI keep telling my students to use parentheses all the time. I even tell them to parenthesize something like 2+(3*4), even though we know that multiplication has precedence over addition, because it’s a good habit to always be crystal-clear to humans and computers alike.

Sometimes I feel silly for being so dogmatic about this. But I just spent an hour debugging, because (a&0xFF<<24) did not put my alpha value into the top 8 bits of an int. It should have been ((a&0xFF)<<24). Now I feel good again about telling people to use lots of parentheses!

Keeping gif Animations Small

grid of lines of different thicknessesAnimated gifs can be big. A 300-frame animation at 500-by-500 pixels can easily run 25 megabytes (MB) or more.

25 MB doesn’t sound like much these days, but there are still a lot of services out there for whom that’s too big. For example, Tumblr has a 10 MB limit. In order to get my animations down to Tumblr size, I’ve relied on two blunt tools: making each frame smaller (and thus losing detail), and making fewer frames (causing shorter or choppier animation).

Recently, though, I discovered something that surprised me: gif compression depends very much on the directional qualities of your image (unlike, say, JPEG). After the break, some data I’ve collected and some advice. Continue reading

Field Masking in Action

Sept23c2014Here’s an animation I made using the new AUMultiField masking call. This is an animated gif that I drew and saved one frame at a time.

I first drew a big white circle on a black background, and saved that in an AUField. That was my mask.

To draw each frame, I first drew the checkerboard full-screen and saved it in an AUField (I could have also drawn it into an offscreen PGraphics buffer). Then I cleared the screen to white, drew the outer circle, then the checkerboard with the mask, so it didn’t clobber my existing background and circle, and then finally drew the red dot on top.

New in AU Library: Field masking

maskedAUMultiFieldIn the AU Library (currently in beta – see earlier posts for download links) you can store an RGB image in an object called an AUMultiField, where you can do lots of things to do it, including drawing it on the screen.

Now you can also draw it using a mask. Create any AUField with shades of gray, and tell the library to use this as a mask when you draw your picture. Values of the mask from 0 to 1 control the opacity of the corresponding pixels, from fully transparent to fully opaque. In other words, the mask is an alpha layer, but it’s better than Processing’s built-in alpha because the values are stored in floats, giving them much more range and precision. The layer is also separate from the pixels, making it easier and faster to modify.
Continue reading

The Joy of Easy Motion Blur

A frame with and without motion blur

Motion blur on the left, no motion blur on the right

Any time I make an animation where things are moving quickly on the screen, I think about adding motion blur to my sketch. We’re used to seeing a trail behind fast-moving objects when watching film or video, and when we don’t see it the animation can feel jerky or just vaguely “wrong” (for more discussion, with examples, see Imaginary Institute Technical Note #7, “Fields and Cameras,” available here). Sometimes I’ve bothered to invest the time to write motion blur code yet again, sometimes I haven’t.

In my AU Library (now available in beta through this post), I’ve implemented a high-quality camera model that is super-easy to use (though it has lots of options for advanced users). One of its built-in features is motion blur. I wrote a little animation yesterday, and thought I’d add motion blur. I included the library and added three trivial lines, and it was done! Less than a minute of work and I had fully motion-blurred results that look great. After the break you can watch the animation with and without motion blur. Continue reading