Browse Source

渲染测式 案例 开发

master
yuanjiajia 1 year ago
parent
commit
0da23f38dd
  1. 3
      .gitignore
  2. 11
      examples/renderTest.php

3
.gitignore

@ -40,7 +40,8 @@ vendor.zip
composer.lock
/sceneTemplate/cacheFiles/*
/sceneTemplate/imageOut/*
/sceneTemplate/log/*
/sceneTemplate/render.cfg
/sceneTemplate/render.log
/sceneTemplate/scene.scn

11
examples/renderTest.php

@ -301,16 +301,17 @@ $sceneCfg = new render\Scene();
$render .= $sceneCfg;
$imageOutPath = $sceneTemplatePath.'/imageOut';
$film = new Film();
$film->width = 1024;
$film->heigth = 1024;
$img = new Image();
$img->effect = [new Pretreatment(),new ToneMapLinear(),new CammaCorrection()];
$film->addImage($img, $sceneTemplatePath);
$film->addImage($img, $imageOutPath);
$film->addImage(new Image(['type' => Image::TYPE_OBJECT_ID]), $sceneTemplatePath);
$film->addImage(new Image(['type' => Image::TYPE_RGBA]), $sceneTemplatePath);
$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();
@ -323,7 +324,7 @@ $img->effect[] = new BackgroundImg(
]
);
$img->effect[] = new CammaCorrection();
$film->addImage($img, $sceneTemplatePath);
$film->addImage($img, $imageOutPath);
$render .= $film;
@ -344,7 +345,7 @@ fclose($handle);
// 六、启动渲染器
$cfgPath = $sceneTemplatePath . "/render.cfg";
$scenePath = $sceneTemplatePath . "/scene.scn";
$logPath = $sceneTemplatePath . "/render.log";
$logPath = $sceneTemplatePath . "/log/render.log";
$cmd = "luxcoreconsole -o " . $cfgPath . " -f " . $scenePath . " 1>" . $logPath . " 2>&1";
echo "\n".$cmd."\n";

Loading…
Cancel
Save