PBRT的scene.pbrt使用方法
這里給出一個場景:
Integrator "path" "integer maxdepth" [ 65 ] Transform [ 0.721367 -0.373123 -0.583445 -0 -0 0.842456 -0.538765 -0 -0.692553 -0.388647 -0.60772 -0 0.0258668 -0.29189 5.43024 1] Sampler "sobol" "integer pixelsamples" [ 64 ] PixelFilter "triangle" "float xwidth" [ 1.000000 ] "float ywidth" [ 1.000000 ] Film "image" "integer xresolution" [ 1280 ] "integer yresolution" [ 720 ] "string filename" [ "material-testball.png" ] Camera "perspective" "float fov" [ 20.114292 ] WorldBeginTexture "Texture01" "spectrum" "checkerboard" "float uscale" [ 20.000000 ] "float vscale" [ 20.000000 ] "rgb tex1" [ 0.325000 0.310000 0.250000 ] "rgb tex2" [ 0.725000 0.710000 0.680000 ] MakeNamedMaterial "RoughMetal" "string type" [ "metal" ] "rgb eta" [ 0.200438 0.924033 1.102212 ] "rgb k" [ 3.912949 2.452848 2.142188 ] "bool remaproughness" [ "false" ] "float uroughness" [ 0.100000 ] "float vroughness" [ 0.100000 ] MakeNamedMaterial "Material" "string type" [ "substrate" ] "rgb Ks" [ 0.067215 0.067215 0.067215 ] "rgb Kd" [ 0.243117 0.059106 0.000849 ] "bool remaproughness" [ "false" ] "float uroughness" [ 0.001000 ] "float vroughness" [ 0.001000 ] MakeNamedMaterial "Stand" "string type" [ "matte" ] "rgb Kd" [ 0.200000 0.200000 0.200000 ] MakeNamedMaterial "Floor" "string type" [ "matte" ] "texture Kd" [ "Texture01" ] TransformBeginTransform [ -0.386527 0 0.922278 0 -0.922278 0 -0.386527 0 0 1 0 0 0 0 0 1]LightSource "infinite" "string mapname" [ "textures/envmap.pfm" ] TransformEndNamedMaterial "Floor" Shape "trianglemesh" "integer indices" [ 0 1 2 0 2 3 ] "point P" [ -0.785994 0 3.11108 -4.55196 -4.75246e-007 -0.80933 -0.63155 0 -4.57529 3.13441 4.75246e-007 -0.654886 ] "normal N" [ 1.2361e-007 -1 2.4837e-009 1.2361e-007 -1 2.4837e-009 1.2361e-007 -1 2.4837e-009 1.2361e-007 -1 2.4837e-009 ] "float uv" [ 0 0 1 0 1 1 0 1 ] NamedMaterial "Material" TransformBeginTransform [ 0.482906 0 0 0 0 0.482906 0 0 0 0 0.482906 0 0.0571719 0.213656 0.0682078 1]Shape "plymesh" "string filename" [ "models/Mesh001.ply" ] TransformEndTransformBeginTransform [ 0.482906 0 0 0 0 0.482906 0 0 0 0 0.482906 0 0.156382 0.777229 0.161698 1]Shape "plymesh" "string filename" [ "models/Mesh002.ply" ] TransformEndNamedMaterial "Stand" TransformBeginTransform [ 0.482906 0 0 0 0 0.482906 0 0 0 0 0.482906 0 0.110507 0.494301 0.126194 1]Shape "plymesh" "string filename" [ "models/Mesh000.ply" ] TransformEnd WorldEndIntegrator "path" "integer maxdepth" [ 65 ]? 表示使用路徑追蹤積分器,遞歸最大深度為65(就是光線最多反彈65次)。其實設置成2次結果也差不多:
?畢竟這個場景里也就這一個物體外加一個地板,基本上反射一次就夠了。
在path.cpp里表示為:
bool foundIntersection = scene.Intersect(ray, &isect);// Possibly add emitted light at intersectionif (bounces == 0 || specularBounce) {// Add emitted light at path vertex or from the environmentif (foundIntersection) {L += beta * isect.Le(-ray.d);VLOG(2) << "Added Le -> L = " << L;} else {for (const auto &light : scene.infiniteLights)L += beta * light->Le(ray);VLOG(2) << "Added infinite area lights -> L = " << L;}}即當第0次反彈,或者是鏡面反射的時候,直接計算光照。
Transform :場景內世界坐標系下的物體怎么變換到相機坐標系下。
Sampler "sobol" "integer pixelsamples" [ 64 ] 使用sobol方法來產生隨機數,每個像素采樣64次。下圖是采樣64次的結果:
如果設置只采樣一次:
PixelFilter "triangle" "float xwidth" [ 1.000000 ] "float ywidth" [ 1.000000 ]? 對每個像素使用三角濾波器,還可以選box濾波器等。
Film "image" "integer xresolution" [ 1280 ] "integer yresolution" [ 720 ] "string filename" [ "material-testball.png" ] 設置渲染圖像分辨率和渲染結果圖像的名字。
Camera :相機參數?"perspective"表透視投影。 ?fov:
圖來自learnOpenGL
光源。注意下面的變換矩陣是一個旋轉矩陣。
TransformBeginTransform [ -0.386527 0 0.922278 0 -0.922278 0 -0.386527 0 0 1 0 0 0 0 0 1]LightSource "infinite" "string mapname" [ "textures/envmap.pfm" ] TransformEnd?
總結
以上是生活随笔為你收集整理的PBRT的scene.pbrt使用方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 华为ensp静态路由配置
- 下一篇: OpenStack柏林峰会主会场侧记:O