Rendering学習日記

日々3DCGの世界は進歩しているけど、勉強して理解したことをまとめていきたい。RenderMan互換レンダラーやグローバル・イルミネーション。いろんなことに好奇心を持ち面白くなってくる。目指せShader書き!!

<< Guile RMan #13 サンプルテスト | main | cgkit works under CentOS6.2 on virtualbox >>

Fujiyama Renderer 0.2.3 for Windows7 64bit

Fujiyama is free and open source, distribution oriented ray-tracing renderer

Windows 64bit Binary
http://fujiyama-renderer.com/downloads.html

Download Fujiyama-Renderer-for-Win-v0.2.3-x64.zip

Create C:\Fujiyama-Renderer folder.

コンピュータ右クリック→プロパティ→システムの詳細設定→環境変数→システム環境変数内のPATHをクリック→「編集」をクリック
変数値の行の最後に以下のパスを記入します。

;C:\Fujiyama-Renderer\bin;

clip-1.jpg

Fujiyama-Rendererフォルダ内にmeshフォルダ、mipフォルダを作ります。
PLY Dataをダウンロードします。meshフォルダにモデルデータを入れます。
dome.ply
floor.ply
teapot.ply


コマンドプロンプトより
>ply2mesh dome.ply dome.mesh
>ply2mesh floor.ply floor.mesh
>ply2mesh teapot.ply teapot.mesh

モデルデータをmeshに変換しました。

次にHDRファイルをダウンロードします。
http://gl.ict.usc.edu/Data/HighResProbes/
glacier.hdr
grace-new.hdr
をダウンロードします。mipフォルダに入れます。

コマンドプロンプトより
>hdr2mip glacier.hdr glacier.mip
>hdr2mip grace-new.hdr grace-new.mip

HDRファイルをmipファイルに変換しました。

続いてsceneフォルダのシーンをレンダリングしてみましょう。
エディタでteapot.scnを開きます。
113行目
NewTexture tex1 ../../mip/grace-new.mip

NewTexture tex1 ../mip/grace-new.mip
に変更。

123行目
NewMesh teapot_mesh ../../mesh/teapot.mesh
NewMesh floor_mesh ../../mesh/floor.mesh
NewMesh dome_mesh ../../mesh/dome.mesh

NewMesh teapot_mesh ../mesh/teapot.mesh
NewMesh floor_mesh ../mesh/floor.mesh
NewMesh dome_mesh ../mesh/dome.mesh
に変更し保存します。

レンダリングします。
sceneフォルダからコマンドプロンプトを使って
>scene teapot.scn

C:\Fujiyama-Renderer\scenes>scene teapot.scn
-- OpenPlugin: [PlasticShader]
-- OpenPlugin: [GlassShader]
-- OpenPlugin: [ConstantShader]
-- NewCamera: [cam1] [PerspectiveCamera]
-- SetProperty3: [cam1] [translate] [0] [1] [7]
-- SetProperty3: [cam1] [rotate] [-5.710593137499643] [0] [0]
-- NewLight: [light0] [PointLight]
-- SetProperty3: [light0] [translate] [0.900771] [12] [4.09137]
-- SetProperty1: [light0] [intensity] [0.03125]
-- NewLight: [light1] [PointLight]
-- SetProperty3: [light1] [translate] [2.02315] [12] [5.28021]
-- SetProperty1: [light1] [intensity] [0.03125]
-- NewLight: [light2] [PointLight]
-- SetProperty3: [light2] [translate] [10.69] [12] [13.918]
-- SetProperty1: [light2] [intensity] [0.03125]
-- NewLight: [light3] [PointLight]
-- SetProperty3: [light3] [translate] [4.28027] [12] [7.58462]
-- SetProperty1: [light3] [intensity] [0.03125]
-- NewLight: [light4] [PointLight]
-- SetProperty3: [light4] [translate] [12.9548] [12] [1.19914]
-- SetProperty1: [light4] [intensity] [0.03125]
-- NewLight: [light5] [PointLight]
-- SetProperty3: [light5] [translate] [6.55808] [12] [2.31772]
-- SetProperty1: [light5] [intensity] [0.03125]
-- NewLight: [light6] [PointLight]
-- SetProperty3: [light6] [translate] [0.169064] [12] [10.9623]
-- SetProperty1: [light6] [intensity] [0.03125]
-- NewLight: [light7] [PointLight]
-- SetProperty3: [light7] [translate] [1.25002] [12] [4.51314]
-- SetProperty1: [light7] [intensity] [0.03125]
-- NewLight: [light8] [PointLight]
-- SetProperty3: [light8] [translate] [2.46758] [12] [5.73382]
-- SetProperty1: [light8] [intensity] [0.03125]
-- NewLight: [light9] [PointLight]
-- SetProperty3: [light9] [translate] [3.55644] [12] [6.84334]
-- SetProperty1: [light9] [intensity] [0.03125]
-- NewLight: [light10] [PointLight]
-- SetProperty3: [light10] [translate] [4.76112] [12] [8.00264]
-- SetProperty1: [light10] [intensity] [0.03125]
-- NewLight: [light11] [PointLight]
-- SetProperty3: [light11] [translate] [13.3267] [12] [9.10333]
-- SetProperty1: [light11] [intensity] [0.03125]
-- NewLight: [light12] [PointLight]
-- SetProperty3: [light12] [translate] [14.4155] [12] [2.68084]
-- SetProperty1: [light12] [intensity] [0.03125]
-- NewLight: [light13] [PointLight]
-- SetProperty3: [light13] [translate] [8.10755] [12] [3.79629]
-- SetProperty1: [light13] [intensity] [0.03125]
-- NewLight: [light14] [PointLight]
-- SetProperty3: [light14] [translate] [9.21103] [12] [4.9484]
-- SetProperty1: [light14] [intensity] [0.03125]
-- NewLight: [light15] [PointLight]
-- SetProperty3: [light15] [translate] [2.83469] [12] [6.09221]
-- SetProperty1: [light15] [intensity] [0.03125]
-- NewLight: [light16] [PointLight]
-- SetProperty3: [light16] [translate] [4.00945] [12] [7.18302]
-- SetProperty1: [light16] [intensity] [0.03125]
-- NewLight: [light17] [PointLight]
-- SetProperty3: [light17] [translate] [12.6072] [12] [0.832089]
-- SetProperty1: [light17] [intensity] [0.03125]
-- NewLight: [light18] [PointLight]
-- SetProperty3: [light18] [translate] [6.21169] [12] [1.98055]
-- SetProperty1: [light18] [intensity] [0.03125]
-- NewLight: [light19] [PointLight]
-- SetProperty3: [light19] [translate] [7.39599] [12] [10.5563]
-- SetProperty1: [light19] [intensity] [0.03125]
-- NewLight: [light20] [PointLight]
-- SetProperty3: [light20] [translate] [8.52421] [12] [4.15086]
-- SetProperty1: [light20] [intensity] [0.03125]
-- NewLight: [light21] [PointLight]
-- SetProperty3: [light21] [translate] [9.5891] [12] [5.39715]
-- SetProperty1: [light21] [intensity] [0.03125]
-- NewLight: [light22] [PointLight]
-- SetProperty3: [light22] [translate] [3.18967] [12] [13.9542]
-- SetProperty1: [light22] [intensity] [0.03125]
-- NewLight: [light23] [PointLight]
-- SetProperty3: [light23] [translate] [4.41432] [12] [0.082813]
-- SetProperty1: [light23] [intensity] [0.03125]
-- NewLight: [light24] [PointLight]
-- SetProperty3: [light24] [translate] [5.48803] [12] [1.21856]
-- SetProperty1: [light24] [intensity] [0.03125]
-- NewLight: [light25] [PointLight]
-- SetProperty3: [light25] [translate] [6.57647] [12] [2.31432]
-- SetProperty1: [light25] [intensity] [0.03125]
-- NewLight: [light26] [PointLight]
-- SetProperty3: [light26] [translate] [0.265098] [12] [10.9453]
-- SetProperty1: [light26] [intensity] [0.03125]
-- NewLight: [light27] [PointLight]
-- SetProperty3: [light27] [translate] [8.84422] [12] [12.1117]
-- SetProperty1: [light27] [intensity] [0.03125]
-- NewLight: [light28] [PointLight]
-- SetProperty3: [light28] [translate] [10.0154] [12] [5.67625]
-- SetProperty1: [light28] [intensity] [0.03125]
-- NewLight: [light29] [PointLight]
-- SetProperty3: [light29] [translate] [11.0907] [12] [14.4043]
-- SetProperty1: [light29] [intensity] [0.03125]
-- NewLight: [light30] [PointLight]
-- SetProperty3: [light30] [translate] [4.71726] [12] [7.98851]
-- SetProperty1: [light30] [intensity] [0.03125]
-- NewLight: [light31] [PointLight]
-- SetProperty3: [light31] [translate] [13.3907] [12] [9.08986]
-- SetProperty1: [light31] [intensity] [0.03125]
-- NewTexture: [tex1] [../mip/grace-new.mip]
-- NewShader: [teapot_shader] [GlassShader]
-- NewShader: [floor_shader] [PlasticShader]
-- NewShader: [dome_shader] [ConstantShader]
-- NewMesh: [teapot_mesh] [../mesh/teapot.mesh]
-- NewMesh: [floor_mesh] [../mesh/floor.mesh]
-- NewMesh: [dome_mesh] [../mesh/dome.mesh]
-- NewObjectInstance: [teapot1] [teapot_mesh]
-- AssignShader: [teapot1] [teapot_shader]
-- NewObjectInstance: [floor1] [floor_mesh]
-- SetProperty3: [floor1] [translate] [-2] [0] [-2]
-- AssignShader: [floor1] [floor_shader]
-- NewObjectInstance: [dome1] [dome_mesh]
-- SetProperty3: [dome1] [scale] [.5] [.5] [.5]
-- SetProperty3: [dome1] [rotate] [0] [30] [0]
-- AssignShader: [dome1] [dome_shader]
-- AssignTexture: [dome_shader] [texture] [tex1]
-- NewObjectGroup: [group1]
-- AddObjectToGroup: [group1] [teapot1]
-- AssignObjectGroup: [teapot1] [shadow_target] [group1]
-- AssignObjectGroup: [floor1] [shadow_target] [group1]
-- NewFrameBuffer: [fb1] [rgba]
-- NewRenderer: [ren1]
-- AssignCamera: [ren1] [cam1]
-- AssignFrameBuffer: [ren1] [fb1]
-- SetProperty2: [ren1] [resolution] [640] [480]
-- RenderScene: [ren1]

# Building Accelerators
# Accelerator Count: 8
# Building Accelerators Done
# 0h 0m 1s

# Preprocessing Lights
# Light Count: 32
# Preprocessing Lights Done
# 0h 0m 1s

# Rendering Frame
# Thread Count: 12
# Tile Count: 80

....1....2....3....4....5....6....7....8....9....0
-------------------------------------------------- 10% (0h 0m 1s)
....1....2....3....4....5....6....7....8....9....0
-------------------------------------------------- 20% (0h 0m 1s)
....1....2....3....4....5....6....7....8....9....0
-------------------------------------------------- 30% (0h 0m 1s)
....1....2....3....4....5....6....7....8....9....0
-------------------------------------------------- 40% (0h 0m 1s)
....1....2....3....4....5....6....7....8....9....0
-------------------------------------------------- 50% (0h 0m 2s)
....1....2....3....4....5....6....7....8....9....0
-------------------------------------------------- 60% (0h 0m 5s)
....1....2....3....4....5....6....7....8....9....0
-------------------------------------------------- 70% (0h 0m 10s)
....1....2....3....4....5....6....7....8....9....0
-------------------------------------------------- 80% (0h 0m 11s)
....1....2....3....4....5....6....7....8....9....0
-------------------------------------------------- 90% (0h 0m 12s)
....1....2....3....4....5....6....7....8....9....0
-------------------------------------------------- 100% (0h 0m 16s)

# Frame Done
# 0h 0m 16s

-- SaveFrameBuffer: [fb1] [../teapot.fb]

画像を確認します。コマンドプロンプトを使って
>fbview ../teapot.fb

ウインドウを広くしてあげると良いです。
clip-2.jpg

OpenEXRファイルに変換するには、変換したいfbファイルがある場所で
コマンドプロンプトを使って
>fb2exr teapot.fb teapot.exr

fujiyama rendererでpythonを使う場合、fujiyama/bin/フォルダにfujiyama.pyをコピーします。
fujiyama.pyファイルを開いて、31と41行目のbin/sceneと二箇所書いてあるところのbin/を削除して保存します。後はset pythonpath=で通してからレンダリングを行います。

>set PYTHONPATH=C:\Python26;C:\Fujiyama-Renderer\bin

例えば、
>python sample.py
でimport fujiyamaが動き、レンダリングします。
シーンファイル内の各モデルや画像のパスを調整してからレンダリングしてください。
Fujiyama Renderer | - | -