<< 4/4
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;
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
ウインドウを広くしてあげると良いです。
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 0.2.8 for Windows 64bit
Fujiyama Renderer0.2.8、メタセコイアmekaをobj→blenderでply出力。s,tをuv1,uv2に書き換え、textureをjpgにして読み込みました。直接jpgやobjやplyを読み込みできるようになったのでちょっと便利になりました。ありがとうございます。
floor.plyをblenderで読み込み、UV editingでunwrapし、obj exportしました。
以下はサンプル
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.6/site-packages/:$HOME/Fujiyama-Renderer/bin/
#set PYTHONPATH=C:\Python26;C:\Fujiyama-Renderer\python
import fujiyama
si = fujiyama.SceneInterface()
#plugins
si.OpenPlugin('ConstantShader')
si.OpenPlugin('PlasticShader')
si.OpenPlugin('GlassShader')
#Camera
si.NewCamera('cam1', 'PerspectiveCamera')
si.SetProperty3('cam1', 'rotate', -20, 0.00, 0.00)
si.SetProperty3('cam1', 'translate', 0.00, 6.00, 7.00)
si.SetProperty1('cam1', 'fov', 45)
#Light
si.NewLight( 'light0', 'PointLight')
si.SetProperty3( 'light0', 'translate', 0.900771, 12, 4.09137)
si.SetProperty1( 'light0', 'intensity', 0.03125)
si.NewLight( 'light1', 'PointLight')
si.SetProperty3( 'light1', 'translate', 2.02315, 12, 5.28021)
si.SetProperty1( 'light1' ,'intensity', 0.03125)
si.NewLight( 'light2', 'PointLight')
si.SetProperty3( 'light2', 'translate', 10.69, 12, 13.918)
si.SetProperty1( 'light2', 'intensity', 0.03125)
si.NewLight( 'light3', 'PointLight')
si.SetProperty3( 'light3', 'translate', 4.28027, 12, 7.58462)
si.SetProperty1( 'light3', 'intensity', 0.03125)
si.NewLight( 'light4', 'PointLight')
si.SetProperty3( 'light4', 'translate', 12.9548, 12, 1.19914)
si.SetProperty1( 'light4', 'intensity', 0.03125)
si.NewLight( 'light5', 'PointLight')
si.SetProperty3( 'light5', 'translate', 6.55808, 12, 2.31772)
si.SetProperty1( 'light5', 'intensity', 0.03125)
si.NewLight( 'light6', 'PointLight')
si.SetProperty3( 'light6', 'translate', 0.169064, 12, 10.9623)
si.SetProperty1( 'light6', 'intensity', 0.03125)
si.NewLight( 'light7', 'PointLight')
si.SetProperty3( 'light7', 'translate', 1.25002, 12, 4.51314)
si.SetProperty1( 'light7', 'intensity', 0.03125)
si.NewLight( 'light8', 'PointLight')
si.SetProperty3( 'light8', 'translate', 2.46758, 12, 5.73382)
si.SetProperty1( 'light8', 'intensity', 0.03125)
si.NewLight( 'light9', 'PointLight')
si.SetProperty3( 'light9', 'translate', 3.55644, 12, 6.84334)
si.SetProperty1( 'light9','intensity', 0.03125)
si.NewLight( 'light10', 'PointLight')
si.SetProperty3( 'light10', 'translate', 4.76112, 12, 8.00264)
si.SetProperty1( 'light10', 'intensity', 0.03125)
si.NewLight( 'light11', 'PointLight')
si.SetProperty3( 'light11', 'translate', 13.3267,12, 9.10333)
si.SetProperty1( 'light11', 'intensity', 0.03125)
si.NewLight( 'light12', 'PointLight')
si.SetProperty3( 'light12', 'translate', 14.4155, 12, 2.68084)
si.SetProperty1( 'light12', 'intensity', 0.03125)
si.NewLight( 'light13', 'PointLight')
si.SetProperty3( 'light13', 'translate', 8.10755, 12, 3.79629)
si.SetProperty1( 'light13', 'intensity', 0.03125)
si.NewLight( 'light14', 'PointLight')
si.SetProperty3( 'light14', 'translate', 9.21103, 12, 4.9484)
si.SetProperty1( 'light14', 'intensity', 0.03125)
si.NewLight( 'light15', 'PointLight')
si.SetProperty3( 'light15', 'translate', 2.83469, 12, 6.09221)
si.SetProperty1( 'light15', 'intensity', 0.03125)
si.NewLight( 'light16', 'PointLight')
si.SetProperty3( 'light16', 'translate', 4.00945, 12, 7.18302)
si.SetProperty1( 'light16', 'intensity', 0.03125)
si.NewLight( 'light17', 'PointLight')
si.SetProperty3( 'light17', 'translate', 12.6072, 12, 0.832089)
si.SetProperty1( 'light17', 'intensity', 0.03125)
si.NewLight( 'light18', 'PointLight')
si.SetProperty3( 'light18', 'translate', 6.21169, 12, 1.98055)
si.SetProperty1( 'light18', 'intensity', 0.03125)
si.NewLight( 'light19', 'PointLight')
si.SetProperty3( 'light19', 'translate', 7.39599, 12, 10.5563)
si.SetProperty1( 'light19', 'intensity', 0.03125)
si.NewLight( 'light20', 'PointLight')
si.SetProperty3( 'light20', 'translate', 8.52421, 12, 4.15086)
si.SetProperty1( 'light20', 'intensity', 0.03125)
si.NewLight( 'light21', 'PointLight')
si.SetProperty3( 'light21', 'translate', 9.5891, 12, 5.39715)
si.SetProperty1( 'light21', 'intensity', 0.03125)
si.NewLight( 'light22', 'PointLight')
si.SetProperty3( 'light22', 'translate', 3.18967, 12, 13.9542)
si.SetProperty1( 'light22', 'intensity', 0.03125)
si.NewLight( 'light23','PointLight')
si.SetProperty3( 'light23', 'translate', 4.41432, 12, 0.082813)
si.SetProperty1( 'light23', 'intensity', 0.03125)
si.NewLight( 'light24', 'PointLight')
si.SetProperty3( 'light24', 'translate', 5.48803, 12, 1.21856)
si.SetProperty1( 'light24', 'intensity', 0.03125)
si.NewLight( 'light25', 'PointLight')
si.SetProperty3( 'light25', 'translate', 6.57647, 12, 2.31432)
si.SetProperty1( 'light25', 'intensity', 0.03125)
si.NewLight( 'light26', 'PointLight')
si.SetProperty3( 'light26', 'translate', 0.265098, 12, 10.9453)
si.SetProperty1( 'light26', 'intensity', 0.03125)
si.NewLight( 'light27', 'PointLight')
si.SetProperty3( 'light27', 'translate', 8.84422, 12, 12.1117)
si.SetProperty1( 'light27', 'intensity', 0.03125)
si.NewLight( 'light28', 'PointLight')
si.SetProperty3( 'light28', 'translate', 10.0154, 12, 5.67625)
si.SetProperty1( 'light28', 'intensity', 0.03125)
si.NewLight( 'light29', 'PointLight')
si.SetProperty3( 'light29', 'translate', 11.0907, 12, 14.4043)
si.SetProperty1( 'light29', 'intensity', 0.03125)
si.NewLight( 'light30', 'PointLight')
si.SetProperty3( 'light30', 'translate', 4.71726, 12, 7.98851)
si.SetProperty1( 'light30', 'intensity', 0.03125)
si.NewLight( 'light31', 'PointLight')
si.SetProperty3( 'light31', 'translate', 13.3907, 12, 9.08986)
si.SetProperty1( 'light31', 'intensity', 0.03125)
#Texture
si.NewTexture( 'tex1', '../hdr/ennis.hdr')
si.NewTexture('tex2', '../hdr/uvmap.jpg')
si.NewTexture('tex3', '../hdr/00tex_master.jpg')
#Shader
si.NewShader('teapot_shader', 'PlasticShader')
si.NewShader('floor_shader', 'PlasticShader')
si.NewShader('dome_shader', 'ConstantShader')
#Mesh
si.NewMesh('teapot_mesh', '../ply/meka.ply')
si.NewMesh('floor_mesh', '../ply/floor3.obj')
si.NewMesh('dome_mesh', '../ply/dome.ply')
#ObjectInstance
si.NewObjectInstance('teapot1','teapot_mesh')
si.SetProperty3('teapot1', 'translate', 0, 0, -2)
si.SetProperty3('teapot1', 'scale', 1.6, 1.6, 1.6)
si.AssignShader('teapot1','teapot_shader')
si.AssignTexture('teapot_shader', 'diffuse_map', 'tex3')
si.NewObjectInstance('floor1','floor_mesh')
si.SetProperty3('floor1','translate', 0, 0, -2.5)
si.SetProperty3('floor1','scale', .6, .6, .6)
si.SetProperty3('floor1','rotate', 90, 0, 0)
si.AssignShader('floor1','floor_shader')
si.AssignTexture('floor_shader', 'diffuse_map', 'tex2')
si.NewObjectInstance('dome1','dome_mesh')
si.SetProperty3( 'dome1', 'scale', .5, .5, .5)
si.SetProperty3( 'dome1', 'rotate', 0 ,135, 0)
si.AssignShader( 'dome1', 'dome_shader')
si.AssignTexture( 'dome_shader' ,'texture', 'tex1')
#ObjectGroup
si.NewObjectGroup( 'group1')
si.AddObjectToGroup( 'group1', 'teapot1')
si.AssignObjectGroup( 'teapot1','shadow_target', 'group1')
si.AssignObjectGroup( 'floor1','shadow_target', 'group1')
#FrameBuffer
si.NewFrameBuffer('fb1', 'rgba')
#Properties
si.ShowPropertyList('Renderer')
#Renderer
si.NewRenderer('ren1')
si.AssignCamera('ren1', 'cam1')
si.AssignFrameBuffer('ren1', 'fb1')
#si.SetProperty2('ren1', 'resolution', 1024, 600)
si.SetProperty2('ren1', 'resolution', 512, 300)
#si.SetProperty2('ren1', 'resolution', 160, 120)
si.SetProperty1('ren1', 'raymarch_step', .01)
si.SetProperty1('ren1', 'raymarch_shadow_step', .02)
si.SetProperty1('ren1', 'raymarch_reflect_step', .02)
#Rendering
si.RenderScene('ren1')
#Output
si.SaveFrameBuffer('fb1', '../teapotscn03.exr')
#Run commands
si.Run()
#si.Print()
ありがとうございます。
MagicaVoxelからFujiyama Rendererへ
Fujiyama Renderer0.2.9、MagicaVoxelからobjをexport。blenderに読み込みply出力。s,tをuv1,uv2に書き換え、textureをjpgにして読み込みました。直接jpgやplyを読み込んでます。objの表示に影が出るのでplyを使います。
Magicavoxelのtextureは拡大。Magicavoxelからobj出力時のテクスチャは1 x 256pixels、変換できないので、100 x 256にしたらできました。ありがとうございます。
#!/usr/bin/env python
#set PYTHONPATH=C:\Python27;C:\Fujiyama-Renderer\python
# 1 teapot with 32 point lights
# This script is the python version of teapot.scn with minor changes.
# It also demonstrates how to load *.ply and *.hdr files
# directly without pre-conversion.
# Copyright (c) 2011-2014 Hiroshi Tsubokawa
import fujiyama
si = fujiyama.SceneInterface()
#plugins
si.OpenPlugin('PlasticShader')
si.OpenPlugin('GlassShader')
si.OpenPlugin('ConstantShader')
#Camera
si.NewCamera('cam1', 'PerspectiveCamera')
si.SetProperty3('cam1', 'translate', 0, 1, 7)
si.SetProperty3('cam1', 'rotate', -5.710593137499643, 0, 0)
#Light
si.NewLight('light0', 'PointLight')
si.SetProperty3('light0', 'translate', 0.900771, 12, 4.09137)
si.SetProperty1('light0', 'intensity', 0.03125)
si.NewLight('light1', 'PointLight')
si.SetProperty3('light1', 'translate', 2.02315, 12, 5.28021)
si.SetProperty1('light1', 'intensity', 0.03125)
si.NewLight('light2', 'PointLight')
si.SetProperty3('light2', 'translate', 10.69, 12, 13.918)
si.SetProperty1('light2', 'intensity', 0.03125)
si.NewLight('light3', 'PointLight')
si.SetProperty3('light3', 'translate', 4.28027, 12, 7.58462)
si.SetProperty1('light3', 'intensity', 0.03125)
si.NewLight('light4', 'PointLight')
si.SetProperty3('light4', 'translate', 12.9548, 12, 1.19914)
si.SetProperty1('light4', 'intensity', 0.03125)
si.NewLight('light5', 'PointLight')
si.SetProperty3('light5', 'translate', 6.55808, 12, 2.31772)
si.SetProperty1('light5', 'intensity', 0.03125)
si.NewLight('light6', 'PointLight')
si.SetProperty3('light6', 'translate', 0.169064, 12, 10.9623)
si.SetProperty1('light6', 'intensity', 0.03125)
si.NewLight('light7', 'PointLight')
si.SetProperty3('light7', 'translate', 1.25002, 12, 4.51314)
si.SetProperty1('light7', 'intensity', 0.03125)
si.NewLight('light8', 'PointLight')
si.SetProperty3('light8', 'translate', 2.46758, 12, 5.73382)
si.SetProperty1('light8', 'intensity', 0.03125)
si.NewLight('light9', 'PointLight')
si.SetProperty3('light9', 'translate', 3.55644, 12, 6.84334)
si.SetProperty1('light9', 'intensity', 0.03125)
si.NewLight('light10', 'PointLight')
si.SetProperty3('light10', 'translate', 4.76112, 12, 8.00264)
si.SetProperty1('light10', 'intensity', 0.03125)
si.NewLight('light11', 'PointLight')
si.SetProperty3('light11', 'translate', 13.3267, 12, 9.10333)
si.SetProperty1('light11', 'intensity', 0.03125)
si.NewLight('light12', 'PointLight')
si.SetProperty3('light12', 'translate', 14.4155, 12, 2.68084)
si.SetProperty1('light12', 'intensity', 0.03125)
si.NewLight('light13', 'PointLight')
si.SetProperty3('light13', 'translate', 8.10755, 12, 3.79629)
si.SetProperty1('light13', 'intensity', 0.03125)
si.NewLight('light14', 'PointLight')
si.SetProperty3('light14', 'translate', 9.21103, 12, 4.9484)
si.SetProperty1('light14', 'intensity', 0.03125)
si.NewLight('light15', 'PointLight')
si.SetProperty3('light15', 'translate', 2.83469, 12, 6.09221)
si.SetProperty1('light15', 'intensity', 0.03125)
si.NewLight('light16', 'PointLight')
si.SetProperty3('light16', 'translate', 4.00945, 12, 7.18302)
si.SetProperty1('light16', 'intensity', 0.03125)
si.NewLight('light17', 'PointLight')
si.SetProperty3('light17', 'translate', 12.6072, 12, 0.832089)
si.SetProperty1('light17', 'intensity', 0.03125)
si.NewLight('light18', 'PointLight')
si.SetProperty3('light18', 'translate', 6.21169, 12, 1.98055)
si.SetProperty1('light18', 'intensity', 0.03125)
si.NewLight('light19', 'PointLight')
si.SetProperty3('light19', 'translate', 7.39599, 12, 10.5563)
si.SetProperty1('light19', 'intensity', 0.03125)
si.NewLight('light20', 'PointLight')
si.SetProperty3('light20', 'translate', 8.52421, 12, 4.15086)
si.SetProperty1('light20', 'intensity', 0.03125)
si.NewLight('light21', 'PointLight')
si.SetProperty3('light21', 'translate', 9.5891, 12, 5.39715)
si.SetProperty1('light21', 'intensity', 0.03125)
si.NewLight('light22', 'PointLight')
si.SetProperty3('light22', 'translate', 3.18967, 12, 13.9542)
si.SetProperty1('light22', 'intensity', 0.03125)
si.NewLight('light23', 'PointLight')
si.SetProperty3('light23', 'translate', 4.41432, 12, 0.082813)
si.SetProperty1('light23', 'intensity', 0.03125)
si.NewLight('light24', 'PointLight')
si.SetProperty3('light24', 'translate', 5.48803, 12, 1.21856)
si.SetProperty1('light24', 'intensity', 0.03125)
si.NewLight('light25', 'PointLight')
si.SetProperty3('light25', 'translate', 6.57647, 12, 2.31432)
si.SetProperty1('light25', 'intensity', 0.03125)
si.NewLight('light26', 'PointLight')
si.SetProperty3('light26', 'translate', 0.265098, 12, 10.9453)
si.SetProperty1('light26', 'intensity', 0.03125)
si.NewLight('light27', 'PointLight')
si.SetProperty3('light27', 'translate', 8.84422, 12, 12.1117)
si.SetProperty1('light27', 'intensity', 0.03125)
si.NewLight('light28', 'PointLight')
si.SetProperty3('light28', 'translate', 10.0154, 12, 5.67625)
si.SetProperty1('light28', 'intensity', 0.03125)
si.NewLight('light29', 'PointLight')
si.SetProperty3('light29', 'translate', 11.0907, 12, 14.4043)
si.SetProperty1('light29', 'intensity', 0.03125)
si.NewLight('light30', 'PointLight')
si.SetProperty3('light30', 'translate', 4.71726, 12, 7.98851)
si.SetProperty1('light30', 'intensity', 0.03125)
si.NewLight('light31', 'PointLight')
si.SetProperty3('light31', 'translate', 13.3907, 12, 9.08986)
si.SetProperty1('light31', 'intensity', 0.03125)
si.NewLight('light32', 'PointLight')
si.SetProperty3('light32', 'translate', 0, 1, 7)
si.SetProperty1('light32', 'intensity', 0.75)
#Texture
# You can specify file paths to *.hdr/*.jpg file via python API
si.NewTexture('tex1', '../hdr/grace-new.hdr')
si.NewTexture('tex2', '../mip/ch02.jpg')
#Shader
si.NewShader('teapot_shader', 'PlasticShader')
si.NewShader('floor_shader', 'PlasticShader')
si.NewShader('dome_shader', 'ConstantShader')
#Mesh
# You can specify file paths to *.ply/*.obj file via python API
si.NewMesh('teapot_mesh', '../ply/sword2.ply')
si.NewMesh('floor_mesh', '../ply/floor.ply')
si.NewMesh('dome_mesh', '../ply/dome.ply')
#ObjectInstance
si.NewObjectInstance('teapot1', 'teapot_mesh')
si.SetProperty3('teapot1', 'translate', 0, -0.55, 1.5)
si.SetProperty3('teapot1', 'rotate', -90, -30, 0)
si.AssignShader('teapot1', 'teapot_shader')
si.AssignTexture('teapot_shader', 'diffuse_map', 'tex2')
si.NewObjectInstance('floor1', 'floor_mesh')
si.SetProperty3('floor1', 'translate', 0, -0.6, 0)
si.AssignShader('floor1', 'floor_shader')
si.NewObjectInstance('dome1', 'dome_mesh')
si.SetProperty3('dome1', 'scale', .5, .5, .5)
si.SetProperty3('dome1', 'rotate', 0, 30, 0)
si.AssignShader('dome1', 'dome_shader')
si.AssignTexture('dome_shader', 'texture', 'tex1')
#ObjectGroup
si.NewObjectGroup('group1')
si.AddObjectToGroup('group1', 'teapot1')
si.AssignObjectGroup('teapot1', 'shadow_target', 'group1')
si.AssignObjectGroup('floor1', 'shadow_target', 'group1')
#FrameBuffer
si.NewFrameBuffer('fb1', 'rgba')
#Renderer
si.NewRenderer('ren1')
si.AssignCamera('ren1', 'cam1')
si.AssignFrameBuffer('ren1', 'fb1')
si.SetProperty2('ren1', 'resolution', 640, 480)
#si.SetProperty2('ren1', 'resolution', 160, 120)
#Rendering
si.RenderScene('ren1')
#Output
# You can specify file paths to *.exr file via python API
si.SaveFrameBuffer('fb1', '../objimport01.exr')
#Run commands
si.Run()
#si.Print()
Fujiyama-Renderer-0.3.6 has installed under Fedora 32
Download Fujiyama-Renderer-0.3.6.tar.gz
Rename Fujiyama-Renderer folder
Edit.
# nano .bash_profile
#Fujiyama-Renderer
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/Fujiyama-Renderer/lib
export PATH=$PATH:/home/yourname/Fujiyama-Renderer/bin
export FJ_LIBRARY_PATH=/home/yourname/Fujiyama-Renderer/lib
creat mesh folder and ply folder and hdr folder.
copy fujiyama.py to bin folder.
$ export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/site-packages/:$HOME/Fujiyama-Renderer/bin/
not python3.8.
Python 3 is not supported.
$ python teapot2.py
thank you.
si.SetProperty2('ren1', 'resolution', 320, 240)
si.SetProperty2('ren1', 'pixelsamples', 32, 32)
rendering time: 14m by my laptop 8 years ago
Resolution: 640 x 480
rendering time: 0h 12m 8s
Primitive group in Fujiyama Renderer
feature since v0.2.9
-------------------------------------------------
* Mesh primitive group has been supported. Different shaders can be assigned to each primitive group. Shading group tagged by 'g' in wavefront obj file is converted to primitive group in Fujiyama.
OBJ export from blender
open obj file with text editor.
change o Cube.001 -----> g Cube.001
change o Cube -----> g Cube
following are: test01.obj
# Blender v2.79 (sub 0) OBJ File: ''
# www.blender.org
mtllib test01.mtl
g Cube.001
v 2.320780 -0.989213 -3.512618
v 2.320780 -0.989213 -1.512618
v 0.320780 -0.989213 -1.512618
v 0.320780 -0.989213 -3.512618
v 2.320780 1.010787 -3.512617
v 2.320779 1.010787 -1.512617
v 0.320780 1.010787 -1.512618
v 0.320780 1.010787 -3.512618
vn 0.0000 -1.0000 -0.0000
vn 0.0000 1.0000 0.0000
vn 1.0000 0.0000 0.0000
vn -0.0000 -0.0000 1.0000
vn -1.0000 -0.0000 -0.0000
vn 0.0000 0.0000 -1.0000
usemtl Material.001
s off
f 1//1 2//1 3//1 4//1
f 5//2 8//2 7//2 6//2
f 1//3 5//3 6//3 2//3
f 2//4 6//4 7//4 3//4
f 3//5 7//5 8//5 4//5
f 5//6 1//6 4//6 8//6
g Cube
v 1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 -1.000000 1.000000
v -1.000000 -1.000000 -1.000000
v 1.000000 1.000000 -0.999999
v 0.999999 1.000000 1.000001
v -1.000000 1.000000 1.000000
v -1.000000 1.000000 -1.000000
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
vn 1.0000 0.0000 0.0000
vn -0.0000 -0.0000 1.0000
vn -1.0000 -0.0000 -0.0000
vn 0.0000 0.0000 -1.0000
usemtl Material
s off
f 9//7 10//7 11//7 12//7
f 13//8 16//8 15//8 14//8
f 9//9 13//9 14//9 10//9
f 10//10 14//10 15//10 11//10
f 11//11 15//11 16//11 12//11
f 13//12 9//12 12//12 16//12
Material: test01.mtl
# Blender MTL File: 'None'
# Material Count: 2
newmtl Material
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.000000 0.000000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl Material.001
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.008794 0.005152 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
Use wavefrontobj.py
open terminal.
$ export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/site-packages/:$HOME/Fujiyama-Renderer/bin/
$ python wavefrontobj.py test01.obj
# Setting up environment variable
# FJ_LIBRARY_PATH = /home/mac/Fujiyama-Renderer/lib
reading test01.obj
reading test01.mtl
si.NewShader(Material, PlasticShader)
si.SetProperty3(Material, ambient, 1.0, 1.0, 1.0)
si.SetProperty3(Material, diffuse, 0.8, 0.0, 0.0)
si.SetProperty3(Material, reflection, 0.5, 0.5, 0.5)
si.NewShader(Material.001, PlasticShader)
si.SetProperty3(Material.001, ambient, 1.0, 1.0, 1.0)
si.SetProperty3(Material.001, diffuse, 0.008794, 0.005152, 0.64)
si.SetProperty3(Material.001, reflection, 0.5, 0.5, 0.5)
si.AssignShader(myobj, Cube.001, Material.001)
si.AssignShader(myobj, Cube, Material)
Rendering with Fujiyama Renderer
following are : two_boxes. Thank You.
import fujiyama
si = fujiyama.SceneInterface()
#plugins
si.OpenPlugin('plastic_shader', 'PlasticShader')
si.OpenPlugin('glass_shader', 'GlassShader')
si.OpenPlugin('constant_shader', 'ConstantShader')
si.OpenPlugin('stanfordply_procedure', 'StanfordPlyProcedure')
si.OpenPlugin('wavefrontobj_procedure', 'WavefrontObjProcedure')
#Camera
si.NewCamera('cam1', 'PerspectiveCamera')
si.SetProperty3('cam1', 'translate', 0, 2, 7)
#si.SetProperty3('cam1', 'rotate', -5.710593137499643, 0, 0)
si.SetProperty3('cam1', 'rotate', -8, 0, 0)
#Light
si.NewLight('light0', 'PointLight')
si.SetProperty3('light0', 'translate', 0.900771, 12, 4.09137)
si.SetProperty1('light0', 'intensity', 0.03125)
si.NewLight('light1', 'PointLight')
si.SetProperty3('light1', 'translate', 2.02315, 12, 5.28021)
si.SetProperty1('light1', 'intensity', 0.03125)
si.NewLight('light2', 'PointLight')
si.SetProperty3('light2', 'translate', 10.69, 12, 13.918)
si.SetProperty1('light2', 'intensity', 0.03125)
si.NewLight('light3', 'PointLight')
si.SetProperty3('light3', 'translate', 4.28027, 12, 7.58462)
si.SetProperty1('light3', 'intensity', 0.03125)
si.NewLight('light4', 'PointLight')
si.SetProperty3('light4', 'translate', 12.9548, 12, 1.19914)
si.SetProperty1('light4', 'intensity', 0.03125)
si.NewLight('light5', 'PointLight')
si.SetProperty3('light5', 'translate', 6.55808, 12, 2.31772)
si.SetProperty1('light5', 'intensity', 0.03125)
si.NewLight('light6', 'PointLight')
si.SetProperty3('light6', 'translate', 0.169064, 12, 10.9623)
si.SetProperty1('light6', 'intensity', 0.03125)
si.NewLight('light7', 'PointLight')
si.SetProperty3('light7', 'translate', 1.25002, 12, 4.51314)
si.SetProperty1('light7', 'intensity', 0.03125)
si.NewLight('light8', 'PointLight')
si.SetProperty3('light8', 'translate', 2.46758, 12, 5.73382)
si.SetProperty1('light8', 'intensity', 0.03125)
si.NewLight('light9', 'PointLight')
si.SetProperty3('light9', 'translate', 3.55644, 12, 6.84334)
si.SetProperty1('light9', 'intensity', 0.03125)
si.NewLight('light10', 'PointLight')
si.SetProperty3('light10', 'translate', 4.76112, 12, 8.00264)
si.SetProperty1('light10', 'intensity', 0.03125)
si.NewLight('light11', 'PointLight')
si.SetProperty3('light11', 'translate', 13.3267, 12, 9.10333)
si.SetProperty1('light11', 'intensity', 0.03125)
si.NewLight('light12', 'PointLight')
si.SetProperty3('light12', 'translate', 14.4155, 12, 2.68084)
si.SetProperty1('light12', 'intensity', 0.03125)
si.NewLight('light13', 'PointLight')
si.SetProperty3('light13', 'translate', 8.10755, 12, 3.79629)
si.SetProperty1('light13', 'intensity', 0.03125)
si.NewLight('light14', 'PointLight')
si.SetProperty3('light14', 'translate', 9.21103, 12, 4.9484)
si.SetProperty1('light14', 'intensity', 0.03125)
si.NewLight('light15', 'PointLight')
si.SetProperty3('light15', 'translate', 2.83469, 12, 6.09221)
si.SetProperty1('light15', 'intensity', 0.03125)
si.NewLight('light16', 'PointLight')
si.SetProperty3('light16', 'translate', 4.00945, 12, 7.18302)
si.SetProperty1('light16', 'intensity', 0.03125)
si.NewLight('light17', 'PointLight')
si.SetProperty3('light17', 'translate', 12.6072, 12, 0.832089)
si.SetProperty1('light17', 'intensity', 0.03125)
si.NewLight('light18', 'PointLight')
si.SetProperty3('light18', 'translate', 6.21169, 12, 1.98055)
si.SetProperty1('light18', 'intensity', 0.03125)
si.NewLight('light19', 'PointLight')
si.SetProperty3('light19', 'translate', 7.39599, 12, 10.5563)
si.SetProperty1('light19', 'intensity', 0.03125)
si.NewLight('light20', 'PointLight')
si.SetProperty3('light20', 'translate', 8.52421, 12, 4.15086)
si.SetProperty1('light20', 'intensity', 0.03125)
si.NewLight('light21', 'PointLight')
si.SetProperty3('light21', 'translate', 9.5891, 12, 5.39715)
si.SetProperty1('light21', 'intensity', 0.03125)
si.NewLight('light22', 'PointLight')
si.SetProperty3('light22', 'translate', 3.18967, 12, 13.9542)
si.SetProperty1('light22', 'intensity', 0.03125)
si.NewLight('light23', 'PointLight')
si.SetProperty3('light23', 'translate', 4.41432, 12, 0.082813)
si.SetProperty1('light23', 'intensity', 0.03125)
si.NewLight('light24', 'PointLight')
si.SetProperty3('light24', 'translate', 5.48803, 12, 1.21856)
si.SetProperty1('light24', 'intensity', 0.03125)
si.NewLight('light25', 'PointLight')
si.SetProperty3('light25', 'translate', 6.57647, 12, 2.31432)
si.SetProperty1('light25', 'intensity', 0.03125)
si.NewLight('light26', 'PointLight')
si.SetProperty3('light26', 'translate', 0.265098, 12, 10.9453)
si.SetProperty1('light26', 'intensity', 0.03125)
si.NewLight('light27', 'PointLight')
si.SetProperty3('light27', 'translate', 8.84422, 12, 12.1117)
si.SetProperty1('light27', 'intensity', 0.03125)
si.NewLight('light28', 'PointLight')
si.SetProperty3('light28', 'translate', 10.0154, 12, 5.67625)
si.SetProperty1('light28', 'intensity', 0.03125)
si.NewLight('light29', 'PointLight')
si.SetProperty3('light29', 'translate', 11.0907, 12, 14.4043)
si.SetProperty1('light29', 'intensity', 0.03125)
si.NewLight('light30', 'PointLight')
si.SetProperty3('light30', 'translate', 4.71726, 12, 7.98851)
si.SetProperty1('light30', 'intensity', 0.03125)
si.NewLight('light31', 'PointLight')
si.SetProperty3('light31', 'translate', 13.3907, 12, 9.08986)
si.SetProperty1('light31', 'intensity', 0.03125)
#Texture
# You can specify file paths to *.hdr/*.jpg file via python API
si.NewTexture('tex1', '../hdr/grace-new.hdr')
#Shader
si.NewShader('floor_shader', 'plastic_shader')
si.NewShader('dome_shader', 'constant_shader')
si.NewShader("Material", 'plastic_shader')
si.SetProperty3("Material", 'ambient', 1.0, 1.0, 1.0)
si.SetProperty3("Material", 'diffuse', 0.8, 0.0, 0.0)
si.SetProperty3("Material", 'reflect', 0.5, 0.5, 0.5)
si.NewShader("Material.001", 'plastic_shader')
si.SetProperty3("Material.001", 'ambient', 1.0, 1.0, 1.0)
si.SetProperty3("Material.001", 'diffuse', 0.008794, 0.005152, 0.64)
si.SetProperty3("Material.001", 'reflect', 0.5, 0.5, 0.5)
#Mesh
si.NewMesh('boxes_mesh')
si.NewMesh('floor_mesh')
si.NewMesh('dome_mesh')
#Procedure
si.NewProcedure('boxes_proc', 'wavefrontobj_procedure')
si.AssignMesh('boxes_proc', 'mesh', 'boxes_mesh')
si.SetStringProperty('boxes_proc', 'filepath', '../ply/test01.obj')
si.RunProcedure('boxes_proc')
si.NewProcedure('floor_proc', 'stanfordply_procedure')
si.AssignMesh('floor_proc', 'mesh', 'floor_mesh')
si.SetStringProperty('floor_proc', 'filepath', '../ply/floor.ply')
si.SetStringProperty('floor_proc', 'io_mode', 'r')
si.RunProcedure('floor_proc')
si.NewProcedure('dome_proc', 'stanfordply_procedure')
si.AssignMesh('dome_proc', 'mesh', 'dome_mesh')
si.SetStringProperty('dome_proc', 'filepath', '../ply/dome.ply')
si.SetStringProperty('dome_proc', 'io_mode', 'r')
si.RunProcedure('dome_proc')
#ObjectInstance
si.NewObjectInstance('boxes1', 'boxes_mesh')
#si.AssignShader('boxes1', 'DEFAULT_SHADING_GROUP', "Material")
si.AssignShader('boxes1', "Cube.001", "Material.001")
si.AssignShader('boxes1', "Cube", "Material")
si.NewObjectInstance('floor1', 'floor_mesh')
si.SetProperty3('floor1', 'translate', 0, -1, 0)
si.AssignShader('floor1', 'DEFAULT_SHADING_GROUP', 'floor_shader')
si.NewObjectInstance('dome1', 'dome_mesh')
si.SetProperty3('dome1', 'scale', .5, .5, .5)
si.SetProperty3('dome1', 'rotate', 0, 30, 0)
si.AssignShader('dome1', 'DEFAULT_SHADING_GROUP', 'dome_shader')
si.AssignTexture('dome_shader', 'texture', 'tex1')
#ObjectGroup
si.NewObjectGroup('group1')
si.AddObjectToGroup('group1', 'boxes1')
si.AssignObjectGroup('boxes1', 'shadow_target', 'group1')
si.AssignObjectGroup('floor1', 'shadow_target', 'group1')
#FrameBuffer
si.NewFrameBuffer('fb1', 'rgba')
#Renderer
si.NewRenderer('ren1')
si.AssignCamera('ren1', 'cam1')
si.AssignFrameBuffer('ren1', 'fb1')
si.SetProperty2('ren1', 'resolution', 640, 480)
#si.SetProperty2('ren1', 'resolution', 160, 120)
#Rendering
si.RenderScene('ren1')
#Output
# You can specify file paths to *.exr file via python API
si.SaveFrameBuffer('fb1', '../two_boxes.fb')
#Run commands
si.Run()
#si.Print()
Furry_bunny by Fujiyama Renderer 0.3.6
解像度160*120で何度もレンダリングしました。
8年前、5万6千円で購入したノートpc、Linux Fedora 32を入れて、fujiyama Renderer 0.3.6で、stay home, うさぎモデルfurry_bunny、52分41秒かかりました。HDR素材は@cgphysical_i
さんサイトを利用しました。
DomeLightのintensityを2.0にしました。
ありがとうございます。
#!/usr/bin/env python
# 1 furry_bunny with 32 point lights
# NOTE curvegen generates different curve color
# since noise functions have been changed since v0.0.5.
# The sample image was rendered by v0.0.2.
# Copyright (c) 2011-2019 Hiroshi Tsubokawa
# NOTE How to make bunny.crv
# $ ply2mesh bunny.ply bunny.mesh
# $ curvegen bunny.mesh bunny.crv
import fujiyama
si = fujiyama.SceneInterface()
#plugins
si.OpenPlugin('plastic_shader', 'PlasticShader')
si.OpenPlugin('constant_shader', 'ConstantShader')
si.OpenPlugin('hair_shader', 'HairShader')
si.OpenPlugin('curve_generator_procedure', 'CurveGeneratorProcedure')
si.OpenPlugin('stanfordply_procedure', 'StanfordPlyProcedure')
#Camera
si.NewCamera('cam1', 'PerspectiveCamera')
si.SetProperty3('cam1', 'translate', 1.6, 0.8, 1.8)
si.SetProperty3('cam1', 'rotate', -8.04946697553, 45, 0)
rot = 180
#Light
si.NewLight('light1', 'DomeLight')
si.SetProperty3('light1', 'rotate', 0, rot, 0)
#si.SetProperty1('light1', 'intensity', 0.0004)
si.SetProperty1('light1', 'intensity', 2.0)
si.SetProperty1('light1', 'sample_count', 256)
#Texture
si.NewTexture('tex1', '../hdr/HDR_tatami.hdr')
#si.NewTexture('tex1', '../hdr/hdrfree068.hdr')
si.AssignTexture('light1', 'environment_map', 'tex1');
#Shader
si.NewShader('curve_shader', 'hair_shader')
si.SetProperty3('curve_shader', 'diffuse', 1, 0, 0)
si.SetProperty3('curve_shader', 'specular', 1, 0.0, 0.0)
si.SetProperty3('curve_shader', 'reflect', 1, 0, 0)
si.NewShader('bunny_shader', 'plastic_shader')
#si.SetProperty3('bunny_shader', 'diffuse', 0.8, 0.5, 0.3)
si.SetProperty3('bunny_shader', 'diffuse', 1, 0, 0)
si.SetProperty3('bunny_shader', 'reflect', 1, 0.1, 0.1)
si.NewShader('floor_shader', 'plastic_shader')
si.SetProperty3('floor_shader', 'diffuse', 0.6, 0.65, 0.8)
si.SetProperty3('floor_shader', 'reflect', 0.4, 0.4, 0.4)
si.NewShader('dome_shader', 'constant_shader')
#Curve
si.NewCurve('curve_data')
#Mesh
si.NewMesh('bunny_mesh')
si.NewMesh('floor_mesh')
si.NewMesh('dome_mesh')
#Procedure
si.NewProcedure('bunny_proc', 'stanfordply_procedure')
si.AssignMesh('bunny_proc', 'mesh', 'bunny_mesh')
si.SetStringProperty('bunny_proc', 'filepath', '../ply/bunny.ply')
si.SetStringProperty('bunny_proc', 'io_mode', 'r')
si.RunProcedure('bunny_proc')
si.NewProcedure('dome_proc', 'stanfordply_procedure')
si.AssignMesh('dome_proc', 'mesh', 'dome_mesh')
si.SetStringProperty('dome_proc', 'filepath', '../ply/dome.ply')
si.SetStringProperty('dome_proc', 'io_mode', 'r')
si.RunProcedure('dome_proc')
si.NewProcedure('floor_proc', 'stanfordply_procedure')
si.AssignMesh('floor_proc', 'mesh', 'floor_mesh')
si.SetStringProperty('floor_proc', 'filepath', '../ply/floor.ply')
si.SetStringProperty('floor_proc', 'io_mode', 'r')
si.RunProcedure('floor_proc')
si.NewProcedure('bunny_hair_gen', 'curve_generator_procedure')
si.AssignMesh('bunny_hair_gen', 'mesh', 'bunny_mesh')
si.AssignCurve('bunny_hair_gen', 'curve', 'curve_data')
si.RunProcedure('bunny_hair_gen')
#ObjectInstance
si.NewObjectInstance('bunny1', 'bunny_mesh')
si.AssignShader('bunny1', 'DEFAULT_SHADING_GROUP', 'bunny_shader')
si.NewObjectInstance('floor1', 'floor_mesh')
si.SetProperty3('floor1', 'translate', 3, 0, 3)
si.AssignShader('floor1', 'DEFAULT_SHADING_GROUP', 'floor_shader')
si.NewObjectInstance('dome1', 'dome_mesh')
si.SetProperty3('dome1', 'scale', 0.5, 0.5, 0.5)
si.SetProperty3('dome1', 'rotate', 0, rot, 0)
si.AssignShader('dome1', 'DEFAULT_SHADING_GROUP', 'dome_shader')
si.AssignTexture('dome_shader', 'texture', 'tex1')
si.NewObjectInstance('curve1', 'curve_data')
si.AssignShader('curve1', 'DEFAULT_SHADING_GROUP', 'curve_shader')
#ObjectGroup
si.NewObjectGroup('group1')
si.AddObjectToGroup('group1', 'bunny1')
si.AddObjectToGroup('group1', 'curve1')
si.AssignObjectGroup('bunny1', 'shadow_target', 'group1')
si.AssignObjectGroup('curve1', 'shadow_target', 'group1')
si.AssignObjectGroup('floor1', 'shadow_target', 'group1')
#FrameBuffer
si.NewFrameBuffer('fb1', 'rgba')
si.ShowPropertyList('HairShader')
si.ShowPropertyList('CurveGeneratorProcedure')
#Renderer
si.NewRenderer('ren1')
si.AssignCamera('ren1', 'cam1')
si.AssignFrameBuffer('ren1', 'fb1')
si.SetProperty2('ren1', 'resolution', 640, 480)
#si.SetProperty2('ren1', 'resolution', 160, 120)
#Rendering
si.RenderScene('ren1')
#Output
si.SaveFrameBuffer('fb1', '../furry_bunny_domelight.fb')
#Run commands
si.Run()
#si.Print()
Furry_Amabie by Fujiyama Renderer 0.3.6
アマビエ、
HDRは、サンフランシスコの教会。
furは、Building Acceleratorsに46分。
レンダリングは1分。
モデルだけ移動させたら、毛が抜けた。毛にも
SetProperty3 curve1 translate -1 0 0
が必要でした。一歩一歩、確認です。
毛の長さ0.12、CurveGeneratorProcedure2をmakeする。
Building Accelerators 4m 19s. Rendering time 43s.
毛の長さ0.04、色変更、CurveGeneratorProcedure3をmakeする。
#!/usr/bin/env python
# 1 amabie with 1 grid light Grace Cathedral, San Francisco
# Copyright (c) 2011-2019 Hiroshi Tsubokawa
import fujiyama
si = fujiyama.SceneInterface()
#plugins
#si.OpenPlugin('sss_shader', 'SSSShader')
si.OpenPlugin('constant_shader', 'ConstantShader')
si.OpenPlugin('plastic_shader', 'PlasticShader')
si.OpenPlugin('hair_shader', 'HairShader')
si.OpenPlugin('stanfordply_procedure', 'StanfordPlyProcedure')
si.OpenPlugin('wavefrontobj_procedure', 'WavefrontObjProcedure')
si.OpenPlugin('curve_generator2_procedure', 'CurveGeneratorProcedure2')
#Camera
si.NewCamera('cam1', 'PerspectiveCamera')
si.SetSampleProperty3('cam1', 'translate', 0, 1.5, 8, 0)
#Light
si.NewLight('light1', 'GridLight')
si.SetProperty1('light1', 'intensity', 2)
si.SetProperty3('light1', 'translate', 0, 10, 0)
si.SetProperty3('light1', 'rotate', 0, 0, 180)
scale = 7
si.SetProperty3('light1', 'scale', scale, scale, scale)
si.SetProperty1('light1', 'sample_count', 8)
#Texture
si.NewTexture('tex1', '../hdr/grace-new.hdr')
#Shader
si.NewShader('armadillo_shader', 'plastic_shader')
si.SetProperty3('armadillo_shader', 'diffuse', 1, 0, 0)
si.SetProperty3('armadillo_shader', 'reflect', 1, 0.1, 0.1)
si.NewShader('curve_shader', 'hair_shader')
si.SetProperty3('curve_shader', 'diffuse', 1, 1, 1)
si.SetProperty3('curve_shader', 'specular', 1, 1, 1)
si.SetProperty3('curve_shader', 'reflect', 0.5, 0.5, 0.5)
"""
si.NewShader('head_shader2', 'sss_shader')
si.SetProperty3('head_shader2', 'reflect', 0, 0, 0)
si.SetProperty1('head_shader2', 'enable_single_scattering', 1)
si.SetProperty1('head_shader2', 'enable_multiple_scattering', 0)
si.SetProperty1('head_shader2', 'single_scattering_samples', 1)
si.SetProperty1('head_shader2', 'multiple_scattering_samples', 1)
si.SetProperty3('head_shader2', 'scattering_coefficient', .07, .122, .19)
si.SetProperty3('head_shader2', 'absorption_coefficient', .00014, .00025, .00142)
si.SetProperty3('head_shader2', 'specular', .01, .01, .01)
"""
si.NewShader('floor_shader', 'plastic_shader')
si.SetProperty3('floor_shader', 'diffuse', .2, .25, .3)
si.SetProperty3('floor_shader', 'reflect', 0.95, 0.95, 0.95)
si.NewShader('dome_shader', 'constant_shader')
si.AssignTexture('dome_shader', 'texture', 'tex1')
#Curve
si.NewCurve('curve_data')
#Mesh
si.NewMesh('armadillo_mesh')
si.NewMesh('floor_mesh')
si.NewMesh('dome_mesh')
#Procedure
si.NewProcedure('armadillo_proc', 'stanfordply_procedure')
si.AssignMesh('armadillo_proc', 'mesh', 'armadillo_mesh')
si.SetStringProperty('armadillo_proc', 'filepath', '../ply/amabied.ply')
si.SetStringProperty('armadillo_proc', 'io_mode', 'r')
si.RunProcedure('armadillo_proc')
si.NewProcedure('floor_proc', 'stanfordply_procedure')
si.AssignMesh('floor_proc', 'mesh', 'floor_mesh')
si.SetStringProperty('floor_proc', 'filepath', '../ply/floor.ply')
si.SetStringProperty('floor_proc', 'io_mode', 'r')
si.RunProcedure('floor_proc')
si.NewProcedure('dome_proc', 'stanfordply_procedure')
si.AssignMesh('dome_proc', 'mesh', 'dome_mesh')
si.SetStringProperty('dome_proc', 'filepath', '../ply/dome.ply')
si.SetStringProperty('dome_proc', 'io_mode', 'r')
si.RunProcedure('dome_proc')
si.NewProcedure('bunny_hair_gen', 'curve_generator2_procedure')
si.AssignMesh('bunny_hair_gen', 'mesh', 'armadillo_mesh')
si.AssignCurve('bunny_hair_gen', 'curve', 'curve_data')
#si.SetProperty1('bunny_hair_gen', 'is_hair', 2)
si.RunProcedure('bunny_hair_gen')
#ObjectInstance
si.NewObjectInstance('armadillo1', 'armadillo_mesh')
si.SetProperty3('armadillo1', 'rotate', -90, 0, 0)
si.SetProperty3('armadillo1', 'scale', 2.2, 2.2, 2.2)
si.SetProperty3('armadillo1', 'translate', 0.3, 0, 0)
#si.SetProperty3('armadillo1', 'scale', 4.5, 4.5, 4.5)
#si.SetProperty3('armadillo1', 'translate', 1, -0.1, 0)
#si.SetProperty3('armadillo1', 'rotate', 0, 120, 0)
si.AssignShader('armadillo1', 'DEFAULT_SHADING_GROUP', 'armadillo_shader')
si.NewObjectInstance('floor1', 'floor_mesh')
si.AssignShader('floor1', 'DEFAULT_SHADING_GROUP', 'floor_shader')
si.NewObjectInstance('dome1', 'dome_mesh')
si.SetProperty3('dome1', 'rotate', 0, -90, 0)
si.AssignShader('dome1', 'DEFAULT_SHADING_GROUP', 'dome_shader')
si.NewObjectInstance('curve1', 'curve_data')
si.SetProperty3('curve1', 'rotate', -90, 0, 0)
si.SetProperty3('curve1', 'scale', 2.2, 2.2, 2.2)
si.SetProperty3('curve1', 'translate', 0.3, 0, 0)
si.AssignShader('curve1', 'DEFAULT_SHADING_GROUP', 'curve_shader')
#ObjectGroup
si.NewObjectGroup('group1')
si.AddObjectToGroup('group1', 'armadillo1')
si.AddObjectToGroup('group1', 'curve1')
si.AssignObjectGroup('armadillo1', 'shadow_target', 'group1')
si.AssignObjectGroup('curve1', 'shadow_target', 'group1')
si.AssignObjectGroup('floor1', 'shadow_target', 'group1')
#FrameBuffer
si.NewFrameBuffer('fb1', 'rgba')
#Renderer
si.NewRenderer('ren1')
si.AssignCamera('ren1', 'cam1')
si.AssignFrameBuffer('ren1', 'fb1')
si.SetProperty2('ren1', 'resolution', 640, 480)
#si.SetProperty2('ren1', 'resolution', 160, 120)
#si.SetProperty2('ren1', 'pixelsamples', 12, 12)
#Rendering
si.RenderScene('ren1')
#Output
si.SaveFrameBuffer('fb1', '../grid_amabie3.fb')
#Run commands
si.Run()
#si.Print()
<< 4/4