## FreeBSD Part 2

So I tried FreeBSD in VirtualBox. Step 2 was to try and install it on my Thinkpad. Unfortunately, I am having boot issues. Perhaps it was too many operating systems. I deleted everything but Windows 10 and then reinstalled Fedora 29. I may try again on my Intel NUC that I am currently using PopOS with. In the mean time, the Raspberry Pi 3 is getting a go at it. The wifi does not work, so it is tethered to my router so I can install X11. I used the image from the FreeBSD website. When I get everything installed, we’ll see how the experience is.

## Playing with FreeBSD 12

So my use case is run FreeBSD in VirtualBox in Windows. The first experiment ended up in failure, but not because I was using Windows, rather because I can’t get the X server to behave. So I will need to attempt this again. I will say that my goal is to do 3D graphics and game development.

However, I did discover some neat things I can use this OS for. For instance, I am rediscovering WindowMaker. I thought it was cool that the PlayStation 2 Linux Kit used it as the default window manager. I used it often in the 1990’s. It still looks good. But, it doesn’t work out of the box for any kind of real work.

There are several packages I am trying: redshift, compton, and xdg-user-dirs, xscreensaver. Anyways, here is my current pkg install command list.

pkg install bash tmux htop vim emacs w3m wget curl nano
pkg install xorg slim windowmaker enlightenment wmakerconf
pkg install redshift compton xdg-user-dirs xscreensaver xeyes
pkg install firefox gimp
pkg install ...

I will note that I find it ironic that it takes 1 gigabyte to do the first line which are supposed to be command line utilities! By using emacs-nox and vim-console, it goes down to 279 MiB instead. These are the dockapps I installed for WindowMaker.

pkg install wmcpuload wmclock wmnetload wmsystemtray wmtop wmmemload
pkg install inconsolata-ttf

The Xdefaults file needs to be updated so that xterm doesn’t look too small. I use the following settings:

*xterm*foreground: #cfcfcf
*xterm*background: #000000
*xterm*font: xft:Inconsolata:size=16

## C++ Vector and Matrix Library

I am working on an open source Vector and Matrix Library for C++ and TypeScript. I am calling it FluxionsGTE and FluxionsWebGTE, respectively.

// TypeScript
class Vector3 {
constructor(public x: number = 0, public y: number = 0, public z: number = 0) { }
}
// C++
template <class T>
class TVector3
{
public:
T x, y, z;

TVector3(T x = T(0), T y = T(0), T z = T(0)) { }
};

using Vector3f = TVector3<float>;

## Conversion between specular exponent, specular roughness, and specular glossiness

Ever need to convert between specular exponent, roughness, and glossiness? for the Blinn-Phong BRDF, these three values represent the same concept. Specular Exponent is the actual value used to compute the BRDF. Let’s call that variable $e$. The roughness $m$ and glossiness $g$ values are numbers between 0 and 1 and they are additive inverses of each other. In other words

$$g = 1 – m \, ,$$

$$m = 1 – g \, .$$

The exponent is given by

$$e = \frac{2}{m^2} – 2$$

or

$$e = \frac{2}{{(1 – g)}^2} – 2 \, .$$

The BRDF $f_r(\omega_i, \omega_g)$ is

$$f_r(\omega_i, \omega_o) = \pi \frac{F(\omega_i \cdot \omega_h) D(\omega_i) G_2(\omega_i \cdot \omega_g, \omega_o \cdot \omega_g)}{4 (\omega_i \cdot \omega_g) (\omega_o \cdot \omega_g)}$$

where Blinn-Phong $D(\omega_i)$ is given by

$$D_{\mathrm{Blinn-Phong}}(\omega_i, \omega_h, e) = \frac{e+2}{2\pi} (\omega_i \cdot \omega_h)^e$$

and the resulting specular illumination is given by
$$\mathbf{L}_o = f_r(\omega_i, \omega_o) \mathbf{L}_i (\omega_i) \mathbf{V}_i (\omega_i) (\omega_g \cdot \omega_i) \, .$$

## Commodore VIC 20 NTSC and PAL colour/color palettes

I’m posting this mostly so I can look at the colors any time I want.

NTSC

PAL

## 1hgj 102: Eats Shoots & Leaves (to the left)

The theme to this past #OneHourGameJam was to make a game based to the object of the left. My main goal was to make a game where a player can fire a projectile towards an enemy that is pursuing the player. Halfway through as I was making a sprite for a spaceship, the idea of a panda seemed appealing. So I made the game with a panda who can only fire in the left direction.

https://www.mfactorgames.com/games/1hgj_102

## The Lost Button (One Hour Game Jam 101)

A man has ten buttons. When one button gets lost, he starts his quest to find it. To play, simply click the button. To hear the music, turn up the volume.

To play The Last Button, please go to the following link. To see other games from One Hour Game Jam 101, go to www.onehourgamejam.com.

## One Hour Game Jam #101

Last blog post, I mentioned One Hour Game Jam which happens every Saturday. So this week, I’m going to jump in and make my first entry since LD29 a few years ago. I’ll probably dust off the old LD29 Manifold code and get ready for the compo.

I have already been practicing making music in 10 minutes or less. Several times this week, the composing bug hit me and I’m confident of putting something together in 15 minutes. But either workflow has something to do with it or being distracted by sound design is.

I have recently taken a sampling approach to this problem. Ableton Live has been the tool of choice lately and recording clips and then sequencing them is very time effective. It is very important to decide what core set of sounds will be needed so that the note entry takes up most of the time. Using an APC40mkii is then very easy to record the sequence of clips using its scene launch capability.

For this weekend, the computer will be set up just for that. The hardware synthesizers will be configured and ready to go and all the tracks will be set to record their respective sounds. The mastering track will be set so exporting the master audio is streamlined.

It’ll be exciting to see what this weekends compo will bring out musically. Can’t wait… In the meantime, warming up to the 21 day challenge, lets dust off the game engine.