Browse Source

新增一个关于模型的类文件,三个关于材质的类文件,一个关于场景的类文件,修改了 print.php 文件

master
yuanjiajia 3 years ago
parent
commit
7f7db2d8d2
  1. 15
      examples/print.php
  2. 35
      src/scene/Scene.php
  3. 61
      src/scene/materials/Emission.php
  4. 73
      src/scene/materials/MaterialsBase.php
  5. 26
      src/scene/materials/Visibility.php
  6. 36
      src/scene/objects/Objects.php

15
examples/print.php

@ -2,15 +2,16 @@
namespace Blobt\Luxcore\scene\render;
use Blobt\Luxcore\scene\file;
namespace Blobt\Luxcore\scene;
use Blobt\Luxcore\scene\materials\MaterialsBase;
use Blobt\Luxcore\scene\objects\Objects;
include dirname(dirname(__FILE__)) . "/vendor/autoload.php"; include dirname(dirname(__FILE__)) . "/vendor/autoload.php";
/*
//设置打印 渲染引擎 的配置参数 //设置打印 渲染引擎 的配置参数
$renderEngine = new RenderEngine(); $renderEngine = new RenderEngine();
echo $renderEngine; echo $renderEngine;
@ -55,7 +56,15 @@ $film->outputs[] = new file\ImageSaver(['index' => 5 ]);
$film->imagepipelines[5] = [new effect\NoiseReducerOIDN(),new effect\Pretreatment(),new effect\ToneMapLinear(),new effect\AnalogFilmSimulation(),new effect\CammaCorrection()]; $film->imagepipelines[5] = [new effect\NoiseReducerOIDN(),new effect\Pretreatment(),new effect\ToneMapLinear(),new effect\AnalogFilmSimulation(),new effect\CammaCorrection()];
echo $film; echo $film;
*/
$scene = new Scene();//创建一个场景,
$scene->objects[0] = new Objects();//在场景中创建一个编号为0的模型,
$scene->materials[7] = new MaterialsBase();//在场景中创建一个编号为7的材质,
$scene->objects[0]->material = 7;//给编号为0的模型,添加编号为7的材质
echo $scene;
?> ?>

35
src/scene/Scene.php

@ -0,0 +1,35 @@
<?php
namespace Blobt\Luxcore\scene;
class Scene extends BaseCfg
{
/**
* @var array 模型数组
*/
public $objects;
/**
* @var array 材质数组
*/
public $materials;
/**
* @var array 贴图数组
*/
public $textures;
/**
* @var array 灯光数组
*/
public $light;
/**
* @var array 相机数组
*/
public $camera;
}
?>

61
src/scene/materials/Emission.php

@ -0,0 +1,61 @@
<?php
namespace Blobt\Luxcore\scene\materials;
use Blobt\Luxcore\scene\BaseCfg;
class Emission extends BaseCfg
{
/**
* @var string TODO:一个小数形式的色值,具体作用沿未明明,(固定取值:1 1 1
*/
public $gain = "1 1 1";
/**
* @var integer TODO:具体作用沿未明明,(固定取值:0)
*/
public $power = 0;
/**
* @var integer TODO:具体作用沿未明明,(固定取值:1)
*/
public $normalizebycolor = 1;
/**
* @var integer TODO:具体作用沿未明明,(固定取值:0)
*/
public $efficency = 0;
/**
* @var integer TODO:具体作用沿未明明,(固定取值:90)
*/
public $theta = 90;
/**
* @var integer TODO:一个ID值,具体作用沿未明明,(固定取值:0)
*/
public $id = 0;
/**
* @var integer TODO:具体作用沿未明明,(固定取值:1)
*/
public $importance = 1;
/**
* @var integer TODO:具体作用沿未明明,(固定取值:-1
*/
public $temperature = -1;
/**
* @var integer TODO:具体作用沿未明明,(固定取值:0)
*/
public $temperatureNormalize = 0;
/**
* @var string TODO:具体作用沿未明明,(固定取值:AUTO)
*/
public $directlightsamplingType = "AUTO";
}
?>

73
src/scene/materials/MaterialsBase.php

@ -0,0 +1,73 @@
<?php
namespace Blobt\Luxcore\scene\materials;
use Blobt\Luxcore\core\Base;
use Blobt\Luxcore\scene\BaseCfg;
class MaterialsBase extends BaseCfg
{
/**
* @var string 材质类型
*/
public $type = "matte";
/**
* @var string 此参数控制材质与光线作用时,产生阴影的透明度,或控制阴影的颜色(取值,小数形式的色值)
*/
public $transparencyShadow = "0 0 0";
/**
* @var integer 当前材质的ID号(取值:大于0的整数)
*/
public $id = 1000000;
/**
* @var float TODO:具体作用尚未明确,(固定取值:0.001
*/
public $bumpsamplingdistance = 0.001;
/**
* @var bool 是否开启阴捕捉(取值:ture false
*/
public $shadowcatcherEnable = false;
/**
* @var bool 是否仅捕捉内部灯光的阴影,需要上一个参数打开,本参数才可以设置(取值:ture false
*/
public $shadowcatcherOnlyinfinitelights = false;
/**
* @var bool 设置当前材质是否保存和使用全局光缓存,当需要打开时,需要渲染器开启全局光缓存功能(取值:ture false
*/
public $photongiEnable = true;
/**
* @var bool 设置当前材质的模型是否对摄像机背景透明,当需要打开时,需要摄像机开启 Transparent Film 功通(取值:ture false
*/
public $holdoutEnable = false;
/**
* @var object 一个 Emission类 的实例,
*/
public $emission;
/**
* @var object 一个 Visibility类 的实例
*/
public $visibility;
/**
* 实例 Emission类、Visibility类的两个对象
*/
public function __construct($config = [])
{
$this->emission = new Emission();
$this->visibility = new Visibility();
Base::__construct($config);
}
}
?>

26
src/scene/materials/Visibility.php

@ -0,0 +1,26 @@
<?php
namespace Blobt\Luxcore\scene\materials;
use Blobt\Luxcore\scene\BaseCfg;
class Visibility extends BaseCfg
{
/**
* @var bool 是否开启漫反射可见(取值:true false
*/
public $indirectDiffuseEnable = true;
/**
* @var bool 是否开启光泽度可见(取值:ture false
*/
public $indirectGlossyEnable = true;
/**
* @var bool 是否开启高光可见(取值:ture false
*/
public $indirectSpecularEnable = true;
}
?>

36
src/scene/objects/Objects.php

@ -0,0 +1,36 @@
<?php
namespace Blobt\Luxcore\scene\objects;
use Blobt\Luxcore\scene\BaseCfg;
class Objects extends BaseCfg
{
/**
* @var string 对应的材质数组键名
*/
public $material = 'chinese';
/**
* @var string 对应的ply网格文件名称
*/
public $ply = 'usa';
/**
* @var bool 是否对摄相机可见
*/
public $camerainvisible = 1;
/**
* @var integer 模型的ID(取值:大于0的整数)
*/
public $id = 5569;
/**
* @var string 一个山16个数据组成模型的变换参数,包抱位置坐标,旋转参数,缩放参数
*/
public $appliedtransformation = '1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1';
}
?>
Loading…
Cancel
Save