|
|
@ -4,13 +4,15 @@ |
|
|
|
|
|
|
|
namespace Blobt\Luxcore\scene; |
|
|
|
use Blobt\Luxcore\scene\materials; |
|
|
|
use Blobt\Luxcore\scene\materials\Disney; |
|
|
|
use Blobt\Luxcore\scene\objects\Objects; |
|
|
|
use Blobt\Luxcore\scene\objects; |
|
|
|
use Blobt\Luxcore\scene\render; |
|
|
|
|
|
|
|
include dirname(dirname(__FILE__)) . "/vendor/autoload.php"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>渲染配置参数>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>'; |
|
|
|
echo "\n\n\n\n"; |
|
|
|
|
|
|
|
/* |
|
|
|
//设置打印 渲染引擎 的配置参数
|
|
|
@ -45,31 +47,39 @@ echo $batch; |
|
|
|
$scene = new Scene(); |
|
|
|
echo $scene; |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
//设置打印 “胶片” 配置参数
|
|
|
|
$film = new Film(); |
|
|
|
$film = new render\Film();//添加一个胶片,
|
|
|
|
|
|
|
|
$film->addImage( new render\Image(['type' => render\Image::TYPE_RGBA ]) ); //为胶片添加一个 RGBA类型 的图片输出
|
|
|
|
$film->addImage( new render\Image(['type' => render\Image::TYPE_MATERIAL_ID ]) );//为胶片添加一个 MATERIAL_ID类型 的图片输出
|
|
|
|
|
|
|
|
$film->outputs[] = new file\ImageSaver(['type' => file\ImageSaver::TYPE_RGBA ]); |
|
|
|
$film->outputs[] = new file\ImageSaver(['type' => file\ImageSaver::TYPE_MATERIAL_ID ]); |
|
|
|
$img = new render\Image(); //创建一个默认类型的图片输出,
|
|
|
|
$img->effect = [new render\effect\NoiseReducerOIDN(),new render\effect\Pretreatment(),new render\effect\ToneMapLinear(),new render\effect\AnalogFilmSimulation(),new render\effect\CammaCorrection()]; //为图片添加效果管线处理
|
|
|
|
|
|
|
|
$film->outputs[] = new file\ImageSaver(['index' => 5 ]); |
|
|
|
$film->imagepipelines[5] = [new effect\NoiseReducerOIDN(),new effect\Pretreatment(),new effect\ToneMapLinear(),new effect\AnalogFilmSimulation(),new effect\CammaCorrection()]; |
|
|
|
$film->addImage($img); //将这个图片添加到胶片
|
|
|
|
|
|
|
|
echo $film; |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scene = new Scene();//创建一个场景,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "\n\n\n\n"; |
|
|
|
echo '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>场景配置参数>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>'; |
|
|
|
echo "\n\n\n\n"; |
|
|
|
|
|
|
|
$scene = new Scene();//创建一个场景,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//添加第一个模型
|
|
|
|
$obj = new Objects( [ 'ply' => 'mesh-10086.ply','appliedtransformation' => '1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1' ] ); //创建一个的模型,
|
|
|
|
$obj = new objects\Objects( [ 'ply' => 'mesh-10086.ply','appliedtransformation' => '1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1' ] ); //创建一个的模型,
|
|
|
|
|
|
|
|
$mix = new materials\Mix(); //创建一个 Mix材质,
|
|
|
|
|
|
|
@ -79,15 +89,15 @@ $mix->amount = 0.6; //指定混合系数为 0.6 |
|
|
|
|
|
|
|
$obj->material = $mix; //为模型赋予这个混合材质
|
|
|
|
|
|
|
|
$scene->addobject($obj); //将模型添加到场景中
|
|
|
|
$scene->addObject($obj); //将模型添加到场景中
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//添加第二个模型
|
|
|
|
$obj = new Objects( [ 'ply' => 'mesh-119.ply','appliedtransformation' => '1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1' ] ); //创建一个的模型,
|
|
|
|
$obj = new objects\Objects( [ 'ply' => 'mesh-119.ply','appliedtransformation' => '1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1' ] ); //创建一个的模型,
|
|
|
|
$obj->material = new materials\Metal( ['fresnel' => "2517393611944Fresnel"] ); //为模型创建一个 金属 类型的材质
|
|
|
|
$scene->addobject($obj); //将模型添加到场景中
|
|
|
|
$scene->addObject($obj); //将模型添加到场景中
|
|
|
|
|
|
|
|
|
|
|
|
echo $scene; |
|
|
|