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.

95 lines
2.4 KiB

  1. <?php
  2. namespace Blobt\Luxcore\scene;
  3. use Blobt\Luxcore\scene\materials;
  4. use Blobt\Luxcore\scene\materials\Disney;
  5. use Blobt\Luxcore\scene\objects\Objects;
  6. include dirname(dirname(__FILE__)) . "/vendor/autoload.php";
  7. /*
  8. //设置打印 渲染引擎 的配置参数
  9. $renderEngine = new RenderEngine();
  10. echo $renderEngine;
  11. //设置打印GPU渲染设备的配置参数
  12. $openCL = new OpenCL();
  13. echo $openCL;
  14. //设置打印光线跟踪的配置参数
  15. $path = new Path();
  16. echo $path;
  17. //设置打印 采样器 配置参数
  18. $sampler = new Sampler();
  19. echo $sampler;
  20. //设置打印 灯光策略 配置参数
  21. $lightStrategy = new LightStrategy();
  22. echo $lightStrategy;
  23. //设置打印 文件储存格式 配置参数
  24. $filesaver = new FileSaver();
  25. echo $filesaver;
  26. //设置打印 渲染终止 配置参数
  27. $batch = new Batch();
  28. echo $batch;
  29. //设置打印 场景属性 配置参数
  30. $scene = new Scene();
  31. echo $scene;
  32. //设置打印 “胶片” 配置参数
  33. $film = new Film();
  34. $film->outputs[] = new file\ImageSaver(['type' => file\ImageSaver::TYPE_RGBA ]);
  35. $film->outputs[] = new file\ImageSaver(['type' => file\ImageSaver::TYPE_MATERIAL_ID ]);
  36. $film->outputs[] = new file\ImageSaver(['index' => 5 ]);
  37. $film->imagepipelines[5] = [new effect\NoiseReducerOIDN(),new effect\Pretreatment(),new effect\ToneMapLinear(),new effect\AnalogFilmSimulation(),new effect\CammaCorrection()];
  38. echo $film;
  39. */
  40. $scene = new Scene();//创建一个场景,
  41. //添加第一个模型
  42. $obj = new Objects( [ 'ply' => 'mesh-10086.ply','appliedtransformation' => '1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1' ] ); //创建一个的模型,
  43. $mix = new materials\Mix(); //创建一个 Mix材质,
  44. $mix->material1 = new materials\Disney();//指定混合材质的第一个材质为 Disney
  45. $mix->material2 = new materials\Metal();//指定混合材质的第一个材质为 Metal
  46. $mix->amount = 0.6; //指定混合系数为 0.6
  47. $obj->material = $mix; //为模型赋予这个混合材质
  48. $scene->addobject($obj); //将模型添加到场景中
  49. //添加第二个模型
  50. $obj = new Objects( [ 'ply' => 'mesh-119.ply','appliedtransformation' => '1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1' ] ); //创建一个的模型,
  51. $obj->material = new materials\Metal( ['fresnel' => "2517393611944Fresnel"] ); //为模型创建一个 金属 类型的材质
  52. $scene->addobject($obj); //将模型添加到场景中
  53. echo $scene;
  54. ?>