|
|
@ -20,6 +20,7 @@ use Blobt\Luxcore\scene\render\FileSaver; |
|
|
|
use Blobt\Luxcore\scene\render\Film; |
|
|
|
use Blobt\Luxcore\scene\render\Image; |
|
|
|
use Blobt\Luxcore\scene\render\LightStrategy; |
|
|
|
use Blobt\Luxcore\scene\render\Native; |
|
|
|
use Blobt\Luxcore\scene\render\OpenCL; |
|
|
|
use Blobt\Luxcore\scene\render\Path; |
|
|
|
use Blobt\Luxcore\scene\render\RenderEngine; |
|
|
@ -268,63 +269,94 @@ $camera = new camera\Perspective( |
|
|
|
'cliphither' => 0.1, |
|
|
|
] |
|
|
|
); |
|
|
|
$camera->bokeh->blades = 0; |
|
|
|
$scene->registerCamera($camera); |
|
|
|
$camera->bokeh->blades = 0; |
|
|
|
$scene->registerCamera($camera); |
|
|
|
|
|
|
|
|
|
|
|
// 四、设置渲染参数
|
|
|
|
// // gpu 渲染
|
|
|
|
// $render = '';
|
|
|
|
// $renderEngine = new RenderEngine();
|
|
|
|
// $render .= $renderEngine;
|
|
|
|
|
|
|
|
// $openCL = new OpenCL();
|
|
|
|
// $render .= $openCL;
|
|
|
|
|
|
|
|
// $lightStrategy = new LightStrategy();
|
|
|
|
// $render .= $lightStrategy;
|
|
|
|
|
|
|
|
// $path = new Path();
|
|
|
|
// $render .= $path;
|
|
|
|
|
|
|
|
// $sampler = new Sampler();
|
|
|
|
// $render .= $sampler;
|
|
|
|
|
|
|
|
// $filesaver = new FileSaver();
|
|
|
|
// $render .= $filesaver;
|
|
|
|
|
|
|
|
// $batch = new Batch();
|
|
|
|
// $batch->haltspp = 200;
|
|
|
|
// // $batch->halttime = 2000;
|
|
|
|
// $render .= $batch;
|
|
|
|
|
|
|
|
// $sceneCfg = new render\Scene();
|
|
|
|
// $render .= $sceneCfg;
|
|
|
|
|
|
|
|
// cpu 渲染
|
|
|
|
$render = ''; |
|
|
|
$renderEngine = new RenderEngine(); |
|
|
|
$renderEngine = new RenderEngine(); |
|
|
|
$renderEngine->type = RenderEngine::TYPE_PATHCPU; |
|
|
|
$render .= $renderEngine; |
|
|
|
|
|
|
|
$openCL = new OpenCL(); |
|
|
|
$render .= $openCL; |
|
|
|
$native = new Native(); |
|
|
|
$render .= $native; |
|
|
|
|
|
|
|
$lightStrategy = new LightStrategy(); |
|
|
|
$render .= $lightStrategy; |
|
|
|
|
|
|
|
$path = new Path(); |
|
|
|
$render .= $path; |
|
|
|
$path = new Path(); |
|
|
|
$render .= $path; |
|
|
|
|
|
|
|
$sampler = new Sampler(); |
|
|
|
$sampler = new Sampler(); |
|
|
|
$render .= $sampler; |
|
|
|
|
|
|
|
$lightStrategy = new LightStrategy(); |
|
|
|
$render .= $lightStrategy; |
|
|
|
|
|
|
|
$filesaver = new FileSaver(); |
|
|
|
$filesaver = new FileSaver(); |
|
|
|
$filesaver->renderengineType = FileSaver::TYPE_PATHCPU; |
|
|
|
$render .= $filesaver; |
|
|
|
|
|
|
|
$batch = new Batch(); |
|
|
|
$batch->haltspp = 200; |
|
|
|
// $batch->halttime = 2000;
|
|
|
|
$batch = new Batch(); |
|
|
|
$batch->haltspp = 200; |
|
|
|
// $batch->halttime = 2000;
|
|
|
|
$render .= $batch; |
|
|
|
|
|
|
|
$sceneCfg = new render\Scene(); |
|
|
|
$sceneCfg = new render\Scene(); |
|
|
|
$render .= $sceneCfg; |
|
|
|
|
|
|
|
|
|
|
|
// 图像输出设置
|
|
|
|
$imageOutPath = $sceneTemplatePath.'/imageOut'; |
|
|
|
$film = new Film(); |
|
|
|
$film->width = 1024; |
|
|
|
$film->heigth = 1024; |
|
|
|
$img = new Image(); |
|
|
|
$film = new Film(); |
|
|
|
$film->width = 1024; |
|
|
|
$film->heigth = 1024; |
|
|
|
|
|
|
|
$img = new Image(); |
|
|
|
$img->effect = [new Pretreatment(),new ToneMapLinear(),new CammaCorrection()]; |
|
|
|
|
|
|
|
$film->addImage($img, $imageOutPath); |
|
|
|
$film->addImage($img, $imageOutPath); |
|
|
|
|
|
|
|
$film->addImage(new Image(['type' => Image::TYPE_OBJECT_ID]), $imageOutPath); |
|
|
|
$film->addImage(new Image(['type' => Image::TYPE_RGBA]), $imageOutPath); |
|
|
|
$film->addImage(new Image(['type' => Image::TYPE_OBJECT_ID]), $imageOutPath); |
|
|
|
$film->addImage(new Image(['type' => Image::TYPE_RGBA]), $imageOutPath); |
|
|
|
|
|
|
|
$img = new Image(); |
|
|
|
$img->effect[] = new NoiseReducerOIDN(); |
|
|
|
$img->effect[] = new Pretreatment(); |
|
|
|
$img->effect[] = new ToneMapLinear(); |
|
|
|
$img->effect[] = new Synthesis(); |
|
|
|
$img = new Image(); |
|
|
|
$img->effect[] = new NoiseReducerOIDN(); |
|
|
|
$img->effect[] = new Pretreatment(); |
|
|
|
$img->effect[] = new ToneMapLinear(); |
|
|
|
$img->effect[] = new Synthesis(); |
|
|
|
$img->effect[] = new BackgroundImg( |
|
|
|
[ |
|
|
|
'file' => "./map/纯白242.png" |
|
|
|
] |
|
|
|
); |
|
|
|
$img->effect[] = new CammaCorrection(); |
|
|
|
$film->addImage($img, $imageOutPath); |
|
|
|
$img->effect[] = new CammaCorrection(); |
|
|
|
$film->addImage($img, $imageOutPath); |
|
|
|
$render .= $film; |
|
|
|
|
|
|
|
|
|
|
|