This is a quick post thrown together to report on my experience with the new Safari 14 regarding support for WebGL 2. The news of improved WebGL support was floated last month in the Shadertoy Community Group:Fast forward to today and the Safari 14 update has now come to my laptop (which still runs macOS Mojave). So the first thing I did check out all my shaders on Shadertoy and then some to see if the promises were true. My verdict (TL/DR):
Sorting through comment spam is burdensome
In order to keep this site spam free I approve every comment by hand. This means that comments will not immediately appear after posting.
Unfortunately, comments tend to appear in bursts. There can be long stretches of no activity (where I get nothing but spam), during which I will get lazy and will tend to check less and less often, only to be surprised when there are multiple legit comments waiting (usually after a link has been posted to social media).
So if you think your post got stuck just try again.
Correct sRGB Dithering
This is a brain-dump inspired by a thread on twitter about correct™ dither in sRGB, meaning, to choose the dither pattern in such a way as to preserve the physical brightness of the original pixels. This is in principle a solved problem, but the devil is in the details that are easily overlooked, especially when dithering to only a few quantization levels.
So, this topic came up on twitter:
I had previously spent some time to wrap my head around this exact problem, so I shot from the hip with some pseudo code that I used in Space Glider on Shadertoy. Code postings on twitter are never a good idea, so here is a cleaned up version wrapped up in a proper function:
Update of my 2013 FMX Slides on Physically Based Shading in PDF format
The slides of my 2013 talk at FMX in Stuttgart were available for download for a long time now in both Keynote and Powerpoint formats. However, people keep asking for a PDF version. As I wrote in the comments once, I always had bad luck with the PDF export from Keynote, so I left it at that.
Yesterday I made a major discovery: The option “export to PDF” is not the only possibility, in fact, it is quite an inferior one. The thing that I overlooked is that one can also just pretend to “print”, and then, in the subsequent printer dialog, chose “save to PDF” instead. Not only does this give additional options but also produces nicer formatting and a smaller file!
I wonder however the UI designers at Apple really intended this to be the primary means of PDF export?
Anyway, I updated the slides to PDF format and also made some minor corrections. I exchanged the font Humanist 521 with Gill Sans. Apparently the former is an official clone of the latter, and since Gill Sans is preinstalled on a Mac anyway, I may as well just use the original. The metrics also seem to look nicer in the PDF. I also copy-edited some of the notes to be more educational than just a transcript of my talk.
Here is again, the direct download link.
Download “FMX 2013 Slides PDF with Notes” fmx-11-revised.pdf – Downloaded 1676 times – 15 MB
Outbound link manager plugin is incompatible with QuickLatex
I found the reason for why sometimes all Latex in my posts got clobbered. The culprit was an outdated plugin, which—as a side effect—deleted backslashes from posts. So I deinstalled the sinner and also repaired all math that I found was broken. If you still find broken math, drop me a line.
Followup to Atmospheric Scattering—Part 1: Overview
This post is the first in a series to follow-up on my 2012 GPU Pro 3 article about atmospheric scattering [11]. What I showed there was a full single-scattering solution for a planetary atmosphere running in a pixel shader, dynamic and in real time, without pre-computation or simplifying assumptions. The key to this achievement was a novel and efficient way to evaluate the Chapman function [2], hence the title. In the time since then I have improved on the algorithm and extended it to include aspects of multiple scattering. The latter causes horizontal diffusion (twilight situations) and vertical diffusion (deep atmospheres), and neither can be ignored for a general atmosphere renderer in a space game, for example.
I have written a Shadertoy that reflects the current state of affairs. It’s a mini flight simulator that also features clouds, and other rendering goodies. A WebGL 2 capable browser is needed to run it. Under Windows, the ANGLE/Direct 3D translator may take a long time to compile it (up to a minute is nothing unusual, but it runs fast afterwards). When successfully compiled it should look like this:
Continue reading
Some recent comments approved
I just waded though a lot of recent comment spam and approved the legit ones along the way. So if you posted something recently it may now appear.
Most Popular Posts and Tags
I have added a permanent page with a summary of the most popular posts on this blog. I also tried to add meaningful tags to all posts. Here are the most important tags:
Content type tags
- download — a download is available is this post
- gem — a code snippet or other copy-paste thing is available
- math — posts that are heavy on math formulae
Topic tags
- atmospheric scattering — posts related to atmospheric effects
- gamma — posts related to display gamma
- hacks of life — little shell tricks or other things
- normal mapping — posts about normal mapping
- photometry — posts related to photometry
- physically based shading — posts related to PBS (or PBR)
So, where are the stars?
In my previous rant about dynamic exposure in Elite Dangerous (which honestly applies to any other space game made to date), I made a rough calculation to predict the brightness of stars as they should realistically appear in photos taken in outer space. My prediction was, that,
- for an illumination of similar strength to that on earth,
- if the sunlit parts are properly exposed,
- and with an angular resolution of about 2 arc minutes per pixel,
then the pixel-value of a prominent star should be in the order of 1 to 3 (out of 255, in 8‑bit sRGB encoding). Since then I was curious to find some real world validation for that fact, and it seems I have now found it.
\usepackage{cmbright}
The ‘modern’ looking sans-serif font I use recently in equations on this blog is called ‘Computer Modern Bright’, and actually is not so modern at all: Designed by Walter Schmidt in 1996, it is still to date the only free sans-serif font available for
with full math support. Type‑1 versions of this font are available in the cm-super package, but I didn’t need to install anything, because apparently, the QuickLaTeX WordPress plugin has them already. The only thing to do was adding just one line to the preamble:
\usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{cmbright} % computer modern bright
I also turned on the SVG images feature that was added with version 3.8 of QuickLatex, so the equations are no longer pixellated on retina displays or when zooming in! Neat, huh?