|
@ -20,6 +20,7 @@ use Blobt\Luxcore\scene\render\FileSaver; |
|
|
use Blobt\Luxcore\scene\render\Film; |
|
|
use Blobt\Luxcore\scene\render\Film; |
|
|
use Blobt\Luxcore\scene\render\Image; |
|
|
use Blobt\Luxcore\scene\render\Image; |
|
|
use Blobt\Luxcore\scene\render\LightStrategy; |
|
|
use Blobt\Luxcore\scene\render\LightStrategy; |
|
|
|
|
|
use Blobt\Luxcore\scene\render\Native; |
|
|
use Blobt\Luxcore\scene\render\OpenCL; |
|
|
use Blobt\Luxcore\scene\render\OpenCL; |
|
|
use Blobt\Luxcore\scene\render\Path; |
|
|
use Blobt\Luxcore\scene\render\Path; |
|
|
use Blobt\Luxcore\scene\render\RenderEngine; |
|
|
use Blobt\Luxcore\scene\render\RenderEngine; |
|
@ -273,12 +274,45 @@ $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 = ''; |
|
|
$render = ''; |
|
|
$renderEngine = new RenderEngine(); |
|
|
$renderEngine = new RenderEngine(); |
|
|
|
|
|
$renderEngine->type = RenderEngine::TYPE_PATHCPU; |
|
|
$render .= $renderEngine; |
|
|
$render .= $renderEngine; |
|
|
|
|
|
|
|
|
$openCL = new OpenCL(); |
|
|
|
|
|
$render .= $openCL; |
|
|
|
|
|
|
|
|
$native = new Native(); |
|
|
|
|
|
$render .= $native; |
|
|
|
|
|
|
|
|
|
|
|
$lightStrategy = new LightStrategy(); |
|
|
|
|
|
$render .= $lightStrategy; |
|
|
|
|
|
|
|
|
$path = new Path(); |
|
|
$path = new Path(); |
|
|
$render .= $path; |
|
|
$render .= $path; |
|
@ -286,10 +320,8 @@ $render .= $path; |
|
|
$sampler = new Sampler(); |
|
|
$sampler = new Sampler(); |
|
|
$render .= $sampler; |
|
|
$render .= $sampler; |
|
|
|
|
|
|
|
|
$lightStrategy = new LightStrategy(); |
|
|
|
|
|
$render .= $lightStrategy; |
|
|
|
|
|
|
|
|
|
|
|
$filesaver = new FileSaver(); |
|
|
$filesaver = new FileSaver(); |
|
|
|
|
|
$filesaver->renderengineType = FileSaver::TYPE_PATHCPU; |
|
|
$render .= $filesaver; |
|
|
$render .= $filesaver; |
|
|
|
|
|
|
|
|
$batch = new Batch(); |
|
|
$batch = new Batch(); |
|
@ -300,14 +332,14 @@ $render .= $batch; |
|
|
$sceneCfg = new render\Scene(); |
|
|
$sceneCfg = new render\Scene(); |
|
|
$render .= $sceneCfg; |
|
|
$render .= $sceneCfg; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 图像输出设置
|
|
|
$imageOutPath = $sceneTemplatePath.'/imageOut'; |
|
|
$imageOutPath = $sceneTemplatePath.'/imageOut'; |
|
|
$film = new Film(); |
|
|
$film = new Film(); |
|
|
$film->width = 1024; |
|
|
$film->width = 1024; |
|
|
$film->heigth = 1024; |
|
|
$film->heigth = 1024; |
|
|
|
|
|
|
|
|
$img = new Image(); |
|
|
$img = new Image(); |
|
|
$img->effect = [new Pretreatment(),new ToneMapLinear(),new CammaCorrection()]; |
|
|
$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_OBJECT_ID]), $imageOutPath); |
|
|