Game Dev & Jam

Thoughts on graphics programming for the 360, but more importantly - fruit preserve.

24 Hour Pinty People

It seems that it’s only after events like these that you actually question what, in the grand scheme of things, could made you have thought that attempting to drink continuously for a entire day would be a helpful and enriching experience. What would have possessed me to write off the harrowing tales of woe related to me by (significantly) bigger and better athletes in the inebriation Olympics?

 

everyone

More the fool I, Dave Hill, and a number of friends took up this gauntlet of insanity, vowing to complete this Herculean task or be-very-disappointed-with-ourselves (hastily changed from ‘commit seppuku with a blunt spoon’ by general consensus).

 

Starting at noon on Saturday, though we managed to complete a gruelling 16 hours, that still left us fully a third short of the goal. Surprisingly, the difficulty arose not with imbibing the considerable quantities of alcohol, but in remaining awake for the duration of the trial. As those who know me will attest, I’m far from a heavyweight, so I have to ascribe my survival and amazing lack of hangover to my choice of Kopparberg as my poison. Other scoffed at my choice of quite sweet pear cider, but when beer and cider drinkers were blowing out left and right, I remained strong in, sipping my way to sweet, sweet victory (well, in the right direction at the very least).

 

The accumulation of so much alcohol in one place was in and of itself was a truly epic event; bringing tears to grown men’s eyes and bowing their heads, fixing in their minds that moment so they might one day say to their children, and their children’s children, “I was there.” Yes, their children might be malformed, undernourished and in the care of social services, but at the least they’ll finally know the turning point in their father’s lives when they finally took upon themselves the mantle of alcoholism.

 

Without the vacuous hyperbole, here is a subset, not by any means exhaustive* of the hi-jinks surfacing on that fateful day:

  • Top Hat-tastic action!
  • Moshing sans shirts to Jamiroquai
    (yes people, apparently you can mosh to anything..)
  • The Game of Mao (The first rule of Mao, is don’t talk about Mao)
  • Exploding Lollipop Conkers - try it today!
  • An exclusive Glow staff performance to 4, you lucky few!
  • More sleeping people in a room than explainable by physics
  • A face full of… socially inappropriate posturing and presentation

* The majority of stories may not be retold for litigation purposes.

 

Sunday was officially by far the best ‘day after’ ever, most significantly for a distinct lack of.. pain. The entire day I was waiting for the hangover to kick in, the worst I felt was actually the caffeine hit from the super-sized Frappachino we bought when we headed into town for jeans… and which we roundly failed to purchase, getting waylaid in the arts and crafts store and buying canvases instead. I’ve never painted on canvas before, it was like being 5 again! With longer arms.

 

fishing for plumbers

Fishing for plumbers..

Brown bear, is Red Fox - I have documents, da?

In the past, Rare has had a reputation for being secretive - about our games, what goes on in the studios, and even so far as to limit the interaction between different game teams to prevent any leaks of ideas and information.

 

This video from Inside Xbox doesn’t do much to dispel that furtive feeling, but it does shed some light on the game that I’ve been working on for the past year.

 

Detail Normal maps

Detail normal maps are used in the same way as detail textures, to add high frequency information/detail to an otherwise low frequency base map or texture. This is useful in situations where a large range of view distances are allowed, such as a landscape, where the view point can encompass the ground close up and distant terrain.

Ideally, the base texture would be of high enough resolution to provide enough detail close to the viewer (using mipmapping to handle the lower sampling frequency at further distances). In fact, the use of mega-textures achieves just this, by texture streaming the relevant resolution segments into memory. However, this solution is not yet in wide use, next-gen engines such as id Tech 5 being among the first to implement it in real-time on current hardware.

Excluding this, the usual method is to stretch one texture over a large mesh to provide a low frequency basic colour and modulating it with a repeating texture to give the illusion of higher detail. The same is done with detail normal maps, but because the maps represent unit length direction vectors, the base and detail normals can’t simply be multiplied together the same way albedos (colours) can.

Primary normal map

Instead, the primary map perturbs (rotates) the interpolated vertex normal, passing the derived normal as input to the next normal map. Pertubation is performed by constructing a matrix composed of the current normal/binormal/tangent vectors that defines the ”basis” of the polygon. This is simply the vectors in world space representing the 3 axes that are perpendicular to the surface (normal), parallel to the surface (binormal) and a third vector also parallel to the surface but perpendicular to the other two vectors (tangent).

By multiplying the normal sampled from the normal map by this NBT matrix (actually the BTN matrix, as the normal is z-axis), the sampled normal is transformed into world space. Breaking down the matrix multiply, the transformation of the sampled normal (n1) from tangent-space into world space (Normal′) becomes straight forward:

 Normal′ = n1.x * Binormal + n1.y * Tangent + n1.z * Normal

In the case of a flat normal with no deviation, n1=(0,0,1), resulting in Normal′=Normal. The x and y components cause according Binormal & Tangent contributions, and as long as the basis axes and the sampled normal are all unit vectors, the resultant linear combination is also of unit length.

Detail normal map

After the primary normal map has been applies, you’re left with Normal′, Binormal and Tangent vectors as the new basis. As only the normal is required for the lighting equation, the fact that the Binormal and Tangent are no longer orthonormal (perpendicular) to Normal′ isn’t a problem with only a single normal map. With a second perturbation, the Binormal and Tangent need to be made orthonormal to the first perturbed normal Normal′ before the . This can be achieved by removing the Normal′ component in the Binormal vector and renormalising it. After that, it’s a simple matter of taking the cross product of the normal and binormal to derive the perturbed tangent:

 Binormal′ = normalise( Binormal - (Binormal . Normal′) * Normal′ )
 Tangent′  = Normal′ x Binormal′

Strictly this may not be the geodesic rotation (the least rotation required to map the basis to align with the perturbed normal) like you can get through the use of quaternions, but it provides consistent results for a relatively small performance impact.