You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
95 lines
2.4 KiB
95 lines
2.4 KiB
<?php
|
|
|
|
|
|
|
|
namespace Blobt\Luxcore\scene;
|
|
use Blobt\Luxcore\scene\materials;
|
|
use Blobt\Luxcore\scene\materials\Disney;
|
|
use Blobt\Luxcore\scene\objects\Objects;
|
|
|
|
include dirname(dirname(__FILE__)) . "/vendor/autoload.php";
|
|
|
|
|
|
|
|
|
|
/*
|
|
//设置打印 渲染引擎 的配置参数
|
|
$renderEngine = new RenderEngine();
|
|
echo $renderEngine;
|
|
|
|
//设置打印GPU渲染设备的配置参数
|
|
$openCL = new OpenCL();
|
|
echo $openCL;
|
|
|
|
//设置打印光线跟踪的配置参数
|
|
$path = new Path();
|
|
echo $path;
|
|
|
|
//设置打印 采样器 配置参数
|
|
$sampler = new Sampler();
|
|
echo $sampler;
|
|
|
|
//设置打印 灯光策略 配置参数
|
|
$lightStrategy = new LightStrategy();
|
|
echo $lightStrategy;
|
|
|
|
//设置打印 文件储存格式 配置参数
|
|
$filesaver = new FileSaver();
|
|
echo $filesaver;
|
|
|
|
//设置打印 渲染终止 配置参数
|
|
$batch = new Batch();
|
|
echo $batch;
|
|
|
|
//设置打印 场景属性 配置参数
|
|
$scene = new Scene();
|
|
echo $scene;
|
|
|
|
|
|
|
|
//设置打印 “胶片” 配置参数
|
|
$film = new Film();
|
|
|
|
$film->outputs[] = new file\ImageSaver(['type' => file\ImageSaver::TYPE_RGBA ]);
|
|
$film->outputs[] = new file\ImageSaver(['type' => file\ImageSaver::TYPE_MATERIAL_ID ]);
|
|
|
|
$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()];
|
|
|
|
echo $film;
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
$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' ] ); //创建一个的模型,
|
|
|
|
$mix = new materials\Mix(); //创建一个 Mix材质,
|
|
|
|
$mix->material1 = new materials\Disney();//指定混合材质的第一个材质为 Disney
|
|
$mix->material2 = new materials\Metal();//指定混合材质的第一个材质为 Metal
|
|
$mix->amount = 0.6; //指定混合系数为 0.6
|
|
|
|
$obj->material = $mix; //为模型赋予这个混合材质
|
|
|
|
$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->material = new materials\Metal( ['fresnel' => "2517393611944Fresnel"] ); //为模型创建一个 金属 类型的材质
|
|
$scene->addobject($obj); //将模型添加到场景中
|
|
|
|
|
|
echo $scene;
|
|
|
|
?>
|