query: tag:cg

N x Mのグリッドがあったとします。
自明ですが、マス目の数は N*M 個です。

これを K 個の長方形に分割することを考えるとき、
K 個の長方形の面積の差が高々 min(N, M) であり、各々の長方形の周の長さの和が最小となるような分割を行うアルゴリズムを求める。

posted by genki genki on Thu 18 Mar 2010 at 06:31 with 1 comment

原子と電磁波の相互作用

  • トムソン散乱
  • コンプトン散乱
  • ラマン散乱

分子レベルの相互作用

  • レイリー散乱
  • ミー散乱

See Also

posted by takiuchi takiuchi on Sun 25 Oct 2009 at 07:59 with 0 comments

ribmosaic
を使うと、
blender
からrib形式のファイルをエクスポートできるようになります。
ribmosaicのtar.gzをダウンロード後展開し、中にあるmosaic.pyファイルを
scriptsディレクトリにコピーします。

pre>>
/usr/share/belnder/scripts
<<--

scriptsディレクトリは、
たとえば上記のような場所にあります。

あとは、blenderを起動して、メニューから
"Render" -> "MOSAIC RenderMan(R) System" を選択すると、
以下のようなパネルが開きます。

スナップショット1.png

Mosaic Settingsのタブから、レンダラを選んで、Export Directoryを指定し、(R)ender Current Frame/Passesをクリックすれば、指定したディレクトリの下にMosaicディレクトリが作成され、その中にribファイルなどが一式出力されます。

posted by genki genki on Mon 18 May 2009 at 09:39 with 0 comments

ちょっと必要だったので作りました。

ss

CoreGraphicsを使って、指定したCGRectの中に、指定した太さの×印(Cross Sign)を描画するためのPathを生成します。

objective-c>>
void PDPathAddCrossSign(CGMutablePathRef path, CGRect rect, CGFloat thickness)
{
CGFloat diff = rect.size.width - rect.size.height;
rect = CGRectDeflateRect(rect, MAX(0, diff/2), MAX(0, -diff/2));
CGFloat radius = rect.size.width/2;
CGFloat d = sqrt(2)*thickness/2;
CGFloat cx = CGRectGetMidX(rect), cy = CGRectGetMidY(rect);
CGAffineTransform transform = CGAffineTransformMakeTranslation(cx, cy);
CGPathMoveToPoint(path, &transform, d, 0);
for(int i = 0; i < 4; ++i){
CGPathAddLineToPoint(path, &transform, radius, radius - d);
CGPathAddLineToPoint(path, &transform, radius - d, radius);
CGPathAddLineToPoint(path, &transform, 0, d);
transform = CGAffineTransformRotate(transform, M_PI/2.0f);
}
CGPathCloseSubpath(path);
}
<<--

中で呼び出してるCGRectDeflateRectは以下のようなものです。

objective-c>>
CGRect CGRectInflateRect(CGRect rect, CGFloat width, CGFloat height)
{
rect.origin.x -= width;
rect.origin.y -= height;
rect.size.width += width2;
rect.size.height += height
2;
return rect;
}

CGRect CGRectDeflateRect(CGRect rect, CGFloat width, CGFloat height)
{
return CGRectInflateRect(rect, -width, -height);
}
<<--

これを使う事で、任意の大きさ、太さ、色で×印を描画できます。

posted by genki genki on Wed 4 Mar 2009 at 00:06 with 0 comments

CoreGraphics
を使った角丸長方形(RoundRect)
を描画するためのメソッドです。

objective-c>>

  • (void)
    drawRoundRect:(CGRect)rect
    withRadius:(CGFloat)radius
    inContext:(CGContextRef)context
    {
    CGFloat lx = CGRectGetMinX(rect);
    CGFloat cx = CGRectGetMidX(rect);
    CGFloat rx = CGRectGetMaxX(rect);
    CGFloat by = CGRectGetMinY(rect);
    CGFloat cy = CGRectGetMidY(rect);
    CGFloat ty = CGRectGetMaxY(rect);

    CGContextMoveToPoint(context, lx, cy);
    CGContextAddArcToPoint(context, lx, by, cx, by, radius);
    CGContextAddArcToPoint(context, rx, by, rx, cy, radius);
    CGContextAddArcToPoint(context, rx, ty, cx, ty, radius);
    CGContextAddArcToPoint(context, lx, ty, lx, cy, radius);
    CGContextClosePath(context);
    CGContextDrawPath(context, kCGPathFillStroke);

}
<<--

角丸が好きなので多用しそうな気がします。
事前にStrokeやFillの色を設定してお使いください。

posted by genki genki on Tue 21 Oct 2008 at 13:10 with 0 comments

I attended the event called OoO, which is an offline meeting for offline renderists.
The word renderist means people who are making renderer or interested in it.

IMG_0188.JPG

The contents of the event is as follows.

  • Keynote by Toshiya Hachisuka
  • Report of SIGGRAPH 2008
  • An introduction of DEMO scenes.

These were all attractive and interesting.
And talks about the Larrabee also were ubiquitous.

I have a long standing issue.
The issue is if providing server-side offline renderer itself is able to be a business going concern.
Once I had tried at 2003, but it failed.
I thought it was too early and it would need a time of 5 years.
So I gave up the business and switched to make a web application.

And the 5 years went by...

The gang's all near.

posted by takiuchi takiuchi on Mon 15 Sep 2008 at 20:10 with 0 comments

テストの実行中になにげなく
MahaloDaily
を見てたら、見覚えのある大型装置が。

Youtubeの埋め込みテストも兼ねて。
OBJECTタグをそのまま貼り付ければ埋め込めます。

posted by genki genki on Tue 9 Sep 2008 at 19:07 with 0 comments

最近のレンダリングアルゴリズム研究をフォローしていて、
面白そうなものを見つけたのでメモ。

動的モンテカルロ法を用いたフォトリアリスティックレンダリングに関する研究(pdf)

relt.jpg

一瞬LS+DS+E経路問題が解けたのかと思ったのですが、
面光源なので、実際のところLDS+DS+E経路のようですね。ふむふむ。

しかし、MLTと比べて非常に効率よくレンダリングが行われているようです。MCMCのレンダリングアルゴリズムへの応用はなかなか面白そうですね。

レプリカ交換法は抽象的な乱数空間で変
異を定義しており,乱数空間での小さな変異が経路空間上で
は大きな変異になってしまうという問題がある

ふむ。これはMutationをちゃんとやってないって事かな。

posted by genki genki on Sat 19 Jul 2008 at 06:45 with 0 comments

イベントのお知らせです。

EGSR 2008の採択論文が出揃ってきたのを受けて、
OoO(=オフラインレンダラ野郎のためのオフラインレンダラについて議論するオフライン会)の第三回が開催されます。

OoO 第三回 : EGSR08 祭り

オフラインレンダラ野朗の皆様は奮ってご参加ください。

posted by genki genki on Fri 18 Jul 2008 at 04:30 with 0 comments

AS3を使ってリアルタイムレイトレをやっているサイトを見つけました。

Flash ActionScript 3.0 Raytracer

rtimg

ブラウザを使った分散レイトレも現実的になってきているのかも。

posted by genki genki on Thu 13 Mar 2008 at 14:14 with 0 comments

via Tumblr for R&D of lucille renderer.

レイトレーシングによる、各種言語のコード量と速度の比較。

Ray tracer language comparison

非常に興味深いですね。OCaml速いですね(参照)。
OoOでF#に期待がかかっていたのもうなずける。
Global Illumination Rendererを使ったベンチマークだとどうなるかな。

posted by genki genki on Wed 12 Mar 2008 at 16:51 with 0 comments

OoO workshop has been successfully held on last Sunday thanks to SGI Japan.

Syoyo, the founder of this event, had predicted the future of GPU in his presentation using a comparison of two charts which are about the Nikkei 225 index and the speed of GPU. Detail is
here.

This is the most interesting prediction about GPU I ever met. Nowadays, CPU is speeding up much faster than GPU and its power consumption is still low against GPU's.

I think that FPGA can be a competitor of CPU rather than GPU in near future. The number of gates in FPGA has become very large so that it could be used for development of very complex processor such as Raytracing Processing Unit as known as RPU.

posted by genki genki on Tue 26 Feb 2008 at 11:11 with 0 comments

イベントのお知らせです。

OoO(Offline meeting for Offline renderists)

いちおう今回のメインテーマはあって、それは OoO をオンラインでフォローするための、ompf のオフラインレンダラ版フォーラムを RoR で作ろうというものです.作っていただける方はいるので、それにときどき意見を出すみたいな。

まあでもその一方で、 MLT の実装とか, 論文書くとかしてても OK.

スライド作成が間に合えば、世界初、日本でしか聞けない(<- これ大事)、MUDA のプレゼンとかするかも.

ということで、僕は作る人として参加します。
Offline Renderingについて熱く語りましょう。

posted by genki genki on Sat 23 Feb 2008 at 02:57 with 0 comments

先日はお疲れ様。

自分にとって本当にコワイ奴は下から来るんだ

もうね、上だけを見てレンダラの巨塔を登り詰める、じゃダメなのですよ。

どんどん下から登ってくるヤツらが、自分をすっ飛ばして上に挑戦しているわけです。
私の存在?もちそんなの認識されてないよ。皆私をスルー。

同感ですね。CG研究を取り巻く環境は日に日に良くなっていく。

しかし、僕が18歳だったころには、面白い問題はあらかた先輩方に解かれて
しまった後だと、己が生まれてきたのが遅すぎた事を恨んだものでした。
問題を解決することよりも難しいのは、面白い問題を見つけること。

結局のところ、今僕がこうしてCGとは関係ないことをやっているのは、
CGの分野で、自分が一生かかっても解決できるかどうかという問題に
出会ったからですね。その問題が解かれるところが見られるのであれば、
それを解くのは自分でなくてもかまわないのかもしれない。

posted by genki genki on Mon 11 Feb 2008 at 05:34 with 0 comments

珍しくCGネタです。

2/8に東大で行われたPaul Debevec氏の
講演会
に参加しました。

New Techniques for Acquiring, Rendering, and Displaying Human Performances

Paul Debevec氏はIBLやHDRIの人として高名な方です。

もっと英語を学ばなければな。いくつか質問したいことがあったけれど、
なんと言ったら良いのかわからなかった。Ummm

聞きたかったことは、Sphere probeをActorを追いかけるように
動かして、全天周画像をキャプチャすれば、Light Stageのような
固定的な設備を用いなくてもdiffuse項の計算ができるのではないか
という事。

また、specular項に関しても、動いているシーンであれば、
時間軸に沿って変化するLight Fieldに対して、変動しない成分を
抽出することで、ある程度は計算可能なのではないかな。

Light Stageを使ったほうが高精度に求められるけど、
建設にお金がかかりそうだから、安上がりにそこそこの
Relightingをしたいぐらいなら良い気がする。

まあでも精密なNormal Mapを採集できるって事のメリットのほうが
大きいのかな。

posted by genki genki on Sat 9 Feb 2008 at 19:09 with 0 comments

まつもとさんも何度か記事を書いていたMUDA
(作者が発音してるのを聞いた感じだと「ムーダ」と読むみたい)の
サイト
がオープンしたようです。

MUDA site opens!

I’ve launched MUDA project page! Check it.

MUDA is a vector language for CPU.
Yeah, not for GPU or (dead and gone) GPGPU ;-)

I’m planning to use MUDA to code core computation part of my lucille renderer.

おめでとうございます!

posted by genki genki on Mon 10 Dec 2007 at 01:09 with 0 comments

ORF 2007
で地下展の話を聞いて興味深かったので、
日本科学未来館に行ってきました。

ticket

ボストーク湖
の展示が興味深かったです。
ほかにもいくつか面白いキーワードを採取できました。

それから、お土産店で蛍石と方解石をGet。

蛍石(左)と方解石(右)

rock

どちらの鉱石も、レンダリングアルゴリズムを考える上では、
興味深い光学特性を持っています。

posted by genki genki on Mon 26 Nov 2007 at 04:31 with 0 comments

友人の藤田さんが主催しているレンダリング・アルゴリズムのイベント、
SBR 2007 観覧会」が本日恵比寿にて開催されるので、参加してきます。

今年も様々な論文が出ていますが、個人的に気になっているのは、Benjamin Segoviaによる2つ

Eric VeachのMLTに感銘を受けたクチなので、Multiple-Try MHに興味があります。

cmlt

posted by genki genki on Sat 10 Nov 2007 at 09:56 with 0 comments