Friday, January 8, 2016

Infrastructure for a mini ray tracing book

I taught a graphics (mainly ray tracing) course at Westminster College here in Utah a year ago and have been meaning to turn my course notes into a mini-book.   There is a very good and extensive book that introduces ray tracing by Kevin Suffern called Ray Tracing from the Ground Up.   I am not doing a book like that-- Kevin's is excellent and I recommend it to anybody learning ray tracing.   My notes are going to be a lot more narrow.    One thing that has delayed me a year is that I don't want to get sucked down the "graphics design rat hole".   I like pretty books and papers, but that "look"  component of a project can really suck the energy out and make a lot of your work concerned with latex and illustrator and delay things indefinitely.   Here is my mental image for the graphics design rat hole (image by Menard from here):

At the left in brown is an author's energy at the beginning.   The big contractions are various fights with latex, illustrator, whatever.

But courses are often not that way.   Almost all of the time is actually communicating.   And in the time one "perfect" diagram is constructed, you instead fill 10 white boards.    I think this is one reason youtube lectures/notes are often so good-- the energy goes into content.

Another force is that if you want an e-book that works for low-vision people as well as all devices, you really DO NOT have control over appearance.   The path of least resistance is essentially a text file plus images.   And really, what's actually wrong with that?   It avoids the graphics design rat hole!

What finally pushed me over the edge was seeing some of my class notes from my undergraduate physics classes by Richard Crandall and Nic Wheeler.   They were typed or hand-written with hand drawings.   Like old SIGGRAPH papers!    And they suffered 0% from this.   In fact they had an artisan quality that was appealing to me.

So I ask myself the extreme programming kind of question: what is the simplest way I could make an e-book?   

For images I could hand draw on paper, hand draw on a white board, or do the virtual of each.   Ever since I used limnu on an iPad Pro I have been making that my first choice.   Scrollable and editable and easier to get a digital image file.   For the text Pages or Word or google docs would all be fine.   The the first question is what hardware/software infrastructure for a "writing pipeline"?   Limnu runs everywhere so it is really a question of stylus.   First in class appears to be iPad Pro.    But if I am typing a windows10 box with a touch screen is attractive, and the workflow might be smoother.   I decided to go with an iPad Pro, but to my dismay the styluses are back-orders for over a month.   So I walked over to the Microsoft Store and ALMOST bought a SufaceBook.   It was super-attractive.   What did me in was cost-- once you add in Word and the GPU and enough memory it is pricey.   So I retreated and again asked "what is the simplest thing I could do?"   Answer for that is a children's wacom tablet (under $100) hooked to my laptop.    I just did a quick test and it is definitely NOT as fun as an iPad Pro but plenty good enough;  here's my test:
Quick test of limnu with a kid's wacom tablet
Next I will test Pages versus google docs for workflow and get rolling!

PS-- I checked the web and Nic Wheeler's hand-written physics notes are discussed and one of them is online.   He also did move to latex later it appears which does have the big advantage of being editable.    Nic gave me a 2D computer ray tracing assignment in 1984 and I was hooked and I often refer to his hand-written optics notes.

Tuesday, January 5, 2016

Photo layout issue on modern phones

In our Subjective iPhone app (please go buy it and rate it-- the "instant" filters have hit a sweet spot IMO) we've had many discussions on a layout issue I will share here.

Almost all mobile cameras now produce 4x3 images (since the optical system has a round lens, I do wonder why it is not 1x1.   Any ideas?), and almost all mobile screens are now 16x9, how do you display the images on a phone?   Here are the "natural" ways to put 1, 2, 3, 4, 6  4x3 images on the  16x9 screen (5 there is no "pretty" way).   After 6, things get too small IMO.

1,2,3,4,6 4x3 rectangles on a 16x9 screen
In our app, we wanted to do the "pick your favorite" UI inspired by A/B testing, subjective refraction at the optometrist, and Photoshop variations.   So 1 is great but doesn't cut it.   6 in a circle like Photoshop uses in the natural choice for big screens and 2D color spaces, but our screen is small and we often are not just navigating a 2D space.   If we want the long axis of the rectangles to match up (so you'll be holding the phone in portrait orientation for editing a portrait mode pictures, then 4 and 6 are really the only options.   We found 6 to be both too many choices, and too small pictures.   And like most engineers, we like it when there is exactly one good design choice :)

Sunday, December 27, 2015

floats versus doubles

When to use floats and when to use doubles is one of those classic topics of discussion and much less pointless than the code formatting religious fights.   A fun thing in the new edition of FCG is that Steve Marschner and I are in opposite camps.   I just checked what amazon previews to the reader with "look inside" and found this (note-- I think that discussion of debugging is something I wish I could send back in time to myself-- it's VERY basic but graphics debugging is different in some ways):

Screen capture from Amazon preview of Fundamentals of Computer Graphics 4th edition
See-- sometimes opposing camps can get along :)

Thursday, December 24, 2015

Winner of the annual University of Utah teapot rendering contest

Once again Cem Yuksel hosted his annual University of Utah teapot rendering contest.    Last year's winner Laura Lediaev won again.   Here is one of her pictures (my favorite):


Laura's other images and some technical details (including Christmas trees(!) are here).

New edition of my graphics text is out.

The newest edition of my intro graphics book is done early.   It looks like the kindle edition is out and the hardcopy will at at amazon soon. I just got my copies in the mail today!   I am a big fan of this edition.   It is also now Marschner and Shirley et al., instead of Shirley and Marchner et al.   Any great improvements in the book I am pretending are correlation and not causation.   But being second author is like I hear being a grandparent is-- all the benefit and none of the responsibility.   Please report any problems to Steve.

This edition we have moved to color:
That retro image in the bottom right is there for nostalia's sake.  It was my first good image (1988 I think).   It was 1024x768 and took two weeks to do radiosity and light maps and 16 viewing rays per pixel on a VAX 11-780.   It was my first "real" C++ program (I think).     Modeled in vi (for real) and some hand rolled rotate a piece-wise linear curve code.   Here it is in all its low-res noisy glory.



Monday, November 30, 2015

Tone mapping colorful images

I recently noticed that a paper of mine from a few years ago had zero references.   This wasn't a paper with any deep research but instead was a "what is the simplest algorithm we can do that works" paper.   The idea was what to do with the practical problem of how most tone mapping pipelines kill bright blues.    Here is a figure from the paper on our inspiration for the user-controlled "dial" we added:

I think I figured out why nobody uses this paper-- we never put a copy online!   I just fixed that.  The paper is:
A copy is available near the bottom of my papers page.

Friday, November 13, 2015

iPad Pro with pencil stylus review

Summary:  Overall, the whiteboarding alone is reason enough for me to buy an iPad pro-- it has gone over that magic threshold of "good enough" that pads of paper will be a thing of the past for me.   Your excuse may be different (pencil drawing is a good one), so I think this device will be huge.


Dave Hart and Grue Debry got an iPad Pro with stylus for their company and they loaned it to me to try out tonight.   I used their limnu shared whiteboarding program to test it.

I tried it with the math I was messing with today (trying to meet Andrew Glassner's color space challenge to get uniformity into the prismatic color volume).

First, I **love** that I can rest my hand on the iPad while I draw (the iPad pro understands not to count that as a touch).


My hand is resting on the iPad as I draw and this is more important to my comfort than I would have thought
My biggest reaction was that this iPad is exactly the size I want.  It's about the size of 8.5 by 11 paper (actual working area size about 7 3/4" by 10 1/4"), so maybe that size evolved in paper to be the "right size" or maybe I am just so used to it that I like it.   Any bigger and it would be awkward to transport, and using this as a pad in a coffee shop is a great use case.   And of course you can pan so really it's a window into a much bigger sheet of paper.

The stylus is fantastic.   It feels good and has some features that has me not as eye-rolling about calling it a pencil.

As a white board marker I loved it.   Changing colors and nib sizes was more useful than I anticipated.   Using it as an eraser (which I had to do a lot as will be evident in some of the not very careful eases below-- I really do use limnu like a white board-- it's for blazing through ideas).   Here's my first screenful.  
A screenshot of my first session on limnu with the iPad Pro


 15 more 2x2 equations to solve (doing them as special cases to take advantage of zero dropouts) so I will definitely need the pan feature.   I used to use a big real white board or a giant artist pad for these situations, but I will most definitely use a tablet from now on.   Even without the saving and collaboration features I think it would be a win just because of physical portability and fluidity.  

Overall, the whiteboarding alone is reason enough for me to buy an iPad pro-- it has gone over that magic threshold of "good enough" that pads of paper will be a thing of the past for me.    I don't think it will make my laptop obsolete due to OS issues (Microsoft is making a better play for that now).   But the hardware of the iPad pro is in the laptop power zone.    John Gruber has a really interesting discussion of this hardware/software issue.