ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

PBRT的scene.pbrt使用方法

2021-01-16 23:57:03  阅读:281  来源: 互联网

标签:string pbrt float scene Transform rgb 0.482906 integer 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次结果也差不多:

 毕竟这个场景里也就这一个物体外加一个地板,基本上反射一次就够了。

在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次的结果:

如果设置只采样一次:

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

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

	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

 

标签:string,pbrt,float,scene,Transform,rgb,0.482906,integer,PBRT
来源: https://blog.csdn.net/tiao_god/article/details/112726121

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有