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 plasma:

ED001

Solar Irradiance

Holy! The above screen­shot shows a sit­u­a­tion right after drop­ping out of hyper­space. I am sup­posed to be at a dis­tance of 12.76 light sec­onds (3.8 mil­lion kilo­me­ters) to Theta Boötis, a class F star which is slight­ly hot­ter than our sun. I think peo­ple real­ly under­es­ti­mate the sheer inten­si­ty of solar radi­a­tion. Take a guess: at this dis­tance, and in the absence of some fan­tas­ti­cal heat block­ing tech­nol­o­gy, how much time would a space­ship have to live before it begins to evaporate?

  • hours
  • min­utes
  • sec­onds
  • you are crazy, it would not evaporate

The answer would be a few min­utes. Just for fun I cal­cu­lat­ed the irra­di­ance at this dis­tance to be about 9 mil­lion watts per square meter! Under this pow­er it would take 2 min­utes to heat one tonne of iron to 2500 K (see [1] and [2] for the details of this calculation).

I’m not crit­i­ciz­ing here. A game that allows to ’super cruise’ might as well pos­tu­late some tech­nol­o­gy for cop­ing with close stel­lar prox­im­i­ty. But I think it should have to be out­fit­ted explic­it­ly and be very expen­sive, maybe even alien tech­nol­o­gy of Thar­goid ori­gin or something.

By the way, look again at the above screen­shot. There is white glow­ing hot plas­ma, dim cock­pit lights and even back­ground stars in the same expo­sure? That’s a mighty dynam­ic range! Here comes the cue: Dynam­ic Range.

ED002

Dynamic Range

To elab­o­rate about dynam­ic range, I choose a less extreme exam­ple, but still very edu­ca­tion­al. The sec­ond screen­shot, tak­en from an ear­ly release, shows the fic­tion­al plan­et ‘Aze­ban’, which is sup­posed to be in the Gliese 556 sys­tem. Tar­get­ed in the back­ground is the sys­tem 44 Boötis, at a dis­tance of 5.47 light years.

To reca­pit­u­late: We have a sun­lit plan­et and back­ground stars in the same expo­sure. The  ice sheet of the plan­et is just as bright as if you were actu­al­ly stand­ing on the plan­et look­ing at the glar­ing white snow around you. The stars are just as bright as ordi­nary night-sky stars. Take anoth­er guess: How many EV (expo­sure val­ues) dif­fer­ence are between the snowy ice sheet (marked with A) and the faint star in the dis­tance (marked with B)?

  • 3
  • 13
  • 9600
  • nit­pick­er, the image is fine as it is

I cal­cu­lat­ed the answer to be 13.2 EV, see [3] and [4] for the details of that cal­cu­la­tion. EV is a log­a­rith­mic scale, so the cor­re­spond­ing lin­ear fac­tor would be about 1:9600 (haha I put a dis­trac­tive answer into the mul­ti­ple choice ques­tion). Put anoth­er way: if the region marked in A has an RGB col­or of #BFA575 then the star in B should be ren­dered as a sin­gle pix­el some­where in the range of #000000 to #030303, see [5] for that calculation.

The corol­lary is that real­ly the back­ground stars should be almost invis­i­ble in the same expo­sure togeth­er with oth­er sun­lit objects, like a plan­et. Only if the plan­et scrolls out of view, then you should be able to see stars (after some adap­ta­tion time). I also know that it is a com­mon sci-fi trope to show stars when it is absolute­ly inap­pro­pri­ate, and that it is dif­fi­cult to rec­on­cile real­is­tic dynam­ic range with oth­er requirements.

I’d side­step the issue like this: The cock­pit view is not real­ly what you see out­side in space. It is a 3‑D ren­der­ing that is pro­vid­ed for you by the ship’s com­put­er, based on sen­sor data, or at least some kind of AR. This is entire­ly plau­si­ble giv­en future tech­nol­o­gy. With this expla­na­tion you could get away with arbi­trary non-pho­to­re­al­is­tic ren­der­ing. And the ships don’t even need to have frag­ile glass win­dows any more.

ED006

Physically Based Shading

One of the cur­rent buzz­words in the graph­ics com­mu­ni­ty is the term ‘phys­i­cal­ly based ren­der­ing’ or alter­na­tive­ly ‘phys­i­cal­ly based shad­ing’ (PBS). While this term seems to imply that all aspects of ren­der­ing are phys­i­cal­ly cor­rect (which they obvi­ous­ly will nev­er be), this is not the mean­ing of it. Rather, PBS stands for a spe­cif­ic improve­ment over tra­di­tion­al sur­face shad­ing that usu­al­ly includes the fol­low­ing bul­let points (for a non-tech­ni­cal expla­na­tion of these, see these slides):

  • Lin­ear lighting
  • Ener­gy con­serv­ing (’nor­mal­ized’) spec­u­lar high­lights with vary­ing glossiness
  • Capa­bil­i­ty to dif­fer­en­ti­ate between met­als + dielectrics
  • Fres­nel effect

Based on what I could judge by just eye­balling Elite Dan­ger­ous, I’d con­firm at least the first three, and maybe a Fres­nel effect on water sur­faces (but nowhere else).

The third screen shows the sur­face of a “Dread­nought” cap­i­tal ship, in back­light. See this video to get an idea of how the entire ship looks like. Most of the sur­face is metal­lic and  col­or­less, it’s the light from the cen­tral star that paints every­thing yel­low. Glossi­ness is easy to esti­mate in motion, but not so easy in a sta­t­ic screen­shot, so I have high­light­ed exem­plars of high glossi­ness with blue marks and low glossi­ness with green marks. The shad­ing behav­ior of these looks like they fol­low a nor­mal­iza­tion curve: the peak is either nar­row and high, or broad and shal­low. Tak­en togeth­er, this part of PBS is imple­ment­ed textbook-perfect.

How­ev­er, all metal­lic parts show a sig­nif­i­cant amount of dif­fuse reflec­tion, while they should have none. I guess this was an artis­tic deci­sion, because in space, there is not enough inter­est­ing envi­ron­ment to be reflect­ed by an envi­ron­ment map or sim­i­lar tech­nique, it’s all black out there! So it looks like they gave all sur­faces, includ­ing the metal­lic ones, at least some 10% dif­fuse or some­thing to mit­i­gate the black environment.

ED-004Lin­ear light­ing can be mea­sured with an exper­i­ment. Above is anoth­er screen shot from inside the Dread­nought. The region A is lit by my ship’s lights, the region B is in sun­light and the region C is lit by both light sources. If light­ing is any­where near lin­ear, then the RGB col­or of C should equal the sum of the RGB col­ors of A and B, after gam­ma expan­sion. Just by eye­balling it feels like they do the right thing (for instance, the region C should not sat­u­rate), and some puny mea­sure­ments seem to con­firm this [6].

The last ‘bul­let point’ on the PBS list is the Fres­nel effect, or the obser­va­tion that reflec­tiv­i­ty increas­es in the lim­it of a graz­ing angle. This effect seems to be inten­tion­al­ly absent in Elite Dan­ger­ous. It was sur­pris­ing­ly dif­fi­cult to test because I had to find a non-metal­lic sur­face that the game allows you to suf­fi­cient­ly move the view­point against to get into a graz­ing angle. This basi­cal­ly rules out all light­ing inside the cock­pit, sta­tions and cap­i­tal ships.

Screenshot_0005-2 1

I final­ly found this to be pos­si­ble with respect to spec­u­lar reflec­tion in the ocean of a plan­et. So I embarked on a jour­ney with the afore­men­tioned super-cruise dri­ve to try to get to the per­fect angle. If the game gave me one cred­it for every time I got inter­dict­ed by pirates or police along the way, I could final­ly afford a Cobra Mk III … well, no not real­ly, but I think there were a dozen inter­dic­tions over the course of one cir­cum­nav­i­ga­tion, which I think is a bit overdone.

See on the fifth screen shot a com­par­i­son of ocean appear­ance from dif­fer­ent angles, with ED in the top row and the real ISS pho­tos in the bot­tom row. In real­i­ty, the reflec­tiv­i­ty of water at nor­mal inci­dence is about 3%, and approach­es 100% for graz­ing inci­dence. In ED, the effect exists (the high­light is def­i­nite­ly brighter at graz­ing inci­dence), but it is very weak.

PIA08388 2Planetary Rings and their Phase Curves

Above you can see how the rel­a­tive bright­ness of dif­fer­ent parts of Saturn’s rings varies with incli­na­tion and phase angle. This is to be expect­ed, since a ring as a cloud of par­ti­cles exhibits strong view-depen­dent occlu­sion and mask­ing effects. Dif­fer­ent parts of the ring have dif­fer­ent opti­cal thick­ness and albe­do val­ues, which results in dif­fer­ent behav­ior under dif­fer­ent light and view angles. For instance, the mid­dle part of the ring, which appears bright­est when Sat­urn is in oppo­si­tion becomes the dark­est part when seen in back­light. These sub­tle shad­ing vari­a­tions are not only of the­o­ret­i­cal inter­est. Elite Dan­ger­ous allows the play­er to approach a ring to the point where the dis­crete par­ti­cles are resolved, which is a very cool fea­ture and I find it well exe­cut­ed, over­all. How­ev­er there is almost always a shad­ing mis­match between the dif­fer­ent lev­els of detail (marked 1 to 4).

ED-003

Elite Dan­ger­ous is not alone in this regard; shad­ing mis­match between LODs is one of the Great Plagues of game ren­der­ing that is dif­fi­cult to get right, so I don’t crit­i­cize here. I want to use this oppor­tu­ni­ty how­ev­er to draw atten­tion one more time to the Lom­mel-Seel­iger BRDF (I men­tioned that in a pre­vi­ous post, here), that, in the ver­sion for finite thick­ness, was specif­i­cal­ly designed to mod­el the appear­ance of Saturn’s rings. It still miss­es some impor­tant effects such as the oppo­si­tion surge, but it should be an improve­ment over com­plete­ly view-inde­pen­dent shading.

Closing Remarks

Many parts of this arti­cle were writ­ten against the first release of the Pre­mi­um Beta, which was in June, but the shad­ing has fun­da­men­tal­ly remained the same through­out the releas­es, so this arti­cle reflects cur­rent state. How­ev­er, ED is pro­gress­ing at a steady pace, so I am look­ing for­ward to the next releases!


Appendix

These are the cal­cu­la­tions to back up the argu­ments in the text. If you think there is an error, drop me a line or write a comment!

[1] Cal­cu­late the irra­di­ance received at 12.76 light sec­onds dis­tance to Theta Boötis. The for­mu­la for the irra­di­ance received by a spher­i­cal light source with known radi­ance was already dis­cussed on this page, and is

    \[E = \pi L \left( \frac{r_0}{r} \right)^2.\]

The val­ues for the vari­ables are list­ed in the table below. I use the 4‑th pow­er law L \sim T^4 to esti­mate the radi­ance L from the known radi­ance of the sun L_\odot and the ratio of temperatures.

Sur­face temperature T = 6265 \, \mathrm{K}
Sur­face radiance L = \left( \frac{T}{T_\odot} \right)^4 L_\odot = 27.77 \times 10^6 \, \mathrm{W} \, \mathrm{m}^{-2} \, \mathrm{sr}^{-1}
Radius r_0 = 1.733 \, R_\odot = 4.023 \, \mathrm{ls}
Dis­tance r = 12.76 \, \mathrm{ls}

The result is

    \[E = 8.672 \times 10^6 \, \frac{\mathrm{W}}{\mathrm{m}^2}.\]

[2] Cal­cu­late the time to heat one ton of iron by 2500 K.

Spe­cif­ic heat capacity c_p =450 \, \mathrm{J} \, \mathrm{kg}^{-1} \, \mathrm{K}^{-1}
Mass m = 1000 \, \mathrm{kg}
Tem­per­a­ture change \Delta T = 2500 \, \mathrm{K}
Total amount of heat needed Q = c_p \, m \, \Delta T = 1.125 \times 10^9 \, \mathrm{J}

Giv­en the irra­di­ance from above, assum­ing a cross sec­tion­al area of one square meter and that all radi­a­tion is absorbed, the time need­ed is

    \[\frac{Q}{E} = 129.7 \, \mathrm{s}.\]

[3] Cal­cu­late the radi­ance L_\mathrm{A} of the pix­el at point A. First, cal­cu­late the irra­di­ance E received at this dis­tance from the cen­tral star, like we did in [1], but also account for the inci­dence angle. This star does not have a con­ve­nient Wikipedia page so I looked for indi­vid­ual references.

Star tem­per­a­ture T = 4809 \, \mathrm{K} ⁣   (ref)
Star radi­ance L = 9.568 \times 10^6 \, \mathrm{W} \, \mathrm{m}^{-2} \, \mathrm{sr}^{-1}
Star radius r_0 = 0.74 \, R_\odot = 1.718 \, \mathrm{ls} ⁣   (ref)
Dis­tance r = 235.3 \, \mathrm{ls}
Irra­di­ance at nor­mal incidence E_\perp = 1602 \, \mathrm{W} \, \mathrm{m}^{-2}
Irra­di­ance at 50° incidence E = \cos 50^\circ E_\perp = 1030 \, \mathrm{W} \, \mathrm{m}^{-2}

Side note: an inso­la­tion of 1600 watts per square meter is a lit­tle bit on the hot side, but could be hab­it­able. How­ev­er the plan­et would most like­ly not have large ice sheets under these con­di­tions. For com­par­i­son, the earth gets 1367 W/m² from our sun. (Edit 2021: The above sim­ple cal­cu­la­tion ignores the limb-dark­en­ing effect so that the true inso­la­tion is prob­a­bly clos­er to the val­ue on earth.)

In the sec­ond step, cal­cu­late the reflect­ed radi­ance L_\mathrm{A} from E, assum­ing the most sim­ple Lam­bert­ian BRDF and some­what guess­ing the albe­do of the surface.

Albe­do of snow-ice (pos­si­bly dirty) \alpha = 0.6
Lam­bert­ian BRDF f_r = \frac{\alpha}{\pi} = 0.191 \, \mathrm{sr}^{-1}

Plug­ging in the val­ues yields

    \[L_\mathrm{A} = f_r \, E = 196.7 \, \mathrm{W} \, \mathrm{m}^{-2} \, \mathrm{sr}^{-1}.\]

[4] Cal­cu­late the radi­ance L_\mathrm{B} of the pix­el rep­re­sent­ing the select­ed sys­tem at point B. The first step is again to cal­cu­late the irra­di­ance E. To keep the cal­cu­la­tion sim­ple, we lump togeth­er the con­tri­bu­tions of the 3 stars of this sys­tem into a sin­gle radi­ant inten­si­ty I = E r^2, which is stat­ed as 2.2 times that of our sun.

Radi­ant intensity I = 2.2 \, I_\odot = 6.73 \times 10^{25} \, \mathrm{W} \, \mathrm{sr}^{-1}
Dis­tance r = 5.47 \, \mathrm{ly} = 5.175 \times 10^{16} \, \mathrm{m}
Irra­di­ance E = \frac{I}{r^2} = 2.513 \times 10^{-8} \, \mathrm{W} \, \mathrm{m}^{-2}

The next step is to assume that E comes from a light source with the size of a sin­gle pix­el. The for­mu­la for this is the reverse of [1] togeth­er with the sub­sti­tu­tion (r_0/r)^2=\sin^2 \beta:

    \[\frac{E}{\pi \sin^2 \beta} = L ,\]

where \beta is now the appar­ent radius of a sin­gle pix­el. For the cen­ter of the screen pro­jec­tion this is giv­en by

    \[\beta = \tan^{-1} \frac{\tan\frac{\phi}{2}}{n} .\]

My screen res­o­lu­tion was 1600 × 900 and the FOV slid­er was at max­i­mum. Based on a sim­ple tim­ing exper­i­ment with my ship turn­ing I think the FOV is exact­ly 90° in this case.

Hor­i­zon­tal field of view \phi = 90^\circ
Hor­i­zon­tal screen resolution n = 1600
Appar­ent pix­el radius \beta = 0.0358^\circ

Plug­ging in the val­ues yields

    \[L_\mathrm{B} = 0.02049 \, \mathrm{W} \, \mathrm{m}^{-2} \, \mathrm{sr}^{-1},\]

and the EV dif­fer­ence is

    \[\log_2 \frac{L_\mathrm{A}}{L_\mathrm{B}} = \log_2 9599.8 = 13.2 \: .\]

Side note: Yes, this means the EV dif­fer­ence is res­o­lu­tion depen­dent. The bright­ness of star pix­els increas­es with res­o­lu­tion. In the extreme case, when the res­o­lu­tion is so high that the star is resolved, it would have to approach the star’s actu­al sur­face radiance.

[5] Cal­cu­late the RGB val­ue for the star pix­el based on the ref­er­ence col­or #BFA575. The sim­plest mod­el of a com­put­er dis­play is a pow­er law, char­ac­ter­ized by its gam­ma value:

    \[\mathrm{RGB}_\mathrm{B} = \left( \frac{L_\mathrm{B}}{L_\mathrm{A}} \right)^{{}^1/_{\gamma}} \, \mathrm{RGB}_\mathrm{A} .\]

The high­est com­po­nent of the ref­er­ence col­or is hexa­dec­i­mal #BF, which is 191 in dec­i­mal. We use the com­mon­place gam­ma val­ue of 2.2.

Ref­er­ence RGB value \mathrm{RGB}_\mathrm{A} = 191
Dis­play gamma \gamma = 2.2

result­ing in

    \[\mathrm{RGB}_\mathrm{B} = 2.95 \, ,\]

or round­ed up to #030303 as grey color.

[6] Check the hypoth­e­sis that the col­ors were added lin­ear­ly (ie. after gam­ma expan­sion). From a down­sized screen­shot we take RGB sam­ples at loca­tions A, B and C, expressed as per­cent­age val­ue. These val­ues are gam­ma expand­ed via

    \[\mathrm{RGB}_\mathrm{linear} = \mathrm{RGB} ^ \gamma\]

with \gamma = 2.2 tak­en as a com­mon val­ue for dis­play gam­ma. The val­ues in the third and fourth rows are in bet­ter agree­ment on the right (‘lin­ear’) col­umn than on the left. On a side node, the val­ues in the left col­umn show how light­ing would have clipped if the RGB val­ues are added naively.

Loca­tion Sam­pleD RGB Lin­ear RGB
A 0.45 0.45 0.57 0.17 0.17 0.29
B 0.68 0.55 0.35 0.43 0.27 0.10
C 0.80 0.71 0.69 0.61 0.47 0.43
A+B 1.31 1.00 0.92 0.60 0.44 0.39

4 Gedanken zu „Elite Dangerous: Impressions of Deep Space Rendering

  1. Nice post, I like the light­ing effects in elite dan­ger­ous, even if they are not per­haps real­is­tic, it has a good artistic/futuristic quality.

  2. Pingback: So, where are the stars? | The Tenth Planet

  3. Pingback: Who’s Out There?: Elite Dangerous & the Space Race | wreckreation.org

  4. Pingback: Caveat: Even NASA pictures may not be linear (or the wrong kind of linear) | The Tenth Planet

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Please answer the following anti-spam test

Which thing makes "tick-tock" and if it falls down, the clock is broken?

  1.    table
  2.    chair
  3.    pencil
  4.    watch
  5.    ruler