2015年11月26日木曜日

セカント法を用いた逆関数補間テーブル

セカント法(Secant Method)
$x_{n+1}=x_n - f(x_n)\frac{x_n - x_{n-1}}{f(x_n)-f(x_{n-1})}$
で逆関数の値を事前に計算し, 後に線形補間で求めるメモ.

2015年11月23日月曜日

Ericsson Texture Compression 1に透過情報を入れる

Unity 3D用のコンバータを作成してみる.
https://github.com/taqu/YUVDither

ETC1 に無理やり透過情報を入れる.

2015年11月17日火曜日

Unity3D RenderTextureから, RenderTargetIdentifierを作成

renderTexture = new RenderTexture(
    width,
    height,
    24,
    RenderTextureFormat.Default,
    RenderTextureReadWrite.Default);

CommandBuffer commandBuffer = new CommandBuffer();

int screenCopyID1 = Shader.PropertyToID("_Temp1");
commandBuffer.GetTemporaryRT(
    screenCopyID1,
    width, height, 0,
    FilterMode.Bilinear);

RenderTargetIdentifier renderTargetId = new RenderTargetIdentifier(renderTexture);
commandBuffer.Blit(renderTargetId, screenCopyID1);
てな感じで, コマンドバッファに組み込んでいける.

2015年10月30日金曜日

Low-Discrepancy Sampling

Efficient Multidimensional Sampling
がレイトレース用のサンプリングとして, いい感じ.
PBRT本では, 計算の仕方は異なるが同じものなはず.

2015年10月18日日曜日

Unity3D 16bit ディザリング

テクスチャリソースのインポート処理時に,
ディザリング処理して16ビットに変換する.
Contrast Aware Halftoningを実装.

https://github.com/taqu/Dither


2015年9月14日月曜日

Bounding Volume Hierarchy 01

既存のコードはQBVHだが, すでに古いらしいので, 古典から順番に作成中.

2015年9月5日土曜日

チューリング先生のマラソン記録

チューリング先生のマラソンベストタイムは, 2時間46分だそうです. 1940年前後のオリンピックマラソン金メダリストの記録は, 2時間30分前後でした. 世のプログラマは斯くあるべきと思う. 私は現在のシューズや舗装路の進化がありながら, 約30分離されている.