Real-Time Physically Based Rendering and BRDFs

_config.yml

The topic of lighting algorithms can be confusing, so this article will break down the building blocks of lighting, introducing each element from the most simple models to a physically based one which can render a range of metals and plastics, of varying roughness in a single Unity3D ShaderLab prgram.

The listing for this article is available in the a Gist.

Read More

Retro Supersampling

Modern systems have a lot more functionaliy than classic ones, except for the ability to render non-square pictures as unlike CRTs, modern displays have fixed square pixels. This means when drawing at the correct aspect ratio there is no direct mapping of pixels between displays at any scale. Emulators usually handle this by using an incorrect aspect ratio and scaling at a round multiple, but a full screen scaling isn’t going to be an exact multiple of the original size.

A good way to solve this problem is supersampling the original pixels, Here is a live example in WebAssembly.

Naive nearest neighbor upscaling on the left, supersampling on the right.

_config.yml

Read More

Q Learning Explained With HTML5

In the future coding job interviews might not only ask questions about basic time-complexity such as Big O, but involve intractable problems and how to approximate solutions in realistic time-frames. Or to put it a little more bluntly, employers will want to know if you have some machine learning knowledge.

This post is about a very simple learning algorithm called Q-Learning, although simple it can be used to effectively tackle problems such as elevator scheduling, and is the underlying idea behind Alpha Go, DeepMind’s Go playing AI. The Tic Tac Toe game below has an opponent trained using Q-Learning, the algorithm should find a good strategy, try it out!

Read More

FizzBuzz in Keras

Recently my lunch hour afforded some time for one of my favourite things, promoting #DerpLearning on Twitter. So I ported Joel Grus FizzBuzz in TensorFlow to Keras.

_config.yml

New front end APIs abstracting much of the setup required for Deep Learning takes away somewhat from Joel’s joke, but I predict democratization will lead to much more advanced #DerpLearning.

This image shows Keras output vs a correct FizzBuzz. In some effort to maintain the geek comedy, there are still some errors but adjusting parameters for a correct output is trivial. Here is the Gist on GitHub.

Read More