Browse Source

渲染测式 开发

master
yuanjiajia 1 year ago
parent
commit
5551156fba
  1. 9
      examples/matRenderTest.php
  2. 9
      examples/renderTest.php
  3. 4
      src/scene/render/Film.php
  4. 5
      src/scene/render/HybridBackforWard.php

9
examples/matRenderTest.php

@ -19,6 +19,7 @@ use Blobt\Luxcore\scene\render\effect\ToneMapLinear;
use Blobt\Luxcore\scene\render\FileSaver; use Blobt\Luxcore\scene\render\FileSaver;
use Blobt\Luxcore\scene\render\Film; use Blobt\Luxcore\scene\render\Film;
use Blobt\Luxcore\scene\render\Filter; use Blobt\Luxcore\scene\render\Filter;
use Blobt\Luxcore\scene\render\HybridBackforWard;
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\Native;
@ -192,7 +193,9 @@ $scene->registerCamera($camera);
// $lightStrategy = new LightStrategy(); // $lightStrategy = new LightStrategy();
// $render .= $lightStrategy; // $render .= $lightStrategy;
// $path = new Path();
// $hybridBackforWard = new HybridBackforWard();
// $hybridBackforWard->partition = 1;
// $path = new Path([],null,$hybridBackforWard);
// $render .= $path; // $render .= $path;
// $sampler = new Sampler(); // $sampler = new Sampler();
@ -222,7 +225,9 @@ $render .= $native;
$lightStrategy = new LightStrategy(); $lightStrategy = new LightStrategy();
$render .= $lightStrategy; $render .= $lightStrategy;
$path = new Path();
$hybridBackforWard = new HybridBackforWard();
$hybridBackforWard->partition = 0.8;
$path = new Path([],null,$hybridBackforWard);
$render .= $path; $render .= $path;
$sampler = new Sampler(); $sampler = new Sampler();

9
examples/renderTest.php

@ -19,6 +19,7 @@ use Blobt\Luxcore\scene\render\effect\ToneMapLinear;
use Blobt\Luxcore\scene\render\FileSaver; use Blobt\Luxcore\scene\render\FileSaver;
use Blobt\Luxcore\scene\render\Film; use Blobt\Luxcore\scene\render\Film;
use Blobt\Luxcore\scene\render\Filter; use Blobt\Luxcore\scene\render\Filter;
use Blobt\Luxcore\scene\render\HybridBackforWard;
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\Native;
@ -289,7 +290,9 @@ $render .= $openCL;
$lightStrategy = new LightStrategy(); $lightStrategy = new LightStrategy();
$render .= $lightStrategy; $render .= $lightStrategy;
$path = new Path();
$hybridBackforWard = new HybridBackforWard();
$hybridBackforWard->partition = 1;
$path = new Path([],null,$hybridBackforWard);
$render .= $path; $render .= $path;
$sampler = new Sampler(); $sampler = new Sampler();
@ -319,7 +322,9 @@ $render .= $sceneCfg;
// $lightStrategy = new LightStrategy(); // $lightStrategy = new LightStrategy();
// $render .= $lightStrategy; // $render .= $lightStrategy;
// $path = new Path();
// $hybridBackforWard = new HybridBackforWard();
// $hybridBackforWard->partition = 0.8;
// $path = new Path([],null,$hybridBackforWard);
// $render .= $path; // $render .= $path;
// $sampler = new Sampler(); // $sampler = new Sampler();

4
src/scene/render/Film.php

@ -23,9 +23,9 @@ class Film extends BaseCfg
public $openclEnable = true; public $openclEnable = true;
/** /**
* @var integer TODO:具体作用尚不明确(取值:0)
* @var integer TODO:具体作用尚不明确(取值:2),使用cpu渲染时,这里必须取值为 2
*/ */
public $openclDevice = 0;
public $openclDevice = 2;

5
src/scene/render/HybridBackforWard.php

@ -12,14 +12,15 @@ class HybridBackforWard extends BaseCfg
public $enable = self::OPEN; public $enable = self::OPEN;
/** /**
* @var float 设置 不跟踪光线 所占最大百分比 (取值:0-1
* @var float 在CPU上计算的光线量(GPU只能计算相机光线)。使用0%禁用灯光跟踪。使用100%意味着CPU只执行光线跟踪
* gpu 渲染默认取值 1, cpu 渲染默认取值 0.8;
*/ */
public $partition = 0; public $partition = 0;
/** /**
* @var float 设置区分图像的 平坦区域和非平坦区域 的阀值 (取值:0-1 * @var float 设置区分图像的 平坦区域和非平坦区域 的阀值 (取值:0-1
*/ */
public $glossinessthreshold = 0.05;
public $glossinessthreshold = 0.002;
} }

Loading…
Cancel
Save