Browse Source

渲染测式 开发

master
yuanjiajia 1 year ago
parent
commit
c50da36934
  1. 78
      examples/matRenderTest.php
  2. 2
      examples/renderTest.php

78
examples/matRenderTest.php

@ -180,21 +180,53 @@ $scene->registerCamera($camera);
// 四、设置渲染参数 // 四、设置渲染参数
// // gpu 渲染
// gpu 渲染
$render = '';
$renderEngine = new RenderEngine();
$render .= $renderEngine;
$openCL = new OpenCL();
// $openCL->cpuUse = OpenCL::CLOSE;
// $openCL->nativeThreadsCount = 0;
$render .= $openCL;
$lightStrategy = new LightStrategy();
$render .= $lightStrategy;
$hybridBackforWard = new HybridBackforWard();
$hybridBackforWard->partition = 1;
$path = new Path([],null,$hybridBackforWard);
$render .= $path;
$sampler = new Sampler();
$render .= $sampler;
$filesaver = new FileSaver();
$render .= $filesaver;
$batch = new Batch();
$batch->haltspp = 4000;
// $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();
// // $openCL->cpuUse = OpenCL::CLOSE;
// // $openCL->nativeThreadsCount = 0;
// $render .= $openCL;
// $native = new Native();
// $render .= $native;
// $lightStrategy = new LightStrategy(); // $lightStrategy = new LightStrategy();
// $render .= $lightStrategy; // $render .= $lightStrategy;
// $hybridBackforWard = new HybridBackforWard(); // $hybridBackforWard = new HybridBackforWard();
// $hybridBackforWard->partition = 1;
// $hybridBackforWard->partition = 0.8;
// $path = new Path([],null,$hybridBackforWard); // $path = new Path([],null,$hybridBackforWard);
// $render .= $path; // $render .= $path;
@ -202,6 +234,7 @@ $scene->registerCamera($camera);
// $render .= $sampler; // $render .= $sampler;
// $filesaver = new FileSaver(); // $filesaver = new FileSaver();
// $filesaver->renderengineType = FileSaver::TYPE_PATHCPU;
// $render .= $filesaver; // $render .= $filesaver;
// $batch = new Batch(); // $batch = new Batch();
@ -213,39 +246,6 @@ $scene->registerCamera($camera);
// $render .= $sceneCfg; // $render .= $sceneCfg;
// cpu 渲染
$render = '';
$renderEngine = new RenderEngine();
$renderEngine->type = RenderEngine::TYPE_PATHCPU;
$render .= $renderEngine;
$native = new Native();
$render .= $native;
$lightStrategy = new LightStrategy();
$render .= $lightStrategy;
$hybridBackforWard = new HybridBackforWard();
$hybridBackforWard->partition = 0.8;
$path = new Path([],null,$hybridBackforWard);
$render .= $path;
$sampler = new Sampler();
$render .= $sampler;
$filesaver = new FileSaver();
$filesaver->renderengineType = FileSaver::TYPE_PATHCPU;
$render .= $filesaver;
$batch = new Batch();
$batch->haltspp = 2000;
// $batch->halttime = 2000;
$render .= $batch;
$sceneCfg = new render\Scene();
$render .= $sceneCfg;
// 图像输出设置 // 图像输出设置
$imageOutDir = $sceneTemplatePath.'/imageOut'; $imageOutDir = $sceneTemplatePath.'/imageOut';
$film = new Film(); $film = new Film();

2
examples/renderTest.php

@ -335,7 +335,7 @@ $render .= $sceneCfg;
// $render .= $filesaver; // $render .= $filesaver;
// $batch = new Batch(); // $batch = new Batch();
// $batch->haltspp = 200;
// $batch->haltspp = 4000;
// // $batch->halttime = 2000; // // $batch->halttime = 2000;
// $render .= $batch; // $render .= $batch;

Loading…
Cancel
Save