Followup to Atmospheric Scattering—Part 1

This post is the first in a series to fol­low-​up on my 2012 GPU Pro 3 arti­cle about atmos­pher­ic scat­ter­ing [11]. What I showed there was a full sin­gle-​scat­ter­ing solu­tion for a plan­e­tary atmos­phere run­ning in a pix­el shad­er, dynam­ic and in real time, with­out pre-​com­pu­ta­tion or sim­pli­fy­ing assump­tions. The key to this achieve­ment was a nov­el and effi­cient way to eval­u­ate the Chap­man func­tion [2], hence the title. In the time since then I have improved on the algo­rithm and extend­ed it to include aspects of mul­ti­ple scat­ter­ing. The lat­ter caus­es hor­i­zon­tal dif­fu­sion (twi­light sit­u­a­tions) and ver­ti­cal dif­fu­sion (deep atmos­pheres), and nei­ther can be ignored for a gen­er­al atmos­phere ren­der­er in a space game, for exam­ple.

I have writ­ten a Shader­toy that reflects the cur­rent state of affairs. It’s a mini flight sim­u­la­tor that also fea­tures clouds, and oth­er ren­der­ing good­ies. A WebGL2 capa­ble brows­er is need­ed to run it. Under Win­dows, the ANGLE/Direct3D trans­la­tor may take a long time to com­pile it (up to a minute is noth­ing unusu­al, but it runs fast after­wards). When suc­cess­ful­ly com­piled it should look like this:
Con­tin­ue read­ing

Most Popular Posts and Tags

I have added a per­ma­nent page with a sum­ma­ry of the most pop­u­lar posts on this blog. I also tried to add mean­ing­ful tags to all posts. Here are the most impor­tant tags:

Content type tags

  • down­load — a down­load is avail­able is this post
  • gem — a code snip­pet or oth­er copy-paste thing is avail­able
  • math — posts that are heavy on math for­mu­lae

Topic tags

 

So, where are the stars?

In my pre­vi­ous rant about dynam­ic expo­sure in Elite Dan­ger­ous (which hon­est­ly applies to any oth­er space game made to date), I made a rough cal­cu­la­tion to pre­dict the bright­ness of stars as they should real­is­ti­cal­ly appear in pho­tos tak­en in out­er space. My pre­dic­tion was, that,

  • for an illu­mi­na­tion of sim­i­lar strength to that on earth,
  • if the sun­lit parts are prop­er­ly exposed,
  • and with an angu­lar res­o­lu­tion of about 2 arc min­utes per pix­el,

then the pix­el-val­ue of a promi­nent star should be in the order of 1 to 3 (out of 255, in 8-bit sRGB encod­ing). Since then I was curi­ous to find some real world val­i­da­tion for that fact, and it seems I have now found it.

ISS_and_Endeavour_EV+0

Con­tin­ue read­ing

\usepackage{cmbright}

The ‘mod­ern’ look­ing sans-serif font I use recent­ly in \LaTeX equa­tions on this blog is called ‘Com­put­er Mod­ern Bright’, and actu­al­ly is not so mod­ern at all: Designed by Wal­ter Schmidt in 1996, it is still to date the only free sans-serif font avail­able for \LaTeX with full math sup­port. Type-1 ver­sions of this font are avail­able in the cm-super pack­age, but I didn’t need to install any­thing, because appar­ent­ly, Quick­La­TeX has them already. The only thing to do was adding just one line to the pre­am­ble:

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{cmbright}   % computer modern bright

I also turned on the SVG images fea­ture that was added with ver­sion 3.8 of Quick­La­tex, so the equa­tions are no longer pixel­lat­ed on reti­na dis­plays or when zoom­ing in! Neat, huh?

Elite Dangerous: Impressions of Deep Space Rendering

I am a backer of the upcom­ing Elite Dan­ger­ous game and have par­tic­i­pat­ed in their pre­mi­um beta pro­gramme from the begin­ning, pos­i­tive­ly enjoy­ing what was there at the ear­ly time. ‘Pre­mi­um beta’ sounds like an oxy­moron, pay­ing a pre­mi­um for an unfin­ished game, but it is noth­ing more than pur­chas­ing the same backer sta­tus as that from the Kick­starter cam­paign.

I came into con­tact with the orig­i­nal Elite dur­ing christ­mas in 1985. Com­pared with the progress I made back then in just two days, my recent per­for­mance in ED is lousy; I think my com­bat rat­ing now would be ‘com­pe­tent’.

But this will not be a game­play review, instead I’m going to share thoughts that were inspired while play­ing ED, most­ly about graph­ics and shad­ing, things like dynam­ic range, sur­face mate­ri­als, phase curves, ‘real’ pho­tom­e­try, and so on; so … after I loaded the game and jumped through hyper­space for the first time (actu­al­ly the sec­ond time), I was greet­ed by this screen fill­ing disk of hot plas­ma:

ED001

Con­tin­ue read­ing

X-Plane announces Physically Based Rendering

I always won­dered when X-Plane would jump on the PBR band­wag­on. I like X-Plane, I think its the best active­ly-devel­oped (*) flight sim­u­la­tor out there, but I always felt that shad­ing could be bet­ter. For instance, there is this unre­al­is­tic ‘Lam­bert-shad­ed’ world ter­rain tex­ture, which becomes too dark at sun­set; anoth­er is the dread­ed ‘con­stant ambi­ent col­or’ that plagues the shad­ing of objects.

Now in this post on the X-Plane devel­op­er blog, Ben announces that Phys­i­cal­ly Based Ren­der­ing is a future devel­op­ment goal, yay! Then he goes on to say that, while sur­face shad­ing will be a solved prob­lem™ because of PBR, oth­ers like par­tic­i­pat­ing media (clouds, atmos­phere) would still need mag­ic tricks for the fore­see­able future. Con­tin­ue read­ing

Journey into the Zone (Plates)

I have exper­i­ment­ed recent­ly with zone plates, which are the 2-D equiv­a­lent of a chirp. Zone plates make for excel­lent test images to detect defi­cien­cies in image pro­cess­ing algo­rithms or dis­play and cam­era cal­i­bra­tion. They have inter­est­ing prop­er­ties: Each point on a zone plate cor­re­sponds to a unique instan­ta­neous wave vec­tor, and also like a gauss­ian a zone plate is its own Fouri­er trans­form. A quick image search (google, bing) turns up many results, but I found all of them more or less unus­able, so I made my own.

Zone Plates Done Right

I made the fol­low­ing two 256×256 zone plates, which I am releas­ing into the pub­lic so they can be used by any­one freely.

Cosine zone plate with constrast weighting

Cosine zone plateCC0

Zone plates with contrast weighting

Sine zone plateCC0

Con­tin­ue read­ing

Ego mecum conjungi …

… Twit­ter!

Twitter_logo_blue

So out of a whim I just embar­rassed myself and tried to write in (prob­a­bly wrong) latin that I joined twit­ter. You can fol­low me under: @aries_code.

If you won­der how this came about, this was my train of thought:

  • Twit­ter has some­thing to do with birds
  • Birds have fan­cy latin species names
  • The species name for Spar­row is Spass­er domes­ti­cus
  • This doesn’t sound too fan­cy ...
  • How do you say ‘I joined twit­ter’ in latin any­way?

But then I dis­cov­ered that I am onto some­thing: Accord­ing to one argu­ment, the brand name of Twit­ter should have been ‘Titi­a­tio’, had it exist­ed in antiq­ui­ty. And accord­ing to anoth­er argu­ment, latin should be an ide­al twit­ter lan­guage, because it is both short and expres­sive.

But I digress. If you are into com­put­er graph­ics, then you know of Johann Hein­rich Lam­bert, the eponym of our beloved Lam­bert­ian ref­electance law. The book where he estab­lished this law, Pho­tome­tria, is writ­ten entire­ly in latin—now this is hard­core!

So, now you know what to do if you want to stand out in your next SIGGRAPH paper …