Q109:用PBRT渲染Blender导出的模型
来源:互联网 发布:怎样参加淘宝抢购 编辑:程序博客网 时间:2024/05/16 19:05
前续:Q106:Linux系统下安装编译PBRT-V3
这篇文章的内容主要分两部分:1,用Blender建立模型;2,用PBRT渲染
一、用Blender建立模型
咱在这里要建立的模型是“马克杯”。完全参考:
台湾大神的blender教程全集
中的“马克杯”部分。
小编看视频做的笔记截图:
将模型数据导出,截图如下:
导出的有如下两个文件:
二、用PBRT渲染
参考:http://pbrt.org/users-guide.html
会用到工具obj2pbrt,这个工具是之前在编译PBRT时一起生成的。
Q106:Linux系统下安装编译PBRT-V3 中的
10.链接可执行文件;
(以便系统能够找到这些可执行文件)
ln -s ~/pbrt-v3/build/* /usr/bin/
已经将obj2pbrt安装在系统中,此时只需执行:
obj2pbrt ~/pbrt/cup/cup3/cup3.obj ~/pbrt/cup/cup3/cup3_geo.pbrt
即将从Blender中导出的.obj文件转换成了.pbrt文件。
根据http://pbrt.org/users-guide.html
中的建议,
First, you may find it useful to run
$ pbrt –toply scene.pbrt > newscene.pbrt
This will convert triangle meshes into more compact binary PLY files, giving you a much smaller pbrt scene file to edit.
所以执行:
pbrt --toply ~/pbrt/cup/cup3/cup3_geo.pbrt > ~/pbrt/cup/cup3/cup3/cup3-geo_new.pbrt
执行完这条指令,会在当前目录下生成cup-geo_new.pbrt文件,同时在~/目录下生成mesh_00001.ply文件。
将mesh_00001.ply文件剪切到当前目录中。
接下来,只需要设置场景脚本文件啦。这里,咱用两种方式来进行渲染:方式一、sppm;方式二、bdtp
(sppm、bdtp是PBRT-V3中提供的积分器)
方式一、sppm
脚本文件(命名为cup3_glass_sppm_blue.pbrt)如下:
#sharp.pbrt -- a simple pbrt input file that displays a cone, sphere# and refletive plane#Richard P. Sharp - CIS782 Fall 2004#first we set up the eyeLookAt 1 5 10 0 0 -3 0 1 0 #ex ey ez lx ly lz ux uy uz#the cameraCamera "perspective" "float fov" [30]#this is the filter used for antialiasingPixelFilter "mitchell" "float xwidth" [2] "float ywidth" [2]#name the fileFilm "image" "string filename" ["cup.exr"] "integer xresolution" [400] "integer yresolution" [400]Integrator "sppm" "float radius" .075 "integer numiterations" [10] "integer photonsperiteration" [5000000]#begin describing sceneWorldBegin#light sourceAttributeBegin CoordSysTransform "camera" LightSource "distant" "point from" [0 0 0] "point to" [0 0 1] "color L" [3 3 3]AttributeEnd#transform the worldAttributeBegin Translate 0 -1 0 Rotate 35 0 1 0 #define an orangish sphere AttributeBegin Scale 1.5 1.5 1.5 Translate 1.5 1 -1.5 Rotate -135 0 1 0 Material "glass" "float index" [ 1.2500000000 ] Shape "plymesh" "string filename" "mesh_00001.ply" AttributeEnd #define a reflective ground plane AttributeBegin Scale 20 20 20 Material "matte" "color Kd" [0.1 1 1] #this is a triangle mesh, the first set of points define four xyz #coordinates, the second set defines the mesh by indexing into #those points Shape "trianglemesh" "point P" [ -1 0 -1 1 0 -1 1 0 1 -1 0 1 ] "integer indices" [ 0 1 2 2 3 0 ] AttributeEndAttributeEndWorldEnd
渲染该文件:
pbrt ~/pbrt/cup/cup3/cup3_glass_sppm_blue.pbrt
生成图形:
方式二、bdtp
脚本文件(命名为cup3_glass_bdtp_blue.pbrt)如下:
#sharp.pbrt -- a simple pbrt input file that displays a cone, sphere# and refletive plane#Richard P. Sharp - CIS782 Fall 2004#first we set up the eyeLookAt 1 5 10 0 0 -3 0 1 0 #ex ey ez lx ly lz ux uy uz#the cameraCamera "perspective" "float fov" [30]#this is the filter used for antialiasingPixelFilter "mitchell" "float xwidth" [2] "float ywidth" [2]#name the fileFilm "image" "string filename" ["cup3_glass_bdpt_blue.exr"] "integer xresolution" [400] "integer yresolution" [400]Sampler "sobol" "integer pixelsamples" 512Integrator "bdpt" "integer maxdepth" 20#begin describing sceneWorldBeginLightSource "spot" "point from" [ 0 5 5 ] "point to" [ 1.5 1 -1.5 ] "rgb I" [ 139.8113403320 118.6366500854 105.3887557983 ] AttributeBegin LightSource "infinite" "rgb L" [ 0.1000000015 0.1000000015 0.1000000015 ] AttributeEnd#transform the worldAttributeBegin Translate 0 -1 0 Rotate 35 0 1 0 #define an orangish sphere AttributeBegin Scale 1.5 1.5 1.5 Translate 1.5 1 -1.5 Rotate -135 0 1 0 Material "glass" "float index" [ 1.2500000000 ] Shape "plymesh" "string filename" "mesh_00001.ply" AttributeEnd #define a reflective ground plane AttributeBegin Scale 20 20 20 Material "matte" "color Kd" [0.1 1 1] #this is a triangle mesh, the first set of points define four xyz #coordinates, the second set defines the mesh by indexing into #those points Shape "trianglemesh" "point P" [ -1 0 -1 1 0 -1 1 0 1 -1 0 1 ] "integer indices" [ 0 1 2 2 3 0 ] AttributeEndAttributeEndWorldEnd
渲染该文件:
pbrt ~/pbrt/cup/cup3/cup3_glass_bdtp_blue.pbrt
生成图形:
- Q109:用PBRT渲染Blender导出的模型
- Q109:用PBRT渲染Blender导出的模型 (2)
- Q109:用PBRT渲染Blender导出的模型(3)
- blender导出的模型在unity里无法贴图材质
- 用Blender导出模型文件,与贴图制作
- 如何使用Blender将点模型的obj文件渲染成网格模型
- [软件渲染器入门]三,加载通过Blender扩展导出JSON格式的网格
- 使用Blender批量导出/转换模型
- 使用Blender批量导出/转换模型
- 关于blender导出urho3d场景的问题
- PBRT 具有照片真实感的渲染和光线追踪算法
- blender导出bullet文件
- Blender 3D渲染工具
- blender学习计划&blender手册翻译--模型篇
- 表格的渲染模型
- 使用blender做一个地球模型,贴上UV纹理,导出Obj格式
- PBRT阅读:第一章 1.2 具有照片真实感的渲染和光线追踪算法
- Physically Based Rendering,PBRT(光线跟踪:基于物理的渲染) 笔记
- OpenCV 造轮子(一) salt and pepper噪声函数
- 《深入理解计算机系统》 图7-9 重定位算法理解
- 修改数据类型+增加列+修改列名+设置主键+设置键值默认值+sys_guid函数
- 当你的深度学习模型走进死胡同,问问自己这5个问题
- 请慎用javascript:void(0),尤其是在坑爹的IE6中
- Q109:用PBRT渲染Blender导出的模型
- Linux下添加Tomcat为系统服务
- 欢迎使用CSDN-markdown编辑器
- 逻辑回归
- 第3周-强大的数据结构(字典集合+scipy的数据结构)
- docker学习(1) 安装
- Android之Handler用法总结
- Python注意(1)
- Linux 下svn恢复到某一版本