idr's blog - archiveblogtesthttp://www.paranormal-entertainment.com/idr/blog/archive/blogtestikiwiki2017-02-21T18:52:00ZUltima IV: Quest of 30 Yearshttp://www.paranormal-entertainment.com/idr/blog/posts/2017-02-18T18:25:35Z-Ultima_IV:_Quest_of_30_Years/2017-02-21T18:52:00Z2017-02-18T18:25:35Z
<p>During the summer of 1986, I spent a lot of time at the public library in
Salem, Oregon. I was between 6<sup>th</sup> and 7<sup>th</sup> grade, and I
was spending the summer at my mom's. Since my mom and step dad worked all
day and had long commutes, I was bored... for hours. The library had two
things that drew a young proto-geek: all of the AD&D books and a computer
lab.</p>
<p><img src="http://www.paranormal-entertainment.com/idr/blog/images/salem-public-library.jpg" width="400" height="297" /></p>
<p>The computer lab was quite amazing, and it was years ahead of its time.
Anyone with a library card could reserve an hour on any of the computers in
the lab. There was an Apple IIe, and Apple IIc, an original Apple
Macintosh, an IBM PC XT 5160, an IBM PCjr, and some sort of weird "luggable"
computer with a tiny amber screen.</p>
<p>I spent a lot of time in that lab. I remember spending hours on using
MacPaint creating AD&D character sheets for each kind of character class.
When I got tired of "working," I spent a bit of time playing some kind of
graphical Rogue clone. I mostly stayed away from the IBM computers because
they seemed boring. I did try to play Flight Simulator on the PCjr, but
there was no way to turn the sound off, and that almost got me banned from
the lab.</p>
<p>Most of my time, however, was spent on the Apple II. This was also the
summer that I discovered software piracy. I had a box of Elephant 5¼"
floppy discs (an elephant never forgets!) full of l337 warez. I spent hours
playing <a href="https://www.youtube.com/watch?v=0GTkRXKPXq4">Conan</a>, <a href="https://www.youtube.com/watch?v=lLlDTLd_me4">Hard Hat
Mack</a>, <a href="https://www.youtube.com/watch?v=jV_iYmk1Sn4">Mario
Bros</a>, and
<a href="https://www.youtube.com/watch?v=Ry8rJPXdw-Y">Bolo</a> (a game sorely in need
of a remake). There was one game that stood out above all the rest: Ultima
IV.</p>
<p>My parents made sure, from a very young age, that I could read and do
arithmetic. I was near the top of my class in both. They did not, however,
educate me on logic puzzles or quests. For shame! As a result, I struggled
with Ultima. There were so many things to find, so many people to
interrogate, and so many dungeons to explore. And you had to behave with
virtue (this was also the summer that I discovered Slayer and Metallica). I
did not finish that game that summer. In fact, I didn't even come close. I
don't think I collected any of the items necessary to finish the game, and I
only became four parts Avatar.</p>
<p>In 1987 I lined up at the store to get <a href="https://www.youtube.com/watch?v=aY4jsHZf3Yk">Ultima
Exodus</a> for the NES. My dad
and I played that game over, and over, and over. I really enjoyed that
game. I really enjoyed the simplifications over the computer version of
Ultima IV. Talking to people was so much less tedious! Still, Avatarhood
beckoned. By that point, my education in logic puzzles and quests was fully
underway. It also helped that by that time I had leared to draw maps of
dungeons. I believe that this is a skill much like making wagon wheels. It
was really important for a while, but now it's nearly useless.</p>
<p>I didn't get access to a computer again until around the middle of the
8<sup>th</sup> grade. One of the teachers at my middle school started an
after school computer club. Mr Paisley was a math teacher and a Mac geek to
the core. He had a Mac SE in his class, and it had a device that went on an
overhead projector to project the screen. Even the other math teachers
thought that was geeky. As a Mac geek and a teacher, he had all the classic
Mac thinking games: Shadowgate, Uninvited, and others. I played a bit of
Ultima at computer club, but the Mac games, which we played mostly as a
group, were too much of a distraction. I didn't have much computer access
after that until my sophomore year of high school.</p>
<p>For whatever reason, when <a href="https://www.youtube.com/watch?v=KzN0kpQk-DU">Ultima: Quest of the
Avatar</a> came out for the NES in
1990, I didn't play it. My dad and I bought it, and he played it quite a
lot. I remember him getting really annoyed whenever I'd drop a spoiler
based on my vague recollections. I honestly don't remember why I didn't
play that game.</p>
<p>In high school I bought my first computer: an Amiga 500. I never got Ultima
for the Amiga. My training continued with <a href="https://www.youtube.com/watch?v=dmpgxhuOwPc">Black
Crypt</a>, <a href="https://www.youtube.com/watch?v=-VSVaJOemEU">Dungeon
Master</a>, and <a href="http://amr.abime.net/review_71">Eye of the
Beholder</a>. Most of my time on the Amiga was
dedicated to solving the mysteries of <a href="https://www.youtube.com/watch?v=8TQStfUfJqY">sine
scrollers</a>,
<a href="https://www.youtube.com/watch?v=xIhcTDWI4ro">shadebobs</a>, and
<a href="https://www.youtube.com/watch?v=Mp7zbub9MQ0">glenzvectors</a>. That is a tale
for another day. I still have EoB, but the others seem to have gone missing
over the years.</p>
<p>Years later I converted over to PCs. One day at Fry's Electronics, I came
across a pack of CDs of 1,000 games or something. One of the discs
contained Ultima I through VI (I think). It was only like $10, so I bought
it, and I resumed my quest. College, software projects, this new thing
called Linux, and life prevented me from spending significant blocks of time
questing. I recall several times restarting because, after a multi-month
hiatus, I could not remember where I was or what I was doing. Eventually the
quest was abandoned.</p>
<p>Last year while I was traveling in Europe, I bought a copy of <a href="https://www.youtube.com/watch?v=CQj3AQG0Egw">Ultima IV for
the Sega Master System</a>at
<a href="http://www.gameover.nl/">Game Over?</a> in Amsterdam (a very nice retro game
shop!). The seed was planted in the back of my mind to resume the quest. I
finally decided to pick it up. Over the summer I found complete, in the box
copies of <a href="https://www.youtube.com/watch?v=VdjeXf50DRY">Ultima I</a> and <a href="https://www.youtube.com/watch?v=tasH0NFL0To">Ultima
II</a> for Atari 8-bit at a garage
sale. Given the amount these <a href="http://www.ebay.com/itm/1982-ATARI-ULTIMA-II-2-REVENGE-OF-THE-ENCHANTRESS-48K-400-800-SIERRA-ON-LINE-/201771716990?hash=item2efa88117e%3Ag%3AnxIAAOSwEzxYQ6Wk&nma=true&si=E9jyO182yLUBv%252FDsTj8byFvOvOk%253D&orig_cvip=true&rt=nc&_trksid=p2047675.l2557">go for on
eBay</a>,
I've been afraid to put the disks in a system to test.</p>
<p>Instead of playing the SMS version, I <a href="https://www.gog.com/game/ultima_4">downloaded it from
GoG</a> and played using DOSbox. After
about 30 hours of play, I have finally completed a quest over 30 years in
the making. It was very, very irritating. Seriously.</p>
<p><img src="http://www.paranormal-entertainment.com/idr/blog/images/ultima-iv/ultima-iv-ending.jpg" width="320" height="200" /></p>
<p>That game was amazing and groundbreaking, but many aspects of its design
have been improved in the intervening 30+ years. Four aspects stand out in
my mind.</p>
<ol>
<li><p>Dialog. The dialog in the game is entirely free form. Each NPC has a
set of key words that will trigger a response (tip: only the first four
characters are checked, so save yourself some typing). After typing
<code>NAME</code>, <code>JOB</code>, <code>MANT</code>, <code>RUNE</code>, <code>SHRI</code>, <code>STON</code>, <code>QUES</code>, <code>MAGI</code>, ... at 100
people, it gets pretty tedious. Doing your taxes kind of tedious. I
feel like games have gone a bit too far the other way in modern times.
People just spill their guts as soon as you talk to them. I'm not sure
what the middle ground would be.</p></li>
<li><p>Combat. Once you have all eight characters, combat is just a chore. You
can't walk through your own characters, even when they're magically
asleep, and many of the rooms have twisty, narrow hallways. Add to that
rooms full of monsters that cast sleep spells, and you'll want to punch
yourself in the face. Have fun on levels 5, 6, and 8 of the Stygian
Abyss.</p>
<p><img src="http://www.paranormal-entertainment.com/idr/blog/images/ultima-iv/level-5-sleepy-room.png" width="320" height="200" /></p>
<p>All nine of those Reapers love to cast sleep on the whole party, and the
Gazers can put a single character to sleep. On multiple occasions, my
entire party was asleep for over a minute. When one of the lazy bums
did wake up, it was usually a guy in the back that could neither attck
nor cast the "awake" spell on another character.</p></li>
<li><p>Secrets. There are many rooms, especially in the Stygian Abyss, that
have secret "trigger plates" in the floors. There is no way to know
where these are. You just have to step on every tile and watch for
something to change in the room. This includes tiles covered with lava.
Have fun navigating all of this with eight characters. If one
accidentally exits through the wrong exit, everyone has to go out and try
the room again.</p></li>
<li><p>Magic. This almost didn't make the list, but one aspect really annoys
me. Ultima uses a fairly standard system of magic points. It also uses
a system where spells require mixtures made of ingredients that must be
bought or found. In many ways this is a feature. Talking to people to
learn new spell mixtures was fun. The problem is that you can't mix
reagents while in combat or combat rooms of dungeons. This includes
rooms that are cleared of enemies and rooms that never had enemies. In
the Stygian Abyss, there are several long, connected sequences of rooms.
Several rooms require use of the "dispel" spell to pass. If you run out
of mixtures, you have to go all the way back. This includes having to
pass one of the annoying maze rooms with creatures that put your party to
sleep.</p></li>
</ol>
<p>I enjoyed the game right up until the Stygian Abyss. The game crossed over
from fun to pure frustration. The lower levels are filled with rooms that
only allow a single character at a time to advance into a position to
attack the enemies, and those rooms are invariably filled with enemies that
cast sleep spells in the character in front. Once those rooms are cleared,
most have invisible floor triggers that must be activated. That is fine,
but many of them cause secret doors to appear. The secret doors are noted
by a single pixel dot in the brick pattern of the walls. On a low
resolution display of 1985, these were easy to pick out. In a 640x400
window on a 2560x1600 display, they're basically invisible. I don't blame
Richard Garriot for that one, but it still made things more frustrating.</p>
<p><img src="http://www.paranormal-entertainment.com/idr/blog/images/ultima-iv/secret-door.jpg" width="55" height="50" /></p>
<p>If I were to play the game again, and in all honesty I probably will, I
would do a few things differently.</p>
<ol>
<li><p>RTFM. The intro sequence tells you to read <a href="http://replacementdocs.com/download.php?view.953">The History of
Britania</a>, but I didn't
exactly download that from GOG. There are a lot of things that you don't
even know you need to do without the book. In the old days, bits were
expensive and paper was cheap. Now bits are basically free, and you
can't download paper over the Internet.</p>
<p><img src="http://www.paranormal-entertainment.com/idr/blog/images/ultima-iv/title_000.png" width="320" height="200" />
<img src="http://www.paranormal-entertainment.com/idr/blog/images/ultima-iv/title_001.png" width="320" height="200" /></p></li>
<li><p>I would probably play the Sega Master System version. I think that would
save some of the dialog tedium. The trade-off is that I think it would
make combat even more irritating. On computer versions, combat commands
are selected by different keys on the keyboard. On console versions,
combat commands are selected using a menu.</p>
<p>The NES version, apparently, removed a bunch of things. The graphics
also look a little too goofy for me to take seriously.</p></li>
<li><p>If I played again on the computer, I would use the <code>normal3x</code> scaling
mode in DOSbox. Always check the configuration options of your emulator
before you get too into things.</p></li>
<li><p>Wait until as late as possible to pick up the last few characters.
Juggling eight characters around in combat is not fun in any dungeon.
You can only have as many characters as the level of your main
character. This time around I got my main leveled up pretty quickly and
picked up all but the last companion. This has two advantages. First,
the core group of characters will be higher level during the final
dungeon. Second, a lot less time and irritation will be spent juggling a
large party in the earlier dungeons.</p>
<p>Geoffery and Katrina are especially useless. Neither can use magic.
Geoffery's strongest ranged weapon is the crossbow, and Katrina's is </p></li>
</ol>
<p>Now I have to go play Ultima V...</p>
FOSDEM2016 Presentationhttp://www.paranormal-entertainment.com/idr/blog/posts/2016-02-04T23:12:36Z-FOSDEM2016_Presentation/2016-02-04T23:21:51Z2016-02-04T23:12:36Z
<p>The
<a href="http://www.paranormal-entertainment.com/idr/blog/images/FOSDEM16/simulation-to-aid-software-development-with-notes.pdf">slides</a>
from my <a href="https://fosdem.org/2016/schedule/event/graphics_simulation/">FOSDEM
talk</a> are now
available.</p>
<p>The <a href="http://video.fosdem.org/2016/k3401/">video of the talk</a> will eventually
be available. It takes a lot of time and hard work to prepare all of the
videos. The notes in the slides are probably more coherent that I am in the
video. There were a few good questions at the end, so you may want to fast
forward to that.</p>
<p>I am planning to post the source for the partial Amiga simulator next week.
When I do, I will also have another blog post. Watch this space...</p>
Bisecting like a bosshttp://www.paranormal-entertainment.com/idr/blog/posts/2015-12-03T20:40:31Z-Bisecting_like_a_boss/2015-12-07T20:18:35Z2015-12-03T20:40:31Z
<p>In a <a href="http://paranormal-entertainment.com/~idr/blog/posts/2015-10-14T16:18:47Z-Good_bug_reports/">previous blog
post</a>
I said, "If you have encountered a regression and you are building a driver
from source, please provide the results of
<a href="https://git-scm.com/docs/git-bisect">git-bisect</a>." There is some feeling
that performing a bisect is hard, time consuming, or both. Back in the
bad-old-days, that was true... but <code>git bisect run</code> changed all that.</p>
<p>Most of performing a bisect is mechanical and repetitious:</p>
<ol>
<li>Build the project.</li>
<li>If the build fails, run <code>git bisect skip</code>.</li>
<li>Run the test.</li>
<li>Inspect the results.</li>
<li>Run <code>git bisect good</code> or <code>git bisect bad</code> depending on the test result.</li>
<li>While there are more steps to bisect, repeat from step 1.</li>
<li>Run <code>git bisect reset</code> to restore the tree to its original state.</li>
</ol>
<p>Some years ago, someone noticed that this seems like a task a computer could
do. At least as early as git 1.6.0 (around 2010), this has been possible with
using <code>git bisect run</code>. Once you get the hang of it, it's surprisingly easy
to use.</p>
<h2>A Word of Caution</h2>
<p>Before actually discussing automated bisects, I want to offer a word of
caution. Bisecting, automated or otherwise, is a process that still requires
the application of common sense. A critical step at the end of bisecting is
manually testing the guilty commit and the commit immediately before the
guilty commit. You should also look at the commit that <code>git-bisect</code> claims is
guilty. Over the years I have seen many bug reports for Mesa that either
point at commits that only change comments in the code or only change a driver
other than the driver on which the bug was observed.</p>
<p>I have observed these failures to have two causes, although other causes may
be possible. With a manual bisect, it is really easy to accidentally <code>git
bisect good</code> when you meant <code>git bisect bad</code>. I have done this by using
up-arrow to go back through the shell command history when I'm too lazy to
type the command again. It's really easy to get the wrong one doing that.</p>
<p id="wrong-failure">The other cause of failure I have observed occurs when
multiple problems occur between the known-good commit and the known-bad
commit. In this case the bisect will report a commit that was already know to
be bad and was already fixed. This false information can waste a lot of time
for the developer who is trying to fix the bug. They will spend time trying
to determine why the commit reported by the bisect still causes problems when
some other commit is the actual cause. The remedy is proper application of
common sense while performing the bisect. It's often not enough to just see
that the test case fails. The mode of the failure must also be
considered.</p>
<h2>Automated Bisect Basics</h2>
<p>All of the magic in an automated bisect revolves around a single script that
you supply. This script analyzes the commit and tells bisect what to do
next. There are four things that the script can tell bisect, and each of them
is communicated using the script's return code.</p>
<ol>
<li><p>Skip this commit because it cannot be analyzed. This is identical to
manually running <code>git bisect skip</code>.This can be used, for example, if the
commit does not build. A script might contain something like:</p>
<pre><code>if ! make ; then
exit 125
fi
</code></pre>
<p>As you might infer from the code example, a return code of 125 instructs
bisect to skip the commit. </p></li>
<li><p>Accept this commit as good. This is identical to <code>git bisect good</code>. A
return code of 0 instructs bisect to accept the commit as good.</p></li>
<li><p>Reject this commit as bad. This is identical to <code>git bisect bad</code>. All
tests in the <a href="http://piglit.freedesktop.org/">piglit</a> test suite print a
string in a specific format when a test passes or fails. This can be used
by the script to generate the exit code. For example:</p>
<pre><code>bin/arb_clear_buffer_object-null-data -auto > /tmp/result.$$
if grep -q 'PIGLIT: {"result": "pass" }' /tmp/result.$$; then
rm /tmp/result.$$
exit 0
else
cat /tmp/result.$$
rm /tmp/result.$$
exit 1
fi
</code></pre>
<p>In this bit of script, the output of the test is printed in the "bad" case.
This can be very useful. Bisects of long ranges of commits may encounter
failures unrelated to the failure you are trying to bisect. Seeing the
output from the test may alert you to failures with unrelated causes.</p>
<p>Looking for simple "pass" or "fail" output from the test may not be good
enough. It may be better to look for specific failure messages from the
test. As <a href="http://www.paranormal-entertainment.com/idr/blog/archive/#wrong-failure">mentioned above</a>, it is important to only report
a commit as bad if it the test fails due to the problem you are trying to
bisect.</p>
<p>Imagine a case where a failure in the <code>arb_clear_buffer_object-null-data</code>
on the master branch is being bisected. The particular failure is an
incorrect error being generated, and the known-good commit is <code>HEAD~200</code>
when the last stable release occurred (on a different branch with a common
root). However, <code>HEAD~110..HEAD~90</code> contain an unrelated rendering error
that was fixed in <code>HEAD~89</code>. Since <code>git-bisect</code> performs a <a href="https://en.wikipedia.org/wiki/Binary_search_algorithm">binary
search</a>, it will
test <code>HEAD~100</code> first and see the wrong failure. Simply looking for test
failure would incorrectly identify <code>HEAD~110</code> as the problem commit. If
the script instead checked for the specific incorrect error message, the
correct guilty commit is more likely to be found.</p>
<p>A return code with any value of 1 through 127, excluding 125, instructs
bisect to reject the commit as bad.</p></li>
<li><p id="return255">Stop at this commit and wait for human interaction. This
can be used when something really catastrophic happens that requires human
attention. Imagine a scenario where the bisect is being performed on one
system but tests are run on another. This could be used if the bisect
system is unable to communicate wit the test system. A return code with
any value of 128 through 255 will halt the bisect.</p></li>
</ol>
<p>All of this can be used to generate a variety of scripts for any sort of
complex environment. To quote Alan Kay, "<a href="https://en.wikiquote.org/wiki/Alan_Kay">Simple things should be simple,
complex things should be possible.</a>"
For a simple make-based project and an appropriately written test case, an
automated bisect script could be as simple as:</p>
<pre><code> #!/bin/bash
if ! make ; then
exit 125
fi
# Use the return code from the test case
exec test_case
</code></pre>
<p>Since this is just a script that builds the project and runs a test, you can
easily test the script. Testing the script is a very good idea if you plan to
leave the computer when the bisect starts. It would be shame to leave the
computer for several hours only to find it stuck at the first commit due to a
problem in the automated bisect script. Assuming the script is called
<code>auto_bisect.sh</code>, testing the script can be as easy as:</p>
<pre><code> $ ./auto_bisect.sh ; echo $?
</code></pre>
<p>Now all of the human interaction for the entire bisect would be three commands:</p>
<pre><code> $ git bisect start bad-commit good-commit
$ git bisect run auto_bisect.sh
$ git bisect reset
</code></pre>
<p>If there are a lot commits in <code>good-commit..bad-commit</code>, building the project
takes a long time, or running the tests takes a long time, feel free to <a href="https://xkcd.com/303/">go
have a sandwich while you wait</a>. <a href="http://dilbert.com/strip/1997-11-16">Or play
Quake</a>. Or do other work.</p>
<h2>Broken Builds</h2>
<p>The bane of most software developer's existence is a broken build. Few things
are more irritating. With GIT, it is possible to have transient build
failures that nobody notices. It's not unheard of for a 20 patch series to
break at patch 9 and fix at patch 11. This commonly occurs either when people
move patches around in a series during development or when reviewers suggest
splitting large patches into smaller patches. In either case patch 9 could
add a call to a function that isn't added until patch 11, for example. If
nobody builds at patch 9 the break goes unnoticed.</p>
<p>The break goes unnoticed until a bisect hits exactly patch 9. If the problem
being bisected and the build break are unrelated (and the build break is short
lived), the normal skip process is sufficient. The range of commits that
don't build will skip. Assuming the commit before the range of commits that
don't build and the commit after the range of commits that don't build are
both good or bad, the guilty commit will be found.</p>
<p>Sometimes things are not quite so rosy. You are bisecting because there was a
problem, after all. Why have just one problem when you can have a whole mess
of them? I believe that the glass is either empty or overflowing with
steaming hot fail. The failing case might look something like:</p>
<pre><code> $ git bisect start HEAD HEAD~20
Bisecting: 9 revisions left to test after this (roughly 3 steps)
[2d712d35c57900fc0aa0f1455381de48cdda0073] gallium/radeon: move printing texture info into a separate function
$ git bisect run ./auto_bisect.sh
running ./auto_bisect.sh
auto_bisect.sh says skip
Bisecting: 9 revisions left to test after this (roughly 3 steps)
[622186fbdf47e4c77aadba3e38567636ecbcccf5] mesa: errors: validate the length of null terminated string
running ./auto_bisect.sh
auto_bisect.sh says good
Bisecting: 8 revisions left to test after this (roughly 3 steps)
[19eaceb6edc6cd3a9ae878c89f9deb79afae4dd6] gallium/radeon: print more information about textures
running ./auto_bisect.sh
auto_bisect.sh says skip
Bisecting: 8 revisions left to test after this (roughly 3 steps)
[5294debfa4910e4259112ce3c6d5a8c1cd346ae9] automake: Fix typo in MSVC2008 compat flags.
running ./auto_bisect.sh
auto_bisect.sh says good
Bisecting: 6 revisions left to test after this (roughly 3 steps)
[1cca259d9942e2f453c65e8d7f9f79fe9dc5f0a7] gallium/radeon: print more info about CMASK
running ./auto_bisect.sh
auto_bisect.sh says skip
Bisecting: 6 revisions left to test after this (roughly 3 steps)
[c60d49161e3496b9e64b99ecbbc7ec9a02b15a17] gallium/radeon: remove unused r600_texture::pitch_override
running ./auto_bisect.sh
auto_bisect.sh says skip
Bisecting: 6 revisions left to test after this (roughly 3 steps)
[84fbb0aff98d6e90e4759bbe701c9484e569c869] gallium/radeon: rename fmask::pitch -> pitch_in_pixels
running ./auto_bisect.sh
auto_bisect.sh says skip
Bisecting: 6 revisions left to test after this (roughly 3 steps)
[bfc14796b077444011c81f544ceec5d8592c5c77] radeonsi: fix occlusion queries on Fiji
running ./auto_bisect.sh
auto_bisect.sh says bad
Bisecting: 5 revisions left to test after this (roughly 3 steps)
[a0bfb2798d243a4685d6ea32e9a7091fcec74700] gallium/radeon: print more info about HTILE
running ./auto_bisect.sh
auto_bisect.sh says skip
Bisecting: 5 revisions left to test after this (roughly 3 steps)
[75d64698f0b0c906d611e69d9f8b118c35026efa] gallium/radeon: remove DBG_TEXMIP
running ./auto_bisect.sh
auto_bisect.sh says skip
Bisecting: 5 revisions left to test after this (roughly 3 steps)
[3a6de8c86ee8a0a6d2f2fbc8cf2c461af0b9a007] radeonsi: print framebuffer info into ddebug logs
running ./auto_bisect.sh
auto_bisect.sh says bad
Bisecting: 3 revisions left to test after this (roughly 2 steps)
[a5055e2f86e698a35da850378cd2eaa128df978a] gallium/aux/util: Trivial, we already have format use it
running ./auto_bisect.sh
auto_bisect.sh says skip
There are only 'skip'ped commits left to test.
The first bad commit could be any of:
19eaceb6edc6cd3a9ae878c89f9deb79afae4dd6
2d712d35c57900fc0aa0f1455381de48cdda0073
84fbb0aff98d6e90e4759bbe701c9484e569c869
c60d49161e3496b9e64b99ecbbc7ec9a02b15a17
1cca259d9942e2f453c65e8d7f9f79fe9dc5f0a7
75d64698f0b0c906d611e69d9f8b118c35026efa
a0bfb2798d243a4685d6ea32e9a7091fcec74700
a5055e2f86e698a35da850378cd2eaa128df978a
3a6de8c86ee8a0a6d2f2fbc8cf2c461af0b9a007
We cannot bisect more!
bisect run cannot continue any more
</code></pre>
<p>In even more extreme cases, the range of breaks can be even longer. Six or
seven is about the most that I have personally experienced.</p>
<p>The problem doesn't have to be a broken build. It could be anything that
prevents the test case from running. On Mesa I have experienced problems
where a bug that prevents one driver from being able to load or create an
OpenGL context persists for a few commits. Anything that prevents the test
from running (e.g., not produce a pass or fail result) or causes additional,
unrelated failures should be skipped.</p>
<p>Usually the problem is something really trivial. If the problem was fixed, a
patch for the problem may even already exist. Let's assume a patch exists in
a file named <code>fix-the-build.patch</code>. We also know that the build broke at
commit <code>75d6469</code>, and it was fixed at commit <code>3a6de8c</code>. This means that the
range <code>75d6469^..3a6de8c^</code> need the patch applied. If you're not convinced
that the <code>^</code> is necessary, observe the log output:</p>
<pre><code> $ git log --oneline 75d6469^..3a6de8c^
a0bfb27 gallium/radeon: print more info about HTILE
1cca259 gallium/radeon: print more info about CMASK
84fbb0a gallium/radeon: rename fmask::pitch -> pitch_in_pixels
19eaceb gallium/radeon: print more information about textures
2d712d3 gallium/radeon: move printing texture info into a separate function
c60d491 gallium/radeon: remove unused r600_texture::pitch_override
75d6469 gallium/radeon: remove DBG_TEXMIP
</code></pre>
<p>Notice that the bottom commit in the list is the commit where the break is
first experienced, and the top commit in the list is <em>not</em> the one where the
break is fixed.</p>
<p>Using this information is simple. The bisect script need only determine the
current commit is in the list of commits that need the patch and conditionally
apply the patch.</p>
<pre><code> # Get the short-from SHA of the current commit
SHA=$(git log --oneline HEAD^.. | cut -f1 -d' ')
# If the current commit is in the list of commits that need the patch
# applied, do it. If applying the patch fails, even partially, abort.
if grep --silent "^$SHA " <(git log --oneline 75d6469^..3a6de8c^)
# ^^ ^
# This bit runs git-log, redirects the output
# to a temporary file, then uses that temporary
# file as the input to grep. Non-bash shells
# will probably need to do all that manually.
if ! patch -p1 --forward --silent < fix-the-build.patch ; then
exit 255
fi
fi
</code></pre>
<p>Before exiting, the script must return the tree to its original state. If it
does not, applying the next commit may fail or applying the patch on the next
step will certainly fail. <a href="https://git-scm.com/docs/git-reset"><code>git-reset</code></a>
can do most of the work. It just has to be applied everywhere this script
might exit. I generally do this using a wrapper function. The simple bisect
script from before might look like:</p>
<pre><code> #!/bin/bash
function report()
{
git reset --hard HEAD
exit $1
}
# Get the short-from SHA of the current commit
SHA=$(git log --oneline HEAD^.. | cut -f1 -d' ')
# If the current commit is in the list of commits that need the patch
# applied, do it. If applying the patch fails, even partially, abort.
if grep --silent "^$SHA " <(git log --oneline 75d6469^..3a6de8c^)
if ! patch -p1 --forward --silent < fix-the-build.patch ; then
# Just exit here... so that we can see what went wrong
exit 255
fi
fi
if ! make ; then
report 125
fi
# Use the return code from the test case
test_case
report $?
</code></pre>
<p>This can be extended to any number of patches to fix any number of problems.</p>
<p>There is one other tip here. If the first bisect attempt produced
inconclusive results due to skipped commits, it may not have been wasted
effort. Referring back to the previous output, there were two good commits
found. These commits can be given to the next invocation of <code>git bisect
start</code>. This helps reduce the search space from 9 to 6 in this case.</p>
<pre><code> $ git bisect start HEAD HEAD~20 622186fbdf47e4c77aadba3e38567636ecbcccf5 5294debfa4910e4259112ce3c6d5a8c1cd346ae9
Bisecting: 6 revisions left to test after this (roughly 3 steps)
[1cca259d9942e2f453c65e8d7f9f79fe9dc5f0a7] gallium/radeon: print more info about CMASK
</code></pre>
<p>Using the last bad commit can reduce the search even further.</p>
<pre><code> $ git bisect start 3a6de8c86ee8a0a6d2f2fbc8cf2c461af0b9a007 HEAD~20 622186fbdf47e4c77aadba3e38567636ecbcccf5 5294debfa4910e4259112ce3c6d5a8c1cd346ae9
Bisecting: 4 revisions left to test after this (roughly 2 steps)
[2d712d35c57900fc0aa0f1455381de48cdda0073] gallium/radeon: move printing texture info into a separate function
</code></pre>
<p>Note that <code>git-bisect</code> does not emit "good" or "bad" information. You have to
author your bisect script to emit that information. The <code>report</code> function is
a good place to do this.</p>
<pre><code> function report()
{
if [ $1 -eq 0 ]; then
echo " auto_bisect.sh says good"
elif [ $1 -eq 125 ]; then
echo " auto_bisect.sh says skip"
else
echo " auto_bisect.sh says bad"
fi
git reset --hard HEAD
exit $1
}
</code></pre>
<h2>Remote Test Systems</h2>
<p>Running tests on remote systems pose additional challenges. At the very least,
there are three additional steps: get the built project on the remote system,
start test on the remote system, and retrieve the result.</p>
<p>For these extra steps, <a href="https://en.wikipedia.org/wiki/Rsync"><code>rsync</code></a> and
<a href="https://en.wikipedia.org/wiki/Secure_Shell"><code>ssh</code></a> are powerful tools. There
are numerous blog posts and tutorials dedicated to using <code>rsync</code> and <code>ssh</code> in
various environments, and duplicating that effort is well beyond the scope of
this post. However, there is one couple nice feature relative to automated
bisects that is worth mentioning.</p>
<p><a href="http://www.paranormal-entertainment.com/idr/blog/archive/#return255">Recall</a> that returning 255 from the script will cause the bisect
to halt waiting for human intervention. It just so happens that <code>ssh</code> returns
255 when an error occurs. Otherwise it returns the result of the remote
command. To make use of this, split the work across two scripts instead of
putting all of the test in a single <code>auto_bisect.sh</code> script. A new
<code>local_bisect.sh</code> contains all of the commands that run on the build / bisect
system, and <code>remote_bisect.sh</code> contains all of the commands that run on the
testing system.</p>
<p><code>remote_bisect.sh</code> should (only) execute the test and exit with the same sort
of return code as <code>auto_bisect.sh</code> would. <code>local_bisect.sh</code> should build the
project, copy the build to the testing system, and start the test on the
testing system. The return code from <code>remote_bisect.sh</code> should be directly
returned from <code>local_bisect.sh</code>. A simple <code>local_bisect.sh</code> doesn't look too
different from <code>auto_bisect.sh</code>:</p>
<pre><code> #!/bin/bash
if ! make ; then
exit 125
fi
if ! rsync build_results tester@test.system.com:build_results/; then
exit 255
fi
# Use the return code from the test case
exec ssh tester@test.system.com /path/to/test/remote_bisect.sh
</code></pre>
<p>Since <code>remote_bisect.sh</code> returns "normal" automated bisect return codes and
<code>ssh</code> returns 255 on non-test failures, everything is taken care of.</p>
<h2>Interactive Test Cases</h2>
<p>Automated bisecting doesn't work out too well when the test itself cannot be
automated. There is still some benefit to be had from automating the process.
Optionally applying patches, building the project, sending files to remote
systems, and starting the test can all still be automated, and I think
"automated" applies only very loosely. When the test is done, the script
should exit with a <a href="http://www.paranormal-entertainment.com/idr/blog/archive/#return255">return code of 255</a>. This will halt the
bisect. Run <code>git bisect good</code> or <code>git bisect bad</code>. Then, run <code>git bisect run
./auto_bisect.sh</code> again.</p>
<p>It's tempting to just run <code>auto_bisect.sh</code> by hand and skip <code>git bisect run</code>.
The small advantage to the later is that skipping build failures will still be
automated.</p>
<p>Going further requires making an interactive test case be non-interactive.
For developers of OpenGL drivers, it is common to need to <a href="https://bugs.freedesktop.org/show_bug.cgi?id=91656">bisect rendering
errors in games</a>. This
can be really, really painful and tedious. Most of the pain comes from the
task not being automatable. Just loading the game and getting to the place
where the error occurs can often take several minutes. These bugs are often
reported by end-users who last tested with the previous release. From the
11.0 branch point to the 11.1 branch point on Mesa there were 2,308 commits.</p>
<pre><code> $ git bisect start 11.1-branchpoint 11.0-branchpoint
Bisecting: 1153 revisions left to test after this (roughly 10 steps)
[bf5f931aee35e8448a6560545d86deb35f0639b3] nir: make nir_instrs_equal() static
</code></pre>
<p>When you realized that bisect will be 10 steps with at least 10 to 15 minutes
per step, you may begin to feel your insides die. It's even worse if you
accidentally type <code>git bisect good</code> when you meant <code>git bisect bad</code> along the
way.</p>
<p>This is a common problem testing interactive applications. A variety of tools
exist to remove the interactivity from interactive applications.
<a href="https://apitrace.github.io/"><code>apitrace</code></a> is one such tool. Using <code>apitrace</code>,
the OpenGL commands from the application can be recorded. This step must be
done manually. The resulting trace can then be run at a known good commit,
and an image can be captured from the portion of the trace that would exhibit
the bug. This step must also be done manually, but the image capture is
performed by a command line option to the trace replay command. Now a script
can reply the trace, collect a new image, and compare the new image with the
old image. If the images match, the commit is good. Otherwise, the commit is
bad. This can be error prone, so it's a good idea to keep all the images from
the bisect. A human can then examine all the images after the bisect to make
sure the right choice were made at each commit tested.</p>
<p>A full <code>apitrace</code> tutorial is beyond the scope of this post. The <a href="https://github.com/apitrace/apitrace/blob/master/docs/USAGE.markdown#automated-git-bisection"><code>apitrace</code>
documentation</a>
has some additional information about using <code>apitrace</code> with automated bisects.</p>
<h2>What Now?</h2>
<p><code>git-bisect</code> is an amazingly powerful tool. Some of the more powerful aspects
of GIT get a <a href="https://xkcd.com/1597/">bad rap for being hard to use
correctly</a>: make one mistake, and you'll have to
re-clone your tree. With even the more powerful aspects of <code>git-bisect</code>, such
as automated bisects, it's actually hard to go wrong. There are two
absolutely critical final tips. First, remember that you're bisecting. If
you start performing other GIT commands in the middle of the bisect, both you
and your tree will get confused. Second, remember to reset your tree using
<code>git bisect reset</code> when you're done. Without this step, you'll still be
bisecting, so see the first tip. <code>git-bisect</code> and automated bisects really
make simple things simple and complex things possible.</p>
GL_EXT_shader_samples_identical sent into the wild!http://www.paranormal-entertainment.com/idr/blog/posts/2015-11-20T19:39:29Z-GL_EXT_shader_samples_identical_sent_into_the_wild/2015-11-24T16:00:14Z2015-11-20T19:39:29Z
<p>Yesterday I pushed an implementation of a new OpenGL extension
<a href="http://cgit.freedesktop.org/mesa/mesa/tree/docs/specs/EXT_shader_samples_identical.txt"><code>GL_EXT_shader_samples_identical</code></a>
to Mesa. This extension will be in the Mesa 11.1 release in <a href="http://lists.freedesktop.org/archives/mesa-dev/2015-November/099530.html">a few
short
weeks</a>,
and it will be enabled on various Intel platforms:</p>
<ul>
<li><a href="https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units#Seventh_generation">GEN7</a>
(Ivy Bridge, Baytrail, Haswell): Only currently effective in the fragment
shader. More details below.</li>
<li><a href="https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units#Eighth_generation">GEN8</a>
(Broadwell, Cherry Trail, Braswell): Only currently effective in the
vertex shader and fragment shader. More details below.</li>
<li><a href="https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units#Ninth_generation">GEN9</a>
(Skylake): Only currently effective in the
vertex shader and fragment shader. More details below.</li>
</ul>
<p>The extension hasn't yet been published in the official OpenGL extension
registry, but I will take care of that before Mesa 11.1 is released.</p>
<h2>Background</h2>
<p><a href="https://en.wikipedia.org/wiki/Multisample_anti-aliasing">Multisample
anti-aliasing</a> (MSAA)
is a well known technique for reducing aliasing effects ("jaggies") in
rendered images. The core idea is that the expensive part of generating a
single pixel color happens once. The cheaper part of determining where that
color exists in the pixel happens multiple times. For 2x MSAA this happens
twice, for 4x MSAA this happens four times, etc. The computation cost is not
increased by much, but the storage and memory bandwidth costs are increased
linearly.</p>
<p>Some time ago, a clever person noticed that in areas where the whole pixel is
covered by the triangle, all of the samples have exactly the same value.
Furthermore, since most triangles are (much) bigger than a pixel, this is
really common. From there it is trivial to apply some sort of simple data
compression to the sample data, and all modern GPUs do this in some form. In
addition to the surface that stores the data, there is a multisample control
surface (MCS) that describes the compression.</p>
<p>On Intel GPUs, sample data is stored in <em>n</em> separate planes. For 4x MSAA,
there are four planes. The MCS has a small table for each pixel that maps a
sample to a plane. If the entry for sample 2 in the MCS is 0, then the data
for sample 2 is stored in plane 0. The GPU automatically uses this to reduce
bandwidth usage. When writing a pixel on the interior of a polygon (where all
the samples have the same value), the MCS gets all zeros written, and the
sample value is written only to plane 0.</p>
<p>This does add some complexity to the shader compiler. When a shader executes
the <a href="https://www.opengl.org/sdk/docs/man/html/texelFetch.xhtml"><code>texelFetch</code></a>
function, several things happen behind the scenes. First, an instruction is
issued to read the MCS. Then a second instruction is executed to read the
sample data. This second instruction uses the sample index and the result of
the MCS read as inputs.</p>
<p>A simple shader like</p>
<pre><code> #version 150
uniform sampler2DMS tex;
uniform int samplePos;
in vec2 coord;
out vec4 frag_color;
void main()
{
frag_color = texelFetch(tex, ivec2(coord), samplePos);
}
</code></pre>
<p>generates this assembly</p>
<pre><code> pln(16) g8<1>F g7<0,1,0>F g2<8,8,1>F { align1 1H compacted };
pln(16) g10<1>F g7.4<0,1,0>F g2<8,8,1>F { align1 1H compacted };
mov(16) g12<1>F g6<0,1,0>F { align1 1H compacted };
mov(16) g16<1>D g8<8,8,1>F { align1 1H compacted };
mov(16) g18<1>D g10<8,8,1>F { align1 1H compacted };
send(16) g2<1>UW g16<8,8,1>F
sampler ld_mcs SIMD16 Surface = 1 Sampler = 0 mlen 4 rlen 8 { align1 1H };
mov(16) g14<1>F g2<8,8,1>F { align1 1H compacted };
send(16) g120<1>UW g12<8,8,1>F
sampler ld2dms SIMD16 Surface = 1 Sampler = 0 mlen 8 rlen 8 { align1 1H };
sendc(16) null<1>UW g120<8,8,1>F
render RT write SIMD16 LastRT Surface = 0 mlen 8 rlen 0 { align1 1H EOT };
</code></pre>
<p>The <code>ld_mcs</code> instruction is the read from the MCS, and the <code>ld2dms</code> is the
read from the multisample surface using the MCS data. If a shader reads
multiple samples from the same location, the compiler will likely eliminate
all but one of the <code>ld_mcs</code> instructions.</p>
<p>Modern GPUs also have an additional optimization. When an application clears
a surface, some values are much more commonly used than others. Permutations
of 0s and 1s are, by far, the most common. Bandwidth usage can further be
reduced by taking advantage of this. With a single bit for each of red,
green, blue, and alpha, only four bits are necessary to describe a clear color
that contains only 0s and 1s. A special value could then be stored in the MCS
for each sample that uses the fast-clear color. A clear operation that uses a
fast-clear compatible color only has to modify the MCS.</p>
<p>All of this is well documented in the <a href="https://01.org/linuxgraphics/documentation/hardware-specification-prms">Programmer's Reference Manuals for
Intel GPUs</a>.</p>
<h2>There's More</h2>
<p>Information from the MCS can also help users of the multisample surface reduce
memory bandwidth usage. Imagine a simple, straight forward shader that
performs an MSAA resolve operation:</p>
<pre><code> #version 150
uniform sampler2DMS tex;
#define NUM_SAMPLES 4 // generate a different shader for each sample count
in vec2 coord;
out vec4 frag_color;
void main()
{
vec4 color = texelFetch(tex, ivec2(coord), 0);
for (int i = 1; i < NUM_SAMPLES; i++)
color += texelFetch(tex, ivec2(coord), i);
frag_color = color / float(NUM_SAMPLES);
}
</code></pre>
<p>The problem should be obvious. On most pixels all of the samples will have
the same color, but the shader still reads every sample. It's tempting to
think the compiler should be able to fix this. In a very simple cases like
this one, that may be possible, but such an optimization would be both
challenging to implement and, likely, very easy to fool.</p>
<p>A better approach is to just make the data available to the shader, and that
is where this extension comes in. A new function <code>textureSamplesIdenticalEXT</code>
is added that allows the shader to detect the common case where all the
samples have the same value. The new, optimized shader would be:</p>
<pre><code> #version 150
#extension GL_EXT_shader_samples_identical: enable
uniform sampler2DMS tex;
#define NUM_SAMPLES 4 // generate a different shader for each sample count
#if !defined GL_EXT_shader_samples_identical
#define textureSamplesIdenticalEXT(t, c) false
#endif
in vec2 coord;
out vec4 frag_color;
void main()
{
vec4 color = texelFetch(tex, ivec2(coord), 0);
if (! textureSamplesIdenticalEXT(tex, ivec2(coord)) {
for (int i = 1; i < NUM_SAMPLES; i++)
color += texelFetch(tex, ivec2(coord), i);
color /= float(NUM_SAMPLES);
}
frag_color = color;
}
</code></pre>
<p>The intention is that this function be implemented by simply examining the MCS
data. At least on Intel GPUs, if the MCS for a pixel is all 0s, then all the
samples are the same. Since <code>textureSamplesIdenticalEXT</code> can reuse the MCS
data read by the first <code>texelFetch</code> call, there are no extra reads from
memory. There is just a single compare and conditional branch. These added
instructions can be scheduled while waiting for the <code>ld2dms</code> instruction to
read from memory (slow), so they are practically free.</p>
<p>It is also tempting to use <code>textureSamplesIdenticalEXT</code> in conjunction with
<code>anyInvocationsARB</code> (from
<a href="https://www.opengl.org/registry/specs/ARB/shader_group_vote.txt"><code>GL_ARB_shader_group_vote</code></a>).
Such a shader might look like:</p>
<pre><code> #version 430
#extension GL_EXT_shader_samples_identical: require
#extension GL_ARB_shader_group_vote: require
uniform sampler2DMS tex;
#define NUM_SAMPLES 4 // generate a different shader for each sample count
in vec2 coord;
out vec4 frag_color;
void main()
{
vec4 color = texelFetch(tex, ivec2(coord), 0);
if (anyInvocationsARB(!textureSamplesIdenticalEXT(tex, ivec2(coord))) {
for (int i = 1; i < NUM_SAMPLES; i++)
color += texelFetch(tex, ivec2(coord), i);
color /= float(NUM_SAMPLES);
}
frag_color = color;
}
</code></pre>
<p>Whether or not using <code>anyInvocationsARB</code> improves performance is likely to be
dependent on both the shader and the underlying GPU hardware. Currently Mesa
<em>does not</em> support
<a href="https://www.opengl.org/registry/specs/ARB/shader_group_vote.txt"><code>GL_ARB_shader_group_vote</code></a>,
so I don't have any data one way or the other.</p>
<h2>Caveats</h2>
<p>The implementation of this extension that will ship with Mesa 11.1 has a three
main caveats. Each of these will likely be resolved to some extent in future
releases.</p>
<p>The extension is only effective on scalar shader units. This means on GEN7 it
is effective in fragment shaders. On GEN8 and GEN9 it is only effective in
vertex shaders and fragment shaders. It is supported in all shader stages,
but in non-scalar stages <code>textureSamplesIdenticalEXT</code> always returns <code>false</code>.
The implementation for the non-scalar stages is slightly different, and, on
GEN9, the exact set of instructions depends on the number of samples. I
didn't think it was likely that people would want to use this feature in a
vertex shader or geometry shader, so I just didn't finish the implementation.
This will almost certainly be resolved in Mesa 11.2.</p>
<p>The current implementation also returns a false negative for texels fully set
to the fast-clear color. There are two problems with the fast-clear color.
It uses a different value than the "all plane 0" case, and the size of the
value depends on the number of samples. For 2x MSAA, the MCS read returns
<code>0x000000ff</code>, but for 8x MSAA it returns <code>0xffffffff</code>.</p>
<p>The first problem means the compiler would needs to generate additional
instructions to check for "all plane 0" or "all fast-clear color." This could
hurt the performance of applications that either don't use a fast-clear color
or, more likely, that later draw non-clear data to the entire surface. The
second problem means the compiler would needs to do state-based recompiles
when the number of samples changes.</p>
<p>In the end, we decided that "all plane 0" was by far the most common case, so
we have ignored the "all fast-clear color" case for the time being. We are
still collecting data from applications, and we're working on several uses of
this functionality inside our driver. In future versions we may implement a
heuristic to determine whether or not to check for the fast-clear color case.</p>
<p>As mentioned above, Mesa does not currently support
<a href="https://www.opengl.org/registry/specs/ARB/shader_group_vote.txt"><code>GL_ARB_shader_group_vote</code></a>.
Applications that want to use <code>textureSamplesIdenticalEXT</code> on Mesa will
need paths that do not use <code>anyInvocationsARB</code> for at least the time being.</p>
<h2>Future</h2>
<p>As stated by issue #3, the extension still needs to gain SPIR-V support. This
extension would be just as useful in Vulkan and OpenCL as it is in OpenGL.</p>
<p>At some point there is likely to be a follow-on extension that provides more
MCS data to the shader in a more raw form. As stated in issue #2 and
previously in this post, there are a few problems with providing raw MCS data.
The biggest problem is how the data is returned. Each sample count needs a
different amount of data. Current 8x MSAA surfaces have 32-bits (returned)
per pixel. Current 16x MSAA MCS surfaces have 64-bits per pixel. Future 32x
MSAA, should that ever exist, would need 192 bits. Additionally, there would
need to be a set of new <code>texelFetch</code> functions that take both a sample index
and the MCS data. This, again, has problems with variable data size.</p>
<p>Applications would also want to query things about the MCS values. How many
times is plane 0 used? Which samples use plane 2? What is the highest plane
used? There could be other useful queries. I can imagine that a high
quality, high performance multisample resolve filter could want all of this
information. Since the data changes based on the sample count and could
change on future hardware, the future extension <em>really</em> should not directly
expose the encoding of the MCS data. How should it provide the data? I'm
expecting to write some demo applications and experiment with a bunch of
different things. Obviously, this is an open area of research.</p>
Good bug reportshttp://www.paranormal-entertainment.com/idr/blog/posts/2015-10-14T16:18:47Z-Good_bug_reports/2015-10-14T18:25:54Z2015-10-14T16:18:47Z
<p>In the old days, there were not a lot of users of open-source 3D graphics
drivers. Aside from a few ID Software games, tuxracer, and glxgears, there
were basically no applications. As a result, we got almost no bug reports.
It was a blessing and a curse.</p>
<p>Now days, thanks to Valve Software and Steam, there are more applications than
you can shake a stick at. As a result, we get a lot of bug reports. It is a
blessing and a curse.</p>
<p>There's quite a wide chasm between a good bug report and a bad bug report.
Since we have a lot to do, the quality of the bug report can make a big
difference in how quickly the bug gets fixed. A poorly written bug report may
get ignored. A poorly written bug may require several rounds asking for more
information or clarifications. A poorly written bug report may send a
developer looking for the problem in the wrong place.</p>
<p>As someone who fields a lot of these reports for Mesa, here's what I look
for...</p>
<ol>
<li><p><strong>Submit against the right product and component.</strong> The component will
determine the person (or mailing list) that initially receives notification
about the bug. If you have a bug in the Radeon driver and only people
working Nouveau get the bug e-mail, your bug probably won't get much
attention.</p>
<p>If you have experienced a bug in 3D rendering, you want to <a href="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa">submit your bug
against Mesa</a>.</p>
<p>Selecting the correct component can be tricky. It doesn't have to be 100%
correct initially, but it should be close enough to get the attention of
the right people. A good first approximation is to pick the component that
matches the hardware you are running on. That means one of the following:</p>
<ul>
<li>Any modern Intel GPU:
<a href="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa&component=Drivers/DRI/i965">Drivers/DRI/i965</a></li>
<li>Old Intel GPUs like i915, i945, G33, or Pineview:
<a href="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa&component=Drivers/DRI/i915">Drivers/DRI/i915</a></li>
<li>Any modern NVIDIA GPU: <a href="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa&component=Drivers/DRI/nouveau">Drivers/DRI/nouveau</a>.</li>
<li>Any modern Radeon GPU: Either
<a href="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa&component=Drivers/Gallium/radeonsi">Drivers/Gallium/radeonsi</a>
or
<a href="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa&component=Drivers/Gallium/r600">Drivers/Gallium/r600</a>.</li>
</ul>
<p>If you're not sure what GPU is in your system, the command <code>glxinfo | grep
"OpenGL renderer string"</code> will help.</p></li>
<li><p><strong>Correctly describe the software on your system.</strong> There is a field in
bugzilla to select the version where the bug was encountered. This
information is useful, but it is more important to get specific, detailed
information in the bug report.</p>
<ul>
<li><p>Provide the output of <code>glxinfo | grep "OpenGL version string"</code>. There
may be two lines of output. That's fine, and you should include both.</p></li>
<li><p>If you are using the drivers supplied by your distro, include the
version of the distro package. On Fedora, this can be determined by
<code>rpm -q mesa-dri-drivers</code>. Other distros use other commands. I
don't know what they are, but Googling for "how do i determine the
version of an installed package on " should help.</p></li>
<li><p>If you built the driver from source using a Mesa release tarball,
include the full name of that tarball.</p></li>
<li><p>If you built the driver from source using the Mesa GIT repository,
include SHA of the commit used.</p></li>
<li><p>Include the full version of the kernel using <code>uname -r</code>. This isn't
always important, but it is sometimes helpful.</p></li>
</ul></li>
<li><p><strong>Correctly describe the hardware in your system.</strong> There are a lot of
variations of each GPU out there. Knowing exactly which variation
exhibited bad behavior can help find the problem.</p>
<ul>
<li><p>Provide the output of <code>glxinfo | grep "OpenGL renderer string"</code>. As
mentioned above, this is the hardware that Mesa thinks is in the system.</p></li>
<li><p>Provide the output of <code>lspci -d ::0300 -nn</code>. This provides the raw PCI
information about the GPU. In some cases this maybe more detailed (or
just plain different) than the output from <code>glxinfo</code>.</p></li>
<li><p>Provide the output of <code>grep "model name" /proc/cpuinfo | head -1</code>. It
is sometimes useful to know the CPU in the system, and this provides
information about the CPU model.</p></li>
</ul></li>
<li><p><strong>Thoroughly describe the problem you observed.</strong> There are two goals.
First, you want the person reading the bug report to know <em>both</em> what did
happen and what you expected to happen. Second, you want the person
reading the bug report to know how to reproduce the problem you observed.
The person fielding the bug report may not have access to the application.</p>
<ul>
<li><p>If the application was run from the command line, provide the full
command line used to run the application.</p>
<p>If the application is a test that was run from
<a href="http://piglit.freedesktop.org/">piglit</a>, provide the command line used
to run the test, <em>not</em> the command line used to run piglit. This
information is in the piglit <code>results.json</code> result file.</p></li>
<li><p>If the application is game or other complex application, provide any
necessary information needed to reproduce the problem. Did it happen at
specific location in a level? Did it happen while performing a specific
operation? Does it only happen when loading certain data files?</p></li>
<li><p>Provide output from the application. If the application is a test case,
provide the text output from the test. If this output is, say, less
than 5 lines, include it in the report. Otherwise provide it as an
attachment. Output lines that just say "Fail" are not useful. It is
usually possible to run tests in verbose mode that will provide helpful
output.</p>
<p>If the application is game or other complex application, try to provide
a screenshot. If it is possible, providing a "good" and "bad"
screenshot is even more useful.
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=91617">Bug #91617</a> is a
good example of this.</p>
<p>If the bug was a GPU or system hang, provide output from <code>dmesg</code> as an
attachment to the bug. If the bug is not a GPU or system hang, this
output is unlikely to be useful.</p></li>
</ul></li>
<li><p><strong>Add annotations to the bug summary.</strong> Annotations are parts of the bug
summary at the beginning enclosed in square brackets. The two most
important ones are <code>regression</code> and <code>bisected</code> (see the next item for more
information about <code>bisected</code>). If the bug being reported is a new failure
after updating system software, it is (most likely) a regression. Adding
<code>[regression]</code> to the beginning of the bug summary will help get it
noticed! In this case you also <strong>must</strong>, at the very least, tell us what
software version worked... with all the same details mentioned above.</p>
<p>The other annotations used by the Intel team are short names for hardware
versions. Unless you're part of Intel's driver development team or QA
team, you don't really need to worry about these. The ones currently in
use are:</p>
<ul>
<li><code>SKL</code> - <a href="https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units#Ninth_generation">Skylake /
GEN9</a></li>
<li><code>BDW</code> - <a href="https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units#Eighth_generation">Broadwell /
GEN8</a></li>
<li><code>BSW</code> - <a href="https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units#Eighth_generation">Brasswell / lower power
GEN8</a></li>
<li><code>HSW</code> - <a href="https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units#Seventh_generation">Haswell /
GEN7.5</a></li>
<li><code>BYT</code> - <a href="https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units#Seventh_generation">Baytrail /
lower power
GEN7</a>.
There may still be some bugs with <code>VLV</code>. This is from the older
Valleyview name.</li>
<li><code>IVB</code> - <a href="https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units#Seventh_generation">Ivy Bridge /
GEN7</a></li>
<li><code>SNB</code> - <a href="https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units#Sixth_generation">Sandy Bridge /
GEN6</a></li>
<li><code>ILK</code> - <a href="https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units#Fifth_generation">Ironlake /
GEN5</a></li>
<li><code>GM45</code> - <a href="https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units#Fourth_generation">Eaglelake /
GEN4.5</a></li>
<li><code>GEN4</code> or <code>i965</code> or <code>965gm</code> or similar - <a href="https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units#Fourth_generation">Broadwater / Crestline /
GEN4</a></li>
<li><code>PNV</code> or <code>i915</code> or <code>i945</code> -
<a href="https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units#Third_generation">GEN3</a></li>
</ul></li>
<li><p><strong>Bisect regressions.</strong> If you have encountered a regression and you are
building a driver from source, please provide the results of
<a href="https://git-scm.com/docs/git-bisect">git-bisect</a>. We really just need the
last part: the guilty commit. When this information is available, add
<code>bisected</code> to the tag. This should look like <code>[regression bisected]</code>.</p>
<p><em>Note:</em> If you're on a QA team somewhere, supplying the bisect is a
practical requirement.</p></li>
<li><p><strong>Respond to the bug.</strong> There may be requests for more information. There
may be requests to test patches. Either way, developers working on the bug
need you to be responsive. I have closed a lot of bugs over the years
because the original reporter didn't respond to a question for six months
or more. Sometimes this is our fault because the question was asked months
(or even years) after the bug was submitted.</p>
<p>The general practice is to change the bug status to <code>NEEDINFO</code> when
information or testing is requested. After providing the requested
information, please change the status back to either <code>NEW</code> or <code>ASSIGNED</code> or
whatever the previous state was.</p>
<p>It is also general practice to leave bugs in the <code>NEW</code> state until a
developer actually starts working on it. When someone starts work, they
will change the "Assigned To" field and change the status to <code>ASSIGNED</code>.
This is how we prevent multiple people from duplicating effort by working
on the same bug.</p>
<p>If the bug was encountered in a released version and the bug persists after
updating to a new major version (e.g., from 10.6.2 to 11.0.1), it is
probably worth adding a comment to the bug "Problem still occurs with ." That way we know you're alive and still care about the problem.</p></li>
</ol>
<p>Here is a sample script that collects a lot of information request. It does
not collect information about the driver version other than the <code>glxinfo</code>
output. Since I don't know whether you're using the distro driver or building
one from source, there really isn't any way that my script could do that.
You'll want to customize it for your own needs.</p>
<pre><code>echo "Software versions:"
echo -n " "
uname -r
echo -n " "
glxinfo 2>&1 | grep "OpenGL version string"
echo
echo "GPU hardware:"
echo -n " "
glxinfo 2>&1 | grep "OpenGL renderer string"
echo -n " "
lspci -d ::0300 -nn
echo
echo "CPU hardware:"
echo -n " "
uname -m
echo -n " "
grep "model name" /proc/cpuinfo | head -1 | sed 's/^[^:]*: //'
echo
</code></pre>
<p>This generates nicely formatted output that you can copy-and-paste directly
into a bug report. Here is the output from my system:</p>
<pre><code>Software versions:
4.0.4-202.fc21.x86_64
OpenGL version string: 3.0 Mesa 11.1.0-devel
GPU hardware:
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 5500 (Broadwell GT2)
00:02.0 VGA compatible controller [0300]: Intel Corporation Broadwell-U Integrated Graphics [8086:1616] (rev 09)
CPU hardware:
x86_64
Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz
</code></pre>
DaynaFile? Why does it exist?http://www.paranormal-entertainment.com/idr/blog/posts/2015-10-09T01:27:18Z-DaynaFile_Why_does_it_exist/2015-10-09T22:31:33Z2015-10-09T01:27:18Z
<p>I've been into retro-gaming for a couple years now, and, after the 30th
anniversary of the Amiga, I've been getting into retro-computing too. To feed
my dirty habbit, I've been doing quite a bit of garage sale hunting. Last
weekend I went to a garage sale that advertised on craigslist as "HUGE HOARDER
SALE". It did not disappoint. There were a bunch of Atari 7800 games in
boxes, so that by itself was worth the trip.</p>
<p><img src="http://www.paranormal-entertainment.com/idr/blog/images/DaynaFile/Atari7800-games.small.jpg" width="640" height="480" /></p>
<p>I talked to the guy a bit. He told me there was more stuff inside, but he
hadn't had a chance to go through it yet. He did want to, "sell an $80 game
for $3." Fair enough. A little more chatting, and he offered to let me have
a look. The games were almost all common stuff, but there was a Mega Man IV,
in the box... I told him to look up a price for that one, and I still got a
really good deal.</p>
<p>The rest of the house... OMG. It really was like you see on TV. Boxes
covering almost every inch of the floor and stacked to the ceiling in places.
The guy told me that he thought it would take about two years to get the
place fully cleaned out. Ouch.</p>
<p>In the kitchen (obviously) there was a big, big pile of computers. I started
looking through that... and there was some weird stuff there. The most
interesting bits were an <a href="https://en.wikipedia.org/wiki/Osborne_1">Osborne 1</a>,
a <a href="http://www.everymac.com/systems/apple/mac_classic/specs/mac_se30.html">Mac
SE/30</a>,
and a <a href="http://users.eastlink.ca/~pspencer/mac/dayna/dayna.html">DaynaFile</a>.</p>
<p>I first saw the DaynaFile from this view, and I thought, "An external SCSI
chasis. I can use that."</p>
<p><a href="http://www.paranormal-entertainment.com/idr/blog/images/DaynaFile/daynafile-back.jpg">
<img src="http://www.paranormal-entertainment.com/idr/blog/images/DaynaFile/daynafile-back.small.jpg" width="640" height="480" />
</a></p>
<p>I picked up, turned it around, and almost dropped it. First of all, that's a
5.25" floppy drive in a SCSI chasis. That earns some serious WTF marks alone.
Look closer... 360k.</p>
<p><a href="http://www.paranormal-entertainment.com/idr/blog/images/DaynaFile/daynafile-front.jpg">
<img src="http://www.paranormal-entertainment.com/idr/blog/images/DaynaFile/daynafile-front.small.jpg" width="640" height="480" />
</a></p>
<p>Now I had to have it. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /> I added it to my pile. I figured that after
amortizing the total price over all the things I got, I paid about $1 for it.</p>
<p>Upon getting it home, I dissected it. Inside is a perfectly ordinary 360k
5.25" floppy drive.</p>
<p><a href="http://www.paranormal-entertainment.com/idr/blog/images/DaynaFile/daynafile-drive.jpg">
<img src="http://www.paranormal-entertainment.com/idr/blog/images/DaynaFile/daynafile-drive.small.jpg" width="640" height="480" />
</a></p>
<p>The whole thing is controlled by a little 8031 microcontroller that bridges
the SCSI bus to the floppy bus.</p>
<p><a href="http://www.paranormal-entertainment.com/idr/blog/images/DaynaFile/daynafile-pcb.jpg">
<img src="http://www.paranormal-entertainment.com/idr/blog/images/DaynaFile/daynafile-pcb.small.jpg" width="640" height="480" />
</a></p>
<p>As if the whole thing weren't crazy enough... there's the date on the ROM.
It's hard to read in the picture, but it says, "DAYNAFILE REV. 3.1 @ 1989".
Yes... 1989. Why? WHY?!? Why did someone need a 360k 5.25" SCSI floppy
drive in 1989?!? By that time Macs, Amigas, Atari STs, and even most PCs had
720k 3.5" floppy drives standard in 1989. I understand wanting to read 1.2M
5.25" PC floppies or 1.44M/720k 3.5" PC floppies on a Mac, but 360k? For
shame!</p>
<p>The bummer is that there's no powersupply for it. I found a <a href="http://users.eastlink.ca/~pspencer/mac/dayna/DaynaFile-UserManual.pdf">user
manual</a>,
which is filled with some serious lolz. '"Reading and writing files" is
MS-DOS terminology.... Reading a file is the same as opening a document and
writing a file is the same as closing a document and saving changes." Now I
remember why I used to make fun of Macintosh users.</p>
<p>What the manual doesn't have anywhere in it's 122 pages is a pinout of the
powersupply connector. The Internet says it uses an Elpac WM220... should be
possible to rig something up.</p>
Stochastic Search-Based Testing for Uniform Block Layoutshttp://www.paranormal-entertainment.com/idr/blog/posts/2014-10-08T13:28:09Z-Stochastic_Search-Based_Testing_for_Uniform_Block_Layouts/2014-10-16T03:11:38Z2014-10-08T13:28:09Z
<p>I just finished my <a href="http://www.x.org/wiki/Events/XDC2014/XDC2014RomanickTesting/">talk at XDC
2014</a>.
The short version: UBO support in OpenGL drivers is <em>terrible</em>, and I
have the test cases to prove it.</p>
<p>There are
<a href="http://www.paranormal-entertainment.com/idr/blog/images/XDC14/stochastic-search-based-testing-for-uniform-block-layouts-slides.pdf">slides</a>,
a <a href="http://www.paranormal-entertainment.com/idr/blog/images/XDC14/stochastic-search-based-testing-for-uniform-block-layouts.pdf">white
paper</a>,
and, eventually, a
<a href="https://www.youtube.com/channel/UCXlH5v1PkEhjzLFTUTm_U7g">video</a>.</p>
<p>UPDATE: Fixed a typo in the white paper reported by <a href="https://twitter.com/Ancurio">Jonas
Kulla</a> on
<a href="https://twitter.com/Ancurio/status/519865869501865984">Twitter</a>.</p>
<p>UPDATE: Direct link to <a href="https://www.youtube.com/watch?v=p-hp4ysNeC0">video</a>.</p>
Everything oldhttp://www.paranormal-entertainment.com/idr/blog/posts/2014-06-30T17:09:35Z-Everything_old/2014-06-30T20:29:46Z2014-06-30T17:09:35Z
<p>On Saturday I went to the <a href="http://www.seattleretro.org/">Seattle Retro Gaming
Expo</a>. It was fun (as usual), and I spent too
much money (also as usual). On Sunday I rolled up my sleeves, and I started
working on a game for a retro system. I've been talking about doing this
for at least a year, but it was hard to find time while I was still working
on my masters degree. Now that I'm done with that, I have no excuses.</p>
<p>Since this is my first foray (back) into game programming on hella old
hardware, I decided to stick with a system I know and a game I know. I'm
doing Tetris for the
<a href="http://en.wikipedia.org/wiki/Texas_Instruments_TI-99/4A">TI-99/4a</a>. Around
1997 I did a version of Tetris in 8051 assembly, and the TI is the first
computer that I ever really programmed.</p>
<p>My stepdad used to work at Fred Meyer in the 80's, and he got the computer
practically for free when TI discontinued them... and retailers heavily
discounted their stock-on-hand. It was a few years until the "kids" were
allowed to play with the computer. Once I got access, I spent basically all
of the wee hours of the night hogging the TV and the computer. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /> It was
around that same time that my older stepsister swiped the tape drive, so I
had no way to save any of my work. I would often leave it on for <em>days</em>
while I was working on a program. As a result, I don't have any of those
old programs. It's probably better this way... all of those programs were
spaghetti BASIC garbage. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /></p>
<p>The cool thing (if that's the right phrase) about starting with the TI is
that it uses the <a href="http://en.wikipedia.org/wiki/Texas_Instruments_TMS9918">TMS9918
VDC</a>. This same
chip is used in the
<a href="http://en.wikipedia.org/wiki/ColecoVision">ColecoVision</a>,
<a href="http://en.wikipedia.org/wiki/MSX">MSX</a>, and <a href="http://en.wikipedia.org/wiki/SG-1000">Sega
SG-1000</a> (system before the system
before the <a href="http://en.wikipedia.org/wiki/Sega_Master_System">Sega Master
System</a>). All the tricks
from the TI will directly apply to those other systems.</p>
<p>Fast forward to the present... This first attempt is also in BASIC, but I'm
using <a href="http://en.wikipedia.org/wiki/TI_Extended_BASIC">TI Extended BASIC</a>
now. This has a few features that should make things less painful, but I'm
pretty sure this will be the only thing I make using the actual TI as the
development system... I'm basically writing code using
<a href="https://www.gnu.org/software/ed/manual/ed_manual.html">ed</a> (but worse), and
I had repressed the memories of how terrible that keyboard is.</p>
<p>On Sunday, for the first time in 28 years, I saved and restored computer
data on audio cassette.</p>
<p>Anyway... my plan is:</p>
<ol>
<li>Get Tetris working. Based on a couple hours hacking around on Sunday, I
don't think BASIC is going to be fast enough for the game.</li>
<li>Redo parts in assembly, which I can call from TI Extended BASIC, so that
the game is playable.</li>
<li>Maybe redo the whole thing in assembly... dunno.</li>
<li>Move on to the next game.</li>
</ol>
<p>I really want to do a version of <a href="https://www.youtube.com/watch?v=NoPoFSjPyvM">Dragon
Attack</a>. The MSX has the same
VDC, so it should be possible. Funny thing there... In 1990 I worked for
<a href="http://en.wikipedia.org/wiki/HAL_America">HAL America</a> (their office was on
Cirrus Drive in Beaverton) as a game counselor. I mostly helped people with
<a href="http://en.wikipedia.org/wiki/Adventures_of_Lolo">Adventures of Lolo</a> and
<a href="http://en.wikipedia.org/wiki/Adventures_of_Lolo_2">Adventures of Lolo 2</a>.
Hmm... maybe I should just port Lolo (which also started on the MSX) to the
TI...</p>
Steam Dev Days talk postedhttp://www.paranormal-entertainment.com/idr/blog/posts/2014-02-13T16:33:51Z-Steam_Dev_Days_talk_posted/2014-02-13T16:39:29Z2014-02-13T16:33:51Z
<p>The
<a href="http://media.steampowered.com/apps/steamdevdays/slides/gengraphics.pdf">slides</a>
and
<a href="http://www.youtube.com/watch?v=4ebAKa4zfiU&list=PLckFgM6dUP2hc4iy-IdKFtqR9TeZWMPjm">video</a>
of my talk from <a href="http://steamdevdays.com/">Steam Dev Days</a> has been posted.
It's basically the Haswell refresh (inside joke) of my <a href="http://www.paranormal-entertainment.com/idr/blog/posts/2013-08-14T03:59:19Z-Performance_tuning_for_GEN/">SIGGRAPH
talk</a>
from last year.</p>
FOSDEM2014 Presentationhttp://www.paranormal-entertainment.com/idr/blog/posts/2014-02-01T12:19:04Z-FOSDEM2014_Presentation/2014-02-02T14:31:01Z2014-02-01T12:19:04Z
<p><img src="http://www.paranormal-entertainment.com/idr/blog/images/FOSDEM14/FOSDEM2014-talk.jpg" width="320" height="240" /></p>
<p>The <a href="http://www.paranormal-entertainment.com/idr/blog/images/FOSDEM14/FOSDEM2014-Tree-IR.pdf">slides</a> from my <a href="https://fosdem.org/2014/schedule/event/intel_glsl/">FOSDEM
talk</a>
are now available.</p>
GLSL multidimensional array... madness?http://www.paranormal-entertainment.com/idr/blog/posts/2014-01-29T17:08:42Z-GLSL_multidimensional_array_madness/2014-01-29T18:16:54Z2014-01-29T17:08:42Z
<p>Multidimensional arrays are added to GLSL via either
<a href="http://www.opengl.org/registry/specs/ARB/arrays_of_arrays.txt"><code>GL_ARB_arrays_of_arrays</code></a>
extension or GLSL 4.30. I've had a couple people tell me that the
multidimensional array syntax is either wrong or just plain crazy. When
viewed from the proper angle, it should actually be perfectly logical to any
C / C++ programmer. I'd like to clear up a bit of the confusion.</p>
<p>Staring with the easy syntax, the following does what you expect:</p>
<pre><code> vec4 a[2][3][4];
</code></pre>
<p>If <code>a</code> is inside a uniform block, the memory layout would be the same as in
C. <a href="http://cdecl.org/">cdecl</a> would call this, "declare a as array 2 of
array 3 of array 4 of vec4".</p>
<p>Using GLSL constructor syntax, the array can also be initialized:</p>
<pre><code> vec4 a[2][3][4] = vec4[][][](vec4[][](vec4[](vec4( 1), vec4( 2), vec4( 3), vec4( 4)),
vec4[](vec4( 5), vec4( 6), vec4( 7), vec4( 8)),
vec4[](vec4( 9), vec4(10), vec4(11), vec4(12))),
vec4[][](vec4[](vec4(13), vec4(14), vec4(15), vec4(16)),
vec4[](vec4(17), vec4(18), vec4(19), vec4(20)),
vec4[](vec4(21), vec4(22), vec4(23), vec4(24))));
</code></pre>
<p>If that makes your eyes bleed,
<a href="http://www.opengl.org/registry/specs/ARB/shading_language_420pack.txt"><code>GL_ARB_shading_language_420pack</code></a>
and GLSL 4.20 add the ability to use C-style array and structure
initializers. In that model, <code>a</code> can be initialized to the same values by:</p>
<pre><code> vec4 a[2][3][4] = {
{
{ vec4( 1), vec4( 2), vec4( 3), vec4( 4) },
{ vec4( 5), vec4( 6), vec4( 7), vec4( 8) },
{ vec4( 9), vec4(10), vec4(11), vec4(12) }
},
{
{ vec4(13), vec4(14), vec4(15), vec4(16) },
{ vec4(17), vec4(18), vec4(19), vec4(20) },
{ vec4(21), vec4(22), vec4(23), vec4(24) }
}
};
</code></pre>
<p>Functions can be declared that take multidimensional arrays as parameters. In
the prototype, the name of the parameter can be present, or it can be
omitted.</p>
<pre><code> void function_a(float a[4][5][6]);
void function_b(float [4][5][6]);
</code></pre>
<p>Other than the GLSL constructor syntax, there hasn't been any madness yet.
However, recall that array sizes can be associated with the variable name or
with the type. The prototype for <code>function_a</code> associates the size with the
variable name, and the prototype for <code>function_b</code> associates the size with
the type. Like GLSL constructor syntax, this has existed since GLSL 1.20.</p>
<p>Associating the array size with just the type, we can declare <code>a</code> (from
above) as:</p>
<pre><code> vec4[2][3][4] a;
</code></pre>
<p>With multidimensional arrays, the sizes can be split among the two, and this
is where it gets weird. We can also declare <code>a</code> as:</p>
<pre><code> vec4[3][4] a[2];
</code></pre>
<p>This declaration has the <strong>same</strong> layout as the previous two forms. This is
usually where people say, "It's bigger on the inside!" Recall the cdecl
description, "declare a as array 2 of array 3 of array 4 of vec4". If we
add some parenthesis, "declare a as array 2 of (array 3 of array 4 of
vec4)", and things seem a bit more clear.</p>
<p>GLSL ended up with this syntax for two reasons, and seeing those reasons
should illuminate things. Without <code>GL_ARB_arrays_of_arrays</code> or GLSL 4.30,
there are no multidimensional arrays, but the same affect can be achieved,
very inconveniently, using structures containing arrays. In GLSL 4.20 and
earlier, we could also declare <code>a</code> as:</p>
<pre><code> struct S1 {
float a[4];
};
struct S2 {
S1 a[3];
};
S2 a[2];
</code></pre>
<p>I'll spare you having to see GLSL constructor initializer for that mess.
Note that we still end up with <code>a[2]</code> at the end.</p>
<p>Using <code>typedef</code> in C, we could also achieve the same result using:</p>
<pre><code> typedef float T[3][4];
T a[2];
</code></pre>
<p>Again, we end up with <code>a[2]</code>. If cdecl could handle this (it doesn't grok
<code>typedef</code>), it would say "declare a as array 2 of T", and "typedef T as
array 3 of array 4 of float". We could substitue the description of <code>T</code>
and, with parenthesis, get "declare a as array 2 of (array 3 of array 4 of
float)".</p>
<p>Where this starts to present pain is that <code>function_c</code> has the same
parameter type as <code>function_a</code> and <code>function_b</code>, but <code>function_d</code> does not.</p>
<pre><code> void function_c(float[5][6] a[4]);
void function_d(float[5][6] [4]);
</code></pre>
<p>However, the layout of parameter for <code>function_e</code> is the same as
<code>function_a</code> and <code>function_b</code>, even though the actual type is different.</p>
<pre><code> struct S3 {
float a[6];
};
struct S4 {
S3 a[5];
};
void function_e(S4 [4]);
</code></pre>
<p>I think if we had it to do all over again, we may have disallowed the split
syntax. That would remove the more annoying pitfalls and the confusion, but
it would also remove some functionality. Most of the problems associated
with the split are caught at compile-time, but some are not. The two
obvious problems that remain are transposing array indices and incorrectly
calculated uniform block layouts.</p>
<pre><code> layout(std140) uniform U {
float [1][2][3] x;
float y[1][2][3];
float [1][2] z[3];
};
</code></pre>
<p>In this example <code>x</code> and <code>y</code> have the same memory organization, but <code>z</code> does
not. I wouldn't want to try to debug that problem.</p>
Portland Retro Gaming Expo 2013http://www.paranormal-entertainment.com/idr/blog/posts/2013-10-08T02:23:50Z-Portland_Retro_Gaming_Expo_2013/2013-10-08T15:42:07Z2013-10-08T02:23:50Z
<p><a href="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/wall-image.jpg"><img src="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/wall-image.thumb.jpg" width="640" height="452" /></a>
<br/></p>
<p>This previous weekend was the <a href="http://retrogamingexpo.com/">Portland Retro Gaming
Expo</a>, and it was awesome! I was there all day
both days.</p>
<p>I got some really good deals. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" />
<a href="http://en.wikipedia.org/wiki/Gaiares">Gaiares</a> (loose) for $5!
<a href="http://en.wikipedia.org/wiki/Truxton_(video_game)">Tatsujin</a> (import version
of Truxton) for $8! I got a <em>lot</em> of games. Just don't ask how much I spent
altogether...</p>
<p>One of the highlights of the show where the performances by <a href="http://www.8bitweapon.com">8Bit
Weapon</a>. You'll notice in the second image that
she's playing an Atari paddle controller. You can also see a C64 (donated by
the <a href="http://pdxcug.org/">local Commodore User Group</a>) in the last image.</p>
<p><a href="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/8bitweapon-01.jpg"><img src="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/8bitweapon-01.thumb.jpg" width="240" height="240" /></a>
<a href="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/8bitweapon-02.jpg"><img src="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/8bitweapon-02.thumb.jpg" width="320" height="240" /></a>
<a href="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/8bitweapon-03.jpg"><img src="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/8bitweapon-03.thumb.jpg" width="320" height="240" /></a></p>
<p>The GIANT arcade was... amazing! There were some games there that I haven't
played in years. My uncle would have enjoyed Mappy. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /> And I didn't win the
tabletop Asteroids game. I spent a lot of time playing
<a href="http://en.wikipedia.org/wiki/APB_(1987_video_game)">APB</a> (Hey Ground Kontrol:
put that in the arcade!!!). I was also pretty surprised that the only console
version of APB is for the Lynx. Oof.</p>
<p>I love the <a href="http://en.wikipedia.org/wiki/Space_Wars">Space Wars</a>
instructions... I think those are still the instructions for Windows... lol.</p>
<p><a href="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/apb-game.jpg"><img src="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/apb-game.thumb.jpg" width="240" height="320" /></a>
<a href="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/asteroids-game.jpg"><img src="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/asteroids-game.thumb.jpg" width="240" height="320" /></a>
<a href="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/mappy-game.jpg"><img src="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/mappy-game.thumb.jpg" width="240" height="320" /></a>
<a href="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/space-wars-game.jpg"><img src="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/space-wars-game.thumb.jpg" width="320" height="124" /></a></p>
<p>There was a cool presentation about making games for the Atari 2600. There
were even a couple "celebrities" in the audience. On the right is Darrell
Spice Jr. (programmer of <a href="http://en.wikipedia.org/wiki/Medieval_Mayhem">Medieval
Mayhem</a>), and on the left is
<a href="http://en.wikipedia.org/wiki/Rebecca_Heineman">Rebecca Heineman</a>
(programmer <a href="http://www.mobygames.com/game/london-blitz">London Blitz</a> for the
2600 among other things). She's also responsible for the <a href="http://www.qotile.net/minidig/disassembly/freeway.asm">awesome
disassembly</a> of the
game <a href="http://en.wikipedia.org/wiki/Freeway_(video_game)">Freeway</a>.</p>
<p>Joe Decuir was also in the audience, and I met him later at the <a href="https://www.atariage.com/">Atari
Age</a> booth (I had to get Medieval Mayhem and Moon
Cresta <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /> ). I can't believe Joe doesn't have a Wikipedia page. He was one
of the original designers of the Atari 2600, programmer of <a href="http://en.wikipedia.org/wiki/Video_Olympics">Video
Olympics</a>
and <a href="http://en.wikipedia.org/wiki/Combat_(video_game)">Combat</a>
(with Larry Wagner). He was also one of the original Amiga designers. He was
having a conversation with one of the Atari Age guys about wanting to design a
new console in the style of an old Atari 8-bit or an Amiga. I told him that
there's a group trying to make an Amiga 2000 from scratch (using FPGAs for
custom chips). So now I'm tasked with finding that project again and getting
him in contact with them. I'm sure they'd appreciate any help he could offer!</p>
<p><a href="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/atari-2600-programming-01.jpg"><img src="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/atari-2600-programming-01.thumb.jpg" width="320" height="240" /></a>
<br/></p>
<p>The <a href="http://tetrischampionship.com/">Tetris World Championships</a> was so
tense!!! I think I have to watch the
<a href="http://en.wikipedia.org/wiki/Ecstasy_of_Order:_The_Tetris_Masters">movie</a>
now. After being down 2 games, <a href="http://www.imdb.com/name/nm4457032/">Jonas</a>
came back to win it... for the fourth time in a row!</p>
<p><a href="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/tetris-championship-01.jpg"><img src="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/tetris-championship-01.thumb.jpg" width="320" height="240" /></a>
<a href="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/tetris-championship-02.jpg"><img src="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/tetris-championship-02.thumb.jpg" width="320" height="240" /></a>
<a href="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/tetris-championship-03.jpg"><img src="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/tetris-championship-03.thumb.jpg" width="320" height="240" /></a>
<a href="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/tetris-championship-04.jpg"><img src="http://www.paranormal-entertainment.com/idr/blog/images/PRGE13/tetris-championship-04.thumb.jpg" width="320" height="240" /></a></p>
Mesa: State of the Projecthttp://www.paranormal-entertainment.com/idr/blog/posts/2013-09-24T17:54:52Z-Mesa:_State_of_the_Project/2013-09-24T17:57:25Z2013-09-24T17:54:52Z
<p>Now my Mesa: State of the Project talk is done too, and the
<a href="http://www.paranormal-entertainment.com/idr/blog/images/XDC13/Mesa-State-of-the-Project.pdf">slides</a>
are available.</p>
<p>I'm assuming that someone will send a long a link to the video soon... <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile4.png" alt=";)" /></p>
Effects Framework for OpenGL Testinghttp://www.paranormal-entertainment.com/idr/blog/posts/2013-09-23T21:27:45Z-Effects_Framework_for_OpenGL_Testing/2013-09-23T21:47:42Z2013-09-23T21:27:45Z
<p>My XDC talk "Effects Framework for OpenGL Testing" just got done, and the
<a href="http://www.paranormal-entertainment.com/idr/blog/images/XDC13/Effects-Framework-for-OpenGL-Testing.pdf">slides</a>
are available. The talk went pretty well, and the discussion was healthy.</p>
<p>The three big high points of the discussion were:</p>
<ul>
<li>For the most part, adding more language to learn won't necessarily make it
easier to add more complex tests. Just writing C tests in piglit isn't bad
these days. The worst parts are dealing with cmake and all.tests. The
best thing about shader_runner (and similar) is that you don't have muck
about with any of that.</li>
<li>One difficulty with complex tests is validating the correctness of results.
The red / green box tests are good because the pass / fail metric is
obvious. Perceptual difference algorithms can work (VMware uses them), but
they can be twitchy and frustrating (Cairo gave up on them).</li>
<li>The shader_runner parser is a mess because everyone just added one more
piece of duct tape for the next tiny feature they need. There used to be a
clean, simple piece of code, but you can't see it now... all you can see is
the big ball of duct tape. One advantage of nvFX is that it is a
consistent, defined language... instead of a ball of duct tape. We could
borrow their syntax for some of the things that shader_runner already
does.</li>
</ul>
<p>There may have been other important points, but those are the two that really
stuck with me. The forum is open. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /></p>
LPC 2013 Talkhttp://www.paranormal-entertainment.com/idr/blog/posts/2013-09-18T16:00:38Z-LPC_2013_Talk/2013-09-27T18:41:58Z2013-09-18T16:00:38Z
<p>I'm giving a <a href="http://www.linuxplumbersconf.org/2013/ocw/sessions/1449">talk tomorrow at
LPC</a> in the <a href="http://wiki.linuxplumbersconf.org/2013:graphics_and_display">Graphics
and Display
microconf</a>.
Since the time slots are so short (25 minutes!), I wanted (okay, Laurent
requested) to provide some details before the talk to prime the pump, so to
speak.</p>
<p>One line summary: Right now debugging and profiling graphics applications and
graphics systems on Linux is a disaster. It's better on Windows, but not by a
lot (especially for OpenGL).</p>
<p>There are very few tools, and the tools that exist are either insufficient or
are vendor-specific. Moreover, the tools don't provide any kind of system
view. At some point in some desktop environment, every developer has to
figure out why / how the compositor is wrecking performance. This often takes
a lot of work because there is no system view.</p>
<p>The one tool for Windows that can provide a system view is
<a href="http://graphics.stanford.edu/~mdfisher/GPUView.html">GPUView</a>.</p>
<p>As a result, even on Windows, many developers end up rolling their own tools.
The methods remind me a lot of the old days of sprinkling <code>rdtsc()</code> calls all
over the code. What has changed is the level detail provided by the tools
that display the logged data. Valve has <a href="http://steamforlinux.com/?q=en/node/80">famously
talked</a> about the system they use.
Other developers have told me they use similar systems.</p>
<p>There is common thematic problem in all of these tools and approaches. The
developer is either gets a lot of detailed data and is tied to a particular
vendor, or the developer gets very coarse data. And they don't get
system-wide data.</p>
<p>There are several disparate groups that need data</p>
<ul>
<li>People creating stand-alone debug / profile tools (e.g., apitrace).</li>
<li>People building data collection into their application and using an
external, post-hoc visualization tool</li>
<li>People building data collection and visualization into their application.</li>
</ul>
<p>Generally, folks doing one of the last two are doing both to varying degrees.</p>
<p>So here's the question. Can we provide a set of interfaces, probably from
the kernel, that:</p>
<ul>
<li>Provides finer grained data than is available from, say,
<a href="http://www.opengl.org/registry/specs/ARB/timer_query.txt"><code>GL_ARB_timer_query</code></a>
about the execution of commands on the GPU.</li>
<li>Provides the above data at a system level with semantic information (e.g.,
this block of time was your call to <code>glDrawArrays</code>, this block of time was
the compositor doing "stuff", this block of time was your XRender request,
etc.) <em>without</em> leaking information in a way that compromises security.</li>
<li>Allow closed-source drivers to expose these interfaces.</li>
</ul>
<p><em>UPDATE:</em> The
<a href="http://www.paranormal-entertainment.com/idr/blog/images/LPC13/State-of-the-Art-Debugging-and-Tuning-Graphics-Applications.pdf">slides</a>
and <a href="http://etherpad.osuosl.org/lpc2013-graphics-and-display">notes</a> from the
talk are available. Thanks to Nathan Willis for reminding me to post them.</p>
Standalone compiler... glsl-lint?http://www.paranormal-entertainment.com/idr/blog/posts/2013-09-10T21:58:43Z-Standalone_compiler_glsl-lint/2013-09-10T22:58:27Z2013-09-10T21:58:43Z
<p>I've just pushed a <a href="http://cgit.freedesktop.org/~idr/mesa/log/?h=standalone-compiler">branch to my fd.o
tree</a>
that brings <em>back</em> the standalone compiler. I've also made some small
enhancements to it. Why? Thanks for asking. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /></p>
<p>One thing that game developers frequently complain about (and they're
damn right!) is the massive amount of variability among GLSL
compilers. Compiler A accepts a shader, but compiler B generates
errors. Then the real fun begins... which compiler is right? Dig
through the spec, report bugs to the vendors, wait for the vendors to
finger point... it's pretty dire.</p>
<p>Mesa compiler has a reputation of sticking to the letter of the spec.
This has caused some ruffled feathers with game developers and with
some folks in the Mesa community. In cases where our behavior
disagrees with all other shipping implementations, I have submitted
numerous spec bugs. If nobody does what the spec says, you change the
spec.</p>
<p>This isn't to say our conformance is perfect or that we don't have any
bugs. Reality is quite the contrary. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /> However, we are really picky
about stuff that other people aren't quite so picky about. When we
find deviations from the behavior of other implementations, one way or
another, we sort it out.</p>
<p>Sometimes that means changing our behavior (and adding piglit tests).</p>
<p>Sometimes that means changing our behavior (and getting the spec changed).</p>
<p>Sometimes that means implementing a work-around for specific apps
(that is only enabled for those apps!).</p>
<p>Sometimes that means not changing anything (and taking a hard line that
someone else needs to fix their code).</p>
<p>The combination of our ability to build our compiler on many common
platforms and our spec pedanticism puts Mesa in a fairly interesting
position. It means that developers could use our compiler, without
the baggage of the rest of a driver, as the thrid-party to settle
disputes. It can be the "if it compiles on here, it had better
compile anywhere" oracle.</p>
<p>Even if it fails at that, we emit a lot of warnings. Sometimes we emit <a href="https://bugs.freedesktop.org/show_bug.cgi?id=68838">too
many warnings</a>. A
standalone compiler gives a good start for <a href="http://en.wikipedia.org/wiki/Lint_(software)">"lint"</a> for GLSL.
There are already a couple places that we give portability warnings (things we
accept that some compilers are known to incorrectly reject), so there's
already some value there.</p>
Performance tuning for GENhttp://www.paranormal-entertainment.com/idr/blog/posts/2013-08-14T03:59:19Z-Performance_tuning_for_GEN/2013-08-16T00:08:43Z2013-08-14T03:59:19Z
<p><a href="http://www.paranormal-entertainment.com/idr/blog/images/SIGGRAPH13/idr-at-SIGGRAPH-2013.jpg">
<img src="http://www.paranormal-entertainment.com/idr/blog/images/SIGGRAPH13/idr-at-SIGGRAPH-2013.thumb.jpg" width="320" height="240" />
</a></p>
<p>Three weeks ago today (that's how far behind I am!), I gave one of Intel's
"Sponsored Technical Sessions" at SIGGRAPH. Last year I <a href="http://www.paranormal-entertainment.com/idr/blog/posts/2012-08-09T00:37:31Z-OpenGL_ES_3_0_announced_for_Intel_HD_Graphics_on_Linux/">presented one slide
in the OpenGL ES
BoF</a>.
This year I present in my company's paid room. Next year... the world.</p>
<p>The presentation was a brief overview of performance tuning graphics
applications... games... for the open-source driver on Intel's GPUs. This is
a collection of tips and suggestions that my team has gathered from tuning our
driver for shipping apps and working with ISVs like Valve. I'm already
working to improve the slide set, and I'm hoping to present something similar
at GDC. We'll see how that turns out.</p>
<p>Anyway, my
<a href="http://software.intel.com/sites/default/files/Performance-tuning-applications-for-Intel-GEN-Graphics-for-Linux-and-Google-Chrome-OS.pdf">slides</a>
are available from Intel.</p>
neGcon + SDL = ?http://www.paranormal-entertainment.com/idr/blog/posts/2013-04-12T19:31:39Z-neGcon_SDL/2013-04-12T21:14:27Z2013-04-12T19:31:39Z
<p>So... I've been on an old games kick for some time now. As part of
that, I recently purchased a <a href="http://en.wikipedia.org/wiki/Negcon">Namco
neGcon</a> Playstation controller.
I'm not going to dig out a copy of
<a href="http://en.wikipedia.org/wiki/Wipeout_(series)">Wipeout</a>... I want to
support it in some of the demo programs I write for the graphics
programming class I teach... because I can. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /></p>
<p><a href="http://www.paranormal-entertainment.com/idr/blog/images/negcon.jpg">
<img src="http://www.paranormal-entertainment.com/idr/blog/images/negcon-small.jpg" width="320" height="240" />
</a></p>
<p>A tiny bit of background for people too lazy to click the Wikipedia
link... This is an old Playstation controller. It came out long
before even the <a href="http://en.wikipedia.org/wiki/Dual_Analog_Controller">Dual
Analog</a> (April
1997, according to the Wikipedia article. I couldn't find a firm
release date, but I remember seeing adds for it around the launch time
of the Playstation. I could find some rec.games.video.sony posts from
March 1996 about importing it from Japan. What makes it special are
the quirky analog inputs. The left trigger and the two red buttons
are analog. The real kicker is <em>twisting</em> it in the middle is also an
analog input.</p>
<p>I hooked it up to my laptop with a generic Playstation-to-USB
converter, and hacked up a demo program in SDL to see how this thing
reports itself. The first disappointing thing is the name. SDL just
reports it as "USB Gamepad " (yes, with a space at the end). I'm sure
that's a quirk of the adapter. Since I have several controllers that
I use, I use the name to set default button mappings. My Logitech
DualShock look-a-like reports as "Logitech Logitech Dual Action" (yes,
Logitech twice), and my PS3 Sixaxis reports as "Sony PLAYSTATION(R)3
Controller".</p>
<p>It shows up as 5 axes, 12 buttons, and a hat. Let's look at the
mapping to see it get crazy:</p>
<ul>
<li>Twisting: axis 0</li>
<li>Buttons I and II (the red ones): axis 1. Yes, the two jolly, red,
candy-like analog buttons show up, <em>together</em>, as axis 1. Button I
gets the negative values, and button II gets the positive values.</li>
<li>Button A: button 1</li>
<li>Button B: button 0</li>
<li>Left trigger: axis 3</li>
<li>Right trigger: button 7</li>
<li>Start: button 9</li>
<li>D-pad: Hat 0. I hate controllers that advertise the d-pad as a
hat. My Logitech controller does that, but the Sixaxis just shows
them as buttons.</li>
</ul>
<p>All of this begs the question, "WTF?" It also begs a couple follow-up
questions. Is all of this madness caused by the adapter, or is it
endemic to the controller itself? I suspect it shows up as 12 buttons
because of the <a href="http://en.wikipedia.org/wiki/DualShock">DualShock</a>.
The DualShock actually has 13 buttons (the "Analog" selector), but I
don't think that gets sent over the protocol. I think that just
changes the function of the controller itself. My Logitech has a
similar "mode" button, and that doesn't go over the protocol.</p>
<p>Did anyone ever use a neGcon with a parallel port adpater? How did it
show up? It looks like the Linux kernel has supported it for ages, so
someone must have done it...</p>
GLX_MESA_query_renderer out for reviewhttp://www.paranormal-entertainment.com/idr/blog/posts/2013-03-01T23:15:18Z-GLX_MESA_query_renderer_out_for_review/2013-03-01T23:35:14Z2013-03-01T23:15:18Z
<p>After giving a <a href="http://www.paranormal-entertainment.com/idr/blog/posts/2013-02-07T22:42:53Z-FOSDEM2013_Presentation/">talk at
FOSDEM</a>
last month on this topic, I finally finished my work on
<code>GLX_MESA_query_renderer</code>... at least finished enough to send out for
<a href="http://lists.freedesktop.org/archives/mesa-dev/2013-March/035562.html">review by a wider
audience</a>.</p>
<p>The extension is modeled after Apple's
<a href="https://developer.apple.com/library/mac/#documentation/graphicsimaging/reference/CGL_OpenGL/Reference/reference.html#//apple_ref/c/func/CGLDescribeRenderer"><code>CGLDescribeRenderer</code></a>
interface. Before even embarking on this project, several ISVs told me
that they really liked that interface. There are some small changes,
but it's still pretty similar.</p>
<p>The <code>glXQueryRendererIntegerMESA</code> and <code>glXQueryRendererStringMESA</code>
functions allow applications query a bunch of aspects about the driver
and hardware <em>before</em> creating a context:</p>
<ul>
<li>Driver version</li>
<li>Driver vendor</li>
<li>Hardware vendor (may be different from driver vendor!)</li>
<li>Hardware chipset (PCI ID)</li>
<li>Available memory</li>
<li>UMA vs. non-UMA</li>
<li>Supported and prefered (by the driver) GL profiles</li>
</ul>
<p>The last one is really important to know before creating a context
because it may influence what sort of context that app creates. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /></p>
<p>The initial branch, with the extension spec, is available at:</p>
<p><a href="http://cgit.freedesktop.org/~idr/mesa/log/?h=query-renderer">http://cgit.freedesktop.org/~idr/mesa/log/?h=query-renderer</a></p>
OpenGL ES 3.0 conformance!http://www.paranormal-entertainment.com/idr/blog/posts/2013-02-13T16:17:14Z-OpenGL_ES_3_0_conformance/2013-02-13T16:36:39Z2013-02-13T16:17:14Z
<p>Woo hoo! In order that people can announce products at <a href="http://www.mobileworldcongress.com/">Mobile World
Congress</a> next week, Khronos voted to
approve the OpenGL ES 3.0 conformance submissions before the usual 30-day
review period was up. It took quite a bit longer to get the conformance tests
ready, so this move was made to not punish companies (who all worked hard to
get their products ready) for delays in the test suite.</p>
<p>Anyway... the vote passed, and <a href="http://www.khronos.org/conformance/adopters/conformant-products#opengles"><em>WE'RE
IN!!!</em></a>
We did it!!!</p>
<p><img src="http://www.paranormal-entertainment.com/idr/blog/images/Intel-OpenGL-ES-3.0-conformance.jpg" width="320" height="240" /></p>
<p>As an aside, thanks to Ken's <a href="http://lists.freedesktop.org/archives/mesa-dev/2013-February/034492.html">recent
patches</a>,
we should be able to submit results for Sandy Bridge on Mesa 9.1 soon.
Unfortunately, that submission will have to wait for the 30-day review period.</p>
FOSDEM2013 Presentationhttp://www.paranormal-entertainment.com/idr/blog/posts/2013-02-07T22:42:53Z-FOSDEM2013_Presentation/2013-02-07T23:13:23Z2013-02-07T22:42:53Z
<p><img src="http://www.paranormal-entertainment.com/idr/blog/images/FOSDEM13/FOSDEM2013-talk.jpg" width="320" height="240" /></p>
<p>The <a href="http://www.paranormal-entertainment.com/idr/blog/images/FOSDEM13/FOSDEM2013-GPU-detection.pdf">slides</a> from my <a href="https://fosdem.org/2013/schedule/event/gpuhwdetect/">FOSDEM
talk</a>
are now available. I would have gotten them out sooner, but I caught
a bit of a cold on the way home. I guess averaging 3 hours of sleep
per night wore my resistance down. Who knew?</p>
<p>In any case, the talk went really well. The attendance was low due to
not being in the printed schedule (I got my information in really
late) and being scheduled across from <a href="https://fosdem.org/2013/schedule/event/operating_systems_open_arm_gpu/">Luc's graphics talk</a> in the main
track. It was really good to chat with the Wine developers... I
continue to be amazed that thing works. I don't envy them <em>at
all</em>... but I'm glad they're there.</p>
Another victory for open-source drivershttp://www.paranormal-entertainment.com/idr/blog/posts/2013-02-06T00:32:32Z-Another_victory_for_open-source_drivers/2013-02-06T00:40:21Z2013-02-06T00:32:32Z
<p>Unbeknownst to most, last week was a pretty big week for open-source
graphics drivers... and I'm not referring to all the presentations at
FOSDEM. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /> Intel and the Mesa community made good on <a href="http://www.paranormal-entertainment.com/idr/blog/posts/2012-08-09T00:37:31Z-OpenGL_ES_3_0_announced_for_Intel_HD_Graphics_on_Linux/">my bold claim at
SIGGRAPH
2012</a>,
and <a href="https://01.org/blogs/brullman/2013/intel%E2%80%99s-open-source-graphics-driver-goes-mobile">we submitted OpenGL ES 3.0 conformance
results</a>
for Ivy Bridge GPUs on the Mesa 9.1 release branch last Tuesday. So
far, only two other companies have made submissions, one before and
<a href="http://www.electronicsweekly.com/Articles/04/02/2013/55489/imagination-targets-opengl-es-3.0-conformance-with-khronos.htm">one
after</a>
ours.</p>
<p>This is a really big deal for both Intel and Mesa! When was the last
time either produced a hardware driver within a reasonable amount of
time after the spec was released? I'm not sure that Mesa has ever
done that, and I believe it was around OpenGL 1.3 for Intel... and now
we're one of the first...</p>
<p>Once the <a href="https://www.khronos.org/conformance/">30-day review period</a>
has passed (assuming there are no faults found with our submission),
we'll be listed in the <a href="http://www.khronos.org/conformance/adopters/conformant-products#opengles">conformant products
list</a>.
Watch this space for more details...</p>
OpenGL ES 2.0 conformance!http://www.paranormal-entertainment.com/idr/blog/posts/2012-08-20T15:57:46Z-OpenGL_ES_2_0_conformance/2012-08-20T16:26:48Z2012-08-20T15:57:46Z
<p>This is a great day for Mesa and open-source graphics drivers. Just a
tad over a month ago, I submitted OpenGL ES 2.0 conformance test
results to Khronos for Intel Sandy Bridge and Ivy Bridge GPUs with
Mesa 8.0.4. There were no objections during the 30 day review period,
so we are now <em>officially</em> conformant! Finally being on <a href="http://www.khronos.org/conformance/adopters/conformant-products#opengles">that
list</a>
is pretty cool.</p>
<p>Not only is this great news for my team at Intel, but it's terrific
news for Mesa. Mesa has had a long history with OpenGL, the ARB, and
Khronos. This is, however, the first time that Mesa has ever, in any
way, been listed as a conformant implementation. This is a big boost
to Mesa's credibility.</p>
<p>Hopefully we'll be able to follow this with OpenGL ES 3.0 conformance
next year. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /></p>
OpenGL ES 3.0 announced... for Intel HD Graphics on Linux!http://www.paranormal-entertainment.com/idr/blog/posts/2012-08-09T00:37:31Z-OpenGL_ES_3_0_announced_for_Intel_HD_Graphics_on_Linux/2012-08-09T01:24:42Z2012-08-09T01:06:30Z
<p>The OpenGL ES BoF at SIGGRAPH is still in progress, but let's have some
real-time news to go with our real-time rendering! In addition to announcing
the availability of OpenGL ES 3.0 and ASTC, several companies were able to
announce their plans for OpenGL ES 3.0. Intel's Open-Source Technology Center
was there. We are working on ES 3.0, and we have a public branch to prove it: <code>git://anongit.freedesktop.org/mesa/mesa gles3</code></p>
<p><a href="http://www.paranormal-entertainment.com/idr/blog/images/SIGGRAPH12/es3.jpg">
<img src="http://www.paranormal-entertainment.com/idr/blog/images/SIGGRAPH12/es3.thumb.jpg" width="320" height="240">
</a></p>
<p>Right now things are "pre-alpha" quality. There are a few features, like
ETC2, that are not yet supported. There are also a bunch of holes in support
for some enums (both ones that should be supported and ones that should not).
At this point, we've enabled a big pile of the functionality, and the driver
says "OpenGL ES 3.0 Mesa 8.1-devel". That's why this lives on a branch, and
it will continue to live on a branch until at least after the next Mesa
release (probably in September).</p>
<p>Like the slide presented at the BoF says, our plan is to have ES 3.0 fully
enabled for release in 2013Q1. This probably means February, but we'll see.
Software releases happen when they happen.</p>
The zombies cometh...http://www.paranormal-entertainment.com/idr/blog/posts/2012-07-19T18:54:37Z-The_zombies_cometh/2012-07-19T20:25:51Z2012-07-19T18:54:37Z
<p>Last week my team and I spent some time in Bellvue working with
<a href="http://blogs.valvesoftware.com/linux/steamd-penguins/">Valve's Linux
team</a> on their
port of Left 4 Dead 2.</p>
<p>It was the most successful work trip I've ever had. The guys at Valve
were amazing to work with. They are sharp, driven, and have an
aggressive plan. Looking at how far they've come and the short amount
of time in which they've done it, I have every confidence that they're
going to kick their plan right in the butt. It's going to be a good
time to be a Linux gamer.</p>
<p>We had three main goals going in:</p>
<ol>
<li>Help them tune their game for our driver / hardware.</li>
<li>Find out where our performance is lacking.</li>
<li>Find out what OpenGL features they need / want.</li>
</ol>
<p>I think we scored on every point. We helped them find some
performance bugs in their vertex buffer management (which also
affected other GPUs / drivers) and some places where the accidentally
triggered shader recompiles. This gave some healthy performance
improvements.</p>
<p>We also found some areas where our driver really, really needs to
improve. They have a couple shaders that devolve into register
spilling nightmares. There are also a few places where we eat way,
way too much CPU. A lot of these problems mirror issues that we've
seen with other game engines (e.g., Unigine).</p>
<p>These have been a lot easier to diagnose on L4D2 because we have
access to their source code. Being able to take a profile that shows
times in the driver and in the application makes a world of
difference. Being able to tweak little things in the app (what
happens if I do this...) is also helpful for diagnosing performance
problems. Eric has already started landing <a href="http://cgit.freedesktop.org/mesa/mesa/commit/?id=a40c1f95229915214be061fbbf9a02e5225fbf01">patches for L4D2
performance</a>,
and there will be many more over the coming weeks.</p>
<p>The funny thing is Valve guys say <em>the same thing about drivers</em>.
There were a couple times where we felt like they were trying to
convince <em>us</em> that open source drivers are a good idea. We had to
remind them that they were preaching to the choir. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /> Their problem with
closed drivers (on all platforms) is that it's such a blackbox that
they have to play guess-and-check games. There's no way for them to
know how changing a particular setting will affect the performance.
If performance gets worse, they have no way to know why. If they can
see where time is going in the driver, they can make much more
educated guesses.</p>
<p>We also got some really good feedback about features. The biggest
feature they want is better output from
<a href="http://www.opengl.org/registry/specs/ARB/debug_output.txt"><code>GL_ARB_debug_output</code></a>.
They really want to know when they do things that fall off performance
paths, trigger shader recompiles, etc. We hacked out some initial
versions of this, and it was a big help. Some patches in that area
should hit the mailing list soon.</p>
<p>They're also interested in what they call "smart vsync." Swaps that
are scheduled soon enough will have vsync, and the application will be
vsync limited. Swaps that are scheduled too late happen immediately.
In their words, "Tearing is bad, but dropping to 30fps is worse." On
GLX, we can expose this with
<a href="http://www.opengl.org/registry/specs/EXT/glx_swap_control_tear.txt"><code>GLX_EXT_swap_control_tear</code></a>.</p>
Yay! More TRON!http://www.paranormal-entertainment.com/idr/blog/posts/2012-05-25T22:54:37Z-Yay_More_TRON/2012-05-25T23:04:02Z2012-05-25T22:35:40Z
<p>The other night I watched the pilot for <a href="http://tron.wikia.com/wiki/TRON:_Uprising">TRON:
Uprising</a>, and was frickin'
impressed. The plot was quite decent, probably even better than
<a href="http://tron.wikia.com/wiki/TRON:_Legacy">TRON: Legacy</a>. For a TV
show on the Disney Channel, the production quality was amazing. The
voice acting was really well done, and the rendering was beautiful.
(I'm not sure if the soundtrack was original, or if was just harvested
from TRON: Legacy.)</p>
<p>That's actually my biggest concern about it. When the series begins
in June, I have a hard time believing that every episode will have as
much work put into as the pilot.</p>
<p>As an additional shock, it was broadcast <em>without</em> commercials.
Somebody must have gotten fired for that!</p>
<p><a href="http://www.youtube.com/watch?v=hjbwVzJR8w4">Watch it</a> for yourself...</p>
Worst company in America? Harsh.http://www.paranormal-entertainment.com/idr/blog/posts/2012-05-02T18:34:34Z-Worst_company_in_America_Harsh/2012-05-02T18:36:14Z2012-05-02T18:34:34Z
<p>It looks like I'm not the only one who's <a href="http://www.paranormal-entertainment.com/idr/blog/posts/2011-12-16T20:32:04Z-No_LAN-only_servers_Youre_kidding_right/">not a fan of
EA</a>.
The Consumerist <a href="http://www.techpowerup.com/163621/EA-is-Consumerist-s-Worst-Company-in-America-for-2012.html">really doesn't like
them</a>.
Ouch.</p>
Assembly shaders in GLSL IRhttp://www.paranormal-entertainment.com/idr/blog/posts/2012-04-17T19:00:38Z-Assembly_shaders_in_GLSL_IR/2012-04-17T19:20:40Z2012-04-17T19:00:38Z
<p>Off-and-on for a couple years (no kidding) I've been working on a branch that
compiles the assembly shaders (e.g.,
<a href="http://www.opengl.org/registry/specs/ARB/vertex_program.txt"><code>GL_ARB_vertex_program</code></a>)
to GLSL IR. I even talked about it at <a href="http://www.x.org/wiki/Events/XDC2011/Program">XDC
2011</a>. This project has turned
into such an incredible rat's nest of irritation that I can't even believe
it.</p>
<p>All of that asside, the project reached a significant milestone today. I can
run retail Doom3 binaries. There are a couple caveats (incorrect rendering,
have to disable HiZ on Sandybridge, etc.), but it's still significant
progress. The images below are i965 on Mesa 8.0.2 (with HiZ disabled), i965
on my branch (with HiZ disabled), and classic swrast on my branch. At least
at the time of this writing, there are <a href="https://bugs.freedesktop.org/show_bug.cgi?id=47535">some
bugs</a> related to separate
stencil on Sandybridge that only occur when HiZ is enabled.</p>
<p><a href="http://www.paranormal-entertainment.com/idr/blog/images/asm-to-ir-doom3/965-good.jpg">
<img src="http://www.paranormal-entertainment.com/idr/blog/images/asm-to-ir-doom3/965-good.jpg" width="320" height="240" />
</a>
<a href="http://www.paranormal-entertainment.com/idr/blog/images/asm-to-ir-doom3/965-bad.jpg">
<img src="http://www.paranormal-entertainment.com/idr/blog/images/asm-to-ir-doom3/965-bad.jpg" width="320" height="240" />
</a>
<a href="http://www.paranormal-entertainment.com/idr/blog/images/asm-to-ir-doom3/swrast-bad.jpg">
<img src="http://www.paranormal-entertainment.com/idr/blog/images/asm-to-ir-doom3/swrast-bad.jpg" width="320" height="240" />
</a></p>
Miskatonic University graduatehttp://www.paranormal-entertainment.com/idr/blog/posts/2012-04-17T18:00:51Z-Miskatonic_University_graduate/2012-04-17T18:30:07Z2012-04-17T18:00:51Z
<p>I finally got around to reading some H. P. Lovecraft. I really enjoyed most
of it. It was amazing to see how much his work has influenced modern sci-fi
and horror. In a few of the stories I really felt like I was reading an
episode of the X-Files. Most of the time the stories were more creepy than
scary. <em>Most</em> of the time.</p>
<p>The notable exception was <a href="http://en.wikipedia.org/wiki/The_Haunter_of_the_Dark">"Hunter of the
Dark"</a>. To maximize the
effect of these stories, I only read them in bed just before going to sleep.
After reading this particular story, I went to sleep very happy. Well, not
happy per-se, but I was very satisfied with how much I enjoyed the story.
About 3am my cat woke me up madly scratching on the wood floor in the next
room. I'm not sure if he was running around in circles or fighting some
blasphemous creature from another realm. In any case, the sound woke me so
suddenly that I sat straight up in bed. My heart was racing.</p>
<p>I looked out towards the open doorway from my bedroom. As my eyes slowly
adjusted to the darkness I noticed it. Something, in the corner of the room
above the doorway, shifted slightly. I waited with bated breath. There was
only darkness. The thing that had moved <em>was</em> the shadow. After more than a
minute watching, waiting, it moved no more.</p>
<p>Still sitting up, I closed my eyes and took a deep breath. When I opened my
eyes, I smiled from ear to ear. After having read a dozen or more of
Lovecraft's stories, I finally understood the joy that readers who hadn't
grown up on Alien, Jaws, and The X-Files must have felt reading this work for
the first time. I laid back down and slept like a baby.</p>
Smurf commithttp://www.paranormal-entertainment.com/idr/blog/posts/2012-04-04T00:56:23Z-Smurf_commit/2012-04-04T01:17:51Z2012-04-04T00:56:23Z
<p><strong>Smurf com•mit</strong> [smɚf kə'mĭt] <br />
<em>noun</em></p>
<ol>
<li><p>Commit made, usually during a long series of commits, that makes
incremental changes or tweaks while developing some larger feature or
performing some larger refactor. Such commits often feature commite messages such as "almost there," "will be working soon," or <a href="http://www.imdb.com/title/tt0081933/quotes?qt=qt0119757">"not much further now."</a></p></li>
<li><p>Commit made by a Smurf.</p></li>
</ol>
Portland is... ?http://www.paranormal-entertainment.com/idr/blog/posts/2012-01-10T02:14:09Z-Portland_is/2012-01-10T02:19:51Z2012-01-10T02:14:09Z
<p>Just for giggles, watch an episode of
<a href="http://en.wikipedia.org/wiki/Grimm_%28TV_series%29">Grimm</a>, then
watch and episode of
<a href="http://en.wikipedia.org/wiki/Portlandia_%28TV_series%29">Portlandia</a>.
For more fun, take a shot of [beverage of choice] each time you see a
location in one show that you saw in the other.</p>
No LAN-only servers? You're kidding, right?http://www.paranormal-entertainment.com/idr/blog/posts/2011-12-16T20:32:04Z-No_LAN-only_servers_Youre_kidding_right/2011-12-16T20:45:06Z2011-12-16T20:32:04Z
<p>After planning my first LAN party in over a year, I discovered that
the game I planned to play, Battlefield: Bad Company 2, intentionally
does not include support for LAN-only servers. In over 15 years of
hosting LAN parties, I have never encountered a game that does this.</p>
<p>EA made this choice, supposedtly, to curb piracy. What they have done
is guarantee that I will never buy one of their products again. Ever.</p>
<p>Strong work.</p>
Occupy Portlandhttp://www.paranormal-entertainment.com/idr/blog/posts/2011-11-14T18:07:51Z-Occupy_Portland/2011-11-14T18:13:43Z2011-11-14T18:07:51Z
<p>In the wake of <a href="http://photos.oregonlive.com/photo-essay/2011/11/occupy_portland_camp_cleaning.html">Occupy Portland being shut
down</a>,
it's good to reflect on why it failed: <a href="http://www.kgw.com/news/local/Fourth-overdose-reported-at-Occupy-camp-as-deadline-approaches-133742433.html">1% ruined
it</a>
for 99%.</p>
No build breaks!http://www.paranormal-entertainment.com/idr/blog/posts/2011-10-26T22:35:41Z-No_build_breaks/2011-10-27T03:02:12Z2011-10-26T22:35:41Z
<p>GIT is a wonderful tool. It enables some really powerful, flexible
working models. There is one model that is commonly used when
developing a major feature (or large refactor):</p>
<ul>
<li><p>Create a long series of patches in the order that it makes sense
to develop them.</p></li>
<li><p>Rebase, reorder, and merge patches into the order that it makes
sense to review them.</p></li>
<li><p>Post patches for review in small, easy to digest groups.</p></li>
</ul>
<p>There is a danger in this process. While reordering patches it is
very easy to create a tree that won't build at intermediate commits.
Since the entire group of patches gets pushed at once, this may not
seem like a problem. However, having intermediate commits not build
makes it impossible to bisect when failures are found later.</p>
<p>Having every commit along a long patch series build is an absolute
requirement.</p>
<p>However, it's kind of a pain in the ass to manually build the tree at
every step. The emphasis in the previous sentence is <em>manually</em>. In
some sense the ideal tool is something like a scripted bisect. This
doesn't work, of course, because both ends of the commit sequence, in
bisect terminology, are good.</p>
<p>To get around this in Mesa, I wrote a script that builds
<code>origin/master</code> and every commit in some range of SHA1s. If any build
fails, the script halts. At the end, it logs the change in the
compiler warnings from <code>origin/master</code> to each commit (as I write
this, it occurs to me that the warning diffs should be between
sequential commits). This is useful to prevent new warnings from
creeping in.</p>
<p>My script is <a href="http://www.paranormal-entertainment.com/idr/blog/misc/check_all_commits.sh">available</a>.
This particular script is very specific to Mesa, but it should be easy
to adapt to other projects. The script is run as:</p>
<pre><code>check_all_commits.sh /path/to/source /path/to/build firstSHA..lastSHA
</code></pre>
SIGGRAPH 2011: Day 4http://www.paranormal-entertainment.com/idr/blog/posts/2011-08-18T17:04:41Z-SIGGRAPH_2011:_Day_4/2011-08-18T17:43:21Z2011-08-18T17:04:41Z
<p>(Better never than late... or something...)</p>
<p>I had high expectations for <a href="http://www.siggraph.org/s2011/for_attendees/talks/sessions/125">Hiding
Complexity</a>,
but I was largely disappointed. I only stayed for the first two talks. As
far as I could tell, <em>Occlusion Culling in Alan Wake</em> summarized the
combination of a bunch of known techniques for occlusion. Their combination
seems to have the strong <em>disadvantage</em> that it has a lot of temporal
instability, and this can lead to frame rate jitter. Even the bit of the talk
about optimizing shadow generation seemed like a subset of the optimizations
from <a href="http://gamma.cs.unc.edu/ccsv/">CC Shadow Volumes</a>. I'll have to look at
their I3D paper, <a href="http://www.cg.tuwien.ac.at/research/publications/2011/bittner-2011-scc/">Shadow Caster Culling for Efficient Shadow
Mapping</a>
to be sure.</p>
<p><em>Increasing Scene Complexity: Distributed Vectorized View Culling</em> can be
summarized by: we optimized a slow part of our code in all the obvious ways,
and it got a lot faster. <strong>shock</strong>.</p>
<p>After that, I bailed and went to <a href="http://www.siggraph.org/s2011/content/compiler-techniques-rendering-0">Compiler Techniques for
Rendering</a>
(<a href="http://www.s2001compilers.org/">slides are also available</a>.</p>
<p>I missed the first couple talks, but I did arrive in time for
<a href="http://www.cdl.uni-saarland.de/projects/anysl/">AnySL</a>. They have an
interesting project. It's essentially an N:M compiler. It seems like we
should connect their OpenCL work with various open-source efforts that are
underway. This is especially the case if their claim of beating Intel's (CPU)
OpenCL compiler on <em>almost</em> all kernels turns out to be true.</p>
<p><em>Automatic Bounding of Shaders for Efficient Global Illumination</em> was
interesting, but I don't think it has anything directly applicable to our GLSL
compiler work. However, it did give me some ideas to try for a real-time
light integrator that I've been working on.</p>
<p><em>Compilation for GPU Accelerated Ray Tracing in OptiX</em> looked mostly
like their talk from SIGGRAPH last year. I didn't recall any mention
of the previous
<a href="http://graphics.stanford.edu/~boulos/papers/rtsl.pdf">RTSL</a> work, and
that paper was an interesting read. There are a couple built-in
functions in that language that are useful. I've open-coded a couple
of them in the past...</p>
<p>The final session of the conference was <a href="http://www.siggraph.org/s2011/for_attendees/technical-papers/sessions/68">Real-Time Rendering
Hardware</a>.</p>
<p><em>Clipless Dual-Space Bounds for Faster Stochastic Rasterization</em> and
<em>Decoupled Sampling for Graphics Pipelines</em> were related pieces of work. Each
was a different part of solving the automatic defocus and motion blur
problem. I like the idea of having the hardware assist with these in a
similar way that it helps with antialiasing. While it's trivial to expose
MSAA to the developer (it's mostly transparent), it's not clear to me how to
expose motion blur or, to a lesser degree, defocus blur. Given all the weird
ways that people implement animation in real-time systems, how can the API
directly expose a time dimension as a shader parameter?</p>
<p><a href="http://intel.ly/spark-s2011/"><em>Spark: Modular, Composable Shaders for Graphics
Hardware</em></a> echoes a lot of concerns that
I've had for a few years. That people have to machine generate 10,000
shaders or use <code>#define</code> madness to specialize 10,000 variations of
their shaders shows that we haven't given them a useful system. Even
without that it's pretty much impossible to have separation of
concerns in a shader stack. They way that
<a href="http://code.google.com/p/openshadinglanguage/">OSL</a> allows shaders to
be composed solves some of this, and Spark takes a different approach.</p>
<p><em>Physically Based Real-Time Lens Flare Rendering</em> goes in the "I should try to
implement that" bin. Bastards! It was nice ending the conference with pretty
pictures.</p>
SIGGRAPH 2011: Day 3http://www.paranormal-entertainment.com/idr/blog/posts/2011-08-12T17:09:18Z-SIGGRAPH_2011:_Day_3/2011-08-12T17:11:49Z2011-08-12T17:09:18Z
<p>I went to
<a href="http://www.siggraph.org/s2011/for_attendees/technical-papers/sessions/55">Surfaces</a>
just to hear <a href="http://www.cc.gatech.edu/~topraj/SIGGRAPH11.html">LR: Compact Connectivity Representation for Triangle
Meshes</a>. Their technique is
pretty simple, and achieves really good results. Their primary insight was
that a lot of mesh connectivvity can be stored <em>implicitly</em> by the ordering of
the verticies. If all of your vertex data is a (non-indexed) strip, you get a
lot of information for free. Like most mesh data structures, they only handle
manifold meshes. The big disadvantage is that LR doesn't "yet" handle
updates, but that's an area of planned future research.</p>
<p>I also tried to get over to the last bits of <a href="http://www.siggraph.org/s2011/for_attendees/talks/sessions/118">Mixed
Grill</a>, but I
only managed to catch <em>High-Resolution Relightable Buildings From
Photographs</em>. Their technique is really a novel combination of several known
techniques. Their results are pretty impressive.</p>
<p>The last session before lunch was <a href="http://www.siggraph.org/s2011/for_attendees/technical-papers/sessions/56">Image
Processing</a>.
I was primarily interested in <a href="http://research.microsoft.com/en-us/um/people/hoppe/proj/aarecovery/">Antialiasing
Recovery</a>,
and it was a really well given talk. You can tell that a speaker knows their
audience when he starts with, "I understand that there are people like me that
like to take naps during talks, so if you want to get the gist of the paper,
pay attention to these parts." Strong work.</p>
<p>They take an image before and after some filter operation (e.g., thresholding
to black and white) and try to recover antialiasing (smooth edges, really) in
the prefiltered image. This is acomplished by examining both images for hard
edges and doing neighbor searches and blending in the areas where new hard
edges appear. On current limitation is the assumption that only two colors
from a pixel's 8 neighbors contribute to the original smooth edge. They also
plan to have code available on their project page in a month or so.</p>
<p><a href="http://people.csail.mit.edu/sparis/publi/2011/siggraph/">Local Laplacian Filters: Edge-aware Image Processing with a Laplacian
Pyramid</a> was a clever
techniqe. I'll probably try to play around with it a bit. There are a few
areas in real-time rendering (e.g., SSAO, some soft-shadow algorithms) where
bilateral filtering is used as an edge-aware filter. <em>Most</em> of these are
low-frequency effects where some of the noise isn't as apparent, but there may
still be some benefit.</p>
<p>The remaining papers, <em>Domain Transform for Edge-Aware Image and Video
Processing</em> and <em>Non-Rigid Dense Correspondence With Applications for Image
Enhancement</em>, produce really good results, but they're both in area <em>way</em>
outside my area of expertise.</p>
<p>I spent the afternoon in the expo hall and at the Animation Theater
"demoscene" session. Hurray for seeing CNCD / Fairlight on the big screen.
Things have come a long way since <a href="http://scene.org/dir.php?dir=%2Fmirrors%2Famigascne%2FGroups%2FE%2FEpsilon%2F">my scene
days</a>...</p>
<p>After that, I went to the OpenGL BoF. Hurray for <a href="http://www.khronos.org/news/press/khronos-enriches-cross-platform-3d-graphics-with-release-of-opengl-4.2-spec">OpenGL
4.2</a>!</p>
SIGGRAPH 2011: Day 2http://www.paranormal-entertainment.com/idr/blog/posts/2011-08-10T15:07:17Z-SIGGRAPH_2011:_Day_2/2011-08-10T16:38:28Z2011-08-10T15:07:17Z
<p>I started the day with <a href="http://www.siggraph.org/s2011/for_attendees/talks/sessions/115">Out of
Core</a>, but I
missed <em>Google Body: 3D Human Anatomy in the Browser</em>.</p>
<p>Over the last few years there have been a lot of papers about real-time global
illumination. They always start with two caveats: no specular and one bounce.
<em>Interactive Indirect Illumination Using Voxel Cone Tracing</em> breaks the mold
and goes for two bounces! Hurray! They can also handle long-range indirect
illumination better than LPVs, and it runs slightly faster. Based on their
2009 GigaVoxels work.</p>
<p><em>Out-of-core Raytracing</em> was really hard to listen to. A big chunk of his
presentation was a video of animated slides. Bad presenter, no biscuit! Even
more frustrating is that the bulk of the presentation focused on the
performance of his very limited raytracer. The raytracer can handle a lot of
polygons, but it can't do shaders, textures, etc. When asked, he said, "Right
now shading is not implemented in this project." Performance comparisons with
other (more capable) raytracers are just not interesting.</p>
<p>What <em>was</em> interesting is the paging structure that he developed to make it
work. The fundamental problem with GPU raytracing is that interesting scenes
are multiple gigabytes, and GPUs can't handle that much data in a single
batch. To over come this he developed a novel way of breaking the scene data
into pages and determining which rays needed which pages. That was the
interesting part, but he only spent a few scant minutes talking about it.</p>
<p>After that, I headed over to <a href="http://www.siggraph.org/s2011/for_attendees/technical-papers/sessions/49">Stochastic Rendering &
Visibility</a>.</p>
<p><a href="http://fileadmin.cs.lth.se/graphics/research/papers/2011/spatiotemp/">High-Quality Spatio-Temporal Rendering using Semi-Analytical
Visibility</a>
is obviously not targeted at real-time rendering, but it seems like some
aspects could be adapted. One of my favorite things about this presentation
was the rich list of areas for future research.</p>
<p>Both <a href="http://graphics.berkeley.edu/papers/Egan-FAS-2011-04/index.html">Frequency Analysis and Sheared Filtering for Shadow Light Fields
of Complex
Occluders</a>
and <a href="http://groups.csail.mit.edu/graphics/tlfr/">Temporal Light Field Reconstruction for Rendering Distribution
Effects</a> assumed a lot of
background knowledge that I don't have. In particular, all the bits
about the Fourier analysis of occluder depths (which was a pretty key
element!) was completely lost on me. I did find the medium frequency
artifacts in the former paper interesting. Who gets medium frequency
noise?!? It's always either high frequency or low frequency. I also
appreciated the background material at the start of the later
presentation. I'll probably harvest some of that for my VGP sequence.</p>
<p><em>The Area Perspective Transform: A Homogeneous Transform for Efficient
In-Volume Queries</em> was an interesting idea that seems to obvious to work. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" />
It takes a bunch of math operations to intersect a frustum with a bounding
volume, but it's cheap to intersect an AABB with another bounding volume.
Their solution? Project the points of the base (the big part) of the frustum
to inifinit so that the lines become parallel (in the limit). I still need to
read the paper to get all the details.</p>
<p>There were only a couple of papers that I paid attention to in
<a href="http://www.siggraph.org/s2011/for_attendees/technical-papers/sessions/53">By-Example Image
Synthesis</a>.</p>
<p>Techniques like <a href="http://www-sop.inria.fr/reves/Basilic/2011/BLRDD11/">Image-Guided Weathering: A New Approach Applied to Flow
Phenomena</a> are
increasingly important in games. They take some examplar images to
generate parameters for a particle simulation, then they use those
parameters to generate new images. What's cool about this is that
almost all of the computation is done to "reverse engineer" the
original image. It ought to be possible to use that data (with some
perturbation of the parameters) to generate new images each time the
game is run. This is another one that goes on my "to implement" list.</p>
<p>I was really stoked about <a href="http://research.microsoft.com/apps/pubs/default.aspx?id=147069">Discrete Element
Textures</a>.
One of the authors, <a href="http://www.liyiwei.org/">Li-Yi Wei</a>, presented one of my
favorite SIGGRAPH
<a href="http://graphics.stanford.edu/papers/tile_mapping_gh2004/">papers</a>. This is
"another" exemplar-based texture synthesis algorithm. Like some of the
previous work they treat elements in the exemplar as units. This prevents the
old artifacts of getting half a of a pebble, for example, in your gravel
texture. I haven't read all of other previous work, but I thought it was
pretty cool that their work also applies to 3D objects. The piles of carrots
and plates of spaghetti were pretty cool.</p>
SIGGRAPH 2011: Day 1http://www.paranormal-entertainment.com/idr/blog/posts/2011-08-09T21:45:01Z-SIGGRAPH_2011:_Day_1/2011-08-09T22:09:30Z2011-08-09T21:45:01Z
<p>I started the day with <a href="http://advances.realtimerendering.com/">Advances in Real-Time Rendering in
Games</a>. I found it interesting that
<a href="http://www.bungie.net/projects/reach/default.aspx">Halo Reach</a> uses "state
mirroring" to communicate updated world state from the simulation process to
the rendering process. They're essentially treating the cores in the Xbox 360
as a distributed system rather than an SMP. This echos what
<a href="http://www.timmattson.com/work.shtml">Matteson</a> et. al. found while
developing the <a href="http://techresearch.intel.com/ProjectDetails.aspx?Id=1">Single-Chip Cloud
Computer</a>.</p>
<p>The Cars 2 talk started the long train of "we do annoying stuff to work around
the limitations of console GPUs." In particular, a large portion of their
stereo rendering algorithm was implemented on the SPUs because the RSX cannot
do scattered writes. It seems like at least the generation of the item
buffer, which is the mapping of points the reference image to one of the
stereo pairs, could be done on the RSX. Of course, OpenGL 4.x class GPUs can
do this. It would be interesting to recast their algorithm using
<a href="http://www.opengl.org/registry/specs/ARB/shader_image_load_store.txt"><code>GL_ARB_shader_image_load_store</code></a>
(Note: DX people will know this as unordered access views / UAVs).</p>
<p>The <a href="http://www.littlebigplanet.com/en/2/">Little Big Planet 2</a> talk was
pretty cute. Their voxel algo rithm for doing AO in world space (instead of
screen space) was clever and produces really good results. Generating one
blob of expensive data and using it for a lot of things usually means you're
winning. I'll also have to add mention to my VGP353 lectures that both LBP1
and LBP2 use variance shadow maps.</p>
<p>The CryEngine 3 talk moved really fast and spent a lot of time switching
between speakers. It was hard to get much out of it. However, I did get a
couple notes for things we need to make better in our driver.</p>
<p>They showed a bit of HLSL code:</p>
<pre><code>float4 HPos = (vStoWBiasZ + (vStoWBiasX * Vpos.x) + (vStoWBiasY * Vpos.y)) *
fSceneDepth;
HPos += vCamPos.xyzw;
</code></pre>
<p>The initial calculation of <code>HPos</code> <em>should</em> be implemented as a single
<a href="http://msdn.microsoft.com/en-us/library/bb219756(v=vs.85).aspx"><code>DP2A</code></a>
instruction on architectures that can do that:</p>
<pre><code>DP2A HPos, Vpos, vStoWBias, vStoWBiasZ;
</code></pre>
<p>We can't do that with our current compiler, and it would take a lot of work to
do so. One thing that we would have to do is notice that two independent
<code>float</code> variables need to be packed into a single <code>vec2</code>. Doing that packing
could have repercussions elsewhere in the code. This is where tree matching
code generators that use dynamic programming and cost functions really shine.</p>
<p>They CryTek guys also complained about the high latency for frame read back
(up to 4 frames) on desktop GPUs. They want to do CPU processing on the depth
buffer from a previously rendered frame to do approximate visibility
calculations for later frames. On consoles, there's only a single frame of
lag.</p>
<p>They also mentioned that they have used cascaded shadow maps since Crysis 1.</p>
<p>I ducked out of <em>Advances in Real-Time Rendering in Games</em> part way through to
go to <em>Drawing, Painting, and Stylization</em>. I caught just the tail end of <em>A
Programmable System for Artist Directed Volumetric Lighting</em>, and I wish I had
seen the rest of it.</p>
<p>I actually went to that session to see <em>Coherent Noise for Non-Photorealistic
Rendering</em>, and I was quite pleased. There are two main problems with
applying noise to NPR. Using 3D noise depends on depth, so the frequency of
noise applied to object (e.g., to make lines wavy) depends on the how far away
from the camera it is. Using 2D noise gives what the authors called the
"shower door effect." That is also fail.</p>
<p>They really want three things:</p>
<ul>
<li>cheap to compute</li>
<li>noise moves with objects</li>
<li>uniform spectrum in screen space</li>
</ul>
<p>The algorithm that they developed accomplishes these goals. Throughout the
presentation, they showed a bit of UP! with Russel hanging from the garden
hoses below the house. With their NPR noise applied as the "texture," the
still image just looked like white noise. As soon as the animation began, all
of the structure of the image magically appeared. It was pretty cool. I'll
need to implement it and make some piglit test cases.</p>
<p>The final session of the day was <a href="http://www.siggraph.org/s2011/for_attendees/talks/sessions/112">Tiles and Textures and Faces Oh
My!</a></p>
<p>I enjoyed the <em>Procedural Mosaic Arrangement In "Rio"</em> talk. It felt like
their system was perhaps a little over complicated, but that complexity may
give it more flexibility for reuse. Not only was the technique used for the
mosaic sidewalks in Copacabana but also for "plain" cobblestone streets. I
would like to have heard more about <em>that</em>. This is something that everybody
does in games, and everybody does it poorly.</p>
<p><img src="http://upload.wikimedia.org/wikipedia/commons/3/34/CopacabanaPavement.jpg" width="400" height="600" /></p>
<p>There were some bits of <em>Generating Displacement from Normal Maps for Use in
3D Games</em> that I didn't fully grok. Their initial attempt was to reverse the
derivative approximation used to generate the normals and propagate the new
offsets around. It seems obvious that this wouldn't work. They moved on from
that to a polar coordinate integration scheme that wasn't communicated very
well by the presentation. I'll have to read the paper and think about it some
more.</p>
<p>I first heard about <a href="http://ptex.us/">Ptex</a> at the "open-source in production"
panel last year. At the time, I had thought that you could implement them in
a fairly straightforward way on a GPU. <em>Per-Face Texture Mapping for
Real-Time Rendering</em> follows pretty much what I was thinking, but there are
some differences.</p>
<p>To maintain some batching, all surfaces with textures of the same aspect ratio
are grouped. Textures of a particular aspect ratio are stored in a series of
<em>non-mipmapped</em> texture arrays. Each texture array corresponds to a
particular mipmap size for that aspect ratio. That is, all of the 512x512
mipmaps are in one texture array, all of the 256x256 mipmaps are in another,
etc. When a texture is sampled, the texture is selected (texture array
index), the LODs are calculated (the arrays), everything is sampled, and the
intermipmap blending is done. This is all open-coded in the shader (via
<code>ptex</code> function).</p>
<p>Having this goofy organization means that a texture with a 64x64 base level
doesn't waste a bunch of space when it's batched with a texture with a
2048x2048 base level. It's the classing time vs. space trade-off.</p>
Um, duhhttp://www.paranormal-entertainment.com/idr/blog/posts/2011-06-14T18:58:12Z-Um_duh/2011-06-14T19:09:31Z2011-06-14T18:58:12Z
<p>After seeing her wonderful display of <a href="http://www.youtube.com/watch?v=oS4C7bvHv2w">US history
knowledge</a>, I have decided
to replace the words "retard" and "retarded" in my vocabulary with
"Palin." Imagine:</p>
<ul>
<li><p>"That is the most Palin thing I've ever heard anyone say."</p></li>
<li><p>"Did you see that guy's driving? Is he a Palin or something?"</p></li>
<li><p>"Hey you bully! Don't pick on those Palin kids!"</p></li>
</ul>
<p>Well, maybe not the last one...</p>
ud-chains coming to GLSL compiler near you...http://www.paranormal-entertainment.com/idr/blog/posts/2011-05-03T23:36:04Z-ud-chains_coming_to_GLSL_compiler_near_you/2011-05-04T00:10:58Z2011-05-03T23:36:04Z
<p>I <em>finally</em> started working on ud-chains for Mesa's GLSL compiler. I'm
continually amazed that it works as well as it does without them. There are
so many ugly hacks and so much ad hoc data-flow analysis that I just couldn't
put it off any longer. If you want to cry, take a look at how reaching
definitions are determined in
<a href="http://cgit.freedesktop.org/mesa/mesa/tree/src/glsl/loop_analysis.cpp"><code>loop_analysis.cpp</code></a>.
It's pretty horrible.</p>
<p>My primary goal is to get enough infrastructure in place to fix that code. In
addition to the ugliness, it fails on cases like:</p>
<pre><code>void main()
{
int n = 3;
int i = 0;
if (b)
some_function();
while (i < n) {
some_other_function();
}
}
</code></pre>
<p>The loop analyzer will have no idea what the values of <code>i</code> or <code>n</code> are. There
are similar issues with identifying values that are constant across all
iterations of the loop. In this case, flow control inside the loop confuses
the analyzer.</p>
<p>The first step to this project is to get real basic block tracking. We have a
mechanism to iterate over instructions as basic blocks (see
<a href="http://cgit.freedesktop.org/mesa/mesa/tree/src/glsl/ir_basic_block.cpp"><code>ir_basic_block.cpp</code></a>,
but nothing is <em>stored</em> about the blocks. This means we don't know which
blocks can transfer control to which other blocks.</p>
<p>I now have some code that creates a the basic block structure of a function.
The next step will be to process the instructions in the basic blocks to track
the (value) definitions within the block.</p>
<p>In the mean time, I modified the stand-alone compiler to optionally dump a
graph of the basic blocks in <a href="http://www.graphviz.org/">dot</a>. The results,
even for small shaders, are shockingly cool.</p>
<p>Here's the code for the piglit test
<code>glsl-fs-vec4-indexing-temp-dst-in-nested-loop-combined.shader_test</code>:</p>
<pre><code>uniform float one;
uniform int count1, count2;
uniform vec4 red;
void main()
{
vec4 array[11];
array[0] = vec4(0.1, 0, 0, 0) * one;
array[1] = vec4(0, 0.1, 0, 0) * one;
array[2] = vec4(0, 0, 0.1, 0) * one;
array[3] = vec4(0, 0.1, 0, 0) * one;
array[4] = vec4(0, 0 , 0.1, 0) * one;
array[5] = vec4(0, 0, 0.1, 0) * one;
array[6] = vec4(0.1, 0, 0, 0) * one;
array[7] = vec4(0, 0.1, 0, 0) * one;
array[8] = vec4(0, 0.1, 0.1, 0) * one;
array[9] = vec4(0.1, 0.1, 0, 0) * one;
array[10] = vec4(0.1, 0, 0.1, 0) * one;
for (int i = 0; i < count1; i++)
for (int j = 0; j < count2; j++)
array[i*3+j] += red*float(j+1);
gl_FragColor = array[0] + array[1] + array[2] + array[3] + array[4] +
array[5] + array[6] + array[7] + array[8] + array[9] + array[10];
}
</code></pre>
<p>And here is the resulting basic block graph:</p>
<p><img src="http://www.paranormal-entertainment.com/idr/blog/images/basic_blocks.png" width="329" height="1171" /></p>
Linux native games?http://www.paranormal-entertainment.com/idr/blog/posts/2011-03-14T22:54:21Z-Linux_native_games/2011-05-04T00:12:24Z2011-03-14T22:54:21Z
<p>I was talking to Linus and others at Intel's Open Source Technology Summit
last week, and it occured to me that I have completely lost touch with what's
available for commercial games that run native on Linux. The last native game
that I bought / played was <a href="http://www.paranormal-entertainment.com/idr/blog/archive/www.idsoftware.com/games/enemyterritory/etqw/">Enemy Territory: Quake
Wars</a>. That was a long time
ago.</p>
<p>I know that <a href="http://oilrush-game.com/">OilRush</a> has recently become available,
and I think a few other <a href="http://unigine.com/">Unigen</a> based games are coming
soon-ish.</p>
<p>What else is there?</p>
<p>More importantly, what else is there that I can add to an automated test suite
for my driver? The easily scriptable timedemo feature of the old Quake3
engine games was the best.</p>
They must have cheated againhttp://www.paranormal-entertainment.com/idr/blog/posts/2011-01-25T18:03:24Z-They_must_have_cheated_again/2011-01-25T18:22:23Z2011-01-25T18:03:24Z
<p>The list of <a href="http://www.oscars.org/awards/academyawards/83/nominees.html">nominees for the 83rd Academy
Awards</a> was just
posted. Somehow <a href="http://www.imdb.com/title/tt1104001/">TRON: Legacy</a> isn't on
the list for Visual Effects. It's like 1983 all over again...and what a shitty
year <em>that</em> was! It <em>is</em> nominated for Sound Editing, but WTF?</p>
<p>My predictions (which I had meant to post <em>weeks ago</em>) were:</p>
<ul>
<li><a href="http://www.imdb.com/title/tt1014759/">Alice in Wonderland</a></li>
<li><a href="http://www.imdb.com/title/tt0980970/">The Chronicles of Narnia: The Voyage of the Dawn Treader</a></li>
<li><a href="http://www.imdb.com/title/tt0926084/">Harry Potter and the Deathly Hallows Part 1</a></li>
<li><a href="http://www.imdb.com/title/tt1375666/">Inception</a></li>
<li><a href="http://www.imdb.com/title/tt1104001/">TRON: Legacy</a></li>
</ul>
<p>I haven't seen Narnia, but that series has gotten Visual Effects nominations
in the past.</p>
<p>The actual list is:</p>
<ul>
<li><a href="http://www.imdb.com/title/tt1014759/">Alice in Wonderland</a></li>
<li><a href="http://www.imdb.com/title/tt0926084/">Harry Potter and the Deathly Hallows Part 1</a></li>
<li><a href="http://www.imdb.com/title/tt1212419/">Hereafter</a></li>
<li><a href="http://www.imdb.com/title/tt1375666/">Inception</a></li>
<li><a href="http://www.imdb.com/title/tt1228705/">Iron Man 2</a></li>
</ul>
<p>3 out of 5 isn't too bad, I guess. I haven't seen Hereafter, and I wasn't
that impressed with Iron Man 2. <em>meh</em>.</p>
<p>I think the winner will be either Inception or Harry Potter. I think
Inception deserves it, but it may be cursed by having too many other
nominations. It seems like the Academy tends to vote for movies with only a
few nominations (HP has 2 vs 8 for Inception) in this category.</p>
@overridehttp://www.paranormal-entertainment.com/idr/blog/posts/2010-08-18T20:37:24Z-override/2010-08-18T20:56:34Z2010-08-18T20:37:24Z
<p>After <a href="http://www.paranormal-entertainment.com/idr/blog/posts/2010-03-01T01:31:54Z-How_do_people_seriously_use_Java/">bashing Java so
brutally</a>,
I have to add <em>another</em> thing to the list of Java features that I wish
C++ (or even just a GCC extension) had: <code>@override</code> notation. Imagine this
scenario...</p>
<p>You have a base class that implements a bunch of methods, and some of
the methods have numerous overloads. We'll call this class <code>base</code>.</p>
<p>You have a bunch of classes that derive from <code>base</code>. Each of the
derived classes only override some of the methods provided by <code>base</code>.</p>
<p>These derived classes are used by other infrastructure that just takes
pointers to objects of type <code>base</code>.</p>
<p>For example:</p>
<pre><code>class base {
virtual void do_something(float x);
virtual void do_something(int x);
virtual void do_something(char *str);
};
class d1 : public base {
virtual void do_something(float x);
};
class d2 : public base {
virtual void do_something(int x);
};
class d3 : public base {
virtual void do_something(char *str);
};
</code></pre>
<p>Everyone with me so far? Sound like every large C++ you've ever seen?
Good.</p>
<p>Now the signature of some of the methods in <code>base</code> changes, perhaps by
adding a parameter. While making that change, n-1 of the derived classes are
correctly modified.</p>
<pre><code>class base {
virtual void do_something(float x, int y);
virtual void do_something(int x, int y);
virtual void do_something(char *str, int y);
};
class d1 : public base {
virtual void do_something(float x, int y);
};
class d2 : public base {
virtual void do_something(int x, int y);
};
class d3 : public base {
virtual void do_something(char *str /* FAIL!!! */ );
};
</code></pre>
<p>Try to find the bug or go to drinking island?</p>
<p>In Java this bug would never happen. All of the <code>do_something</code>
methods in the derived classed would be annotated with <code>@override</code>.
When the compiler found <code>do_something</code> in <code>d3</code> that didn't match the
signature of any <code>do_something</code> in <code>base</code>, it would complain. With
C++ you just spend hours trying to track down the bug.</p>
<p>P.S.: I <em>still</em> hate Java.</p>
GPU Ray Casting of Virtual Globeshttp://www.paranormal-entertainment.com/idr/blog/posts/2010-08-12T17:22:14Z-GPU_Ray_Casting_of_Virtual_Globes/2011-01-28T23:11:37Z2010-08-12T17:22:14Z
<p>I mentioned the GPU Ray Casting of Virtual Globes poster in a <a href="http://www.paranormal-entertainment.com/idr/blog/posts/2010-07-28T22:12:37Z-SIGGRAPH_2010:_Day_3/">previous
post</a>.
The author has since sent me a link to an updated version of an older <a href="http://blogs.agi.com/insight3d/index.php/2010/04/19/gpu-ray-casting-of-virtual-globes/">blog
post</a>
with the poster, a five minute video, and source code. Cool stuff. The video
is 18MB, so be prepared.</p>
<p>Patrick is also working on a book called, <a href="http://virtualglobeandterrainrendering.blogspot.com/">"Virtual Globe and Terrain
Rendering"</a>.
I'll watch for that at the <em>next</em> SIGGRAPH.</p>
SIGGRAPH 2010: Day 4http://www.paranormal-entertainment.com/idr/blog/posts/2010-08-02T17:18:31Z-SIGGRAPH_2010:_Day_4/2011-01-28T23:11:37Z2010-07-29T20:52:49Z
<p>Even though I'm completely exhausted, it was well worth the effort to
get up for the <em>Large Steps Toward Open Source</em> panel. It seems that the
movie industry is today where the computer industry was 10 years ago
w.r.t. open source. They want to join the cool kids, but they don't quite
"get" it yet. The biggest failing is that they only want to open source
something when it's 1.0... after it has been used on a couple movies. <em>ur doin
it rong.</em> <em>sigh...</em></p>
<p>The single exception seems to be Sony Pictures / Imageworks. They have
realized that the community is an integral stakeholder at every step of a
successful open source project. The first slide from Rob Bredow's part of the
talk said, in big letters, "Develop a community." YES!!!</p>
<p>In any case, there were a couple choice quotes and some cool projects. The
best was Andy Henrickson from Disney Animation saying, "Disney isn't in the
habbit of giving things away for free." He made another comment that I think
really strikes to the core of why open source is so important across
industries. He said, "Some things have no value unless you give them away."</p>
<p>I also liked a couple of comments from Florian Kains (of ILM). When talking
about their move to Linux, he said, "All our production used to be on SGI
machines at one point, but that ceased to be viable." I have to give some
credit back to George Lucas. Apparently he was the one who got the "no value
unless you give it away" argument that ultimately led to OpenEXR being open
source. Florian siad, "Once George signed off, all the lawyers said, 'Yes sir,
Mr. Lucas.'"</p>
<p>Here's a run down of current and future projects from the various presenters:</p>
<ul>
<li><p>Disney Animation - <a href="http://www.disneyanimation.com/technology/opensource.html">current projects</a></p>
<ul>
<li><p><a href="http://ptex.us/">Ptex</a></p></li>
<li><p><a href="http://www.pythoscope.org/">Pythoscope</a> is test generator for Python.
Next time I have to do a large Python project, I'll take a closer look at
this.</p></li>
<li><p>Maya Dynamica front end for Bullet Physics</p></li>
<li><p>Partio -> Particle input / output library to abstract many, many different
formats. It is intended to be "the" interchange library for the various
particle systems used in production.</p></li>
<li><p>Disney's (mathematical) expression editor. This was a pretty rhobust set
of widgets and a parser for mathematical expressions. It looked pretty
damn cool.</p></li>
</ul></li>
<li><p>Pixar Animation Studios</p>
<ul>
<li>Rhobust, accurate, readable subdivision surface reference library. They
have big plans for this, but it looks like they're going to do it wrong.
They're going to develop it completely in house, in isolation, then
release it when it's "done."</li>
</ul></li>
<li><p>ILM</p>
<ul>
<li><p><a href="http://www.openexr.com/">OpenEXR</a></p></li>
<li><p><a href="http://code.google.com/p/alembic/">Alembic</a></p></li>
<li><p>A couple other projects that I didn't write down. Sorry.</p></li>
</ul></li>
<li><p>Sony</p>
<ul>
<li><p><a href="http://code.google.com/p/openshadinglanguage">Open Shading Language</a> As
an aside, Rob mentioned that Rhythm & Hues plans to use OSL in a future project.</p></li>
<li><p><a href="http://code.google.com/p/alembic/">Alembic</a></p></li>
<li><p><a href="http://code.google.com/p/opencolorio/">OpenColorIO</a></p></li>
<li><p><a href="http://code.google.com/p/field3d/">Field3D</a></p></li>
<li><p><a href="http://code.google.com/p/imageworks-sp-reticle/">Imageworks SP Reticle</a></p></li>
<li><p><a href="http://code.google.com/p/scala-migrations">Scala Migrations</a></p></li>
<li><p><a href="http://code.google.com/p/pystring/">Pystring</a></p></li>
</ul></li>
</ul>
<p>I was also impressed that both Sony and ILM give money (ILM to Python) and
machines (Sony to some "small" Linux distro) to "pay" for the open source
software that they use. Florian did comment that it's often really, <em>really</em>
hard to pay people for stuff. He gave a hypothetical example of trying to
donate to some random guy in Wales. What's his tax ID? How do I notify the
government? Etc.</p>
<p>The <em>Games & Real Time</em> had some good presentations, but by the time it came
around (the last session on the last day), I was exhausted.</p>
<p><a href="http://portal.acm.org/citation.cfm?id=1837026.1837083"><em>User-Generated Terrain in ModNation
Racers</em></a> had some pretty
cool ideas. They let the user draw the terrain map using brushes. Instead of
storing the drawing, they store the brush strokes. This allows them to have a
very small in-core foot print. Of course, all the terrain "drawing" is done on
the GPU. New terrain is combined with existing terrain using the alpha blend
unit. They even use min/max blending! I'll have to rent this game (sorry!) to
try out the editor.</p>
<p><em>Irradiance Rigs</em> is largely based on several algorithms (irrandiance volumes
and spherical harmonics lighting) that I'm not familiar with. meh. I need to
get on that.</p>
<p><a href="http://img.univ-mlv.fr/~biri/mlaa-gpu/"><em>Practical Morphological Anti-Aliasing on the
GPU</em></a> was a GPU implementation of an
algorithm presented last year at SIGGRAPH. Basically, you scan the rendered
image from certain types of sharp features and blur them. It's a major hack,
but it does fix may unappealing artifacts. It's still pretty slow, and it
doesn't handle some common cases (e.g., breaks in rendered telephone lines).</p>
<p>One of my favorite phrases in graphics: "[This algorithm is] not physically
correct, but plausible." <a href="http://portal.acm.org/citation.cfm?id=1837026.1837086"><em>Curvature-Dependent Reflectance Function for
Rendering Translucent
Materials</em></a> reminds me a
bit of a poster that I saw at SIGGRAPH last year, but I couldn't find any
information about that. I might have a flyer or something at home. It's also
similar to the curvature based AO technique that I mentioned yesterday. A
preprocess step determines the curvature at each point. This curvature is then
used in a different sort of lighting equation boost lighting. The equation is
fairly complex, and the fast implementation uses a look-up texture based on the
material properties.</p>
<p>The biggest failing seems to be a variety of unfortunate interactions with
shadows. The precomputation step also hurts, but not as much. Still, it
seems pretty cool.</p>
SIGGRAPH 2010: Day 3http://www.paranormal-entertainment.com/idr/blog/posts/2010-07-28T22:12:37Z-SIGGRAPH_2010:_Day_3/2011-01-28T23:11:37Z2010-07-28T22:12:37Z
<p>I got to the <em>Textures</em> session a bit late because I went to Nvidia's <a href="http://nvidia.fullviewmedia.com/siggraph2010/02-dev-barthold-lichtenbelt-mark-kilgard.html">"OpenGL
4.0 for 2010"</a> session, and the session went over by 20 minutes. It was a good
overview of OpenGL 4.0 / 4.1. Nvidia (Mark Kilgard, more precisely)
continues to spread mis-information about the <code>compatibility</code> profile, and
that's really frustrating.</p>
<p>I missed all of <a href="http://alice.loria.fr/index.php/publications.html?redirect=0&Paper=TEXRESIZE@2010"><em>By-Example Synthesis of Architectural
Textures</em></a>
and everything except the results of <a href="http://www.cs.columbia.edu/cg/hybrids/index.html"><em>Synthesizing Structured Image
Hybrids</em></a>. The results in
the later were very cool. I especially liked the synthesized pirate flags.</p>
<p>Every year there's some piece of cool tech at SIGGRAPH that I want to
implement. I think <a href="http://www.kunzhou.net/#vst"><em>Vector Solid Textures</em></a> is
it this year. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /> It's a very clever method of compactly storing volumetric
textures as a sort of voxelized SVG. The complex step, of course, is
generating the texture data. Any algorithm that utilizes sub-algorithms with
names like <a href="http://en.wikipedia.org/wiki/L-BFGS">"L-BFGS-B minimizer"</a> and
<a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.107.5747">"teleportation"</a>
is bound to be frightening. lol.</p>
<p>The <a href="http://www.cemyuksel.com/research/meshcolors/"><em>Mesh Colors</em></a>
presentation started with an excellent overview of all the problems with 2D
texture mapping. If he had stopped there, I would have called it a useful
presentation. Of course, he didn't stop there. The idea behind mesh colors
is that a set of colors are stored for each triangle (one per vertex, one per
edge, and N per triangle) along a tessellation grid (basically). At run-time
the UV value is used to weigh the nearest colors. The frustrating bit of the
presentation was the massive amount of hand waving (shown in the photo below)
about the implementation. I suspect the details are in the paper. The <a href="http://www.hair-farm.com">hair
farm</a> shirt was a nice touch.</p>
<p align="center">
<a href="http://www.paranormal-entertainment.com/idr/blog/images/SIGGRAPH10/mesh_colors.jpg">
<img src="http://www.paranormal-entertainment.com/idr/blog/images/SIGGRAPH10/mesh_colors.thumb.jpg" width="320" height="240">
</a>
</p>
<p>It also seems like there is a lot of area for future research. The filtered
performance is pretty poor. I had a brief discussion with Cem about using
hardware tessellation (to a level that matches the mesh colors pattern) to
solve some of the filtering issues. It seems like it could work in some
cases, but it presents problems of its own (i.e., potentially a lot more work
for the rasterizer).</p>
<p>I may have to implement this algorithm too.</p>
<p>There were a bunch of cool things in the poster session, and I took the
opportunity today to talk to some of the authors. There were several useful
posters about soft-shadow algorithms, a couple about image enhancement, and a
couple about ambient occlusion. I especially liked <a href="http://portal.acm.org/citation.cfm?id=1836845.1836976&coll=portal&dl=GUIDE"><em>Curvature depended
Real-Time Ambient
Occlusion</em></a>
(sic). They use a preprocess to determine the concave curvature at each
vertex. At run-time, this is interpolated, and the interpolated to determine
the AO. The interpolation here gives a better result vs. per-vertex AO in the
same way that interpolating light parameters gives better results than
interpolating per-vertex light calculations.</p>
<p>My two favorite posters were <a href="http://blogs.agi.com/insight3d/wp-content/uploads/2010/04/"><em>GPU Ray Casting of Virtual
Globes</em></a> and, I
kid you not, <a href="http://portal.acm.org/citation.cfm?id=1836845.1836970&coll=portal&dl=GUIDE"><em>A Physical Rendering Model for Human
Teeth</em></a>.
I plan to add both of these to my VGP curriculum. The tooth shader is useful
because it shows a case of a lighting model developed for a specific type of
surface.</p>
<p>The other poster that really caught my eye was the
<a href="http://github.com/OneGeek/WebGLU/">WebGLU</a> poster. It sounds like Benjamin
is doing a lot of the same things for WebGL that I'm doing for desktop GL. He
and I talked, and there may be some colaboration in our future.</p>
<p>There are some things to <em>really</em> like about <a href="http://code.google.com/p/openshadinglanguage"><em>Open Shading
Language</em></a>. Being able to
arbitrarily connect shaders (via matching inputs and outputs) in a DAG is
something that I've been talking about doing in OpenGL for years. Pulling
data out by specifying an arbitrary expression on shader outputs is also
genius. In OSL the data gets dumped as an image, but I still see use for this
in GL.</p>
<p>The implementation of automatic differentiation is really, really smart. I
suspect that something like this could even be implemented in our hardware
shaders. This would allow higher quality derivatives in some cases. I guess
I need to read the <a href="http://homepage.mac.com/sigfpe/paper.pdf">Piponi paper</a>
from <a href="http://jgt.akpeters.com/papers/Piponi04/">journal of graphics tools</a>.</p>
<p>And they now use LLVM.</p>
<p>Since this system has texture mapping support in this system, this might make
an interesting test bed for my thesis work. Hmm...</p>
<p><a href="http://portal.acm.org/citation.cfm?id=1837026.1837071"><em>REYES Using DirectX
11</em></a> wasn't too
interesting to me. During the Q-and-A period, someone (the previous
presenter, in fact) asked what could be changed in either DirectX or the
hardware to make this either easier or faster. Being able to insert compute
shaders directly into the pipeline (to eliminate the intermediate buffers,
synchronization, etc.) would have helped a lot. This isn't the first time
I've heard a request for this.</p>
<p>The <a href="http://portal.acm.org/citation.cfm?id=1837026.1837072"><em>WebGLot: High-Performance Visualization in the
Browser</em></a> (<a href="http://dan.lecocq.us/wordpress/2010/08/02/webglot-high-performance-visualization-in-the-browser/">slides available</a>) guys are
doing some <em>really</em> cool stuff on top of WebGL. We'll need to use this app to
test WebGL on our drivers!</p>
<p>The <em>Gazing at Games: Using Eye Tracking to Control Virtual Characters</em> course
didn't feel like a course. It felt like a presentation of a survey paper on
what people have done related to eye tracking in games. I got references to a
bunch of papers that seem interesting, but that's about it. I do like the
idea of "smart text." Text (dialog, etc.) is displayed until you look away
from it. I had to leave early to go to the OpenGL BoF, so I probably missed
the best parts. <em>shrug</em></p>
<p>The highlight of the OpenGL BoF was, of course, the announcement of
<a href="http://dri.freedesktop.org/glu3/">GLU3</a> as part of the OpenGL SDK. Getting a
round of applause was cool. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /></p>
<p>One of the trivial questions was, "What ARB extension has not been shipped in
any publicly available driver?" Answer?
<a href="http://www.opengl.org/registry/specs/ARB/shading_language_include.txt"><code>GL_ARB_shading_language_include</code></a>.
Damnit!!! Okay, we need to add that to our compiler todo list. Ugh. It's a
cool feature, and John Kessenich, Jon Leech, and I spent a lot of time working
on it. In all fairness, GLSL needs a <em>much</em> better module mechanism than it
currently has. I have some ideas, but they'll have to wait until our new
compiler actually ships <em>at least</em> GLSL 1.30.</p>
SIGGRAPH 2010: Day 2http://www.paranormal-entertainment.com/idr/blog/posts/2010-07-27T20:52:49Z-SIGGRAPH_2010:_Day_2/2011-01-28T23:11:37Z2010-07-27T20:52:49Z
<p>The <em>Importance Sampling for Production Rendering</em> course was interesting, but
a lot of it was review. I hadn't noticed that the first presenter in the
course was also the author of the <a href="http://http.developer.nvidia.com/GPUGems3/gpugems3_ch20.html">GPU-Based Importance
Sampling</a> from
GPU Gems 3 that I use in VGP352. The bits about multiple important sampling
and the bits about resampled importance sampling for shadows from the second
presenter were new to me. There was a question from the audience about the
Lafortune BRDF. Matt's response echoed what I say in VGP352 every year. He
says that the Lafortune BRDF is not used at IMD beause it is "too
uncontrollable for many artists."</p>
<p>I don't really know anything about REYES, so most of <a href="http://www.kunzhou.net/2010/mptracing.pdf"><em>Micropolygon Ray Tracing
With Defocus and Motion Blur</em></a> was lost on me. The hyper-trapezoid BVH was
interesting, though. <a href="http://www.mpi-inf.mpg.de/~slee/pub/"><em>Real-Time Lens Blur Effects and Focus Control</em></a> was
similarly a loss. The foreground occlusion image may find a place in VGP352
when I talk about depth-of-field effects. <a href="http://graphics.cs.williams.edu/papers/OptiXSIGGRAPH10/"><em>OptiX: A General Purpose Ray
Tracing Engine</em></a> was mostly an advertisement for Nvidia's ray tracing engine.
There were a couple interesting bits about their compiler architecture, but
meh.</p>
<p>To this point, I wish I would have gone to the An Introduction to 3D Spatial
Interaction With Videogame Motion Controllers session instead.</p>
<p>That changed with <a href="http://graphics.stanford.edu/papers/fragmerging/"><em>Reducing Shading on GPUs using Quad-Fragment
Merging</em></a>. One of the
opening tidbits will annoy keithp to be sure. "...one of the better ideas of
real-time rendering [is] multisample anti-aliasing." In any case, their
method of merging quads (2x2 pixel blocks processed by the fragment shading
hardware) is fairly straight forward, but still clever. They track facing and
connectivity for covered pixels in each quad. Multiple quads that have
connected triangles with the same facing are merged. This can save a <em>lot</em> of
processing.</p>
<p>Much to my joy, the <em>Making of TRON: Legacy</em> session got moved to Tuesday
evening... when it didn't conflict with anything that I wanted to attend!
w00t! Yes folks, that is the line...</p>
<p align="center">
<a href="http://www.paranormal-entertainment.com/idr/blog/images/SIGGRAPH10/tron_line.jpg">
<img src="http://www.paranormal-entertainment.com/idr/blog/images/SIGGRAPH10/tron_line.thumb.jpg" width="320" height="240">
</a>
</p>
<p><strong>EIGHT MINUTES</strong> of footage from the movie. A <a href="http://www.youtube.com/watch?v=opvP8NVI8xs">new trailer</a> (I want one of
those lightcycle throw pillows from 0:12 in the trailer). Full on awesome.</p>
<p align="center">
<a href="http://www.paranormal-entertainment.com/idr/blog/images/SIGGRAPH10/tron_screen.jpg">
<img src="http://www.paranormal-entertainment.com/idr/blog/images/SIGGRAPH10/tron_screen.thumb.jpg" width="320" height="240">
</a>
<a href="http://www.paranormal-entertainment.com/idr/blog/images/SIGGRAPH10/tron_panel.jpg">
<img src="http://www.paranormal-entertainment.com/idr/blog/images/SIGGRAPH10/tron_panel.thumb.jpg" width="320" height="240">
</a>
</p>
<p>A couple interesting bits:</p>
<ul>
<li><p>Daft Punk is doing the music, and they have a cameo.</p></li>
<li><p>Some of the concept drawings from the original movie that couldn't be done
on computers at the time was used. For example, the original lightcycles
had the rider on the <em>outside</em>. There was no way the computers of 1982
could render that, so the design was changed.</p></li>
<li><p>It was filmed in 3D, but, in the words of the director, there's no "spear
poking you in the eye" business.</p></li>
</ul>
<p>In the Q-and-A session I asked a semi-smart ass question. That's how I roll.
"My biggest disappointment with the film industry came when I was 8 and the
original TRON wasn't nominated for an Oscar because it "cheated" [by using
computers]. Come January, is it going to be lightcycles or broomsticks? TRON
or Harry Potter?" Yes, I know the Oscars are in March. I was nervous.
Unfortunately, their answer was way, <em>way</em> too serious. "Ultimately that's up
to you, but we think our work will stand on it's own." meh.</p>
<p><strong>UPDATE:</strong> One thing I forgot before, there was an off-hand mention by the
director that some effort was going into doing a "re-imagination" of <a href="http://www.imdb.com/title/tt0078869/">The
Black Hole</a>. That was such a creepy
movie! A re-make <em>could</em> be awesome... or horrible.</p>
SIGGRAPH 2010: Day 1http://www.paranormal-entertainment.com/idr/blog/posts/2010-07-26T16:19:37Z-SIGGRAPH_2010:_Day_1/2011-01-28T23:11:37Z2010-07-26T16:19:37Z
<p>This year I was <em>finally</em> smart enough to register at the conference the day
before it starts. Yay me. That made is <em>so much</em> easier the first day.</p>
<p>I wasn't expecting a lot from <em>envLight: An Interface for Editing Natural
Illumination</em>, but I was pleasantly surprised. There were a couple of
surprises in their results. I keep meaning to implement some sort of
parameter editing interface for my BRDF demos, and I would have done it quite
differently before seeing this paper.</p>
<p>I understand the method in <a href="http://www.mpi-inf.mpg.de/resources/OnSurfaceDeform/"><em>Interactive On-Surface Signal
Deformation</em></a>, but I
don't really get how it would be implemented in a real system. I guess that's
what I get for not reading the paper before attending the presentation. I
would have read the paper if I had remembered to bring the DVD drive for my
laptop. That's the one annoying thing about the X200s... no built-in optical
drive. In any case, it seems like this approach could be used to great effect
in a demo. I imagine a scene where, say, the shock wave from a heavy object
hitting the ground causes shadows on the ground to get pushed away.</p>
<p>My first <a href="http://www.imdb.com/title/tt0499549/">Avatar</a> presentation,
<a href="http://research.nvidia.com/publication/pantaray-fast-ray-traced-occlusion-caching-massive-scenes"><em>PantaRay: Fast Ray-Traced Occlusion
Caching</em></a>
was impressive. I guess rendering scenes with 10M to <strong>ONE BILLION
DOLLARS</strong>... er... one billion polygons needs some new acceleration
techniques. And a petabyte of "live data" needs some kick ass I/O. There are
so many different optimizations implemented here that I think they could have
gotten multiple papers out of it. Seriously. Just the layers of
optimizations in the spatial index calculation should have been sufficient.
Showoffs! <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /></p>
<p>On a whim, I went the SIGGRAPH awards presentation. The cool thing there was
a visualization app that shows, on a map of the world, where every technical
paper ever published at SIGGRAPH originated. It will supposedly be posted on
the web, so I'll link it here soon. The talk by Don "The Tornado" Marinelli
really made it worth it, though. You can tell that he comes from a drama
background. They also said that some of the content would be posted on
YouTube, so his talk <em>may</em> get linked here later.</p>
<p>The word(s) of the day: deferred shading. <a href="http://portal.acm.org/citation.cfm?id=1837026.1837046&coll=portal&dl=GUIDE&type=series&idx=SERIES382&part=series&WantType=Proceedings&title=SIGGRAPH"><em>Screen Space Classification for
Efficient Deferred
Shading</em></a>
was the first of the bunch. The basic technique is to read back the G-buffer
to generate a batch of polygons to draw. The screen is divided into tiles,
and the tiles are classified by attributes (e.g., in shadow, direct lit,
etc.). On both PS3 and Xbox360 it cuts the frame time by about half. They
talked a bit about the optimization of the polygon submission. Since the
polygons are tile aligned, it seems like some sort of quadtree could be
generated and rendered using point sprites. I'll have to think on that a bit
more.</p>
<p>"Boom. 60 is better." lol. <em>How to Get From 30 to 60 Frames Per Second in
Video Games for "Free"</em> uses the Z-buffer and the velocity buffer from the
current frame and the color buffer of the previous frame to generate an
in-between frame. The author was inspired by MPEG motion vectors. Here, it's
a big hack. It has a bunch of hacks on top of it to fix artifacts. The best
part is the way dynamic objects are "erased" from the frame (this is only
necessary with deferred shading). I like it.</p>
<p><a href="http://portal.acm.org/citation.cfm?id=1837026.1837048&coll=portal&dl=GUIDE&type=series&idx=SERIES382&part=series&WantType=Proceedings&title=SIGGRAPH"><em>Split-Second Motion
Blur</em></a>
covered some additional work from <a href="http://ps3.ign.com/articles/108/1089982p1.html">Split
Second</a>. They render a
per-pixel 2D motion vector ID. This ID is then used in a blur post-process.
In addition, they update the texture sampling derivatives based on the motion
vector. Cheap, easy, good results. I'll definitely add this to the motion
blur techniques covered in VGP351 next time it comes around.</p>
<p>Over the last couple years systems for indirect lighting in real-time have
been all the rage. Pretty much all of them have used deferred shading. <a href="http://hal.archives-ouvertes.fr/inria-00480869/"><em>A
Deferred-Shading Pipeline for Real-Time Indirect
Illumination</em></a> is <strong>shock</strong>
no different. However, they're algorithm has good quality and speed. The
other algorithms that I have seen pick one or the other. They incorporated a
clever way to include occlusion for bounces, but this costs a lot of memory.
I guess that's the trade off. The method for mipmapping the G-buffer was
pretty clever. At each downscale they average the attributes from the largest
object. This is sort of a bilateral filter in reverse. It's still screen
space, so it has some drawbacks:</p>
<ul>
<li><p>losing indirect light from an object that goes off screen</p></li>
<li><p>no support for mirrors reflecting objects behind the camera</p></li>
</ul>
<p>Also, if I hear "current console hardware can't" one more time, I'll
puke... or just roll my eyes <em>again</em>. I knew realize dynamic branching was
bad on PS3, but I didn't it was so bad on Xbox360. <em>sigh</em>...</p>
<p>I wrapped up the day with <a href="http://www.siggraph.org/s2010/for_attendees/live_real_time_demos">Live Real-Time
Demos</a>. As
<a href="http://www.realtimerendering.com/blog/live-real-time-demos-at-siggraph/">Eric Haines
notes</a>,
they were pretty cool. Thinking back to my <a href="http://www.pouet.net/prod.php?which=15356">days as a demo
coder</a>, it brings a tear to my eye
to see <a href="http://pouet.net/prod.php?which=54603">demos</a> on the big screen at
SIGGRAPH.</p>
GLU3 0.9 releasehttp://www.paranormal-entertainment.com/idr/blog/posts/2010-07-21T20:43:05Z-GLU3_0_9_release/2011-01-28T23:11:37Z2010-07-21T20:43:05Z
<p>The <a href="http://dri.freedesktop.org/glu3/">0.9 release</a> is now available!
I'm calling this 0.9 because not all of the functionality is available
in the C interfaces. Once that is resolved and a couple other GLSL
utilities are complete, I'll call it 1.0.</p>
<p>There is a tag in the GIT repo for the release. The <code>glu3-0.9.1</code> tag is
the "real" tag. I pushed the <code>glu3-0.9</code> before doing <code>make distcheck</code>,
and, of course, there were errors.</p>
<p>md5sums:</p>
<pre><code>75032c9aaf2d279738ce3940383439ff GLU3-0.9-20100721-bin.zip
63ccdbdb8d6799b9a530b661f1d9d0f7 GLU3-0.9-20100721-src.zip
862b22f67dd7d6f087ff6ba497653621 GLU3-0.9-20100721.tar.bz2
6266c6944128eec4149c8b8101e290df GLU3-0.9-20100721.tar.gz
</code></pre>
SIGGRAPH 2010 Previewhttp://www.paranormal-entertainment.com/idr/blog/posts/2010-07-16T03:59:42Z-SIGGRAPH_2010_Preview/2011-01-28T23:11:37Z2010-07-16T03:59:42Z
<p>I've been pretty busy over the last few months, so I haven't had a chance
to really comb through the SIGGRAPH
program. <a href="http://www.realtimerendering.com/blog/siggraph-2010-game-content-roundup/">There</a>
<a href="http://www.realtimerendering.com/blog/siggraph-2010-panels/">are</a>
<a href="http://www.realtimerendering.com/blog/siggraph-2010-talks/">several</a>
<a href="http://www.realtimerendering.com/blog/siggraph-2010-courses/">good</a>
<a href="http://www.realtimerendering.com/blog/siggraph-2010-courses-update/">overviews</a>
<a href="http://www.realtimerendering.com/blog/siggraph-scheduler-course-update/">at</a>
<a href="http://www.realtimerendering.com/blog/more-siggraph-course-updates/">the</a>
<a href="http://www.realtimerendering.com/blog/">Real-Time Rendering Blog</a>.
</p>
<p>My plan feels full, but there is still time left for posters and the expo.
I think I'm doing it right. There are a couple courses and some of the Avatar
talks that look interesting on Sunday, but, seriously? <em>Sunday?</em>
FAIL.</p>
<p>
<u>Monday</u></p>
<ul>
<li><em>Lighting & Material Design (9:00AM - 10:30AM)</em>
<p>There are several presentations
about <a href="http://www.tgdaily.com/games-and-entertainment-features/45279-nvidia-unveils-pantaray-engine">PantaRay</a>
in conjunction with all the sessions (<b>at least</b> a dozen!) about
<a href="http://www.imdb.com/title/tt0499549/">Avatar</a>. <em>PantaRay:
Fast Ray-Traced Occlusion Caching</em> in this session looks good.</p>
</li>
<li><em>Split Second Screen Space (2:00PM - 3:30PM)</em>
<p>All four papers in this session sound interesting. I'm especially
interested in <em>Screen Space Classification for Efficient Deferred
Shading</em> and <em>Split-Second Motion Blur</em>. Unfortunately, I
don't see a preprints for either one online.</p>
</li>
</ul>
<p>
<u>Tuesday</u></p>
<ul>
<li><em>Importance Sampling for Production Rendering (course) (9:00AM -
10:30AM)</em>
<p>I've been wanting to include some coverage of this topic in VGP352 for
the last couple years. I already talk about
<a href="http://http.developer.nvidia.com/GPUGems3/gpugems3_ch20.html">GPU-Based
Importance Sampling</a> from GPU Gems 3, but I'd like to have a bit
broader coverage.</p>
</li>
<li><em>GPU Rendering (2:00PM - 3:30PM)</em>
<p><a href="http://graphics.stanford.edu/papers/fragmerging/">Reducing
Shading on GPUs Using Quad-Fragment Merging</a> and <a href="http://www.mpi-inf.mpg.de/~slee/pub/">Real-Time Lens Blur Effects and
Focus Control</a> look to be the highlights in this session for me.</p>
<p>As usual at SIGGRAPH, there are big periods of nothing for me, and big
periods where there are 37 things I want to see. Also at 2:00 is <em>An
Introduction to 3D Spatial Interaction With Videogame Motion
Controllers</em>. Since this session runs until 5:00PM, I might just drop
in late.</p>
</li>
</ul>
<p>
<u>Wednesday</u></p>
<ul>
<li><em>Textures (10:45AM - 12:15AM)</em>
<p>I like the looks of all the papers in this session. <a href="http://alice.loria.fr/index.php/publications.html?redirect=0&Paper=TEXRESIZE@2010">By-Example
Synthesis of Architectural Textures</a></li> and <a href="http://www.cs.columbia.edu/cg/hybrids/index.html">Synthesizing
Structured Image Hybrids</a> are probably the most interesting to me.
However, <a href="http://www.kunzhou.net/#vst">Vector Solid Textures</a> and
<a href="http://www.cemyuksel.com/research/meshcolors/">Mesh Colors</a> also
look good.</p>
</li>
<li><em>APIs for Rendering (2:00PM - 3:30PM)</em>
<p>I <a href="http://www.paranormal-entertainment.com/idr/blog/posts/2010-01-13T19:19:55Z-Sony_Pictures_Imageworks_releases_OSL_code_and_docs/">posted</a>
about Open Shading Language a few months ago. I'd like to hear more about
what they've done... especially since I've been off in compilerland this
whole year.</p>
</li>
<li><em>Perception, Presence & Animation (2:00PM - 3:30PM)</em>
<p>I <em>might</em> try to drop in for <a href="http://graphics.eecs.berkeley.edu/site_root/papers/Held-UBA-2010-03/">Using
Blur to Affect Perceived Distance and Size</a>.</p>
</li>
<li><em>OpenGL BoF (5:15PM)</em>
<p>Duh.</p>
</li>
</ul>
<p>
<u>Thursday</u></p>
<ul>
<li><em>Large Steps Toward Open Source (panel) (9:00AM - 10:30AM)</em>
<p>I feel obligated to attend this panel. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /></p>
</li>
<li><em>Games & Real Time (10:45AM - 12:15AM)</em>
<p>Both <em>Practical Morphological Anti-Aliasing on the GPU</em> and
<em>Curvature-Dependent Reflectance Function for Rendering Translucent
Materials</em> are high on my list. I <em>think</em> the later paper had a
poster last year. Whether it was them or not, there was an cool posted
about a similar technique.</p>
<p>I may need to bail to go to <em>The Making of "TRON: LEGACY"</em>. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/biggrin.png" alt=":D" /></p>
</li>
<li><em>Global Illumination Across Industries (2:00PM - 5:15PM)</em>
<p>GI has always been fascinating to me, and I'm so happy to live in a time
where real-time GI is <em>just about</em> within reach.</p>
</li>
</ul>
Constructor-as-function-call idiomhttp://www.paranormal-entertainment.com/idr/blog/posts/2010-07-07T19:45:03Z-Constructor-as-function-call_idiom/2010-07-07T21:54:31Z2010-07-07T19:45:03Z
<p>Several coworkers and I have been working on a compiler project for the last
six months or so. We're implementing it in C++, and, for most of us, it's our
first real C++ project. We're using various flavors of
<a href="http://en.wikipedia.org/wiki/Visitor_pattern">visitors</a><a href="http://www.paranormal-entertainment.com/idr/blog/archive/#1"><sup>1</sup></a> for a lot of our IR
processing. In quite a few places we have visitors that just do stuff but
have no value. To invoke them some code that looks something like:</p>
<pre><code> ir_validate_tree v;
v.run(instructions);
</code></pre>
<p>Often these are wrapped in a function. In other places we have things like:</p>
<pre><code> ir_swizzle_swizzle_visitor v;
v.run(instructions);
/* Do something with v.progress */
</code></pre>
<p>The latter form is always wrapped in a function that just returns
<code>v.progress</code>.</p>
<p>I find the first form to be particularly ugly. Wrapping it in a function
makes using it less ugly, but the ugly is still there, lurking in the
shadows.</p>
<p>It occured to me today that at least the first form could be "fixed" by using
the constructor as the <code>run</code> method. Instead of the code above, there would
be a constructor that had the code from the <code>run</code> method, and callers would
just do:</p>
<pre><code> ir_validate_tree(instructions);
</code></pre>
<p>Something similar could be done with the second case, but that would look
like:</p>
<pre><code> progress = ir_swizzle_swizzle_visitor(instructions).progress || progress;
</code></pre>
<p>My conundrum, as a C++ newb, is whether or not this is a common idiom. Would
someone familiar with C++ (at least more familiar than I am) look at that code
and know what was going on? Or would they just think the author was a
clueless newb?</p>
<p><a name="1">1:</a> We primarily use <a href="http://c2.com/cgi/wiki?HierarchicalVisitorPattern">hierarchical visitors</a>.</p>
GLSL compiler, take 2http://www.paranormal-entertainment.com/idr/blog/posts/2010-06-10T18:55:29Z-GLSL_compiler_take_2/2010-06-10T19:32:49Z2010-06-10T18:55:29Z
<p>Folks may remember from XDS 2008 that I was working on a rewrite of Mesa's
GLSL compiler. To make a long story short, let's just say that effort fell
over and sank into the swamp.</p>
<p>Last December, I started building another one. I had called the working
directory of the first compiler <code>glsl</code>, so this one, being take 2, was called
<code>glsl2</code>. After I had been working on it for a couple months, Eric Anholt and
Ken Graunke (who has since joined our group at Intel) started working on it
with me. We've come a long way.</p>
<p>I expect we'll take some flak for working in semi-secret. I'll take the blame
for that one. The first attempt at rewriting the compiler was widely
publicized and turned into a disaster. In spite of it being widely
publicized, I don't think anyone ever pulled the tree. I decided that I
wanted to just keep my head down and work on this one. The announcements can
come when there's actually something to announce. I think we're close enough
to having something to announce to make it worth the effort.</p>
<p>At this point, the front-end (parsing, semantic checking, generation of the
initial high-level IR) is mostly complete. We support all of GLSL 1.20 and
most of GLSL 1.30. We've temporarily punted on switch-statements, the
<code>float</code> (vs. <code>vec4</code>) variants of the shadow sampler functions, and the
"offset" versions of all the texture look-up functions. Each of those is
going to require a bit more thought to implement correctly.</p>
<p>Carl Worth has written a preprocessor for us, but it hasn't been integrated
into the tree yet. As was <a href="http://marc.info/?l=mesa3d-dev&m=127612840317832&w=2">mentioned on the Mesa mailing
list</a>, <em>without the
preprocessor</em> we're passing over 90% of the piglit tests.</p>
<p>There's still a lot left to do.</p>
<ul>
<li>Linker: The single biggest thing remaining is the linker. The compiler
and the IR are structured such that we can actually have a real linker
(instead of just concatenating multiple sources and recompiling), but that
means we have to write a real linker.</li>
<li>More optimizations: Our primary target is i915-class hardware. In order
to get GLSL to run on hardware that doesn't have branches, there are a
bunch of optimizations, like loop-unrolling, that you have to do. We still
need to do some of those.</li>
<li>Preprocessor: We still have to integrate Carl's preprocessor. I believe
that is being done this will still.</li>
<li>Memory management: Any objects that are no longer needed get dropped on
the floor. We leak like a screendoor on a submarine. This was an
intentional design decision. I had planned to eventually write some sort
of slab allocator. At the end of compilation, the entire slab would be
deleted. Eric and Carl have since convinced me to just use
<a href="http://talloc.samba.org/talloc/doc/html/index.html">talloc</a>.</li>
<li>Codegen: Eric is writing a back-end that will generate Mesa's existing
low-level IR from our IR. I believe this is getting close to being done
enough.</li>
<li>Mesa: Once all that stuff is done, we need to get our stand-alone compiler
in the Mesa tree. We're expecting it to live in a branch for a few months
while things stabilize. It should make for <a href="http://en.wikipedia.org/wiki/May_you_live_in_interesting_times">interesting
times</a>.</li>
</ul>
<p>The primary repo is my GIT tree. Eric, Ken, and Carl all have their own
trees, and I pull from them when their stuff is ready.</p>
<p><code>git://anongit.freedesktop.org/~idr/glsl2</code></p>
<p>For those interested in help things along, the biggest thing we need are more
test cases. We're especially interested in shaders from real applications
that are known to work correctly on other drivers. We have a bunch from
gstreamer and other projects, but more is better. If you have some shaders
and don't mind releasing them under a piglit compatible license, <em>please</em> send
them our way.</p>
w00t!http://www.paranormal-entertainment.com/idr/blog/posts/2010-05-09T17:23:15Z-w00t/2011-01-28T23:11:37Z2010-05-09T17:23:15Z
<p>Last night Rose and I went to see
<a href="http://en.wikipedia.org/wiki/W00tstock">w00tstock</a> at the <a href="http://www.aladdin-theater.com/">Aladdin
Theater</a>. It was freakin' awesome. If you
live in Chicago or Minneapolis (the next stops on the tour), you need to go
see it when it comes to town. I have to admit, other than <a href="http://www.adamsavage.com/">Adam
Savage</a> and <a href="http://www.wilwheaton.net/">Wil
Wheaton</a>, I hadn't heard of any of the acts before
the show. I was a bit skeptical about the whole thing. Alas. It was 4+
hours of win. I know, it's billed as "3 Hours of Geeks & Music," but it went
<em>way</em> over.</p>
<p>Since they expressly released the content of the show under a <a href="http://creativecommons.org/">Creative
Commons NC-BY license</a>, the whole show has
probably been posted, bit by bit, to YouTube by now.</p>
<p>Even though the show went hours over time, I stayed until the very end for
autographs. (Note: I'll post pictures later.) The autographs were being done
from the bar area where the Aladdin usually serves pizza. The line went
across the lobby, up the stairs, across the balcony, down the other stairs,
and out on to the side walk. I was fourth from last. I get up to the front,
have a little chit chat with <a href="http://www.paulandstorm.com/">Paul and Storm</a>,
but I'm really waiting to meet Adam. Of course, by the time I got there, I
couldn't think of "my favorite episode." It came to me this morning. Three
words: <a href="http://www.youtube.com/watch?v=ynZxVErTovg&feature=PlayList&p=0FAF24DD1F88AE0B&playnext_from=PL&playnext=1&index=2">exploding cement
truck</a>.</p>
<p>Instead, all I can think of is <a href="http://www.youtube.com/watch?v=exJQBYW5aaA">Tori whacking his
knee</a>. That episode drove me
nuts! They kept replaying that clip over and over again. Every time I got
this shot of sympathy pain in my left knee... that I damaged in a skiing
accident. So, that's what I told Adam about. As soon as I mentioned that
episode, his facial expression changed. "I wasn't at that shoot," he tells
me, "but I soon as I saw that set-up I said, 'What the hell are they
thinking?'" And then we had a decent conversation about it. It was really
cool.</p>
What's GNU?http://www.paranormal-entertainment.com/idr/blog/posts/2010-04-02T04:37:22Z-Whats_GNU/2010-04-02T04:43:06Z2010-04-02T04:37:22Z
<p>Am I the only one terrified by the thought of RMS making educational
games for children?</p>
<p><img src="http://www.paranormal-entertainment.com/idr/blog/images/whats_gnu.jpg" width="512" height="384" /></p>
Train your rendering enginehttp://www.paranormal-entertainment.com/idr/blog/posts/2010-03-30T05:04:45Z-Train_your_rendering_engine/2010-03-30T06:07:47Z2010-03-30T05:04:45Z
<p>Over the weekend my wife and I went to see <a href="http://www.imdb.com/title/tt0892769/">How to Train Your
Dragon</a>. Holy crap. It was
<em>really</em> good. For the type of movie that it is, I think it was just
about perfect. Coming from me, that's saying something. I can pretty
much always find something to complain about.</p>
<p>Not only was the movie great, but the rendering went above and beyond!
I was expecting the fire to be the impressive rendering feat, but it
was the water and the clouds that impressed me. Of course, it is hard
to top the
<a href="http://screenrant.com/wp-content/uploads/harry-potter-image5-japanese.jpg">fire</a>
from <a href="http://www.imdb.com/title/tt0417741/">The Half-Blood Prince</a>. I
think the best shot was towards the end of the movie. The Vikings had
arrived at an island by ship. One of the dragons was going breathe
fire over the ships. The camera cut to a shot from under the water
looking straight up. It's hard to explain, but it was freakin' cool.
It's about 3 seconds after the image below.</p>
<p align="center">
<img src="http://www.paranormal-entertainment.com/idr/blog/images/dragon-01.jpg" width="640" height="271" />
</p>
<p>And yeah, the fire is pretty damn sweet in that shot.</p>
<p>About a minute into the
<a href="http://www.youtube.com/watch?v=oKiYuIsPxYk">trailer</a> are some good
shots of the water (surface of the lake) and the clouds.</p>
GLX-fixes treehttp://www.paranormal-entertainment.com/idr/blog/posts/2010-03-22T18:24:45Z-GLX-fixes_tree/2011-01-28T23:11:37Z2010-03-22T18:24:45Z
<p>I've just created a branch in my personal xserver git repository where
<em>reviewed</em> GLX and DRI patches will land. My intention is to collect,
review, and test server-side GLX and DRI patches. When I believe the
tree is stable, I will send a pull request to keithp. My hope is that
this will get some patches into the tree a little faster.</p>
<p>For people who would like to try out this branch, it is available at:</p>
<p><code>git://anongit.freedesktop.org/~idr/glu3 GLX-fixes</code></p>
Discussion winhttp://www.paranormal-entertainment.com/idr/blog/posts/2010-03-19T18:48:29Z-Discussion_win/2010-03-19T18:56:05Z2010-03-19T18:48:29Z
<pre>
Mar 19 11:38:44 <anholt> idr: so, I've been looking into savage2. guess what we need to fix it? :P
Mar 19 11:38:58 <idr> anholt: A pony?
Mar 19 11:39:03 <anholt> yeah
Mar 19 11:39:12 <anholt> more specifically CSE inside of loops
Mar 19 11:39:21 <anholt> and decent register allocation in the presence of loops
Mar 19 11:40:11 <anholt> float v = length(a); vec4 n = normalize(a); /* oh no where'd all my temps go, and why's my program a million instrs long? */
Mar 19 11:40:36 <idr> blarg.
Mar 19 11:40:36 <anholt> lots of n_dot_l recomputation
Mar 19 11:41:42 * idr gets back to work trying to give birth to a pony...
Mar 19 11:41:56 <ajax> there's an image i didn't need
Mar 19 11:42:29 <idr> I'll post pictures to my blog later.
</pre>
Little blue GPU...http://www.paranormal-entertainment.com/idr/blog/posts/2010-03-06T23:33:19Z-Little_blue_GPU/2010-03-06T23:49:35Z2010-03-06T23:33:19Z
<p>You'd think with a name like that they'd have better performance.</p>
<p><a href="http://failblog.org/2010/02/11/processor-name-fail/">
<img src="http://failblog.files.wordpress.com/2010/02/epic-fail-processor-name-fail.jpg" width="400" height="387" alt="Via GPU name FAIL">
</a></p>
<p>This is the <em>old</em> <a href="http://www.via.com.tw/en/products/apollo/mvp4.jsp">Apollo
MVP4</a> chipset used in
<a href="http://en.wikipedia.org/wiki/Super_Socket_7">Super Socket 7</a> sytems used
primarily with AMD <a href="http://en.wikipedia.org/wiki/K6-2">K6-2</a> and
<a href="http://en.wikipedia.org/wiki/K6-III">K6-III</a> CPUs. It used the <a href="http://www.anandtech.com/showdoc.aspx?i=899&p=1">Trident
Blade3D</a> graphics core, so
you <em>know</em> it was full of win.</p>
Meet me at Flynn'shttp://www.paranormal-entertainment.com/idr/blog/posts/2010-03-06T05:07:44Z-Meet_me_at_Flynns/2010-03-06T05:24:51Z2010-03-06T05:07:44Z
<p>I just got back from seeing <a href="http://www.imdb.com/title/tt1014759/">Alice in
Wonderland</a>. It was really
pretty but largely content free. The high point was the trailer for
<a href="http://www.imdb.com/title/tt1104001/">Tron Legacy</a> (I think this says
more about me than about the quality of AiW.). Oh man... I am
so stoked for that movie to come out! I'm <em>really</em> hoping there will good
Tron swag in the Disney booth at SIGGRAPH this year.</p>
<p>/me crosses his fingers...</p>
How do people seriously use Java?!?http://www.paranormal-entertainment.com/idr/blog/posts/2010-03-01T01:31:54Z-How_do_people_seriously_use_Java/2010-03-01T02:06:20Z2010-03-01T01:31:54Z
<p>I've been taking a <a href="http://web.cecs.pdx.edu/~antoy/Courses/syllabi/WIN2010CS553.html">design patterns
class</a>
at Portland State this term. I've been really enjoying and getting a
lot out of the material of the class. However, the class is entirely
in Java, and each time I sit down to do an assignment, I find myself
wonder how people can actually use this steaming pile of a language.
Seriously. Let me cite an example of why this language is just
worthless.</p>
<p>I have a class hierarchy for expressions in a programming language.
This consists of a base class (<code>Expr</code>), derived classes for different
types of operations (<code>ExprMul</code>, <code>ExprAdd</code>, etc.), a derived class for
variable dereferences (<code>ExprVar</code>), and a derived class for literal
constants (<code>ExprIntLiteral</code>).</p>
<p>I want to use implement the last two as
<a href="http://en.wikipedia.org/wiki/Flyweight_pattern">flyweights</a>. I add a
class <code>ExprFactory</code> to manage the instances of the flyweights. I also
make the constructors of the flyweights private. This is where the
whole thing falls apart. Now that the flyweights' constructors are
private, I have to put <strong>all</strong> of the classes into a package.</p>
<p>Now that all of the classes are in the same package, they all have
visibility into all of the other classes. WTF?!? I wanted to limit
the visibility of a couple methods in a couple of classes, but in
order to do that I've had to remove all visibility limitations on
everything. Fueled by bong hits.</p>
<p>I've also noticed that it's almost impossible to do Java development
without using an integrated environment. It appears that once you
start using packages, you have to build things in a very precise
order. I basically have to fiddle with it until the compiler stops
giving me useless messages.</p>
<p>And don't get me started about having to put every public class in a
separate file with a matching name. Seriously?</p>
<p>Java is a toy language for making web applets. It is completely
useless for anything else.</p>
<p><strong>UPDATE</strong>: I have now learned the difference between marking a method
or member explicitly <code>private</code> and leaving it blank. But I'm still
irritated.</p>
GLU3 is a real project!http://www.paranormal-entertainment.com/idr/blog/posts/2010-02-28T08:30:41Z-GLU3_is_a_real_project/2011-01-28T23:11:37Z2010-02-28T08:30:41Z
<p>GLU3 is now a "real" project with hosting on freedesktop.org! This
means that there is a <a href="http://lists.freedesktop.org/mailman/listinfo/glu3-devel">development mailing
list</a>, and
the GIT repo has moved.</p>
<p><code>git://anongit.freedesktop.org/git/glu3</code></p>
<p>My hope is to have a 1.0 release out in the next month or so. I've
got some new functionality that I'm working on, but I should be able
to finish most of that this weekend.</p>
Presentation Camera 0.2http://www.paranormal-entertainment.com/idr/blog/posts/2010-02-24T19:56:35Z-Presentation_Camera_0_2/2010-02-24T20:26:03Z2010-02-24T19:56:35Z
<p>I updated my presentation camera rig this week with a new camera. I replaced
the old <a href="http://www.logitech.com/index.cfm/435/217&hub=1&cl=nz,en?WT.z_sp=Image">Quickcam for Notebooks
Deluxe</a>
with a <a href="http://www.dynexproducts.com/pc-692-10-dynex-13mp-web-cam.aspx">Dynex 1.3MP Web
Cam</a>. I was
hoping that going from 640x480 to 1280x1024 would solve a lot of the problems
with the 0.1 setup. Alas, it did not.</p>
<p>I encountered two primary problems. First,
<a href="http://projects.gnome.org/cheese/">Cheese</a> would occasionally turn into a
slide show when capturing at full res with a maximized window. It was very
annoying. The frame-to-frame lag was long enough for me to write an entire
word. The other problem, and this is the deal breaker, is that the camera has
a fixed focus distance of about thee feet. If I position the camera three
feet from the writing pad, the writing pad occupies about 640x480 of the
captured image. <em>Fail.</em></p>
<p>I guess I need a camera that will stream at 1.3MP (or better) and either
automatically focus or a focus adjustment (the old camera had the latter).
Cameras that I could find on the net that meet these requirements all cost $70
or more. Meh.</p>
<p>I have an alternate plan, but I'll have to actually write some code. I have
an older <a href="http://en.wikipedia.org/wiki/Canon_PowerShot_A">Canon PowerShot A70</a>
that I don't use. I seem to recall that there are some libraries available
that allow real-time capture of single frames directly from the camera. The
library basically tells the camera to take a picture, and then it downloads
that picture. If I can get it to stream fast enough, say 10fps to 15fps, that
should be a usable solution.</p>
<p>Given that nobody has written a V4L driver to stream from these cameras in this
manner, I suspect that I may be heading down a road of disappointment. <a href="http://www.metrolyrics.com/snowball-in-hell-lyrics-they-might-be-giants.html">If it
wasn't for disappointment, I wouldn't have any
appointments.</a></p>
Presentation Camera Hackhttp://www.paranormal-entertainment.com/idr/blog/posts/2010-02-12T06:23:22Z-Presentation_Camera_Hack/2010-02-12T06:47:14Z2010-02-12T06:23:22Z
<p>For <em>years</em> I have been irritated by the lack of white-board space in the
classrooms at the Art Institute. When the screen for the projector is pulled
down, there is, literally, 4'x4' of white-board space available. As a result,
I frequently have to erase drawings, equations, and bits of pseudo-code that
I've written on the board. Almost invariably I want to refer back to... oops!
It was erased!</p>
<p>Some of the classrooms at <a href="http://pdx.edu/">PSU</a> have <a href="http://www.bitec.com/document_cameras_lumens.html#DC166">Lumens
DC166</a> presentation
cameras. My STAT551 teach uses the one in that classroom, and it's a pretty
nice device. Joyous day! I figured I'd get one of those, and all my problems
would be solved. I went to eBay to get one, but they're <strong>$200</strong>.</p>
<p>The hacker in me took over. When it gets down to it, the thing is really just
a webcam and a light. It has some other features, like direct VGA /
composite video output, but I don't need any of them because I have a laptop.
I decided to build one. What did I build it from? Well, version 0.1 is a
webcam and a light. Shocking, I know.</p>
<p><img src="http://www.paranormal-entertainment.com/idr/blog/images/presentation_cam.jpg" alt="My presentation camera" title="My presentation camera" /></p>
<p>I used it this past Tuesday with <a href="http://projects.gnome.org/cheese/">Cheese</a>.
As you can see, the image quality isn't great. However, I was able to flip
back to "erased" equations and drawings at will. Not only that, but I didn't
get white-board marker smudges on my hands. The 0.1 test was a complete
success.</p>
<p><img src="http://www.paranormal-entertainment.com/idr/blog/images/presentation_cam_sample.jpg" alt="Presentation cam sample" title="Presentation cam sample" /></p>
<p>I need to get a new cam, and I need to add a diffuser and a back "bounce" to
the light. I also have some ideas for new software to write for it. I'll
dish on that later. Once I get the final <em>hardware</em> built, I'll put up a full
howto with pictures.</p>
GLU3 FTW!http://www.paranormal-entertainment.com/idr/blog/posts/2010-01-22T15:20:09Z-GLU3_FTW/2010-01-25T22:45:52Z2010-01-22T15:20:09Z
<p>I just finished pitching my fledgling GLU3 library to the ARB, and
everybody loved it. Quite a few people said that they've hacked up
something similar, but much less complete, to get simple demo apps
running. A few of the people had functionality not in the library,
and it sounds like I may get a few code contributions. It also sounds
like it <em>may</em> be included in the <a href="http://www.opengl.org/sdk">OpenGL
SDK</a>. Yay me!</p>
<p>For those interested, the doxygen documentation is at:</p>
<p><a href="http://people.freedesktop.org/~idr/glu3">http://people.freedesktop.org/~idr/glu3</a></p>
<p>The GIT tree for the code is available at:</p>
<p><code>git://anongit.freedesktop.org/~idr/glu3</code></p>
<p>At some point the tree will probably move somewhere that can allow
direct commits by people other than me. I'll cross that bridge when I
come to it.</p>
Sony Pictures Imageworks releases OSL code and docshttp://www.paranormal-entertainment.com/idr/blog/posts/2010-01-13T19:19:55Z-Sony_Pictures_Imageworks_releases_OSL_code_and_docs/2010-01-13T19:35:06Z2010-01-13T19:19:55Z
<p>As pointed out in the excellent <a href="http://www.realtimerendering.com/blog/sony-pictures-imageworks-open-source-projects/">Real-Time Rendering
blog</a>,
Sony Pictures Imageworks has released the documentation and <em>source code</em> for
their <a href="http://code.google.com/p/openshadinglanguage/">Open Shading Language
compiler</a>. It's a slightly
different take on shading languages than GLSL / HLSL / Cg. The idea is that
instead of generating final colors, as in other SLs, shaders compute
information about how a surface / light / whatever interacts. These shaders
are then connected into a network, and complex global illumination is then
calculated by evaluating the network. At least, that's my understanding from
readin the
<a href="http://code.google.com/p/openshadinglanguage/wiki/OSL_Introduction">introduction</a>
for five minutes. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /></p>
<p>Pretty cool stuff.</p>
Stairs almost done!http://www.paranormal-entertainment.com/idr/blog/posts/2010-01-08T20:32:34Z-Stairs_almost_done/2010-01-08T21:14:30Z2010-01-08T20:32:34Z
<p>I finally got my uncle out to fix my rickety basement stairs. You may
remember that my wife <a href="http://www.paranormal-entertainment.com/idr/blog/posts/2009-08-14T22:01:19Z-Virtual_cast/">fell down these
stairs</a>
last August. My uncle Brad does carpentry for a living, and he came
up from Stayton a couple times over the last well to fix them. It's
<em>almost</em> done, as you can see from the pictures below. All that's
left is to install the handrails on both sides.</p>
<p><img src="http://www.paranormal-entertainment.com/idr/blog/images/stairs/stairs_gone.jpg" alt="Stairs after being ripped out" title="Stairs after being ripped out" />
<img src="http://www.paranormal-entertainment.com/idr/blog/images/stairs/stairs_almost_done.jpg" alt="New stairs installed w/o handrails" title="New stairs installed w/o handrails" /></p>
<p>You can't see it very well in the pictures, but I also got a new
door. Amazingly, this one actually opens and closes like a normal
door. It doesn't have cracks and holes in it either. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /></p>
<p>If you need any work done in the Stayton-Salem-Woodburn area, let me
know. I'll put you in contact with my uncle. He does really good work.</p>
The last straw!http://www.paranormal-entertainment.com/idr/blog/posts/2010-01-07T05:13:02Z-The_last_straw/2010-01-07T05:25:20Z2010-01-07T05:13:02Z
<p>That was the last frickin' straw! On my way home, two blocks from my
house, I broke <em>another</em> spoke. That's <em>four</em>. The bike I have is
large. How big is it? It's big enough that when I hang it on the
bike rack on the MAX it touches the ground. I find it hard to believe
that a company would sell a big that big that can't take the weight of
a 6' man. EPIC FAIL.</p>
<p>So... I'm in the market for a new (to me, anyway) bike, and I'm
looking for recommendations. Since I have to ride to school (~14 mile
round-trip) twice a week, I need to get something soon. I'm a little
bit past "casual commuter", but I'm nowhere near those psychos with
the clip-shoes and no brakes.</p>
<p>I need something that can carry me and rack full of books and a
laptop. The current bike is an 18 speed, but I never use the lowest
gear on the front or back. Seriously... if I need those, I may as
well get off and walk!</p>
<p>Thoughts?</p>
I am Spartacus!http://www.paranormal-entertainment.com/idr/blog/posts/2009-12-22T05:08:24Z-I_am_Spartacus/2009-12-22T05:54:22Z2009-12-22T05:08:24Z
<p>It is just me, or are the Tiger Woods affairs getting to be like the
end of <a href="http://www.imdb.com/title/tt0054331/">Spartacus</a>? Seriously.</p>
<p>"I am Tiger Woods' mistress!"</p>
<p>"I am Tiger Woods' mistress!"</p>
<p>"I am Tiger Woods' mistress!"</p>
<p>"Is anyone here <em>not</em> Tiger Woods' mistress?"</p>
Santa selects a quest...http://www.paranormal-entertainment.com/idr/blog/posts/2009-12-21T21:49:29Z-Santa_selects_a_quest/2009-12-21T21:56:45Z2009-12-21T21:49:29Z
<p>It occurs to me that Christmas shopping is a lot like the quests in
many computer RPGs. How many XP do I get for finding the best deal in
town on a toaster?</p>
Jimmy Cameron, his next 3 hour movie, and a silly foxhttp://www.paranormal-entertainment.com/idr/blog/posts/2009-12-19T07:46:59Z-Jimmy_Cameron_and_his_next_3_hour_movie/2009-12-20T06:06:26Z2009-12-19T07:46:59Z
<p>I just got back from seeing
<a href="http://www.imdb.com/title/tt0499549/">Avatar</a> at
<a href="http://www.cinetopiatheaters.com/">Cinetopia</a>. Holy crap. Serious.
The movie was so beautiful to behold. It was really, really long, but
it didn't <em>feel</em> long. Know what I mean? Anyway, I'm looking forward
to all the SIGGRAPH papers about the rendering techniques developed
for the movie. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /></p>
<p>I really like the juxtaposition of the way the Na'vi connected with
the trees, pa'li (horses), and ikran (flying creatures) with the way
the humans connected with their mechanized walkers and avatar
connection machines.</p>
<p>My single nit is that native peoples with bows and arrows never win.
The Zulu came close, but pretty much everyone else just got
slaughtered.</p>
<p>I also saw <a href="http://www.imdb.com/title/tt0432283/">Fantastic Mr. Fox</a>
this weekend. Oh man... so many lols. Jason Schwartzman seriously
made that movie. "I can't go to school. I'm sick." "No you're not."
"I have a fever." "No you don't." "Okay."</p>
Farewell Adrian!http://www.paranormal-entertainment.com/idr/blog/posts/2009-12-05T03:59:35Z-Farewell_Adrian/2009-12-05T04:16:32Z2009-12-05T03:59:35Z
<p>So, series finales are usually rubbish. Seinfeld? Cheers? BSG?
I'd wipe my bum with those scripts! However, the finale to Monk was
exactly what it needed to be. Script writters take notice: this is
the model to follow.</p>
L4D2 is shithttp://www.paranormal-entertainment.com/idr/blog/posts/2009-11-28T09:02:50Z-L4D2_is_shit/2009-11-28T09:45:20Z2009-11-28T09:02:50Z
<p>I'm going to go out on a limb, and say that L4D2 is <strong>worse</strong> than the
original. A lot of the new weapons are just worthless (the AK-47 as
an example), and the new specials are just fucking ridiculous (the
charger as an example). The witch <em>in the fucking safe room</em> was the
last straw. If you could return things to Steam for a refund, I probably would.</p>
New museum piecehttp://www.paranormal-entertainment.com/idr/blog/posts/2009-11-09T00:03:50Z-New_museum_piece/2009-11-09T00:11:54Z2009-11-09T00:03:50Z
<p>So... I got a new addition for my graphics card museum a week or so
ago. I found this on eBay when I was searching for something else
entirely.</p>
<p><img src="http://www.paranormal-entertainment.com/idr/blog/images/Rage_Fury_MAXX.small.jpg" alt="Rage Fury MAXX" title="Rage Fury MAXX" /></p>
<p>I haven't installed it in a system yet, so it may not work. Why not?
Because I know it doesn't work <em>at all</em> with the r128 driver in Mesa.
I might therefore be tempted to hack on that driver. <em>That would be bad.</em></p>
FatELFhttp://www.paranormal-entertainment.com/idr/blog/posts/2009-11-04T05:21:29Z-FatELF/2009-11-04T05:55:06Z2009-11-04T05:21:29Z
<p>I have to say, I really liked the idea of
<a href="http://icculus.org/fatelf/">FatELF</a>. I'm not terribly surprised at
the... er... push-back. We've seen this a lot of times in the past.
A number of years ago SGI proposed some patches to use a "spare"
32-bits in a per-thread data structure to hold the GL context
pointer. The patches were rejected, and the submitters were flamed.
Fast forward a few years (and by I a few I mean 5-ish) we have TLS to
store this sort of data in a generic way.</p>
<p>What's the point?</p>
<p>Well, some times someone has the right idea to solve a particular
problem. It might not be <em>everyone's</em> problem, and it might not be
something we (the "royal" we, of course) want to maintain moving
forward. However, it might be something useful and there might be a
way to generalize it to make it really useful.</p>
<p>How so?</p>
<p>The first idea that idea had about FatELF was to put multiple versions
of a code compiled with optimizations for different targets in the
same binary. So, put the -march=i686 and -march=core2 code in the
same binary. Yeah, GCC has some features that work sort of like
this. Last I tried them, it was a pain in the ass and carried some
annoying "caveats".</p>
<p>I would also love a solution to the mixed 32-bit / 64-bit distros.
Anyone that thinks /lib and /lib64 (or /lib32 of you're Ubuntu) is a
good solution needs a kick in the teeth. Seriously. FatELF isn't a
solution "out of the box" for that problem (how do you install a
32-bit library into an existing 64-bit library install) yet, but it
doesn't seem like an insurmountable problem.</p>
Killing Floor mini reviewhttp://www.paranormal-entertainment.com/idr/blog/posts/2009-10-23T04:00:49Z-Killing_Floor_mini_review/2009-10-23T22:13:04Z2009-10-23T04:00:49Z
<p>Steam is having a free trial of Killing Floor this weekend, and I spent some
time with it. Let me be frank. At first, I completely hated this game. The
first draft of this review had nothing positive to say and was downright mean.
I played it for another hour or so after that, and I came to understand it a
bit better. As a mindless zombie killing romp, it does a decent job.</p>
<p>There are some interesting game mechanics that add to the interest. I
especially game to appreciate the encumbrance / inventory system. Each item
has a certain weight, and you can only carry so much. The weights are pretty
carefully selected to force some difficult choices. For example, if you pick
the Hunting Shotgun, that's the only weapon (other than the knife and 9mm)
that you get.</p>
<p>While I'm at it, I <strong>really</strong> like the Hunting Shotgun. It's one of the
better shotguns I've encountered in a game. It reminded me of the old Doom 2
double-barrel shotgun, and that's a good thing.</p>
<p>The use of headshots to prevent creatures from using their special abilities
was also clever. However, pretty much all the creatures die within a few
seconds of receiving a headshot, so it doesn't turn out to be that useful.</p>
<p>I eventually came to enjoy the interior maps. The welding torch, which is
used to secure doors ala Aliens, is really cool. I eventually settled on
running through the halls, welding a door shut, then running around behind
the creatures that are trying to break through the door. It was very
satisfying to unload both barrels on a big group of creatures lined up at a
door. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /></p>
<p>Most of the exterior maps, especially the Farm, failed due to the crummy AI.
Those maps basically degrade to running around until all of the creatures are
behind you, turning around and picking them off one by one with the rifle.
Either the AI needs to be better or something needs to change in those maps.</p>
<p>My main complaints are:</p>
<ul>
<li>Reload times on most weapons is way, way too long. This is especially true
with the 9mm.</li>
<li>When you're reloading, you're completely defenseless. You can't abort the
reload to switch weapons, and you can't do any sort of melee attack. You
can just stand there and get hacked to pieces. L4D got this right with the
"shove."</li>
<li>While I'm complaining about weapons, the AK-47 and the LAW are rubbish.
The spread on the AK-47 is so wild that the weapon is almost useless. The
one time I got the LAW, I couldn't get it to shoot. The game even goes so
far as to mock you by saying, "If you're far enough to get [the LAW], you
don't need weapon tips." That would be true if pressing the shoot button
made it shoot!</li>
<li>Limited time in the shop between levels. I understand having limited time
to <em>get to</em> the shop. That's one of the game mechanics. However, once the
entire team has gotten to the shop, the timer should stop. The existing
setup punishes people for being unfamiliar with the game. The first few
times you're in the shop, it's difficult to know what to buy. The
interplay of encumbrance and item weights makes this even more difficult.</li>
<li>One of the Ten Commandments of an FPS is "thou shalt have a crosshair." I
understand that one of the main game mechanics is getting head-shots, but
lack of a crosshair is still weak. I do have to give them some credit for
fixing my other peeve with all other FPS games... you can use the "sights"
on any weapon. It used to drive me nuts in Enemy Territory (as an
example), that you couldn't use the sights on the M1.</li>
<li>When you die, you get pushed to the next map set and lose all your
stuff. Nothing is more frustrating than getting to 2 monsters left
on map 3 of 4 and dying. Well... now it's an hour until you get to
try that map again.</li>
<li>I like death metal, but the soundtrack was just painful.</li>
</ul>
<p>Currently the rating on Steam is 71. That's about what I would give it as
well. For a $15 game, that's not bad. The problem is that there are a lot of
other great games out there, and there are a few really good <em>free</em> games.
I'll probably play Killing Floor a bit more this weekend. It may be worth
$15, but I'm not sure it's worth my time.</p>
OpenGL tutorialshttp://www.paranormal-entertainment.com/idr/blog/posts/2009-10-12T07:03:20Z-OpenGL_tutorials/2009-10-12T07:25:02Z2009-10-12T07:03:20Z
<p>I just posted two <a href="http://people.freedesktop.org/~idr/OpenGL_tutorials">OpenGL
tutorials</a>. This
is the start of what I hope will be a long series of tutorials. Right
now there's just a "Hello, world!" tutorial for the post-OpenGL 3.1
world (i.e., no immediate mode, no fixed-function) and a more in-depth
tutorial for vertex shader inputs.</p>
<p>Since I want to produce PDF and HTML output, I'm authoring them in
DocBook (or is it SGML? WTF?). It's mostly working out, but there
are some things that I just can't seem to get to work right. The most
frustrating part is that documentation for all of the SGML toolchains
that I can find are crap. It's kind of ironic that the documentation
for a document creation tool is so lacking...</p>
<p>My two biggest peeves are the crap figure handling in the PDF output
and the crap table formatting in the HTML output. I can fix the HTML
problems with CSS, but how is the tool makeing the output so bad in
the first place? For the PDFs, seriously, a page break in the middle
of a figure? Whose genius plan is that?!?</p>
<p>The other problem that I initial had was the lack of XInclude support
in Jade. I "fixed" that using xmllint, but this seems like a
fundamental feature to be missing from the tool.</p>
<p>Before anyone comments, I did consider using LaTeX. The main problem
I have with LaTeX is the HTML output that it generates make me want to
stab somebody. Every single time I come across an academics webpage
that has been generated from LaTeX, I shed a lonely tear...</p>
Chicken fight!http://www.paranormal-entertainment.com/idr/blog/posts/2009-10-08T07:13:34Z-Chicken_fight/2011-01-28T23:11:37Z2009-10-08T07:13:34Z
<p>I never get tired of watching the "chicken fight" skits on Family Guy. WIN!</p>
Floating-point 'equality' for the losehttp://www.paranormal-entertainment.com/idr/blog/posts/2009-09-23T01:19:45Z-Floating-point_equality_for_the_lose/2009-09-24T17:11:50Z2009-09-23T01:19:45Z
<p>Well, isn't that just special? I've been writing some tests for
<a href="http://www.opengl.org/registry/specs/NV/fragment_program_option.txt"><code>NV_fragment_program_option</code></a>
before merging the <code>asm-shader-rework-2</code> branch to Mesa master. While
doing that, I came across a neat case on shipping drivers on real
hardware. These two code sequences produce different results:</p>
<pre><code> ADDC R0, R0, |R0|;
MOV R1 (NE), {1.0};
</code></pre>
<p>and</p>
<pre><code> ADD R0, R0, |R0|;
SNE R1, R0, {0.0};
</code></pre>
<p>I don't think the absolute-value operator has anything to do with it,
but that's how my test case was written. Gosh... if the <code>ADDC</code>
doesn't set the <code>NE</code> condition code, I'd expect the result in <code>R0</code> to
be equal to zero. Have I gone completely mad?!?</p>
Polish noms cometh...http://www.paranormal-entertainment.com/idr/blog/posts/2009-09-13T21:48:59Z-Polish_noms_cometh/2009-09-13T21:56:52Z2009-09-13T21:48:59Z
<p>Just a friendly reminder... the <a href="http://www.myspace.com/portlandpolishfest">Portland Polish
Festival</a> is coming up the
weekend between <a href="http://linuxplumbersconf.org/2009/">LPC</a> and
<a href="http://www.x.org/wiki/Events/XDC2009">XDC</a>. It has been getting more
and more crowded every year, but it's still fun. How can you say "no"
to perogies and potato pancakes? nom nom nom nom...</p>
Hurray!http://www.paranormal-entertainment.com/idr/blog/posts/2009-09-09T19:22:00Z-Hurray/2009-09-09T22:32:16Z2009-09-09T19:22:00Z
<p>Hurray for context-free grammars! <em>sigh...</em></p>
<p>I started implementing support for <code>GL_NV_fragment_program_option</code> to
the Mesa shader assembler. I quickly discovered that the grammar for
this extension is broken in a pretty fundamental way. They didn't
bother to make new keywords, such as <code>LONG</code>, <code>SHORT</code>, or the condition
names (e.g., <code>LT</code>) reserved. This means that a Bison parser has to
treat the places where these non-reserved reserved words occur as
identifiers. That by itself is annoying, but I can work around it.</p>
<p>The real problem is with the <code>KIL</code> instruction. In
<code>GL_ARB_fragment_program</code> the <code>KIL</code> instruction takes a swizzled
source register as its parameter. The current fragment is discarded
if the value of that register is less than zero.
<code>GL_NV_fragment_program_option</code> adds a second form that takes a
swizzled condition code as a parameter. As a result, the following
shader is ambiguous:</p>
<pre><code>!!ARBfp1.0
OPTION NV_fragment_program;
TEMP GT;
MOVC GT, fragment.texcoord[0];
KIL GT.xxxx;
MOV result.color, fragment.texcoord[1];
END
</code></pre>
<p>What does the <code>KIL</code> do? Does it discard the fragment if X component
of <code>GT</code> is less than zero, or does it discard the fragment if the X
component of <code>GT</code> is greater than zero?</p>
<p>Strong work guys!</p>
<p>My temptation is to add a new token to the lexer called
<code>USED_IDENTIFIER</code>. When the lexer encounters something that it would
currently consider to be an <code>IDENTIFIER</code>, it will check the symbol
table. If the symbol is already there, it will return
<code>USED_IDENTIFIER</code> instead. Then the places that want to use source
registers will match <code>USED_IDENTIFIER</code> instead of <code>IDENTIFIER</code>.</p>
<p>However, this complicates error reporting. I don't think I would be
able to generate error messages like "undefined variable <em>foo</em>".
Instead you'd get some gook like "syntax error, unexpected <code>IDENTIFIER</code>,
expecting <code>RESULT</code> or <code>USED_IDENTIFIER</code>". Meh.</p>
<p>The big question is whether or not this will match the behavior of
Nvidia's assembler. Of course, with an odd, ambiguous corner case
like this, it's possible the behavior of Nvidia's assembler has
changed over the years.</p>
First batch of assembly shader fixes pushedhttp://www.paranormal-entertainment.com/idr/blog/posts/2009-08-21T21:41:49Z-First_batch_of_assembly_shader_fixes_pushed/2009-08-21T21:57:49Z2009-08-21T21:41:49Z
<p>Just a few moments ago I pushed my asm-shader-rework-1 branch to Mesa
master. This fixes a couple minor bugs compared to the existing ARB
shader assembler, and it improves performance of the assmebler by
~50x. We (Intel) are entering the bug fixing phase of our Q3 release,
so I probably won't work on phase 2 for another month or so. When I
do, I plan to add support for
<a href="http://www.opengl.org/registry/specs/NV/fragment_program_option.txt"><code>NV_fragment_program_option</code></a>
next. I'll follow this with support for a couple of the other Nvidia
assmebly extensions.</p>
<p>This work has even been <a href="http://www.phoronix.com/scan.php?page=news_item&px=NzQ2OQ">mentioned on Phoronix.com</a>.</p>
Thesis work startedhttp://www.paranormal-entertainment.com/idr/blog/posts/2009-08-20T23:59:52Z-Thesis_work_started/2009-08-21T00:06:42Z2009-08-20T23:59:52Z
<p>After all these years, I finally started working on my master's degree
last fall. This summer I got an idea for my thesis, and I've started
work. As part of that, I wrote a short <a href="http://web.cecs.pdx.edu/~idr/publications/CPU_vs_GPU_texture_mapping_white_paper.pdf">white
paper</a>
describing the project. Basically, I want to compare the performance
of texture mapping on a modern multicore CPU with a modern integrated
GPU. I also want to see what the bottlenecks are that limit
performance on a CPU. I'm pretty sure that discrete GPUs will be
around for a few more years, but I feel like the integrated GPUs days
are (or should be) numbered. That makes this an important and
interesting area to explore.</p>
LPC is coming...http://www.paranormal-entertainment.com/idr/blog/posts/2009-08-20T19:43:53Z-LPC_coming/2009-08-20T19:50:44Z2009-08-20T19:43:53Z
<p><a href="http://linuxplumbersconf.org/ocw/proposals/70">My talk</a> was accepted
for <a href="http://linuxplumbersconf.org/2009/">Linux Plumbers Conference</a>.
LPC was <em>really</em> good last year, so I'm looking forward to it again
this year. I'm a bit bummed, though, that LPC and the OpenGL portion
of the Khornos face-to-face meeting are at the same time. I can't be
in two places at once, and LPC wins. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /></p>
Virtual casthttp://www.paranormal-entertainment.com/idr/blog/posts/2009-08-14T22:01:19Z-Virtual_cast/2009-08-14T22:48:05Z2009-08-14T22:01:19Z
<p>Last Sunday night, my wife fell down our basement stairs broke her
right leg. This isn't some pansy hair-line fracture. Heavens no!
She broke the living daylights out of it! Anyway, Monday morning she
had surgery to insert an adamantium "nail" along her tibia. This is
in lieu of a hip-to-ankle cast. Tuesday evening she came home from
the hospital.</p>
<p align="center">
<img src="http://www.paranormal-entertainment.com/idr/blog/images/broken_leg/Rose_leg_Sunday.jpg" alt="Aw, snap!" width="347" height="554">
<img src="http://www.paranormal-entertainment.com/idr/blog/images/broken_leg/Rose_leg_Monday.jpg" alt="Rose's adamantium leg" width="335" height="450">
</p>
<p>She's doing okay now. Getting her to the potty and only getting 90
minutes of sleep at a time is rough on both of us. Each day she gets
a little stronger, and getting up gets a little easier.</p>
<p>The whole point of this is that she's <em>not</em> getting a real cast. That
means there's nothing for anybody to sign. What a rip off! So,
<strong>this</strong> is her virtual cast. You can leave messages for her here.
If you have any troubles, drop me an e-mail, and I'll sort it out.</p>
SIGGRAPH 2009: Day 4http://www.paranormal-entertainment.com/idr/blog/posts/2009-08-07T23:05:16Z-SIGGRAPH_2009:_Day_4/2011-01-28T23:11:37Z2009-08-07T23:05:16Z
<p>CRAZY DAY OF RENDERING TALKS!!! AHHHHH!!!</p>
<p>I didn't think <em>Practical Uses of a Ray Tracer for "Cloudy With a
Chance of Meatballs"</em> would be interesting to me, and the <em>content</em>
wasn't. However, the presenters mentioned that Sony / Imageworks are
<a href="http://opensource.imageworks.com/">open-sourcing a bunch of
projects</a>, <em>including</em> the shading
language used in the movie. Strong work!</p>
<p>There was quite a bit of information in <a href="http://www.sci.utah.edu/~bavoil/"><em>Multi-Layer, Dual-Resolution
Screen-Space Ambient Occlusion</em></a>
that I plan to include in my lectures on AO later this summer. Their
algorithm use depth peeling, so I'll have to also cover that if I'm
going to explain their algorithm. I <em>might</em> skip that bit. We'll
see.</p>
<p><a href="http://sglab.kaist.ac.kr/RACBVH/"><em>RACBVHs: Random-Accessible Compressed Bounding Volume
Hierarchies</em></a> was interesting, but
it wasn't really what I was expecting. That's the bad part of the two
sentence summary of the abstract in the advance program. The focus of
this work is BVHs for huge data sets. That is, data sets so large
that the full BVH may not fit in main memory. Their example had a BVH
of 8GB. Still, it was worth seeing. The part that really impressed
me is that the performance hit on small models (i.e., ones that fit in
memory without compression) was only ~3%.</p>
<p>The <em>Real Fast Rendering</em> session was, as predicted, full of win. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /></p>
<p>I have to read the paper for <em>Volumetric Shadow Mapping</em> because
there's some bit of the algorithm that I missed. I get the general
idea, and I like it. Basically, you trace viewing rays through the
(existing) shadow map to determine fogging. Cool stuff.</p>
<p><a href="http://www.irit.fr/~Anthony.Pajot/publications.php"><em>BVH for Efficient Raytracing of Dynamic Metaballs on
GPU</em></a> earns points
for running the presentation from a Linux laptop. There was a
shocking lack of Linux at the conference. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/sad.png" alt=":(" /></p>
<p>I share <a href="http://www.realtimerendering.com/blog/hpg-2009-a-closer-look/">Naty's skepticism of depth peeling
methods</a>. <em>Bucket
Depth Peeling</em> provides some promise to improve things. The massive
use of MRT (8 targets) and the abuse of the outputs (packing 4 8-bit
values in each 32-bit output component) may limit the use of this technique.</p>
<p><em>Normal Mapping With Low-Frequency Precomputed Visibility</em> built on a
bunch of algorithms that I'm completely unfamiliar with. I don't know
anything about using spherical harmonics for lighting, for example, so
I didn't get a lot out of this talk. Add that to my list of things to
learn about before next SIGGRAPH.</p>
<p>After lunch, I listened to a couple papers in the <em>Rendering and
Visibility</em> session. <em>An Efficient GPU-Based Approach for Interactive
Global Illumination</em> was really impressive. Still, they get less than
10 fps for some relatively simple scenes. It seems like they have a
good grasp of the issues they still need to tackle. Maybe by the time
they get that done hardware will be fast enough to make this generally
useful. (Note: They also use spherical harmonics, so mod+1 for me
learning about spherical harmonics.)</p>
<p><em>Single Scattering in Refractive Media With Triangle Mesh Boundaries</em>
was pretty interesting. They've made some reasonable simplifying
assumptions for caustics rendering, and they got some good results for
ray tracing. It seems like something similar to <a href="http://download.nvidia.com/developer/GPU_Gems_2/GPU_Gems2_ch08.pdf">displacement
maps</a>
could be used to achieve this faster. Hmm... I'll add that to my list
of things to (eventually) research.</p>
<p>Something else I noticed... every single real-time related paper
presented results rendered on Nvidia hardware, usually Geforce 280 GTX.</p>
<p>Nit of the day: If you're going to take pictures during a talk, <em>turn
off</em> the fake shutter sound on your digital camera. And don't use the
*#%$ing flash either.</p>
Mid-day nomshttp://www.paranormal-entertainment.com/idr/blog/posts/2009-08-07T18:32:38Z-Mid-day_noms/2009-08-07T23:04:57Z2009-08-07T18:29:16Z
<p>Yay! I got to Mother's for lunch today. I'm just glad I got there
before the line got too out of hand. I had to wait outside for a
little bit, but not for as long as these people!</p>
<p align="center">
<img src="http://www.paranormal-entertainment.com/idr/blog/images/SIGGRAPH09/20090807/Mothers_for_lunch.jpg" alt="The line at Mother's waiting for lunch" width="512" height="384">
</p>
Fix bugs!http://www.paranormal-entertainment.com/idr/blog/posts/2009-08-06T23:34:09Z-Fix_bugs/2009-08-06T23:37:31Z2009-08-06T23:34:09Z
<p>So... on my way back to the hotel, I saw this huge bug on the
sidewalk. WTF is it? Did it eat Tokyo?!?</p>
<p align="center">
<img src="http://www.paranormal-entertainment.com/idr/blog/images/SIGGRAPH09/20090806/scary_bug.jpg" alt="Scary bug image!" width="512" height="384">
</p>
SIGGRAPH 2009: Day 3http://www.paranormal-entertainment.com/idr/blog/posts/2009-08-06T23:25:26Z-SIGGRAPH_2009:_Day_3/2011-01-28T23:11:37Z2009-08-06T23:25:26Z
<p>For me, there is one recurring theme every year at SIGGRAPH: I need to
take more math classes. Good grief! Anyway... <a href="http://graphics.cs.lth.se/research/papers/2009/tcu/"><em>Automatic
Pre-Tessellation
Culling</em></a> was
really interesting, but I was a bit disappointed that Tomas
Akenine-Möller wasn't presenting. This is not to knock Jacob
Munkberg, who was a fine presenter. Their idea is pretty straight
forward, and I similar to something I've been thinking about for
sometime. Basically, analyze the shader to partition it into the
parts that calculate the position and the parts that calculate
everything else. Run the part that calculates the position, perform
culling, and conditionally run the rest.</p>
<p>The idea I had some time ago was to do similar analysis on shaders to
pull low-frequency calculations up to higher levels. For example,
detect calculations in the vertex shader that only change per primitive
group (i.e., calculations that only depend on uniforms) and pull them
out of the vertex shader.</p>
<p><em>Real-Time Hand-Tracking With a Color Glove</em> was good research, but it
has a ways to go. They basically store a big-ass database of hand
images. At run-time, they search the database for an image matching
the image from the camera. This is a gross simplification, but it's
the right general idea. They're able to match really well, but it
soaks two cores on a quad-core C2D system. Ouch. From some of the
discussion after the presentation, I think there's a lot they can do
to accelerate the database search. Maybe they'll have a follow-on
next year.</p>
<p>Everyone loved <em>Achieving Eye Contact in a One-to-Many 3D Video
Teleconferencing System</em>, but it was really hard for me to get excited
about it. Yeah, it's really cool technology, but it's just too
fragile. By fragile I mean that you have to have a bunch of special
hardware setup in a very special way. They had a demo in the e-tech,
and that's probably to only instance of this thing that will ever
exist. Like a couple people at the session commented "it's just a
head in a box", but "it's the best head in the best box".</p>
<p>So, I didn't get to see Tomas Akenine-Möller present today, but I
<em>did</em> get to see Ken Perlin present! <a href="http://unmousepad.org/"><em>The
UnMousePad</em></a> is just plain kick-ass. It's a
technology for making arbitrary sized multitouch, pressure sensitive
input devices. They had 24" (diagonal) versions in the e-tech
display. I talked to they guys at the e-tech display, and they're
going to have an SDK, with Mac, Windows, <strong>and Linux</strong> support in a
month or so. I think X.org needs to get one for who-t. I talked to
the guy that has been working on the API, and I think I may have
convinced him to go to XDC.</p>
<p align="center">
<img src="http://www.paranormal-entertainment.com/idr/blog/images/SIGGRAPH09/20090806/Ken_Perlin.jpg" alt="Ken Perlin" width="512" height="384">
<img src="http://www.paranormal-entertainment.com/idr/blog/images/SIGGRAPH09/20090806/UnMousePad.jpg" alt="UnMousePad" width="512" height="384">
</p>
<p>I took a late lunch because I decided to go to AMD's <em>Next-Generation
Graphics: The Hardware and the APIs</em> talk. They were pitching a whole
ton of Shader Model 5 stuff that they're wanting to add to GLSL.
A lot of the features are mostly useful for video decode. The neat
thing is that I think i965 hardware can do a lot of it.</p>
<p>In the afternoon session, <a href="http://graphics.cs.uiuc.edu/~kircher/publications.html"><em>Inferred Lighting: Fast Dynamic Lighting
and Shadows for Opaque and Translucent
Objects</em></a> was
excellent. They came up with an algorithm that, basically, straddles
deferred shading and forward shading. I did cringe when he explained
that they do alpha materials using screendoors, but it's pretty much
the only way to do what they wanted to. It's a cool enough algorithm
that I'm going to add it to VGP352 next year.</p>
<p>I was surprisingly interested in the last paper, <em>Heuristics for
Continuity Editing of Cinematic Computer-Graphics Scenes</em>. They're
system does a really good job, and I'm looking forward to the paper.
From the clips they showed, they freely admit that there automated
system isn't as good as an Academy Award nominated film editor. <em>lol</em>.
In any case, automatically generating instant replays was something
that I was thinking about way back when I was working on Dactyl Joust
on the Jaguar.</p>
Mother's... yum!http://www.paranormal-entertainment.com/idr/blog/posts/2009-08-06T04:04:41Z-Mother_s_yum/2009-08-06T04:24:56Z2009-08-06T04:04:41Z
<p>I forgot to mention in my last post... Before I came to New Orleans, I
saw an episode of "Tyler's Ultimate" called <a href="http://www.foodnetwork.com/tylers-ultimate/ultimate-french-quarter/index.html">Ultimate French
Quarter</a>.
In that episode, he kept talking about this place called
<a href="http://www.mothersrestaurant.net/">Mother's</a>. Three or four times he
mentioned how great it was. So, I decided to give it a try.</p>
<p>Holy smokes! It was <em>good</em>! Now, this is <strong>not</strong> high cuisine, but
their baked spaghetti pie really hit the spot. The cabbage and meat
(pretty sure it was beef...probably left-over corned beef) that came
as a side was to die for. Not only was this one of the best meals
that I've had here, but it was also one of the cheapest... second only
to my lunch today at Subway.</p>
<p>I'm pretty sure I'm going to have to go there again before I leave
NOLA. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /></p>
SIGGRAPH 2009: Day 2http://www.paranormal-entertainment.com/idr/blog/posts/2009-08-06T04:03:08Z-SIGGRAPH_2009:_Day_2/2011-01-28T23:11:37Z2009-08-06T04:03:08Z
<p>So, I didn't miss the <em>The Future of Teaching Computer Graphics for Students in
Engineering, Science, and Mathematics</em> panel, but I wasn't exactly
there on time either. It was both nice and disturbing to hear that
other teachers encounter the same problems that I do. Hearing <a href="http://www.cs.utah.edu/~shirley/">Pete
Shirley</a> complain that math is "bad"
everywhere in the US was a little surprising, but I guess it shouldn't
have been. I have to teach, re-teach, and re-re-teach a <em>lot</em> of math
in my graphics sequence. I had thought this problem was localized to
the Art Institute, but I guess not.</p>
<p align="center">
<img src="http://www.paranormal-entertainment.com/idr/blog/images/SIGGRAPH09/20090805/teaching_gfx_panel.jpg" alt="Teaching graphics panel" width="512" height="384">
</p>
<p align="center"><em>Panelists from left to right: Dave Shreiner,
Pete Shirley, Evan Hart, and Ed Angel.</em></p>
<p>There were two other highlights of the panel. One was
<a href="http://www.cs.unm.edu/~angel/">Ed Angel</a> saying, "It will
take you longer to get started with [OpenGL] 3.1, ... but they're
actually going to have to do something with the math and they're going
to be stronger for it." Yeah, I figured that one out too. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /> That's
90% of the reason I stopped teaching fixed-function this year.</p>
<p>The other highlight was the discussion <em>after</em> the panel that Dave
Shreiner and I had with
<a href="http://www.cs.brown.edu/~avd/">Andries van Dam</a> about
teaching graphics. Seriously. That's like discussing teaching
baseball with Yogi Berra!</p>
<p align="center">
<img src="http://www.paranormal-entertainment.com/idr/blog/images/SIGGRAPH09/20090805/andries_van_dam.jpg" alt="Andries van Dam" width="512" height="384">
</p>
<p>The <em>Capture and Display</em> session in the afternoon was a lot more
interesting than I thought it would be. <em>Dense Stereo Event Capture
for the James Bond Film "Quantum of Solace"</em> was really, <em>really</em>
cool. Basically, they used a few of high-speed cameras to record the
actors in a free-fall wind tunnel. The multiple images per-frame were
then used to create really good models per-frame via a technique
called "shrink wrapping." With the approximate models, they could
view the scene from new angles and relight it. Too bad none of their
work was actually used in the movie.</p>
<p>The big surprise of the session was <em>ILM's Multitrack: A New Visual Tracking
Framework for High-End VFX Production</em>. They described a new
technique for tracking elements in a video sequence with a moving
camera. This is used in VFX, for example, to infer the camera
position so that CG elements can be added. I think it might be time
for an open-source package to do this. An add-on for Blender,
perhaps? I like the idea of using this in a demo to combine video
with real-time graphics. <em>drool</em>...</p>
<p><em>Estimating Specular Roughness From Polarized Second-Order Spherical
Gradient Illumination</em> was, aside from the crazy-long name, as
interesting as I hoped it would be. The novel thing from their work
is that their data can be used to generate parameters from real
objects for arbitrary analytic BRDFs. I really want to build one of
those <a href="http://www.merl.com/projects/facescanning/">geodesic lighting
domes</a> used to capture
BRDF data. Their technique only requires one camera, so I don't think
it would be <em>that</em> hard.</p>
<p>Unfortunately, I had to miss <em>Creating Natural Variations</em> because the
OpenGL BoF was at the same time. Since the BoF was at kind of a bad
time and SIGGRAPH is smaller this year, I wasn't expecting a good turn
out. However, it was standing room only. I suspect the traditional
free beer may have helped. Anyway, people seemed generally pleased
with the progress that's been made. We had a lot of good questions
and comments. One person even asked if we were considering pixel
transfer shaders. This was in the <em>old</em> 3dlabs OpenGL2 proposal, but
I haven't heard any mention of it since then. It seems almost
unnecessary when OpenCL is available. Still... might be worth considering.</p>
nom nom nomhttp://www.paranormal-entertainment.com/idr/blog/posts/2009-08-05T03:51:20Z-nom_nom_nom/2009-08-05T03:57:40Z2009-08-05T03:51:20Z
<p>Crawfish ettoufee... nom nom nom nom...</p>
SIGGRAPH 2009: Day 1http://www.paranormal-entertainment.com/idr/blog/posts/2009-08-05T02:02:59Z-SIGGRAPH_2009:_Day_1/2011-01-28T23:11:37Z2009-08-05T02:02:59Z
<p>I managed to get to the 8:30 course, "Real-Time Global Illumination
for Dynamic Scenes", on time. Amazing! It was well worth getting up
early, too.</p>
<p>After the course I decided to go through the exhibitor hall. The
previous two times that I have gone to SIGGRAPH the exhibitor hall
took a couple hours to get through. There have been a ton of booths,
and lots of interesting stuff. This time... not so much. I'd say it
was somewhere between a third and half the size of 2008. I was
particularly disappointed that there was no Disney booth. After
seeing the <a href="http://www.flynnlives.com/media/video/0xendgame.aspx">trailer for the new Tron
movie</a>, I was
really hoping they'd have some cool stuff. /sigh.../</p>
<p>Every year there's some hot technology that dominates most of the
booths. The big trend that I noticed this year was stereo displays
with optically tracked 3D input devices.</p>
<p>I decided that I didn't want an $8 cheeseburger (fries where $3
extra), so I wandered off for lunch. I ended up at Mulate's. This
wasn't too noteworthy except two things. My culinary hero, Alton
Brown, went there for his show "Feasting on Asphalt." He raved about
the bread pudding. I have to admit it was pretty damn good. This
brings me to point #2. A po' boy, a lemonade, and the bread pudding
was $27. Yeah, no kidding. It is <strong>so expensive</strong> to eat in this
town.</p>
<p>Since I still had a pile of time before the technical paper session, I
wandered through the posters and the emerging technology exhibits.
There were a bunch of cool things in each. The coolest posters also
have papers to be presented later in the week, so I'll save the
write-up for then. I especially liked the "Pull NAVI" in the e-tech.
One person wears a helmet with ear clips, and another person operates
a joystick. When the joystick is moved, the ear clips tug the ears in
that direction... and the person moves in that direction. lol</p>
<p><img src="http://www.paranormal-entertainment.com/idr/blog/images/SIGGRAPH09/20090804/Pull_NAVI.jpg" alt="Pull NAVI poster" title="Pull NAVI" /></p>
<p>The <a href="http://www.cs.cornell.edu/projects/HarmonicFluids/">"Harmonic
Fluids"</a> paper was
really interesting, but a lot of the background math was beyond me.
The one problem that I had with it was the use of a 16-core system to
simulate the fluid and generate the sound. Given that it was so
parallelizable, I was surprised that there was no mention of
implementing it on a GPU. There was mention of "acceleration" in the
"future work" slide, but that was it.</p>
<p>The "Directable, High-Resolution Simulation of Fire on the GPU"
presentation blew my freakin' mind. It turns out that this is the
fire algorithm used in "Harry Potter and the Half Blood Prince" when
Dumbledore burned the inferi. It's an incredibly straightforward
algorithm. That's not even the cool part. The cool part is that it
was developed using OpenGL Shading Language (OpenGL 2.1 / GLSL 1.20)
on the presenters laptop. Yeah, no kidding!</p>
<p>My final nit... it's a steam room outside, but it's a meat locker
inside. Seriously guys, it doesn't need to be 67 degrees in the auditoriums!</p>
<p>I finished up the evening with the computer animation festival. There
was some <em>really</em> weird stuff this year. For the first time ever
there was some real-time animation as well. The highlight was Will
Wright (literally) in Fight Night 4 K.O.ing Tyson in the first
round. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /> Some of my favorites that I can remember the names of were:</p>
<ul>
<li>Friends?</li>
<li>Anima</li>
<li>Alma (really, <em>really</em> creepy!)</li>
<li>Project: Alpha</li>
</ul>
<p>"Silhouettes of Jazz" gets my honorable mention. It was a cute idea,
but I would have liked to have seen more done with it. "Unbelievable
Four" was also pretty good and quite correctly named.</p>
In one piece!http://www.paranormal-entertainment.com/idr/blog/posts/2009-08-04T13:25:04Z-In_one_piece/2011-01-28T23:11:37Z2009-08-04T13:25:04Z
<p>I waited to post until I actually got to the conference... but I have
arrived in one piece with <em>no</em> travel drama! Yay me!</p>
OpenGL 3.2 away!http://www.paranormal-entertainment.com/idr/blog/posts/2009-08-03T17:46:59Z-OpenGL_3_2_away/2010-01-22T15:33:44Z2009-08-03T17:46:59Z
<p>w00t! OpenGL 3.2 was officially posted today! This is the third
OpenGL release in the last 12 months:</p>
<ul>
<li>OpenGL 3.0 at SIGGRAPH 2008</li>
<li>OpenGL 3.1 at GDC 2009</li>
<li>OpenGL 3.2 at SIGGRAPH 2009</li>
</ul>
<p>I think at this point we've closed most of the function gap between
OpenGL and "the other API." Now that we can expose, either through
core GL or through ARB extensions, pretty much all of what the
hardware can do, we can focus on just making OpenGL better. This was
an intentional decision, and we took a <em>lot</em> of flak for it. Lots of
people we pissed that there was no Long's Peak object model, for
example. I don't know that we'll ever get that <em>exactly</em>, but I'm
hopeful and excited for the future.</p>
<p>Given our steady rate of progress and the positive feedback that
we've been seeing, I <em>think</em> the ARB has started to regain some
credibility. As much as I liked a lot of the design ideas for Long's
Peak, it underscored one of the most important lessons of software
development: take small steps. Any large project that tries to do a
massive redesign all in one go (see my previous blog entry about my
GLSL compiler) is going to get nothing but pain. Big pieces of
software have to be redesigned incrementally. Trying to do it all at
once fails (always!) because it takes too long and you can't get
feedback as to what works / doesn't work.</p>
<p>/me gets off his soapbox... for now...</p>
<p>The <a href="http://www.opengl.org/registry">OpenGL 3.2 spec</a> is available
from the OpenGL registry, and there is an <a href="http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=261641">active
discussion</a>
on the OpenGL message boards.</p>
<p>P.S.: Don't ask me what we are planning because a) nothing is decided yet,
and b) I couldn't say anything even if we did. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /></p>
Rubbish!http://www.paranormal-entertainment.com/idr/blog/posts/2009-07-31T05:32:21Z-Rubbish/2009-07-31T05:38:09Z2009-07-31T05:32:21Z
<p>Every now and then I get a little discouraged by the state of graphics
on Linux. Then I try to relax by listening to some music or watching
a video... and I'm reminded of what a total pile of rubbish <em>audio</em> is
on Linux. WTF? Why does <em>nothing</em> ever just work? Why do I have to
jump through flaming hoops of death to get audio input working? Why
can I get sound from my laptops headphone jack but not from the
internal speakers? For cryin' out loud guys... get your shit together!</p>
asm-shader-rework-1 away!http://www.paranormal-entertainment.com/idr/blog/posts/2009-07-25T01:22:38Z-asm-shader-rework-1_away/2009-07-25T01:44:27Z2009-07-25T01:22:38Z
<p>I finally pushed my assembly shader (e.g., GL_ARB_vertex_program)
re-work branch today. I've been working on this off-and-on for a
couple of months now. I finally realized that my grand plan to
rewrite the GLSL compiler was doomed to failure. I just couldn't get
enough blocks of time to get it all done. I kept having to work on
other things (bug fixes). After each break it took a few days (or
more) to figure out what I was working on and get back into it. By
the time I got back into it, I had to break away to work on other
things. <em>FAIL</em>.</p>
<p>So, now I have a new plan.</p>
<p>The areas where I really want to work are optimizing IR and generating
final machine code from IR. Phases 1 and 2 of the asm-shader-rework-1
branch support this. I've rewritten the ARB program parser, that's
phase 1. Phase 2 is to add support for some of the later Nvidia
layered extensions. These extension expose the full instruction set
required to support GLSL. That's where the fun beings.</p>
<p>This is the point, phase 3, where I can start experimenting with IRs.
I can bridge from the assembly code to an IR and back. Using the full
assembly interfaces I can pick apart bits of complex shaders and dump
them into the IR. I expect to go through several revisions of the IR
before I move to the next phase. GPUs are really different from CPUs,
so I expect that an IR that works well here will be different from,
say, what GCC uses. I really need a test bed for experimentation.</p>
<p>I don't want to think about what comes next until I get quite a bit
more along. My hope is that the current code base will settle down
over the next week or two, and I can merge it into master for the Mesa
7.6 release.</p>
The Eagle is blurry.http://www.paranormal-entertainment.com/idr/blog/posts/2009-07-24T23:40:46Z-The_Eagle_is_blurry/2009-07-24T23:52:33Z2009-07-24T23:40:46Z
<p>I was so excited when I heard that NASA's Lunar Reconnaissance Orbiter
would orbit the moon close enough to <a href="http://www.nasa.gov/mission_pages/LRO/multimedia/lroimages/apollosites.html">photograph the Apollo landing
sites</a>.
Not only was I excited to be able to see the sites for myself, but I
was excited to, hopefully, silence at least one or two of those
ass-hats who believe the landings were faked. But I'm not sure this
will convince anyone:</p>
<p><img src="http://www.paranormal-entertainment.com/idr/blog/images/apollo11.jpg" alt="Apollo 11 image" title="Apollo 11" /></p>
<p>Hmm... maybe the landings <em>were</em> faked. Afterall, Buzz, Neil, and the
guys didn't bring back <strong>any</strong> green cheese...</p>
SIGGRAPH 2009 Previewhttp://www.paranormal-entertainment.com/idr/blog/posts/2009-07-23T00:16:12Z-SIGGRAPH_2009_Preview/2011-01-28T23:11:37Z2009-07-23T00:16:12Z
<p>Yay me! I get to go to SIGGRAPH again this year. As usual the
program looks really good, and there appears to not be enough hours in
the day. Here are my picks:</p>
<p>
<u>Tuesday</u></p>
<p><ul>
<li><em>Real-Time Global Illumination for Dynamic Scenes (8:30am -
10:15am)</em></p>
<p>The odds of me getting to this course on time are low, but I'm very
interested to hear what they have to say. This is an area of
real-time graphics that I don't really know that much about. I'd like
to fix that.</p>
<p></li></p>
<p><li><em>Fluid Simulation (3:45pm - 6:00pm)</em></p>
<p><p>I'm pretty curious to <em>hear</em> the results of "Harmonic
Fluids". I'm also pretty interested in "Directable, High-Resolution
Simulation of Fire on the GPU". The bit about "Simulation resolutions
as high as 2048 can be computed in a <em>few hours</em> by
parallelizing work among multiple GPUs" (emphasis mine) is a bit
scary, though.<p>
</li></p>
<p></ul></p>
<p>
<u>Wednesday</u></p>
<ul>
<li><em>The Future of Teaching Computer Graphics for Students in
Engineering, Science, and Mathematics (8:30am - 10:15am)</em>
<p>This panel is extremely relevant to my work at the Art Institute.
I know three of the four people on the panel, so I know it will be
good. However, I'd really like to go to the "Build Your Own 3D
Scanner" course that is at the same time. meh.</p>
</li>
<li><em>Capture and Display (1:45pm - 3:30pm)</em>
<p>This session doesn't have a lot that I'm interested in, but
"Estimating Specular Roughness From Polarized Second-Order Spherical
Gradient Illumination" really caught my attention.</p>
</li>
<li><em>Creating Natural Variations (3:45pm - 6:00pm)</em>
<p>For me, this probably the most interesting session of the whole
conference. I'm particularly interested in "Procedural Noise Using Sparse
Gabor Convolution" and "Self-Organizing Tree Models for Image
Synthesis". Unfortunately, there are a couple papers in the
<em>Imaging and Rendering Pipeline</em> session, which occurs at the
same time, that I'm also interested in.</p>
</li>
</ul>
<p>
<u>Thursday</u></p>
<ul>
<li><em>Rendering Methods and Systems (8:30am - 10:15am)</em>
<p>I <em>cannot</em> miss "Automatic Pre-Tessellation Culling."
Seriously. For a real-time graphics enthusiast to miss a SIGGRAPH
presentation by Tomas Akenine-Möller is just silly.</p>
</li>
<li><em>Interacting With Hands, Eyes, and Images (10:30am -
12:15pm)</em>
<p>I'm getting fed up with using a mouse to interact with objects in
3-space. Over the last couple years, there have been some interesting
developments in this area. "Real-Time Hand-Tracking With a Color
Glove" covers one of the more promising (IMHO) areas of current
research. "The UnMousePad - An Interpolating Multi-Touch
Force-Sensing Input Pad" also seems like it may have some promise.</p>
<p>This is another case where conflicts defeat me! I'd also like to
attend "Building Story in Games: No Cut Scenes Required", but it's
scheduled at the same time.</p>
</li>
<li><em>3D and the Cinematic in Games (3:45pm - 5:30pm)</em>
<p>Most of the papers in this session aren't too interesting to me,
but "Inferred Lighting: Fast Dynamic Lighting and Shadows for Opaque
and Translucent Objects" hits one of my favorite topic: shadows.
Yeah, I'll be there.</p>
</li>
</ul>
<p>
<u>Friday</u></p>
<p>Friday looks to be the crazy day of rendering overload! w00t!</p>
<ul>
<li><em>Rendering (8:30am - 10:15am)</em>
<p>This summer is the first time in my graphics classes that I'm
covering ambient occlusion. "Multi-Layer, Dual-Resolution
Screen-Space Ambient Occlusion" couldn't come at a better time! It's
a good thing that I'm covering AO <em>after</em> SIGGRAPH. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /></p>
<p>"RACBVHs: Random-Accessible Compressed Bounding Volume Hierarchies"
should be pretty interesting as well. This is another topic that I
intend to cover this summer. I may have to change the reading list
for the class.</p>
</li>
<li><em>Real Fast Rendering (10:30am - 12:15pm)</em>
<p>Three of the four talks in this session, "Volumetric Shadow
Mapping", "Bucket Depth Peeling", and "Normal Mapping With
Low-Frequency Precomputed Visibility", are in areas of high interest
for me (apologies to the authors of the fourth paper in the session).
Last year there were quite a few shadow rendering papers, but this
appears to be the only one (and it's a talk, not a paper) this
year.</p>
</li>
<li><em>Rendering and Visibility (1:45pm - 3:30pm)</em>
<p>"Apative Global Visibility Sampling" and "An Efficient GPU-Based
Approach for Interactive Global Illumination" seem like the winners in
this session.</p>
</li>
</ul>
L4F FTLhttp://www.paranormal-entertainment.com/idr/blog/posts/2009-06-25T06:48:22Z-L4F_FTL/2009-12-05T04:33:38Z2009-06-25T06:48:22Z
<p>I really like the game Left4Dead, but it seems to have the <em>worst</em> on-line
community of any game I have ever played. I played Versus mode using "Quick
Start" (because all my L4D friends are away on vacation) for a hour tonight.
I that time I saw no less than 15 rage quits, 10 TKers, and was vote-kicked,
for no apparent reason 4 times. It was pretty bad.</p>
Donerailhttp://www.paranormal-entertainment.com/idr/blog/posts/2009-06-21T23:56:23Z-Donerail/2009-12-20T06:12:33Z2009-06-21T23:56:23Z
<p>I went and saw my friend's brother's band, Donerail, play last night. It was
the first time I've seen them play, and they were pretty good. Ending with
"Mother" was a bit silly. :P I was hoping to see Dmitri there, but I
understand why he didn't come. I'll probably post some pics later...</p>
Got an A!http://www.paranormal-entertainment.com/idr/blog/posts/got_an_a/2009-06-18T03:39:49Z2009-06-18T04:36:57Z
<p>Somehow, and I really don't know how, I got an A in my Theory of Computation
class. Given how poorly I <em>know</em> I did on the final, this is more than just
a little surprising. NO COMPLAINTS HERE!!!</p>
Cat barf at dawnhttp://www.paranormal-entertainment.com/idr/blog/posts/cat_barf/2009-06-16T17:44:55Z2009-06-16T18:41:36Z
<p>There are just so few things in life more awesome the being woken up at 4AM by
your cat <em>barfing on you</em>. Seriously.</p>
Return of the BLOGhttp://www.paranormal-entertainment.com/idr/blog/posts/return_of_the_blog/2009-03-17T05:35:39Z2009-03-17T04:34:07Z
<p>So... my blog is back, and things are very different. I had been using
some blog software called
<a href="http://www.kiyuko.org/software/poster">Poster</a>. I liked it. It was
dead simple and mostly did what I wanted. However, I had some spam
problems. I hated it. It was annoying and mostly made me hate
bloging. Poster had a built-in captcha, but I could never get it to
work on the fdo server. It seem to require the mcrypt package for
PHP, but even after installing that (and some following PHP fail), it
didn't work.</p>
<p>At keithp's urging, I have decided to join the cool kids and use
ikiwiki. To be honest, the jury is still out on the ikiwiki
transition. It works, and it has a giant pile of features, but it has
a somewhat steeper learning curve. I'll figure it out...it will just
take more than 20 minutes.</p>
<p>One thing that I <em>do</em> like about ikiwiki is that I can use a regular
text editor and spell checker to write blog posting. Death to browser
based editors! Death to "you were idle for 20 minutes while writing
that post, please log back in while I lose everything you wrote"!</p>
<p>I have moved over all of my postings, with correct dates, from my old
blog. The comments have, sadly, been lost. Not counting the spam,
there were only about 10 comments total, so it's not a significant loss.</p>
I has sad.http://www.paranormal-entertainment.com/idr/blog/posts/i_has_sad/2009-02-05T23:56:05Z2008-11-11T01:25:07Z
<p>Today was the conclusion of a completely miserable weekend.</p>
<p>Last week we noticed that Fancy Feet, one of our cats, wasn't really eating. If we gave her some canned food mixed with dry, she would eat a little bit. We thought she was just being finicky...you know, <em>a cat</em>. On Thursday she stopped eating almost altogether. If we gave her just canned food she would lick some of the juice, but that was it. We started measuring her consumption on Thursday. On Thursday and Friday <em>combined</em> she ate about half an ounce of food.</p>
<p>On Saturday morning we took her to <a href="http://www.northwestvetspecialists.com/">Northwest Veterinary Specialists</a>. She was really dehydrated and had a pre-existing heart murmur. She stayed there overnight with an IV to rehydrate. She continued to not eat. Neither my wife or I really slept at all Saturday night. I think we finally got to bed around 3:30AM. The anxiety of not knowing what was wrong with Fancy was just eating us up.</p>
<p>We brought her home on Sunday. We made a plan to take her to our regular vet on Monday for an abdominal ultrasound. Around 11:30PM she started breathing really heavily and in an odd manner. We took another trip to NWVS. They didn't find anything (new) wrong with her. An x-ray showed that her heart was quite abnormally shaped and her lymph nodes were enlarged. We finally got back home with Fancy around 3:00AM.</p>
<p><p>That brings us to today. "Giant pile of suck" doesn't even begin to cover it. We dropped her off out our regular vet as soon as they opened. We knew that they were going to have to fit her into their full schedule, so we wanted to get her there early. She was finally able to get a chest echo around noon and an abdominal ultrasound around 2:30. The ultrasound showed a number of unmistakable spots on her liver: cancer.<p></p>
<p>She had been really miserable for the last few days. Usually, no matter how agitated she was, if we pet her and kissed her on the top of the head enough she would eventually start purring. We hadn't been able to get her to purr since Saturday afternoon. The only thing left to do was make that horrible, painful choice that almost every pet owner has to make at some point.</p>
<p>We're going to miss her a lot.</p>
<p align="center">
<img src="http://people.freedesktop.org/~idr/images/Fancy_and_Minnie_Nov06.jpg" />
</p>
<p>That's Fancy on the left. The kitty on the right is Minnie.</p>
Out with the old...http://www.paranormal-entertainment.com/idr/blog/posts/out_with_the_old/2009-02-05T23:56:05Z2008-11-05T04:23:57Z
<p>Everyone and their uncle has something to say about the election
tonight, so I'll be brief... Today is a great day for America. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /></p>
Where art thou, Delphi3D.net?http://www.paranormal-entertainment.com/idr/blog/posts/where_art_thou_delphi3d_net/2009-03-17T06:37:15Z2008-10-03T22:21:55Z
<p>Oh nos! Something seems to have gone wrong with
<a href="http://www.delphi3d.net/">Delphi3D.net</a>! All I get is "403
Forbidden". There haven't been any updates for years, but the
database of which card / driver combinations support which OpenGL
versions / extensions has been really, really useful to me (and
others) over the years.</p>
<p>Any ideas what the heck happened?</p>
SIGGARPH 2008: Day 4http://www.paranormal-entertainment.com/idr/blog/posts/siggraph_2008_day_4/2011-01-28T23:11:37Z2008-08-16T01:19:45Z
<p><p>Meh. This trip is making me feel <em>old</em>. Each day I feel
more and more exhausted. This morning I woke up in plenty time to get
to the 8:30 session, but I just didn't feel like going...and slept for
another hour-and-a-half instead. After getting to the convention
center, I took a long lunch and a walk down
<a href="http://en.wikipedia.org/wiki/Figueroa_Street">Figueroa
Street</a>.
El Pollo Loco is the only fast food restaurant I have ever been to
that had horchatta. Too bad it was <em>horrible</em> horchatta.</p>
<p align="center">
<img src="http://people.freedesktop.org/~idr/images/SIGGRAPH08/200808151239 - Figueroa Street.jpg" width="512" height="341" />
</p>
<hr width="33%" />
<p>The painting and sketching session was great. It is the only
session that I have attended that I think keithp or cworth would have
enjoyed. Both
<a href="http://artis.imag.fr/Publications/2008/OBWBTS08/">"Diffusion
Curves: A Vector Representation for Smooth-Shaded Images"</a>
and
<a href="http://graphics.cs.cmu.edu/projects/gradient-paint/">"Real-Time
Gradient-Domain Painting"</a>
seemed right up cworth's alley. I think the presenter of the second
paper, Jim McCann, may be a long-lost cousin of anholt. Their sample
application is also available <a href="http://gradient-paint.com/">on-line</a>.
</p>
<p align="center">
<img src="http://people.freedesktop.org/~idr/images/SIGGRAPH08/200808151411 - Jim McCann.jpg" width="512" height="288" />
</p>
<p>
<a href="http://nis-ei.eng.hokudai.ac.jp/~doba/pub_doba.html">"Feedback
Control of Cumuliform Cloud Formation Based on Computational Fluid
Dynamics"</a>
wasn't exactly what I was expecting. (What's the deal with crazy-long
names of papers?!?) The presented algorithm was able to generate
plausible clouds constrained to a 2D contour. The problem that I had
with it was that the sequence of cloud <em>generation</em> was not
plausible. I don't think that was a goal of their algorithm, but it
does seem like a useful feature. Anyway...I don't want to bash their
work because it was good work.</p>
<p>
<a href="http://www.mrl.nyu.edu/~gingold/shading/">"Shading-Based
Surface Editing"</a>
presented a really interesting tool. Basically, the artist paints
shading (darker areas) on a lit 3D model. The algorithm then rotates
surfaces under the stroke to match the shading. The presenter pointed
out that this tool is really useful for artists that are already
familiar with shading in 2D drawing. He mentioned in passing that it
could be useful to <em>teach</em> shading. I think that particular
point should be explored further. I can envision a sort of feed-back
based expert system to teach shading.</p>
<hr width="33%" />
<p>The first half of the last session wasn't too interesting to
me...and I didn't pay that much attention.</p>
<p>
<a href="http://www.cg.tuwien.ac.at/research/publications/2008/LIPP-2008-IEV/">
"Interactive Visual Editing of Grammars for Procedural Architecture"</a>
did catch my interest. Though, it wasn't so much with the topic of
the paper. I hadn't realized that grammar based generation of
geometry had gotten so sophisticated. It has come a long way since
Logo! (heh...maybe I am as old as this trip is making me feel).</p>
<p>I'm such a trooper! I stayed for
<a href="http://oregonstate.edu/~cheng/street_sig08/street_project.htm">
"Interactive Procedural Street Modeling"</a>...the last technical
paper of SIGGRAPH 2008. The idea is really simple, but it produces
very effective results. The user draws some guiding structures on the
blank map. A tensor field is generated from those guiding structures.
The user can edit that tensor field by adding noise, creating or
moving guiding structures, etc. Once the user is satisfied, streets
are generated at semi-random positions within the tensor field.
</p>
<p>It was cool to see a paper about designing procedural buildings
immediately followed by a paper about designing procedural
cities...where those buildings might be.</p>
<p>I'll <em>probably</em> do an update about the poster sessions after
I get back. A couple of them were really cool, so they deserve some
comment.</p>
SIGGARPH 2008: Day 3http://www.paranormal-entertainment.com/idr/blog/posts/siggraph_2008_day_3/2011-01-28T23:11:37Z2008-08-15T01:25:43Z
<p>The morning session, "Teaching Computer Graphics in Context in
Computer Science," was not at all what I was expecting. It was about
teaching graphics in contexts where graphics are actually used (i.e.,
scientific visualization). Since I'm teaching graphics to game
programmers in a game programming department, this isn't really an
issue for me. Meh.</p>
<hr width="33%" />
<p align="center">
<img src="http://people.freedesktop.org/~idr/images/SIGGRAPH08/200808141736 - Nokia Theater.jpg" width="512" height="288" />
</p>
<p>At 10:30 I blew off all the technical sessions and went to the
computer animation festival. Holy smokes...the Nokia Theater is
impressive! The place is <em>huge</em>, and the screen looked great.
Oh, and the animation was pretty cool too. I especially enjoyed
<a href="http://www.youtube.com/watch?v=WFarV-Pm2y8">"Our
Wonderful Nature,"</a>
<a href="http://www.oktapodi.com/">"Oktapodi,"</a> and
<a href="http://www.cgw.com/ME2/dirmod.asp?sid=&nm=&type=Publishing&mod=Publications%3A%3AArticle&mid=8F3A7027421841978F18BE895F87F791&tier=4&id=4925725FFB5A4BA2B187FD7C362A8B5D">
"Boldies."</a>
I couldn't find a better link, sorry. The excerpts from the movie
<a href="http://www.imdb.com/title/tt0997147/">"Dai Nipponjin"</a>
were good enough that I'll have to see if Netflix has the movie.</p>
<hr width="33%" />
<p>After lunch I went to the "Beyond Programmable Shading: In Action"
session. The most interesting bit was Jon Olick's (Id Software) talk
about parallel programming in games. I was especially interested in
the bit about ray casting and voxels in games. The demo running at 60
- 30 fps of a <strong>7 million</strong> polygon model directly
exported from Z Brush blew me away. The progressive levels of detail
in the model were just awesome. You could zoom all the way in to see
finger prints on the character's hand.</p>
<hr width="33%" />
<p>In the final afternoon session, the first talk that I saw
<a href="http://www.cs.huji.ac.il/~raananf/projects/defog/index.html">
"Single Image Dehazing,"</a> was cool, but way, <em>way</em> over my
head. I am reminded that I really need some more <em>undergrad</em>
math. teh suck.</p>
<p>The next paper,
<a href="http://www.cse.cuhk.edu.hk/~leojia/projects/motion_deblurring/index.html">
"High-Quality Motion Deblurring from a Single Image,"</a> also contained a lot of math that was beyond me, but I got a
lot of the general ideas. I don't think I can summarize it in a few
sentences. The purpose is to deblur images where either the camera or
the subject was moving during exposure. The results that they
achieved were quite good. Several of the source images were
completely unintelligible, but the deblurred images looked great.
</p>
<p>They said that their software is available, so
I'll have to take a look at it. Maybe after I get back home I'll try
it on one of my
<a href="http://people.freedesktop.org/~idr/images/SIGGRAPH08/200808130948 - Microfacets.jpg">
pictures</a> from yesterday.</p>
<hr width="33%" />
<p><strike>The SIGGRAPH reception is at the Dodger's game tonight, so I'll
<em>probably</em> update this entry after the game...it will depend on
how late it goes / how tired I am.</strike></p>
<p align="center">
<img src="http://people.freedesktop.org/~idr/images/SIGGRAPH08/200808142019 - Us at Dodger Stadium.jpg" width="512" height="288" />
</p>
<p>We went to the game, but we left at the seventh inning stretch. Rose had a horrible headache, and the noise (and a couple annoying people behind us) was just too much. We did get to see a homerun go over the fence pretty close to us in the 5th (I think).</p>
<p>While the <em>game</em> was fun, getting into and out of the parking lot was a giant pile of suck. There are no useful signs anywhere, so you have no idea where to park to be close to your seats. As luck would have it, we parked, literally, at the exact opposite end of the stadium from the SIGGRAPH reception. Because the stadium is built on a hill, about 80% distance back to the car was up long stretches of stairs. <em>But wait, there's more!</em> The lot is partitioned into smaller parking areas by number. We were parked in area 11. However, once we got around to the correct side of the stadium we could only find parking areas with <em>letters</em>. We were by area P. Of course there were no signs or other directions. After wandering around for more than 10 minutes, I found someone to ask. We had to go through a non-obvious gate through a hedge and down a hill to get to area 11. Genius. Pure genius.</p>
<p align="center">
<img src="http://people.freedesktop.org/~idr/images/SIGGRAPH08/200808142103 - LA from Dodger Stadium.jpg" width="512" height="288" />
</p>
<p>I did get a couple nice pictures of LA from the lot. Other than that, I'm seriously getting tired of LA. I overheard someone at the conference make a keen observation, "Everything in LA is 10 miles from everything else. It's kind of stupid." Well said.</p>
SIGGARPH 2008: Day 2http://www.paranormal-entertainment.com/idr/blog/posts/siggraph_2008_day_2/2011-01-28T23:11:37Z2008-08-14T06:00:00Z
<p>Add one more nit to pick with the iPhone: turning off the <em>ringer
volume</em> also turns of the <em>alarm clock volume</em>. Fail. So,
I got up late today and missed the whole first technical paper session.</p>
<p></p>
<p>I ended up going to the Nvidia tech talk about rendering realistic
hair in real-time. That was actually quite interesting.
Unfortunately a lot of the details of the algorithm presented depend
on new <em>DX11</em> shader stages. Still, pretty much all of it
could be done with multiple passes on DX10 or OpenGL 3.0.</p>
<hr width="33%" />
<p>Since I was at the Nvidia sessions, I only caught the last paper,
<a href="http://www.shuangz.com/projects/aniso/">
"Modeling Anisotropic Surface Reflectance With Example-Based
Microfacet Synthesis,"</a> in this session. I was really impressed with
the results they were able to achieve with a really simple BRDF
measurement rig. Instead of the usual geodesic dome with a dozen or
more cameras and scores of lights, they had a single camera with 20 or
so lights on a moving track. You can't really tell from the picture,
but on the big screen it looked like it was build from Legos.</p>
<p align="center">
<img src="http://people.freedesktop.org/~idr/images/SIGGRAPH08/200808130948 - Microfacets.jpg" width="512" height="289" />
</p>
<p>Seriously. I could build that rig in my basement. The real magic
is in the algorithm the extrapolates the "missing" data from the
measured data. There are, of course, some types of materials where it
fails, but for a lot of stuff it works really well.</p>
<hr width="33%" />
<p>The two shadow mapping papers, as predicted, were the most
interesting to me, even though I missed the entire first paper.
Specifically,
<a href="http://www.idav.ucdavis.edu/publications/print_pub?pub_id=919">
"Resolution Matched Shadow Maps"</a> was a great paper that
was very well presented. I had avoided hierarchical shadow map
techniques in VGP353 specifically because of the frame-to-frame
variability. This effectively makes these techniques useless for
games. However, these guys have managed to eliminate that fault,
speed up the algorithm, <em>and</em> make it easier to implement. Can
it even be real?</p>
<p>In a way, I feel bad for the researchers from
<a href="http://gamma.cs.unc.edu/logpsm/">"Logarithmic
Perspective Shadow Maps."</a> Their algorithm is very useful <em>in
theory</em>, but it relies on a rasterization primitive (logarithmic
rasterization) that will likely never be implemented. Once hardware
is fast enough to implement their technique generally, it will be fast
enough to do things like "Resolution Matched Shadow Maps" at full
speed. This will make their technique irrelevant.</p>
<hr width="33%" />
<p>I missed the first few minutes (this is my theme for today) of
"Multiresolution Texture Synthesis," but I got a lot out of it. The
technique uses "exmplar" images to roughly describe the synthesized
texture at multiple levels of details. These exemplars are connected
in a graph that can contain cycles. This allows textures with
infinite detail. There was an example, that reminded me of some
infinite zoomer demos on the Amiga, where an image of sand was used to
create an infinite zoom. Very, very cool.</p>
<p><a href="http://research.microsoft.com/research/pubs/view.aspx?tr_id=1277">"Inverse Texture Synthesis"</a>
is a very clever idea. Most texture
synthesis algorithms take some sort of sample texture (some algorithms
call it an exemplar or an epitome) and use that to generate a larger
image. Usually the sample texture is cut, either by hand or
algorithmically, from an original texture. This algorithm starts with
the larger image, generates a novel sample texture, and uses that to generate
a alrger texture. The sample texture is usually not directly cut from
the original texture, but it is still representitive of the whole
original. This is generated using a "control map" that describes
different regions of the texture. One of the examples is a "ripeness"
control map for a banana that corresponds to black versus yellow
regions of the banana.</p>
<p>The really cool thing about this is that it allows an artist to
generate a novel control map for an object. A new texture is
generated using the sample texture and the control map that matches
what the artist expects. (That was worded poorly, but I think you get
what I mean.)</p>
<p>"Lapped Solid Textures" was also a nice advancement. It probably
not as directly useful to me, though. I hope to see games use this
technique to make objects "solid." The other interesting thing about
this paper is that the author suggests a number of areas further
research that would be within the reach of undergrads (<em>wink, wink,
nudge, nudge</em>). One of those areas being to improve the user
interface for editing the texture exemplars used in this approach.
This differs from the 2D patched used by Hoppe, et al because they are
volumetric.</p>
<p>In the final paper of the session,
<a href="http://graphics.ucsd.edu/~matthias/publications.htm">"Anisotropic Noise"</a>
addresses
one of the issues with noise that has bothered me for years.
It is pretty much impossible correctly filter noise that is generated
from textures. Octave truncation works, but it always ends up with
textures that are <em>both</em> under-sampled and over-sampled. FAIL
+ FAIL. Using some off-line processing to generate some noise
"tiles," correctly anisotropically filetered noise textures can be
generated. The hard part is the off-line processing, and the
real-time processing is trivially higher than octave truncation.</p>
<p>As an added bonus, this algorithm can fix "texture distortion."
Imagine a terrain where the assigned texture coordinates are the X/Y
values. Areas with steep slopes have more texels than flat areas, and
this results in stretching. Using the same anisotropic technique can
fix this problem. WIN + WIN.</p>
<hr width="33%" />
<p>The OpenGL BoF went really well, I think. Nobody showed up with
torches or pitchforks. Of course, the free beer may have helped. The
most useful part of it for me was the mingling period after all the
presentations. I talked with quite a few people and, contrary to the
/. reports, nobody was furious. <em>Whew!</em></p>
<p><strong>EDIT:</strong> Added links to <em>most</em> of the papers.</p>
SIGGRAPH 2008: Day 1http://www.paranormal-entertainment.com/idr/blog/posts/siggraph_2008_day_1/2011-01-28T23:11:37Z2008-08-13T05:24:09Z
<p align="center"><img src="http://people.freedesktop.org/~idr/images/SIGGRAPH08/200808120749 - Outside LACC.jpg" width="512" height="288" /></p>
<p>In spite of various travel failure, I managed to get to the Convention
Center by about 7:50AM. Registration opened at 8:00, and I was done
by 8:15...that even includes the time it took me to go back and get
<em>my</em> conference badge. I was originally given someone else's
badge. Oops.</p>
<p>While I was waiting in line, I took a quick peek at /. on my phone.
The story about <a href="http://tech.slashdot.org/tech/08/08/11/2135259.shtml">developer reaction to OpenGL
3.0</a> was
depressing, at best. I knew that people were going to be disappointed
and upset, but I am a little surprised at the level of anger that
people seem to be expressing. I can only hope that this is being over
exaggerated on /.</p>
<p>One other random thing...I took a bus to downtown (the cab from
downtown to the hotel was $50 yesterday). It was an express
"commuter" bus. The vast majority of the people on it were
30-something / 40-something women. In the front part of the bus there
were 11 women to 1 man (me). I didn't take a census of the rest of
the bus, but the gender distribution appeared to be similarly skewed.
Is it my imagination, or does that seem odd?</p>
<hr width="33%" align="center" />
<p align="center">
<img src="http://people.freedesktop.org/~idr/images/SIGGRAPH08/200808120838 - Factoring Repeated Content Within and Among Images.jpg" width="512" height="288" /></p>
<p>I was able to make it to the first paper session. In a lot of
ways, the material in "Factoring Repeated Content Within and Among
Images" reminded me of MPEG macro blocks and motion vectors. Their
technique applies to still images, however. For certain types of
images, they are able to achieve very high quality at very good
compression ratios. In particular, images with very high frequency
information (they used an image of zebras standing in grass) tend to
not work well. The other advantage of their technique is that
decompression can be very easily implemented in a fragment shader.</p>
<p>The <a href="http://phototour.cs.washington.edu/findingpaths">interactive photo
tourism</a> software
presented next was, I have to admit, one of the coolest things I've
ever seen. I especially like the ability to use "community" photos to
find paths between sequences of personal photos to create smooth
transitions. The vacation photo slide show will <em>never</em> be the
same!</p>
<hr width="33%" align="center" />
<p align="center">
<img src="http://people.freedesktop.org/~idr/images/SIGGRAPH08/200808121054 - Larrabee.jpg" width="512" height="288" /></p>
<p>I was robbed! Michael Abrash <em>wasn't</em> one of the
presenters of the Larrabee paper. We got Larry Seiler instead (no
offense, Larry). That's the end of the bad news. Let me say this
now: Larrabee is going to change everything. I'm still a bit in shock
at how awesome the <em>architecture</em> is. Having worked on Cell, I
believe that Larrabee will be everything that Cell <em>should
have</em> been.</p>
<p>Larrabee fixes two significant limitations of the Cell architecture
with respect to implementing a "standard" graphics pipeline.</p>
<ul>
<li>A normal memory architecture. Each core accesses memory via L2
caches is the same programming model that we've been using forever.
None of this local storage, software-managed cache nonsense.</li>
<li>A hardware texture unit. One of the areas that I was most worried
about with porting Mesa to Cell was texture mapping. The way that
textures are addressed and accessed was going to take a lot of
instructions on Cell. On Larrabee, they just have a freakin' texture
unit that can, as the Larry said, "support thousands of in-flight
texture accesses" to hide latency.</li>
</ul>
<p>Of course, no products, timelines, clock speeds, etc. were
announced. I don't know any of that either, so please don't ask.</p>
<p>I'm filled with a variety of emotions right now. On the one hand
I'm really, <em>really</em> excited for Larrabee and the opportunities
it will bring. I'm also even more disappointed that I already was
about Cell. The window for someone to create an OpenGL implementation
for Cell is now closed. Sure, they could do it, but nobody would
care. Opportunity lost. <em>sigh</em></p>
<hr width="33%" align="center" />
<p>The surprise in the last session was the last paper. I wasn't
expecting much from "Real-Time Rendering of Textures With Feature
Curves," but there was some good bits there. Basically, they define a
normal-map using specially encoded Bezier curves for embossing /
engravings. The fragment shader then uses this information to
generate normals that preserve the discontinuity in the "trench" of
the engraving. Using a normal-map texture when there is a
discontinuity can result in some off artifacts in close-up views.
I'll probably <em>mention</em>> this work next year in VGP352. I think
it will be a bit beyond the abilities of my students to implement it.
The algorithm has a number of complex details.</p>
<hr width="33%" align="center" />
<p>The various hair rendering papers were interesting...but
interesting to me in the same way as quantum physics is interesting.
That is, it's good to know that people are working on it, and it's
good to hear about it, but it's not generally useful in my day-to-day
life.</p>
<hr width="33%" align="center" />
<p>I went and saw most of the expo floor between sessions. It wasn't
really that great. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/sad.png" alt=":(" /> About every 4th booth was for an art school.
Of course, The Art Institute was there. There were also a
<em>lot</em> of "3D printer" booths. Yippie. Most disappointing of
all...there weren't any good booth hand-outs. I take that back.
Intel was giving out cool USB hubs, but they wouldn't give me one
because I work there. Fail.</p>
<p>I plan to finish the expo floor tomorrow. I will also try to look
at the rest of the posters. I looked at quite a few today as they are
spread all around the conference center. I've written enough for one
day, so I'll save the poster details for later. There <em>are</em>
some cool posters...like the guy doing audio processing and an Nvidia
GPU and audio <strong>output</strong> from the VGA port.</p>
<p align="center"><img src="http://people.freedesktop.org/~idr/images/SIGGRAPH08/200808121150 - Ai.jpg" width="512" height="288" /></p>
<p><strong>EDIT:</strong> I think I fixed the formatting failure.</p>
And let the travel drama begin!http://www.paranormal-entertainment.com/idr/blog/posts/and_let_the_travel_drama_begin/2011-01-28T23:11:37Z2008-08-12T02:34:59Z
<p>Memo to myself: only stay in hotels with negotiated rates, no matter
how far they are from the convention. Why? Because you don't
negotiate with kidnappers or crap hotels.</p>
<p>The hotel that I originally booked turned out to be all kinds of crap.
The place looked nice on the inside, but look can be oh-so deceiving.
They didn't have a room available <em>with a private bathroom</em>.
Uhm...what? I called Amex and got a different hotel (10 miles from
the convention center...fail), and took a cab over. The cabbie told
me that the city give homeless people vouchers to stay at that hotel.
After seeing some of the people that wandered into that place while I
was on hold with Amex, I believe him! Truth be told, I think it's a
<em>good</em> thing they didn't have a room available!</p>
<p>All that is behind me now. I'm going for dinner in a bit, and I'm
going to the conference in the morning.</p>
<p>So, boys and girls, if Amex doesn't like a hotel, you probably won't
either. And, apparently, don't travel with me either. I'm bad
luck.</p>
SIGGRAPH or bust!http://www.paranormal-entertainment.com/idr/blog/posts/siggraph_or_bust/2011-01-28T23:11:37Z2008-08-04T20:18:15Z
<p>This year was the first time since 1998 that I went to Europe. It
will be the first time since 2004 that I will go to SIGGRAPH. Yay
me!</p>
<p>The program looks really good this year. Here's how a conference
like this works for me. I plan a bunch of stuff to go see, get really
overwhelmed, and miss a bunch of good stuff. :P I think the rule,
especially at SIGGRAPH, is that if you're not overwhelmed, you're not
doing it right! Anyway, here's the plan so far...</p>
<p>
<u>Tuesday</u></p>
<ul>
<li><em>Image Collections & Video (8:30am - 10:15am)</em>
<p>Truth be told, I probably won't make it to this session. I'll
probably either still be asleep or busy with registration and all
that. If I do make it, I'm most interested in "Factoring Repeated
Content Within and Among Images."</p>
</li>
<li><em>Parallelism (10:30am - 12:15pm)</em>
<p>There is no way that I'm going to miss a chance to see Michael
Abrash talk. Back in the early to mid 90's when he was being
published in Dr. Dobb's Journal and working on Quake, I totally
idolized him and hung on his every word. In the graphics classes that
I teach, I still quote, "If it looks good, it is good." Combined with
seeing Iron Maiden in concert a couple months ago, this is turning out
to be a summer of re-lived youth. Now, where's my Amiga...</p>
</li>
<li><em>Rendering Materials (1:45pm - 3:30pm)</em>
<p>This is what I love about SIGGRAPH! I consider myself to be
"skilled in the art." I try to keep up with new rendering techniques.
Then I see a paper titled "Realistic Rendering of Birefringency in
Uniaxial Crystals." <em>I have no idea what that even means!</em> I
am so there!</p>
</li>
<li><em>Hair and Realistic Rendering (3:45pm - 5:30pm)</em>
<p>"Dual Scattering Approximation for Fast Multiple Scattering in
Hair" seems to be the only paper in this session that focuses on
real-time rendering. Last year in VGP352 (Lighting and Shading) I
covered a couple fur shaders (fins-and-shells and the fakefur BRDF),
so it might be time to add some decent hair rendering.</p>
</li>
</ul>
<p>
<u>Wednesday</u></p>
<ul>
<li><em>Real-Time Rendering (8:30am - 10:15am)</em>
<p>I have to see "Real-Time, All-Frequency Shadows in Dynamic Scenes."
Over the past years I have assigned readings from other papers by
these authors in VGP353 (Shadows). I just might have to add this one
to the list...</p>
<p>Nvidia has some tech sessions between 9:00am and 11:00am that look
really interesting too. So many things to see!</p>
</li>
<li><em>Faces & Reflectance (10:30am - 12:15pm)</em>
<p>"Face Swapping: Automatically Replacing Faces in Photographs"
sounds really interesting. This has popped up a couple times in the
tech news lately, so it's a very timely issue. I expect this to be a
pretty full session.</p>
<p>We spend a lot of time talking about BRDFs in VGP352, so "Modeling
Anisotropic Surface Reflectance With Example-Based Microfacet
Synthesis" also really caught my eye.</p>
</li>
<li><em>Global Illumination (1:45pm - 3:30pm)</em>
<p>Two papers about shadow maps in one session? The <em>Shape
Analysis</em> session didn't stand a chance!</p>
</li>
<li><em>Texture (3:45pm - 5:30pm)</em>
<p>This one was a close call. There are a few papers in <em>Jiggly
Fluids</em> that sound interesting, but I don't think I have a strong
enough background in the area to get much out of them.</p>
<p>The texture synthesis papers, especially "Inverse Texture
Synthesis" by Yi-Li Wei, et. al. intrigue me. I saw Yi-Li present <a href="http://graphics.stanford.edu/papers/tile_mapping_gh2004/">Tile-Based
Texture Mapping on Graphics Hardware</a> at SIGGRAPH 2004. It was the
most memorable, if not favorite, presentation that year.</p>
<p>"Anisotropic Noise" is also a must-see. I need to beef-up the
coverage of noise in VGP352, and this might help.</p>
</li>
<li><em>OpenGL BoF (6:00pm - 8:00pm)</em>
<p>This is the whole reason Intel is sending me to SIGGRAPH. Will
there be a big announcement at the BoF? Well...you'll just have to
show up to find out, won't you? <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /></p>
</li>
</ul>
<p>
<u>Thursday</u></p>
<ul>
<li><em>Teaching Computer Graphics in Context in Computer Science
(9:00am - 10:00am)</em>
<p></p>
</li>
<li><em>TBD. (10:30am - 12:15pm)</em>
<p>This one is a toss up. There are a couple papers in both <em>Hair,
Rods & Cloth</em> and <em>Perception & Hallucination</em> that
sound interesting, but nothing really jumps out at me. That probably
means that I won't go to either. Expo floor, maybe?</p>
</li>
<li><em>TBD. (1:45pm - 3:30)</em>
<p>Meh. I might go to AMD's "GPU-Accelerated Video Encoding: State of
the Art" from 1:00pm to 2:30pm.</p>
</li>
<li><em>Deblurring & Dehazing (3:45pm - 5:30pm)</em>
<p>The two papers about motion deblurring of images sound interesting.</p>
</li>
</ul>
<p>
<u>Friday</u></p>
<ul>
<li><em>Shape Acquisition (8:30am - 10:15am)</em>
<p>In a previous life, I was very interested in archeology. I even
went on a dig of an old Roman town (<a href="http://en.wikipedia.org/wiki/Leptiminus">Leptiminus</a>) in
Tunisia. Because of that, "A System for High-Volume Acquisition and
Matching of Fresco Fragments: Reassembling Theran Wall Paintings"
caught my eye. I might not stay for the rest of the papers in the
session.</p>
</li>
<li><em>TBD. (10:30am - 12:15pm)</em>
<p>I don't know what to do here. The papers in the <em>Differential
Equations</em> session all sound like they're over my head, and the
papers in the <em>NPR & Deformation</em> session don't sound that
interesting to me.</p>
</li>
<li><em>Painting & Sketching (1:45pm - 3:30pm)</em>
<p>Cloud rendering is an area that has always interested me but that I have
not gotten into. "Feedback Control of Cumuliform Cloud Formation
Based on Computational Fluid Dynamics" sounds like it will present
some interesting work in this area. None of the other papers in the
session sound that interesting to me, though.</p>
</li>
<li><em>Procedural Modeling & Design (3:45pm - 5:30pm)</em>
<p>Poor saps! Presenting the in the last session of the last day is
always a big lose. I have to see "Interactive Procedural Street
Modeling." Three of the authors are local boys from Oregon State
University. Go Beavers!</p>
</li>
</ul>
<p>Whew! I'm tired already!</p>
Love the mediahttp://www.paranormal-entertainment.com/idr/blog/posts/love_the_media/2011-01-28T23:11:37Z2008-07-22T20:15:45Z
<p>I guess I must be awesomely famous or something (probably "or
something"). My new job has <a href="http://www.phoronix.com/scan.php?page=news_item&px=NjU5NA">already been
mentioned</a>
on Phoronix.com. Unfortunately, the work that I will be doing to
parallelize Mesa won't be for anything as glamorous as Larrabee.</p>
<p>In fact, it will be for the complete opposite end of the spectrum.
We're seeing more and more chips, like Intel's own Atom, that trade
wide, out-of-order pipelines for simpler, in-order cores with multiple
threads per core. On those types of architectures, especially when
hardware TNL is not available, Mesa's performance is really, really
bad.</p>
<p>There is room for a lot of improvement even on more traditional
systems with hardware TNL and processors with good single-threaded
performance. It is easy to find apps where lot of time is spent in
the app, a lot of time is spent in the driver, and only one CPU is
utilized. Sure, the app developer could multi-thread the app, but
why? That means multi-threaded optimization needs to be done in N
places (for N apps) instead of just one.</p>
<p>Anyway...I guess I should get back to work now...</p>
Pictures recovered!http://www.paranormal-entertainment.com/idr/blog/posts/pictures_recovered/2009-03-17T06:37:15Z2008-07-09T04:45:17Z
<p>As I mentioned in my previous post, my camera and laptop were stolen
while I was recently travelling. During our trip, both my wife and I
had been copying pictures off our cameras onto the laptop. Once
copied to the laptop, the pictures were deleted off the cameras.
So...even though my wife's camera wasn't stolen, we still lost all
those pictures. Or so we thought.</p>
<p>Since cameras use FAT32 file systems, I knew it was <em>possible</em> the
deleted pictures could be save. I had her switch to a secondary
memory card for the rest of the trip. I did a little searching, and I
found a program called
<a href="http://www.cgsecurity.org/wiki/PhotoRec">PhotoRec</a>. PhotoRec FTW!!!
It managed to find 201 pictures that were deleted!</p>
<p>The bad news is that the value of the stolen items is less than my
insurance deductible, so I get the shaft. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/sad.png" alt=":(" /> We booked our trip with
Amex, so we're going to follow up there...I could have sworn that they
had some sort of "automatic" travel insurance, but I could be wrong.</p>
Message of the day: lock the door!http://www.paranormal-entertainment.com/idr/blog/posts/message_of_the_day_lock_the_door/2009-03-17T06:37:15Z2008-06-26T11:07:35Z
<p>So...I'm still off on vacation. I'm in Rome now. My wife already
posted something to her blog, but I have a rant of my own. On the
train from Paris to Rome, someone broke into our cabin and stole my
laptop and camera. The laptop was her old G4 PowerBook and the camera
wasn't too expensive either, so I'm not too upset about that.
However, I lost all of my pictures from the first 6 days of our
vacation. I had some really good photos from Paris, especially the
tripod shots from the catacombs. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/sad.png" alt=":(" /></p>
<p><strong>Stop reading if you're Italian.</strong></p>
<p>Once we got to Rome, it was like arriving in a 3rd world country. We
either went to or called 4 police stations to report the theft, and
they were all...closed. <strong>Closed?!?!</strong> WTF?!? We finally got to an
open police station today, and there was a couple from England who and
been robbed (1.000€!!!) on the same train.</p>
<p>I get the distinct impression that the train conductors, who only
speak Italian, are in on it. The didn't tell us to lock the doors or
even tell us that there were locks. Since train theft is obviously
common, it seems obvious to warn people. Not everyone rides these
trains all the time. There shouldn't be anyone getting on or off the
train in the night (at border stops, etc.), so they might also check
people there.</p>
<p>Needless to say, I was pretty pissed all day yesterday. Rome may have
been a great nation, but Italy not so much. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/sad.png" alt=":(" /></p>
Good-bye IBM. Hello Intel!http://www.paranormal-entertainment.com/idr/blog/posts/goodbye_ibm_hello_intel/2009-02-05T23:29:27Z2008-06-18T01:15:01Z
<p>As some folks are likely aware, today was my last day at IBM. I was
previously at Sequent, who was bought by IBM, since 1997. I've been
working with many of the same people for 11 years. Am I still a
young-un if I think 11 years is a hella long time to work at one
place?</p>
<p>I really enjoyed working in IBM's Linux Technology Center. It is a
unique and incredible working environment. I highly recommend the LTC
for folks interested in any aspect of server related Linux work.
However, IBM isn't a graphics company these days, so the advancement
opportunities for a graphics specialist are limited. At many times
over the years there wasn't enough "fundable" graphics work, so I had
to work on other things. Faced with the choice of changing my
technical focus or move on, I have decided to move on.</p>
<p>Where am I going? To Intel, of course. I'll be joining keithp,
anholt, and jbarnes at Intel. It seems they have a lot of graphics
work to do these days, and they have no shortage in sight. I'm really
excited to join their team. I've already been going over my Mesa "to
do" to see what I might be able to tackle. There are a lot of
choices. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /></p>
<p>I'll be starting at Intel on 6/30. Between now and then I will be
vacationing with my wife in Europe. I'm taking a laptop, but I don't
know how often I'll be able to / want to check e-mail. On the way to
the Netherlands (our first stop), I have a <strong>12 hour</strong>)
lay-over in Houston. I sure hope they have free wifi...ugh...</p>
Iron Maiden? Excellent!http://www.paranormal-entertainment.com/idr/blog/posts/iron_maiden_excellent/2009-12-20T06:12:33Z2008-06-05T16:40:32Z
<p>I can now comfortably die with a life complete. On Monday, June 2nd,
I saw Iron Maiden perform live at the White River Amphitheater near
Seattle. I have, literally, been waiting 22 years to see them live.
When I was in middle school and high school and they came to Portland
for Somewhere In Time and Seventh Son of a Seventh Son, I was broke.
When they came to Portland in 1996 for The X Factor, they canceled at
the last minute.</p>
<p>This show was, basically, a re-mix of all their class tours from the
80's and early 90's. They even had the giant Eddie mummy with sparks
shooting from his eyes from the World Slavery Tour. Hopefully without
sounding like too much of an old dork, it was fucking awesome!</p>
<p><img src="http://people.freedesktop.org/~idr/images/the_trooper.jpg" width="640"> </p>
Game ranthttp://www.paranormal-entertainment.com/idr/blog/posts/game_rant/2009-12-05T04:33:38Z2008-05-03T19:05:31Z
<p>I recently purchased Mario Kart for the Wii. It's a hella good time.
However, it contains on of those mis-features of console games that
makes me hate consoles. Why do I have to play the single-player game
to "unlock" 50% of the content for multi-player? I paid for 100% of
the content, so I'd like to be able to play it...without having to pay
for it <em>again</em> by playing to boring-ass single-player game.
kthnks.</p>
<p>Unlocking parts of the game was cool when it was unlocking
<strong>a</strong> bonus level or <strong>a</strong> bonus character. Having to unlock a large
portion of the regular game is just insulting.</p>
Beta release...finally!http://www.paranormal-entertainment.com/idr/blog/posts/beta_release_finally/2009-02-05T23:22:25Z2008-05-02T22:42:12Z
<p>Yesterday I <em>finally</em> made a beta release of the XP10 driver.
The driver uses native mode setting (instead of calling the BIOS),
RANDR 1.2 (thanks to keithp and anholt). It currently only supports
the VGA output, but that should be resolved shortly. It also still
has the color byte-ordering issue on big-endian. In spite of all
that, I think that it's pretty solid on x86.</p>
<p>Now, if I could just get a hold of ajax to get this in X.org 7.4 and
Fedora 9...</p>
Har-har-har!http://www.paranormal-entertainment.com/idr/blog/posts/har_har_har/2009-02-05T23:19:46Z2008-03-28T17:19:27Z
<p>Dear Mr. Weather,</p>
<p>We received your April Fool's Day joke a bit early this year. Thank
you for reminding us that <em>global warming</em> means weird weather,
not hot weather. That said, <strong>may we please have spring back
FFS?!?!?!</strong></p>
<p><img src="http://people.freedesktop.org/~idr/snow-way.jpg" width="512" height="384" /></p>
Reason for all the XP10 lovehttp://www.paranormal-entertainment.com/idr/blog/posts/reason_for_all_the_xp10_love/2011-01-28T23:11:37Z2007-09-25T18:00:13Z
<p>This week at POWER.org's <a href="http://www.power.org/devcon/07/">Power Architecture Dev Con
'07</a> IBM showed a system that is
known internally as <em>Bimini</em>. At the conference it was shown with X
running doing a continuous loop of kernel compiles. It's a 4-way
PowerPC 970MP (2 CPUs, 2 cores per CPU) system targeted at developers.
It has a PCI-Express x16 slot, and that slot ships filled with an XP10
card.</p>
<p><img src="http://people.freedesktop.org/~idr/images/Bimini at POWER.org event.jpg"></p>
<p>All of this XGI XP10 work that I have been doing over the last few
months has been for this system. I put in some long hours last week
trying to get the driver into shape for this demo, and I'm pretty
pleased with the result. There is, however, still quite a bit of work
to be done. The existing driver does most things (mode setting, DDC,
DPMS, etc.) using BIOS calls. Obviously, that doesn't work on
PowerPC! In my local tree I have single-head CRT mode setting working
without the BIOS, but there's a lot of ugliness there...it also
doesn't save / restore the console mode.</p>
<p>If you've looked through the published docs for XP10 at all, you've
probably noticed that there is a <strong>lot</strong> of information about mode
setting missing. I'm (painfully) aware of that, and I'm working with
XGI to get that resolved.</p>
XGI driver 1.5.0 releasehttp://www.paranormal-entertainment.com/idr/blog/posts/xgi_driver_1_5_0_release/2011-01-28T23:11:37Z2007-08-28T01:07:46Z
<p>As per the message sent to the xorg-annouse list, I've just released
version 1.5.0 of the XGI driver. This is the driver for the V3XT, Z7,
and various releated chips.</p>
<p>I should also have a libpciaccess release out pretty soon.</p>
<p>I'm hoping to get a release for the XP10 out soon, but I'm not sure it
will make it out in time for the X.org 7.3 release. We'll see...</p>
DRM fences for XP10http://www.paranormal-entertainment.com/idr/blog/posts/drm_fences_for_xp10/2009-02-05T23:06:11Z2007-08-17T21:26:28Z
<p>It looks like DRM fences are working on XP10. Using fences instead of
the scheme previously used in the DDX simplified the code <strong>a lot</strong>.
Hopefully TTM support for the PCI-e GART will be as easy to implement
as fences were. Somehow I doubt it. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/sad.png" alt=":(" /></p>
'Final' XP10 DRM bug fixed!http://www.paranormal-entertainment.com/idr/blog/posts/final_xp10_drm_bug_fixed/2009-02-05T23:03:42Z2007-08-15T20:55:29Z
<p>Earlier this week I managed to fix the last known bug in the XP10 DRM.
I can now restart the X-server as many times as I like, and
acceleration keeps working. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /> I'm just waiting to see if benh and
airlied have any review comments before I bump the version to 1.0.0
and merge to trunk.</p>
Acceleration for XP10http://www.paranormal-entertainment.com/idr/blog/posts/acceleraation_for_xp10/2011-01-28T23:11:37Z2007-07-22T07:29:47Z
<p>While my wife was spending <em>the whole Saturday</em> reading Harry
Potter, I was spending <em>the whole Saturday</em> trying to get
acceleration working on XP10. I leave it as an exercise for the
reader to determine which of us is the bigger geek. In any case, it
works now. DRM changes are pushed to xgi-0-0-2 branch and DDX changes
are pushed to HEAD.</p>
<p>Next week I get to see if it works on 64-bit if it's still broken. <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/sad.png" alt=":(" />
I've changed so many of the internal types to the "correct" things
that I suspect it might Just Work. I think I hear Nelson laughing at
me somewhere...</p>
I'm in your kernel module, converting to DRM!http://www.paranormal-entertainment.com/idr/blog/posts/im_in_your_kernel_module_converting_to_drm/2011-01-28T23:11:37Z2007-07-19T19:49:00Z
<p>Sorry about the title. I've obviously spent too much time on fark.</p>
<p>In any case, the DRM xgi-0-0-2 branch contains a version of the XP10
(aka Volari 8300) kernel module converted to the DRM infrastructure.
Since most of the code in the driver supplied by XGI duplicated
existing infrastructure, this nets a <em>reduction</em> of ~2,700
lines of code. That reduces the size of the kernel module (source) by
nearly 50%.</p>
<p>In addition, the HEAD of xf86-video-xgixp (the DDX for the XP10) has
been modified to use the DRM-based kernel module instead of the XGI
supplied monolithic kernel module.</p>
<p>Baring any unforseen objections by other DRM folks, I'm going to merge
the xgi-0-0-2 branch into DRM trunk on Friday. This means that it
should find its way into a mainline kernel soon-ish.</p>
<p>w00t!</p>
XG40 DRM support in mainline!http://www.paranormal-entertainment.com/idr/blog/posts/xg40_drm_support_in_mainline/2011-01-28T23:11:37Z2007-06-29T22:42:00Z
<p>I just received notice that my (trivial) patch to add support for XG40
chips (as used in Volari V3EX, V3XT, V5, and V8 cards) is in the
mainline tree. In a practical sense, what does this mean? Well, if
you have one of those cards you can use the open DRM, open DDX (from
fd.o GIT) with the closed DRI.</p>
<p>For those who haven't been keeping up, XGI <em>cannot</em> open the
code for the DRI driver. It uses a lot of code license from SGI.
However, this does provide us another step towards creating an open
DRI driver. The <a href="https://bugs.freedesktop.org/show_bug.cgi?id=9129">data books are in fd.o
bugzilla</a>.</p>
<p>Start hacking! <img src="http://www.paranormal-entertainment.com/idr/blog/archive/../smileys/smile.png" alt=":)" /></p>
First post... w00t!http://www.paranormal-entertainment.com/idr/blog/posts/first_post_w00t/2009-02-05T22:49:24Z2007-06-28T07:56:00Z
<p>Hurray for me. After all these years on teh intarweb, I have a blog. I
have no intention of chronicling my life or some other boring crap
like that. Instead, I intend to use this as a forum to communicate
information about various open source projects that I develop. This
will primarily cover my work on Mesa, X.org X-server, the MGA driver
for X.org, and the various XGI drivers for X.org. There may be other
stuff from time to time, but I suspect that these are the topics most
likely to interest anyone.</p>