Skip to content

Instantly share code, notes, and snippets.

Battling i16n demons

Hakanai hakanai

Battling i16n demons
View GitHub Profile
hakanai /
Last active Jul 2, 2021
RFL File Format Notes

RFL File Format Notes

The RFL file format was used by Wavefront's Advanced Visualizer software to store "spectral curve data", which is essentially a way to encode the response of a material to different wavelengths of light.

The docs for the [MTL file format][1] frequently refer to this format, but never seem to include the documentation for the format.

hakanai /
Created Aug 30, 2020
Blender script to perform conformal mapping from unit square to unit circle
import numpy
import bpy
import bmesh
from math import sqrt, floor
from bpy import context
from scipy.special import ellipj, ellipk
Kval = ellipk(0.5) # 1.8540746773013719
def elliptical_map(x, y):
hakanai / ELRaymarchBase.cginc
Created May 28, 2020
Implementing raycast abstraction by defining a raymarch abstraction
View ELRaymarchBase.cginc
#include "ELRaycastBase.cginc"
float2 ELMap(float3 objectPos);
float3 ELRaymarchNormal(in float3 objectPos)
static const float2 e = fixed2(0.000001, -0.000001);
hakanai / MagicDieV3.cginc
Created May 28, 2020
Shader code reuse prototype
View MagicDieV3.cginc
#include "../Common/ELRaycastBase.cginc"
#include "../Common/ELRaycastFunctions.cginc"
// Input / Output Data Structures
struct FragmentInput
hakanai / WhichCamera.cginc
Created Oct 11, 2019
Stashing this for safekeeping
View WhichCamera.cginc
bool isVR() {
return true;
return false;
bool isVRHandCamera() {
hakanai /
Created Sep 26, 2019
Demonstration of Java's HTTP client caching credentials when you don't want it
public class AuthenticationLeakBugDemo
public static void main(String[] args) throws Exception
// User 1
hakanai / han-unification.html
Created Aug 26, 2019
Quick test of differing renderings of the same Unicode character based on the language being rendered.
View han-unification.html
<title>Han Unification Test</title>
<style type="text/css">
* { font-family: 'Noto Serif CJK JP'; }
<li>zh-CN: <span lang="zh-CN"></span></li>
hakanai /
Created Jun 6, 2019
Small JxBrowser example for crash reproduction
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JMenuBar;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
hakanai / example.groovy
Created May 28, 2019
Reusing file sets in Gradle builds
View example.groovy
def commonCrap = copySpec {
from('dir1') {
include '**/*.jar'
from('dir2') {
include '**/*.dll'
task copy1(type: Copy) {
hakanai / Jenkinsfile-fragment.groovy
Last active May 24, 2019
Is it possible to do _this_ in Jenkins pipeline?
View Jenkinsfile-fragment.groovy
pipeline {
// ...
stages {
// ...
customMatrix {
matrix [name: 'debian', prettyName: 'Debian'],
[name: 'ubuntu', prettyName: 'Ubuntu'],
[name: 'centos', prettyName: 'CentOS'],
[name: 'macos', prettyName: 'macOS'],
[name: 'windows', prettyName: 'Windows']