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 ] 
WorldBegin
	Texture "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" ] 
	TransformBegin
		Transform [ -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
	NamedMaterial "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" 
	TransformBegin
		Transform [ 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" ] 
	TransformEnd
	TransformBegin
		Transform [ 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" ] 
	TransformEnd
	NamedMaterial "Stand" 
	TransformBegin
		Transform [ 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
WorldEnd

Integrator "path" "integer maxdepth" [ 65 ]  表示使用路径追踪积分器,递归最大深度为65(就是光线最多反弹65次)。其实设置成2次结果也差不多:

PBRT的scene.pbrt使用方法 毕竟这个场景里也就这一个物体外加一个地板,基本上反射一次就够了。

在path.cpp里表示为:

        bool foundIntersection = scene.Intersect(ray, &isect);

        // Possibly add emitted light at intersection
        if (bounces == 0 || specularBounce) {
            // Add emitted light at path vertex or from the environment
            if (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次的结果:

PBRT的scene.pbrt使用方法PBRT的scene.pbrt使用方法

如果设置只采样一次:

PBRT的scene.pbrt使用方法PBRT的scene.pbrt使用方法

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:

PBRT的scene.pbrt使用方法图来自learnOpenGL

光源。注意下面的变换矩阵是一个旋转矩阵。

	TransformBegin
		Transform [ -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

 

上一篇:HandsInteractionTrainScene Sample Scene


下一篇:2021_基础