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.

110 lines
3.0 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. include dirname(dirname(__FILE__)) . "/vendor/autoload.php";
  7. echo '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>渲染配置参数>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>';
  8. echo "\n\n\n\n";
  9. /*
  10. //设置打印 渲染引擎 的配置参数
  11. $renderEngine = new RenderEngine();
  12. echo $renderEngine;
  13. //设置打印GPU渲染设备的配置参数
  14. $openCL = new OpenCL();
  15. echo $openCL;
  16. //设置打印光线跟踪的配置参数
  17. $path = new Path();
  18. echo $path;
  19. //设置打印 采样器 配置参数
  20. $sampler = new Sampler();
  21. echo $sampler;
  22. //设置打印 灯光策略 配置参数
  23. $lightStrategy = new LightStrategy();
  24. echo $lightStrategy;
  25. //设置打印 文件储存格式 配置参数
  26. $filesaver = new FileSaver();
  27. echo $filesaver;
  28. //设置打印 渲染终止 配置参数
  29. $batch = new Batch();
  30. echo $batch;
  31. //设置打印 场景属性 配置参数
  32. $scene = new Scene();
  33. echo $scene;
  34. */
  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. echo "\n\n\n\n";
  47. echo '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>场景配置参数>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>';
  48. echo "\n\n\n\n";
  49. $scene = new Scene();//创建一个场景,
  50. //添加第一个模型
  51. $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' ] ); //创建一个的模型,
  52. $mix = new materials\Mix(); //创建一个 Mix材质,
  53. $mix->material1 = new materials\Disney();//指定混合材质的第一个材质为 Disney
  54. $mix->material2 = new materials\Metal();//指定混合材质的第一个材质为 Metal
  55. $mix->amount = 0.6; //指定混合系数为 0.6
  56. $obj->material = $mix; //为模型赋予这个混合材质
  57. $scene->addobjects($obj); //将模型添加到场景中
  58. /*
  59. //添加第二个模型
  60. $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' ] ); //创建一个的模型,
  61. $obj->material = new materials\Metal( ['fresnel' => "2517393611944Fresnel"] ); //为模型创建一个 金属 类型的材质
  62. $scene->addObject($obj); //将模型添加到场景中
  63. */
  64. //echo $scene;
  65. ?>