Blender渲染
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
3.5 KiB

  1. <?php
  2. namespace Blobt\Luxcore\scene;
  3. use Blobt\Luxcore\scene\materials;
  4. use Blobt\Luxcore\scene\objects;
  5. use Blobt\Luxcore\scene\render;
  6. use Blobt\Luxcore\scene\texture;
  7. include dirname(dirname(__FILE__)) . "/vendor/autoload.php";
  8. echo '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>渲染配置参数>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>';
  9. echo "\n\n\n\n";
  10. /*
  11. //设置打印 渲染引擎 的配置参数
  12. $renderEngine = new RenderEngine();
  13. echo $renderEngine;
  14. //设置打印GPU渲染设备的配置参数
  15. $openCL = new OpenCL();
  16. echo $openCL;
  17. //设置打印光线跟踪的配置参数
  18. $path = new Path();
  19. echo $path;
  20. //设置打印 采样器 配置参数
  21. $sampler = new Sampler();
  22. echo $sampler;
  23. //设置打印 灯光策略 配置参数
  24. $lightStrategy = new LightStrategy();
  25. echo $lightStrategy;
  26. //设置打印 文件储存格式 配置参数
  27. $filesaver = new FileSaver();
  28. echo $filesaver;
  29. //设置打印 渲染终止 配置参数
  30. $batch = new Batch();
  31. echo $batch;
  32. //设置打印 场景属性 配置参数
  33. $scene = new Scene();
  34. echo $scene;
  35. //设置打印 “胶片” 配置参数
  36. $film = new render\Film();//添加一个胶片,
  37. $img = new render\Image();
  38. $img->effect = [new render\effect\Pretreatment(),new render\effect\ToneMapLinear(),new render\effect\CammaCorrection()];
  39. $film->addImage($img);
  40. $film->addImage(new render\Image(['type' => 'ALBEDO']));
  41. $film->addImage(new render\Image(['type' => 'AVG_SHADING_NORMAL']));
  42. $img = new render\Image();
  43. $img->effect = [new render\effect\NoiseReducerOIDN(),new render\effect\Pretreatment(),new render\effect\ToneMapLinear(),new render\effect\CammaCorrection()];
  44. $film->addImage($img);
  45. echo $film;
  46. */
  47. echo "\n\n\n\n";
  48. echo '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>场景配置参数>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>';
  49. echo "\n\n\n\n";
  50. $scene = new Scene();//创建一个场景,
  51. //添加第一个模型
  52. $bumpMap = new texture\ImageMap();
  53. $baseColorMap = new texture\ImageMap();
  54. $metallicMap = new texture\ImageMap();
  55. $material1 = new materials\Disney(); //创建一个 Disney 材质
  56. $material2 = new materials\Metal(); //创建一个 Metal 材质
  57. $material1 = $scene->addMaterial($material1); //将材质存入材质数组,并获得其键名
  58. $material2 = $scene->addMaterial($material2); //将材质存入材质数组,并获得其键名
  59. $mix = new materials\Mix(); //创建 Mix 材质,
  60. $mix->material1 = $material1; //为材质通道1 指定一个键名
  61. $mix->material2 = $material2; //为材质通道2 指定一个键名
  62. $mix->amount = 0.6; //指定混合系数为 0.6
  63. $mix = $scene->addMaterial($mix); //将材质存入材质数组,并获得其键名
  64. $obj = new objects\Objects( [ 'ply' => 'mesh-10086.ply','appliedtransformation' => '1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1' ] ); //创建一个的模型,
  65. $obj->material = $mix; //为模型的材属性 指定一个键名
  66. $scene->addObjects($obj); //将模型添加到场景中
  67. /*
  68. //添加第二个模型
  69. $obj = new objects\Objects( [ 'ply' => 'mesh-119.ply','appliedtransformation' => '1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1' ] ); //创建一个的模型,
  70. $obj->material = new materials\Metal( ['fresnel' => "2517393611944Fresnel"] ); //为模型创建一个 金属 类型的材质
  71. $scene->addObject($obj); //将模型添加到场景中
  72. */
  73. echo $scene;
  74. ?>