dead rising

i finally got a 360 to play dead rising and it was totally worth it. i haven't enjoyed a console game this much since resident evil code veronica on the dreamcast.

here are some tips: always grab the katana and submachine gun on your way through the paradise plaza, mix orange juice and pie for untouchable drinks, mix milk and milk for a drink that makes you run really fast, get the criminology book in the store with the japanese tourists so the katana will last three times as long, and keep the people you're rescuing alive by giving them orange juice and weapons.  i beat the game but only got ending c which is weird because i did in fact talk to isabella at 10.  oh well, i'll try beating it again because it's so fun.

 

photoshop blend modes

i mentioned to merlucin that i had found a nice website awhile back with the
formulas for the photoshop blend modes. this is probably useful to others as well
so i'll post it here. www.pegtop.net/delphi/articles/blendmodes/. here's a summary so you don't have to navigate through all the links to collect em all.

multiply a * b
screen 1 - (1 - a) * (1 - b)
darken min(a, b)
lighten max(a, b)
difference abs(a - b)
negation 1 - abs(1 - a - b)
exclusion a + b - 2 * a * b
overlay a < .5 ? (2 * a * b) : (1 - 2 * (1 - a) * (1 - b))
hard light b < .5 ? (2 * a * b) : (1 - 2 * (1 - a) * (1 - b))
soft light b < .5 ? (2 * a * b + a * a * (1 - 2 * b)) : (sqrt(a) * (2 * b - 1) + (2 * a) * (1 - b))
dodge a / (1 - b)
burn 1 - (1 - a) / b

some modes use different formulas for light and dark colors and while this seems to work
pretty nicely in photoshop it can look ugly when things are moving around.
what i've found works well is to just compute both formulas and smoothly blend between them.

transparency

sorting alpha blended objects back to front gets transparency something like 95% correct
in games. that last 5% is a real pain though and happens when you have
objects with bounds that overlap so that no matter what order you draw them in
you're going to get errors. sorting the triangles for a transparent object
isn't difficult, but sorting the triangles between objects when those objects
have different materials and the two sets of triangles interpenetrate each other
is awful and doesn't map efficiently to current graphics APIs and hardware.

a couple years back the nice folks at nVidia came up with a technique called depth peeling
in an attempt to solve this. it uses an extra depth buffer and allows you to pull
off the next nearest set of pixels from the scene with each rendering pass. in this way you can peel off many depth layers into separate color buffers
and then as a final step blend all the layers back together in the proper order. it's very expensive though since you need an extra color buffer and render pass
for each layer of transparency in addition to the extra depth buffer.

there are other solutions that researchers have proposed like the A-buffer, F-Buffer, R-Buffer, etc that require only a single rendering pass. most of these approaches focus on temporarily storing all the alpha
blended fragments (except the ones behind the nearest opaque fragment) on the graphics card and then
after everything has been rendered running through all the fragments for each pixel
to properly composite them. this has some similarities with current MSAA implementations but also requires
the extra storage of the fragment depth values and much more complexity in
resolving the final pixel colors. although it requires extra
storage for the depth values, compression techniques like those used with MSAA could
also be used here to reduce memory bandwidth during resolve. for example most pixels will likely have only
one or two fragments so only those need to be touched whereas with depth peeling
you wind up touching every pixel of each color buffer regardless of the actual depth complexity of the scene.

so a pick-your-favorite-letter-Buffer sounds great but what happens when you have very high levels of
depth complexity? if you depend completely on this system to get proper sorting you'll
need a very large number of fragments per pixel. having all this extra
memory seems excessive when you remember that for typical game scenes just sorting
whole objects back to front already gets you so close to the correct result. i think
this is something that's missing in the research and think a good solution would be
a combination of the techniques. you need the hardware support to get those first couple
layers of transparency blended correctly, but after that blending the fragments in
the order they're drawn will look just fine. so instead of stressing on fancy ways
to cope with cases where dozens of fragments are needed per pixel i think just having
the nearest two fragments sorted properly and all other fragments blended in the order
they render will work out great for games and for CAD stuff you could optionally allocate room for many more fragments or just fall back to
depth peeling.

so here's my proposed algo:

  • hardware buffer has slots for let's say 3 color and depth samples per pixel.
    2 color and depth samples are used for the nearest 2 fragments and 1 for the
    combination of all fragments behind the nearest 2.
  • app should render all opaque objects sorted by material, then all alpha blended objects
    sorted back to front
    • any opaque fragment that passes depth test resets the slots for the 2 nearest samples and stores itself in the final slot.
    • any alpha blended fragment compares it's depth against the nearest 2.
      if behind both it immediately blends with the final color. otherwise
      it is inserted in the proper order and the second slot is blended
      into the final color.

back in the states

i'm back from spain and euskal 14!

this was my first trip to europe and i expected the travel to kill me but it turned out to be cake.  i passed the flight time there with untold legends, family guy, and gta 3 on the psp.  the only hitch was at the paris airport which didn't display the connection info for my flight getting me quite lost.  it wasn't so bad though because i got to talk to many cute french girls to find my way.  :)

the demo trace, neurokin, and i worked on came out quite nice.  it was difficult because the week before the party trace was at his parent's place with no internet connection then i was at my hotel and it took me a few days before i had access to the internet.  so we finally spent a lot of time together at the party place with little sleep trying to finish it up.  after the deadline and display of the productions on the big screens it was nice to relax and spend time with some sceners there.  jeenio was hilarious singing with ps and playing music on his guitar.  their renditions of famous songs from demos cracked me up.  i also loved a song sung countless times at the party "amiga for you, amiga for you, amiga forever, amiga for you" (sung to the tune of happy birthday).   
at one point that night XPLSV was written out on the ground with some lighter fluid and set on fire prompting the authorities to stop by with their opinion on the realtime effect.  :)

the final day was the award ceremony which had many funny antics and a rather amusing display of disinterest from the gamers and those there apparently just to download things.  it was funny when the results for the open demo competition were tabulated with the stravaganza vote counter and, because only the group names were displayed, two histogram bars for XPLSV duked it out for first place (a demo from shine + wizard and one from trace + neurokin + me). the first place was awarded to our demo tokyo, second to shine and wizard's wonderful envolvente and third to merlucin, amb, and madgoblin's die anderung 2.

i was hoping to do a little sight seeing afterwards and check out the guggenheim museum but after many days of little sleep i just crashed and slept until my flight home.  on the way back i ran into more trouble with the paris airport - getting lost again, having my connection delayed so long i almost missed next flight back to usa, and ... they lost my luggage!! those wacky french did eventually find my bag but i'm not getting it back for a couple days still.  :(

all in all it was an awesome trip and so great to finally meet trace and sole and all the other sceners at the party.  i'm certainly going to miss having hotel staff clean my room each day, money with holograms, free coca cola burn, and having people around me that actually know what in the world demos are.

okay you can download and watch the party version of tokyo from pouet and expect a final version soon!

euskal 14

i think i've now got everything set for my trip to spain and the euskal 14 demoparty! plane tickets, hotel, passport, and party reservation.  now what's left?  hmmm... a demo!