Blender渲染
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.
 
 

132 lines
4.1 KiB

<?php
namespace Blobt\Luxcore\scene;
include dirname(dirname(__FILE__)) . "/vendor/autoload.php";
echo '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>渲染配置参数>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>';
echo "\n\n\n\n";
/*
//设置打印 渲染引擎 的配置参数
$renderEngine = new render\RenderEngine();
echo $renderEngine;
//设置打印GPU渲染设备的配置参数
$openCL = new render\OpenCL();
echo $openCL;
//设置打印光线跟踪的配置参数
$path = new render\Path();
echo $path;
//设置打印 采样器 配置参数
$sampler = new render\Sampler();
echo $sampler;
//设置打印 灯光策略 配置参数
$lightStrategy = new render\LightStrategy();
echo $lightStrategy;
//设置打印 文件储存格式 配置参数
$filesaver = new render\FileSaver();
echo $filesaver;
//设置打印 渲染终止 配置参数
$batch = new render\Batch();
echo $batch;
//设置打印 场景属性 配置参数
$scene = new render\Scene();
echo $scene;
//设置打印 “胶片” 配置参数
$film = new render\Film();//添加一个胶片,
$img = new render\Image();
$img->effect = [new render\effect\Pretreatment(),new render\effect\ToneMapLinear(),new render\effect\CammaCorrection()];
$film->addImage($img);
$film->addImage(new render\Image(['type' => 'ALBEDO']));
$film->addImage(new render\Image(['type' => 'AVG_SHADING_NORMAL']));
$img = new render\Image();
$img->effect = [new render\effect\NoiseReducerOIDN(),new render\effect\Pretreatment(),new render\effect\ToneMapLinear(),new render\effect\CammaCorrection()];
$film->addImage($img);
echo $film;
*/
echo "\n\n\n\n";
echo '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>场景配置参数>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>';
echo "\n\n\n\n";
$scene = new Scene();//创建一个场景,
//添加第一个模型
$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' ] ); //创建一个的模型
$cloudsMap = new texture\map\Clouds(); //创建一个 Clouds类的贴图对象
$scene->registerTexture($cloudsMap); //将这个对象注册到 Scene
$imageMap = new texture\map\ImageMap(); //创建一个 ImageMap类的贴图对象
$scene->registerTexture($imageMap); //将这个对象注册到 Scene
$blend = new texture\map\Blend(); //创建一个 Blend类的贴图对象
$scene->registerTexture($blend); //将这个对象注册到 Scene
$disney = new materials\Disney(); //创建一个 Disney 材质对象
$disney->setBaseColor($cloudsMap); //为 basecolor 指定一个贴图对象,如果这个对象没有注册到Scene,则 set函数抛出异常,以下同理
$disney->setMetallic($blend);
$disney->setBumptex($imageMap);
$scene->registerMaterial($disney); //将这个对象注册到 Scene
$metal = new materials\Metal(); //创建一个 Disney 材质对象
$metal->setRefraction($imageMap);
$metal->setBumptex($cloudsMap);
$scene->registerMaterial($metal); //将这个对象注册到 Scene
$mix = new materials\Mix(); //创建 Mix 材质对象
$mix->setMaterial1($disney); //为材质通道1 指定一个键名
$mix->setMaterial2($metal); //为材质通道2 指定一个键名
$mix->setAmount($blend ); //指定混合系数为 0.6
$scene->registerMaterial($mix); //将这个对象注册到 Scene
$obj->setMaterial($mix) ; //为模型的指定一个混合材质
$scene->registerObjects($obj); //将模型添加到场景中
// //添加第二个模型
// $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); //将模型添加到场景中
echo $scene;
?>