Rendering学習日記

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

wine-3.6 (Ubuntu 3.6-1) install under Linux Lite. 2020/5

Wineのインストール


Linux Lite4.2 64bitにwineをいれました。
Windows10では動かない、Lightflowやmetalight2が動くか確認した見ました。インストールは64bitですが、32bitのwinアプリが動きました。
■参考
下記を参考にしました。ありがとうございます。
ガラクタプログラム

■設定
Linux Liteを,virtualbox上で動かしています。

$ apt-file search winehq
たくさん、出てきます。
$ sudo apt-get update

$ sudo apt install wine-development

$ wine
Usage: wine PROGRAM [ARGUMENTS...] Run the specified program
wine --help Display this help and exit
wine --version Output version information and exit

$ wine --version
wine-3.6 (Ubuntu 3.6-1)

■設定方法
まずwinecfgを起動します。しばらく時間がかかる。
$ winecfg
$ wine notepad メモ帳
$ wine regedit レジストリ・エディタ

■Winetricksを使って必要なライブラリやフォントなどをインストールします。
$ sudo apt install winetricks
$ winetricks
Direct3D9をいれてみました。

■VirtualBox共有フォルダ
ubuntu系
sudo nano /etc/modules
cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
vboxsf
--------------

ゲストOSに$mkdir <マウントポイント名>
フォルダを作る。

$sudo mount.vboxsf <設定したホストOSでの共有ファイル名> /home/<ログインに使う名前>/<マウントポイント名>

例: ~$ sudo mount.vboxsf kyouyu /home/mac/litekyouyu/


■バージョン確認
$ cat .wine/system.reg | grep -m 1 '#arch' | cut -d '=' -f2
win64

■古いプログラムが起動する。ありがとうございます。
インストーラーも、起動してCドライブに入ります。Python1.5.2をインストールしました。
$ wine py152.exe
Python1.5.2 for windows のインストール。

$ wine cmd
コマンドプロンプト

$ wine explorer
Windows のコマンドプロンプトからエクスプローラを開く
Windows のファイルマネージャーはエクスプローラ (explorer.exe)
コピー、貼り付けがゆっくりですが、できました。



■Wine上の環境変数の設定
Wine上の環境変数の扱いについて(後半)」を参考にしました。
$ wine regedit
を使います。
ユーザごとの環境変数はHKEY_CURRENT_USER/Environment、(仮想Windows環境における)システム環境変数はHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment以下に「[環境変数名]=[値]」形式の文字列としてレジストリ項目が存在する場合にこれを読み込む形となっている。
screen_2020-05-12_13-58-42.jpg

保存し、再起動して、確認、PATHが追加されました。
c:\Lightflow\PM\Examples>path
PATH=C:\windows\system32;C:\windows;C:\windows\system32\wbem;C:\Program Files (x86)\Python

これで、64bit環境で、windows 32bitプログラム、Lightflow Rendering Toolが動きました。
Lightflowのインストールはこちら。

>python mechanic.py

Lightflow Rendering Tools
Copyright (c) 1995-2000 by Jacopo Pantaleoni. All rights reserved


Pinhole Camera On
Objects : 3
00:00:00 - CSEADS 100/100 - boxes 26 - depth 1 - objects 18
00:00:00 - CSEADS 100/100 - boxes 26 - depth 1 - objects 6
LfSoftLight::Init()
00:00:02 - cell 418176 / 418176
LfSoftLight::Init()
00:00:02 - cell 418176 / 418176

Rendering 400 x 400 pixels
00:00:45 - 93.0%

LfDOFImager():
row 400 / 400

mechanic.py 45秒でした。

metalight2も動いてます。仮想画面を1024*768にしました。
sc05-12.png
レンダリング、radiocity
kumafur.jpg
ありがとうございます。
  • -
  • -

Furry_Amabie by Fujiyama Renderer 0.3.6

アマビエ、
HDRは、サンフランシスコの教会。
furは、Building Acceleratorsに46分。
レンダリングは1分。
grid_amabie005.jpg
モデルだけ移動させたら、毛が抜けた。毛にも
SetProperty3 curve1 translate -1 0 0
が必要でした。一歩一歩、確認です。
毛の長さ0.12、CurveGeneratorProcedure2をmakeする。
grid_amabie006.jpg
Building Accelerators 4m 19s. Rendering time 43s.
毛の長さ0.04、色変更、CurveGeneratorProcedure3をmakeする。
grid_amabie4.jpg

#!/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()
  • -
  • -

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にしました。
ありがとうございます。
furrey_bunny


#!/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()
  • -
  • -
<< 5/184 >>