diff --git a/examples/startDome.php b/examples/startDome.php index fa9961f..5070357 100644 --- a/examples/startDome.php +++ b/examples/startDome.php @@ -129,11 +129,12 @@ $light = new lights\env\HdrImage( // new 一个环境光对 [ 'gain' => "1.25 1.25 1.25", // 设置颜色增益 'transformation' => "0.1736481 -0.9848078 0 0 -0.9848078 -0.1736481 0 0 0 0 1 0 0 0 0 1", //设置对象变换 - 'file' => "env.png", // 加载一个全景图像文件 + 'file' => "./env.png", // 加载一个全景图像文件 'gamma' => 1, // 设置一个校正全景图像文件的 gamma 值 'storage' => "byte" // 声明这个图像文件表示色值的数据类型 ] ); +$light->id = 0; // 一个场景只能有一个环境光对象,并且 id 必须为 0 $scene->registerLight($light); // 将环境光注册到 scene 中 @@ -154,7 +155,7 @@ $mapping->useUVMapping2d( // 使用"uvmapping2d"类 $texture = new texture\procedural\ImageMap( // 创建一个纹理 [ - 'file' => "方形阴影遮照.png", // 加载一个图像文件 + 'file' => "./方形阴影遮照.png", // 加载一个图像文件 'gain' => 0.6, // 设置颜色增益 'gamma' => 1, // 设置校正图像文件的gamma值 ] @@ -519,4 +520,10 @@ $handle = fopen( "/home/yuanjiajia/Desktop/blender/blender_test/scene/render.cfg fwrite($handle,$render); fclose($handle); +$result = null; +$var = null; +$cmd = 'luxcoreconsole -o /home/yuanjiajia/Desktop/blender/blender_test/scene/render.cfg -f /home/yuanjiajia/Desktop/blender/blender_test/scene/scene.scn'; +exec($cmd, $result, $var); + + ?> diff --git a/src/scene/BaseCfg.php b/src/scene/BaseCfg.php index 1c90b96..8925756 100644 --- a/src/scene/BaseCfg.php +++ b/src/scene/BaseCfg.php @@ -50,7 +50,8 @@ class BaseCfg extends Base switch(gettype($value)) { case 'string': - $ret .= "{$className}.{$name} = \"{$value}\"\n"; + // $ret .= "{$className}.{$name} = \"{$value}\"\n"; + $ret .= "{$className}.{$name} = {$value}\n"; break; case 'integer': @@ -81,7 +82,7 @@ class BaseCfg extends Base break; default: - $ret .= "{$className}.{$name} = \"unknow type\"\n"; + $ret .= "{$className}.{$name} = \"unknow type\"\n"; } } return $ret; diff --git a/src/scene/materials/MaterialsBase.php b/src/scene/materials/MaterialsBase.php index 25cb0a2..2a6725a 100644 --- a/src/scene/materials/MaterialsBase.php +++ b/src/scene/materials/MaterialsBase.php @@ -32,7 +32,7 @@ class MaterialsBase extends BaseCfg //璃板的边缘可见,效果会更好。) const TYPE_ROUGHGLASS = 'roughglass'; //粗糙玻离材质类型,高光光泽度流程 const TYPE_NULL = 'null'; //空的材质 - const TYPE_METAL = 'matal2'; //金属度流程的金属材质 + const TYPE_METAL = 'metal2'; //金属度流程的金属材质 const TYPE_MIRROR = 'mirror'; //镜面材质,金属度 const TYPE_CARPAINT = 'carpaint'; //车漆材质,高光光泽度流程,使用此类材质不能设置不透明度 const TYPE_CLOTH = 'cloth'; //布料材质,高光光泽度流程 diff --git a/src/scene/render/Film.php b/src/scene/render/Film.php index 1e75590..23e5482 100644 --- a/src/scene/render/Film.php +++ b/src/scene/render/Film.php @@ -83,6 +83,7 @@ class Film extends BaseCfg $this->imagepipelines[ sprintf("%03d",$object->index) ] = $object->effect; $object->effect = null; } + $object->filename = "../{$object->type}_{$object->index}.png"; } $this->outputs[] = $object; } diff --git a/src/scene/render/Image.php b/src/scene/render/Image.php index 16ff566..93bd3b0 100644 --- a/src/scene/render/Image.php +++ b/src/scene/render/Image.php @@ -151,18 +151,15 @@ class Image extends BaseCfg Base::__construct($config); if( in_array($this->type,self::PNG ) ) { - if($this->index == null) $this->filename = "../{$this->type}.png"; - else $this->filename = "../{$this->type}_{$this->index}.png"; + $this->filename = "../{$this->type}.png"; } else if ( in_array($this->type,self::EXR) ) { - if($this->index == null) $this->filename = "../{$this->type}.exr"; - else $this->filename = "../{$this->type}_{$this->index}.exr"; + $this->filename = "../{$this->type}.exr"; } else { - if($this->index == null) $this->filename = "../{$this->type}.jpg"; - else $this->filename = "../{$this->type}_{$this->index}.jpg"; + $this->filename = "../{$this->type}.jpg"; } } diff --git a/src/utils/StringHelper.php b/src/utils/StringHelper.php index 1910ce7..32774fc 100644 --- a/src/utils/StringHelper.php +++ b/src/utils/StringHelper.php @@ -53,7 +53,8 @@ class StringHelper } else if( is_string($value) ) { - $retStr[] = "{$key} = \"{$value}\""; + // $retStr[] = "{$key} = \"{$value}\""; + $retStr[] = "{$key} = {$value}"; } else {