DominicHamon.com

Life is like a grapefruit

#DearJohn: An open letter to my representative

As you may have read about, there is a bill in the House of Representatives that is, apparently, the countries “highest legislative priorities”. This bill will deny vital medical care to many victims of rape and incest due to its introduction of the word “forcible” to differentiate between different levels of rape.

I don’t like to be open about my political standing, though anyone that knows me can probably guess just how far to the left I lean, and I don’t usually have much motivation to step up and be counted. However, I want to share the letter that I have written to my representative, Rep. Nancy Pelosi:

Rep Pelosi

I am writing to you today regarding HR3.

From what I understand of your background, and your previous position on similar matters, I feel confident that I don’t have to ask this, but I cannot stay quiet about this issue.

It is imperative that you vote ‘NO’ on HR3 and continue to protect those who were unable to protect themselves. This is not about conservative versus liberal, and it’s not about supporting abortion or contraception. This is about women who have survived an horrendous ordeal and need support and compassion more than ideologies.

This bill is a terrible affront to the women who have fought hard for their rights and will erode years of effort in a single stroke.

Thank you for your time, and I look forward to seeing this bill defeated.

I cannot urge you enough to find your representative, find out about their background, and write to them. It is not enough to be outraged, you must be heard.

Posted on 2011/01/31 in personal | Tagged HR3, politics | 1 Comment

Putting it all out there

This weekend I finally finished a project 1 and made it publicly available. This is the first time I’ve put software that I’ve developed on my own out there and I’ve been running the gamut of emotions over it. I suspect the feelings I’m going through are something akin to a musician putting out an album, or an actor having their performance on the big screen, only much much geekier. Continue reading

  1. Well, got a project to the point where it’s usable by others ↩︎

Posted on 2011/01/25 in personal | Tagged acetate, animation, projects | Leave a comment

Pushnote: All talk and no trousers

PushNote is a new service that will be known, for good or ill, primarily for being announced over Twitter by Stephen Fry, who is one of their investors. Similar attempts have been made in the past for a cross-site commenting platform, Google Sidewiki for example, and none have taken off. I really want a service like this to work as having a single point-of-entry for communication and discussion across all sites would be fantastic, but there are a few fundamental issues with this one that will stop me from subscribing to it wholesale at this time:
Continue reading

Posted on 2011/01/13 in personal | Tagged internet, pushnote | Leave a comment

Crying foul

I recently watched the Twilight movies and, having not read the books, and with no intention to do so, actually enjoyed them.

There, now that’s out-of-the-way, we can get on with the rest of this post. See, after I watched them, I wrote up a really long article defending the movies and arguing that the criticisms that are usually leveled at the franchise are, at best, easily dismissed and, at worst, unwarranted. But then I realised that I don’t need to pick apart the criticisms piecemeal and I can write something much more general. So here goes, I hope you’re ready:

Continue reading

Posted on 2011/01/11 in personal | Tagged movies, rant, twilight | Leave a comment

Speed: Give me what I need

Do you host your site through dreamhost? If not, you should. They’re fantastic and great.

In fact, they just got even more fantastic: http://blog.dreamhost.com/2010/11/04/mod_pagespeed-now-available/

If you already use them, you should totally go and turn this feature on. Go ahead, I’ll wait here.

To save you reading their blog post: They have enabled mod_pagespeed as an option for domain managers. This module dynamically rewrites pages before they’re served to make them faster to download and faster to render. Why is this good? Well if everyone used it, you could browse twice as many sites with pictures of puppies, kittens, or sugar gliders in the same amount of time.

Full disclaimer: This is one of the projects I work on.

</shameless plug>

Posted on 2010/12/09 in personal | Tagged plug, work | Leave a comment

In which the word ‘intereading’ is coined

In between ending my old job and starting my new job, I had 10 weeks off. In that 10 weeks I started a lot of the little projects that have been on my mind (and finished none, of course): a z80 emulator (the cpu from a gameboy) and some bits of the graphics processor, a short story, the start of a longer story, an iPad version of the old Fighting Fantasy books (which someone beat me to releasing), and an iPad framework for developing old-school text adventure games. Most of these projects were just clearing out dusty corners of my cerebral filing cabinet, but I was most excited about playing with the notion of books and interactivity on the iPad.

This next bit may seem like a non-sequitur, but i’ll pull it all back together in a bit. I promise.

I’ve admired Oliver Jeffers‘ work for ages. I own a few of his books, have a large print of his in the bedroom, and have a tattoo appointment booked to get a tattoo inspired by another of his images.

Here’s where this post comes back together: This is one of those ideas that I wish I’d had. It’s a version of Oliver Jeffers’ latest book, The Heart and the Bottle, developed for iPad with beautiful, whimsical interactions for the reader.

As an aside, we’re probably going to want to start using a more active noun for someone who reads interactive books. An interacter, perhaps? Or intereader?

Anyway, I cannot wait until there are more books like this, and if I was a kid I would interead this over, and over again.

Who am I kidding; I will be intereading it over, and over.

Posted on 2010/11/27 in personal | Tagged books, ideas, NaNoWriMo, oliver jeffers, projects, tattoo | Leave a comment

Pumpkins scream in the dead of night

Let’s talk about pumpkins.

I’m not a fan of pumpkin, but I do appreciate their versatility and I love that during the Hallowe’en season so many people take opportunity of the pumpkin carving tradition to explore cooking at home. Whether it’s soups, pies, cupcakes, or cookies, the insides of that gourd-like squash have a huge number of uses, and anything that encourages people to cook more food instead of ordering in is a good thing.

However, around my neighbourhood I see another use for pumpkins: They’re left uncarved and whole to rot on peoples’ stoops. I’ve realised this year just what a waste this is and it’s really bothering me, so you get to read all about my feelings here, the only soap-box I have. Continue reading

Posted on 2010/10/27 in personal | Tagged halloween, rant | Leave a comment

So long, LucasArts

I have a lot of things to thank LucasArts for. If it wasn’t for Day of the Tentacle, Monkey Island, X-Wing, Tie Fighter, or the Dark Forces games, I would not have been drawn to programming as a career, and specifically game development.

Without the opportunity they gave me to lead the game development team at Lucasfilm Animation Singapore, I would not have realised how much I want to code rather than manage.

They brought me to the US, and specifically to San Francisco which is the best city I’ve ever lived in, and has rapidly become my home.

They gave me the chance to work on The Force Unleashed II,which was a phenomenal technical challenge and during which I learned a huge amount from some incredibly smart people.

Then, when it was time, they set me free to run wild, and gave me the chance to find a new challenge.

This whole path facilitated by them has led me to today, when I accepted a new job at somewhere I have wanted to work for years: Google.

So long, LucasArts, and thanks for all the fish.

Posted on 2010/09/30 in personal | Tagged work | 6 Comments

Goodnight Eddie

When I last wrote about Eddie, it ended up being the day that I let him go. It had been a rough two weeks for him, and as much as I wanted to believe that he was going to get better any day, he wasn’t. I saw the x-ray images. I saw how much he was quietly suffering.

Continue reading

Posted on 2010/09/29 in personal | Tagged eddie, pooch | Leave a comment

Sub-surface scattering with CDRF

Introduction
In this paper, Kubo, Dobashi and Morishima present a compelling case for using a curvature dependent reflectance function (CRDF) to simulate sub-surface scattering. The basic idea is that smaller objects with higher curvature exhibit more noticeable sub-surface scattering than flatter ones. Using photon mapping with spheres, the authors found a reasonable relationship between the curvature of the sphere (the inverse of the sphere’s radius) and the radiance across the sphere. With the only examples in the paper shown being fairly close to spherical, I wanted to see if I could use their technique, or a variant of it, to get a cheap sub-surface scattering effect on a more complicated mesh. Like, say, the dragon from Stanford’s 3d scanning repository.

The mathematics
First, the authors of the paper attempt to fit their data using the following CDRF:

Where is the incident light energy and is a gaussian:

As can be seen from figure 2(c) in the paper, this is not a particularly good fit though it does match the data qualitatively with a Lambert type shape at low curvature which spreads at higher curvatures.

However, a better quantitative fit is given by (thanks to Cedrick Collomb for help with this):

Once you have this, it’s time to move on to measuring the curvature of your mesh.

Mesh curvature
There are a few different techniques out there for determining the local curvature of a mesh, but the two main techniques involve either finding an analytical formula or patch that fits the mesh around the vertex you are interested in, or determining the curvature directly from the vertex and normal information. As this was just a prototype, I went with the more performance friendly, and less work-intensive, option of determining the curvature directly from the mesh.

My first attempt was inspired by this paper where the area of each ring of faces around a vertex is compared to the area of those same faces projected onto a unit sphere. This gives a measure of the Gaussian curvature of a mesh which is an intrinsic property of any surface. When applied to a series of test meshes, the results were less than ideal. The sign of the curvature appears correct, but the magnitude depends heavily on the size of the faces, as you would imagine from the definition.

I did attempt to extend the neighborhood used to calculate the Gaussian curvature to two rings, but this had two negative effects: The local curvature was smoothed out too much in some places, and other places the technique became invalid as it relies on the sign of curvature not changing within a neighborhood.

These limitations led me to a definition of curvature that is not an intrinsic property of a surface, but depends on the space a surface is embedded in. As I can control the ambient space within my test program and ensure it remains Euclidean (side note – has anyone considered making a game set against a non-Euclidean space?) this measure is still valid for my requirements.

This technique, outlined in this paper again compares areas of faces within the neighborhood of a vertex, but as the area of the face appears in both the numerator and the denominator of the ratio, the magnitudes of curvature are more well-behaved both locally and across the mesh. My results from this technique were far more useful.

Putting it all together
So now you have an intimidating formula linking local curvature and incident light angle to outgoing radiance. What happens when you put it together?

First, here’s a baseline. The dragon with a simple Lambert BRDF:

Now replacing this with the CDRF from the original paper:

The diffuse lighting is clearly wrapping around the model more, as expected, however there are some issues. Note in particular the spine of the dragon which, being thinner, should show more transmission. However, as it has flat curvature when compared to the thicker body of the dragon, it transmits less.

To compare, here’s an image of the same mesh, with the same data, but using a more traditional depth-based technique for sub-surface scattering:

Which clearly shows the transmission effect, but where we might expect the scattering effect to be pronounced, around the details in the face, for example, we lose all detail.

While it is true that transmitted light will focus into areas of high curvature, this is an additional effect on top of how far the light has to travel within the model. So perhaps by combining these effects and using the CDRF to add a curvature dependent term to the depth-based sub-surface scattering model, we might get something better than either:

Which has all the benefits of a depth-based technique but with the added benefit of concentrating the transmission where the curvature has a high positive magnitude and darkening the transmission where the curvature is negative.

However, we can combine the curvature with the depth-based sub-surface scattering effect in other ways. We can use the curvature of the model directly to lighten and darken the transmitted light. This should add detail back in without the expense of the CDRF calculations and looks like this:

This, in combination with a Blinn-Phong BRDF and a Fresnel reflectance term, gives us something that starts to approximate jade:

Summary
While the original application of the local curvature of a mesh does not provide a good model of sub-surface scattering for more general cases, it can certainly be applied to existing techniques to add subtlety to the transmission and scattering of light through a model.

Posted on 2010/08/25 in rendering | Tagged cdrf, sub-surface scattering | 6 Comments

Recent Posts

Archives

Search

Search

Copyright © Dominic Hamon 2021. WordPress theme by Ryan Hellyer.