Rendering学習日記

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

LightFlow for linux 64bit その2

前回64bitでうまくいかなかった。やっとできたのでメモする。
CentOS 64bit環境でpython1.5を32bitビルド試みたが、64bitになってしまう。結局Virtualboxに入れたCentOS i686(32bit)版でビルドしたpython1.5をコピーして、LightFlowが起動した。

以下試みる。CentOS 64bitでビルドしても64bit.
export CFLAGS=-m32
export CXXFLAGS=-m32
echo $CFLAGS
echo $CXXFLAGS
yum install glibc-2.12-1.80.el6_3.5.i686
yum install libstdc++*
yum install libstdc++*.i686
./configure --enable-32bit
make ARCH="-m32"

32bit環境の以下をコピー
/usr/local/bin python1.5
/usr/local/lib python1.5/
/usr/local/include python1.5/
64bit環境にインストールする。
sudo cp python1.5 /usr/local/bin

さらに次のファイルをダウンロードします。
compat-libstdc++-6.2-2.9.0.14.i386.rpm
http://rpm.pbone.net/index.php3/stat/4/idpl/14760/com/compat-libstdc++-6.2-2.9.0.14.i386.rpm.html

インストールします。
[root@localhost]# rpm -ivh compat-libstdc++-6.2-2.9.0.14.i386.rpm
Preparing... ########################################### [100%]
1:compat-libstdc++ ########################################### [100%]

その他、.bashrcに記入
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/Lightflow
PYTHONPATH=$PYTHONPATH:$HOME/Lightflow
LIGHTFLOWPATH=$HOME/Lightflow
LIGHTFLOW_SE_MEMORY=32000
LIGHTFLOW_VE_MEMORY=32000

export LD_LIBRARY_PATH PYTHONPATH LIGHTFLOWPATH LIGHTFLOW_SE_MEMORY LIGHTFLOW_VE_MEMORY

以下を実行するとレンダリングできました。
Examples]$ python1.5 ball1.py

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


Pinhole Camera On
Objects : 1

Rendering 300 x 300 pixels
00:00:00 - 87.1%
Windowsより速いです。
  • -
  • -

Lightflow C++-Tutorial for beginners

C++でのやり方。参考になりました。
ありがとうございます。
http://www.knoerig.de/lightflow_en.html
Rudi's Homepage - Lightflow
  • -
  • -

Lightflow C API sample ball2

2018/10/22
sample ball2
main2.cpp
#includeの両側に半角スペースが入っています。

#include < Lightflow/LfLocalSceneProxy.h >

int main()
{
LfLocalSceneProxy* s = new LfLocalSceneProxy();
LfArgList list;

list.Reset();
list << "position" << LfPoint( 5.0, -5.0, 4.0 );
list << "color" << LfColor( 300.0, 300.0, 300.0 );
s->LightOn( s->NewLight( "point", list ) );

list.Reset();
list << "basis" << "sin";
list << "scale" << 0.6;
list << "depth" << 0.2;
list << "turbulence.omega" << 0.5 << 0.7;
list << "turbulence.octaves" << LfInt( 6 );
LfInt bump = s->NewPattern( "multifractal", list );

list.Reset();
list << "ka" << LfColor( 0, 0, 0.05 );
list << "kc" << LfColor( 1, 1, 1 );
list << "kd" << 0.5;
list << "km" << 0.1;
list << "displacement" << bump;
LfInt plastic = s->NewMaterial( "standard", list );


s->MaterialBegin( plastic );

list.Reset();
list << "radius" << 1.0;
LfInt sphere = s->NewObject( "sphere", list );

list.Reset();
list << "surfaces" << sphere;
list << "tolerance" << 0.02 << 0.1 << 0.05;
s->AddObject( s->NewObject( "surface-engine", list ) );

s->MaterialEnd();


list.Reset();
list << "file" << "ball2.tga";
LfInt saver = s->NewImager( "tga-saver", list );

s->ImagerBegin( saver );

list.Reset();
list << "eye" << LfPoint( 0, -4, 0 );
list << "aim" << LfPoint( 0, 0, 0 );
LfInt camera = s->NewCamera( "pinhole", list );

s->ImagerEnd();

s->Render( camera, 300, 300 );

delete s;
}

$ /usr/local/gcc-2.95/bin/g++ -I ./include -lLightflow main2.cpp -o simplescene2
$ ./simplescene2
$ convert ball2.tga ball2.jpg
$ eog ball2.jpg
ball2.jpg
main22.cpp
#includeの両側に半角スペースが入っています。

#include < Lightflow/LfLocalSceneProxy.h >
int main()
{
LfLocalSceneProxy* s = new LfLocalSceneProxy();
LfArgList list;

list.Reset();
list << "position" << LfPoint( 5.0, -5.0, 4.0 );
list << "color" << LfColor( 300.0, 300.0, 300.0 );
s->LightOn( s->NewLight( "point", list ) );

list.Reset();
list << "basis" << "sin";
list << "scale" << 0.6;
list << "depth" << 0.2;
list << "turbulence.omega" << 0.5 << 0.7;
list << "turbulence.octaves" << LfInt( 6 );
LfInt bump = s->NewPattern( "multifractal", list );

list.Reset();
list << "kr" << LfVector3(0.3,0.3,0.5);
list << "kd" << 0.3;
list << "km" << 0.3;
list << "shinyness" << 0.8;
list << "fresnel" << LfInt(1) << LfFloat(0.5) << LfFloat(0.5);
list << "caustics" << LfInt(1) << LfInt(1);
list << "displacement" << bump;
LfInt bumpmetal = s->NewMaterial( "physical", list );

s->MaterialBegin( bumpmetal );

list.Reset();
list << "radius" << 1.0;
LfInt sphere = s->NewObject( "sphere", list );

list.Reset();
list << "surfaces" << sphere;
list << "tolerance" << 0.02 << 0.1 << 0.05;
s->AddObject( s->NewObject( "surface-engine", list ) );

s->MaterialEnd();

list.Reset();
list << "file" << "ball2.tga";
LfInt saver = s->NewImager( "tga-saver", list );

s->ImagerBegin( saver );

list.Reset();
list << "eye" << LfPoint( 0, -4, 0 );
list << "aim" << LfPoint( 0, 0, 0 );
LfInt camera = s->NewCamera( "pinhole", list );

s->ImagerEnd();

s->Render( camera, 300, 300 );
delete s;
}

$ /usr/local/gcc-2.95/bin/g++ -I ./include -lLightflow main22.cpp -o simplescene22
$ ./simplescene22
$ convert ball2.tga ball2.jpg
$ eog ball2.jpg
ball2.jpg
  • -
  • -
<< 23/25 >>