cmc233

Forum Replies Created

Viewing 22 posts - 31 through 52 (of 52 total)
  • Author
    Posts
  • in reply to: 作业7的提高题踩得一些坑(慢更中) #5518 Score: 0
    cmc233
    Participant
    6 pts

    这个球是直接用new Sphere(Vector3f(300, 100, 300), 100, metal)创建的,metal->ior取的20,也没定义kd和ks
    (我感觉microfacet和diffuse,specular是独立的,是一种新的材质定义,他的两种极端就是diffuse和specular,所以计算时并不用考虑kd,ks(PS,菲涅尔项有一种近似倒是用ks定义的),如果microfacet想定义颜色,应该是取3个不同的metal->ior来对应rgb(因为菲涅尔项和光的波长有关)
    至于为啥ior取的20(物理上金属一般都是1-2吧),我倒是尝试过1.5,但这时候就特别黑orz,当然,也有可能是我函数写的有问题orz,不过我在网上看用来测试microfacet的模型,ior定义也是10+,v-ray对金属的ior定义也是20+)
    ps,如果直接用new Sphere建球,最好改一下sphere里对光线和球相交的判断,直接用应该会造成大量黑色噪点(和spp无关,加大spp不能减少)

    in reply to: 作业7的提高题踩得一些坑(慢更中) #5514 Score: 0
    cmc233
    Participant
    6 pts

    为啥要考虑这么复杂?直接按microfacet的定义写就行?(如图

    Attachments:
    You must be logged in to view attached files.
    in reply to: 代码框架三角形面积没除2? #5397 Score: 0
    cmc233
    Participant
    6 pts

    好的,谢谢助教

    in reply to: 作业七光线相交测试异常 #5375 Score: 2
    cmc233
    Participant
    6 pts

    会不会是你的 Scene::intersect(ray)写的有问题,因为所有与xy,yz,zx平面平行的区域都没有渲染出来(注意,left那个板子不和yz平行),你在intersect(ray)里判断进入包围和出包围盒的时间是严格小于吗?但对于与xy,yz,zx平面平行的面,此时进入包围和出包围盒的时间是相等的

    This post has received 2 votes up.
    • This reply was modified 4 years, 8 months ago by cmc233.
    in reply to: mipmap微分方程求助 #5344 Score: 0
    cmc233
    Participant
    6 pts

    感觉自己第一次的回答有问题orz,应该还是得转换回世界空间计算。。。不过我跑了一下作业3,在渲染那个奶牛的情况下,转不转换差别很小(因为此时修正的系数比例:1 / (alpha/t.v[0].w() + beta/t.v[1].w() + gamma/t.v[2].w()) * (1/ * t.v[i].w())非常接近1)

    in reply to: mipmap微分方程求助 #5339 Score: 0
    cmc233
    Participant
    6 pts

    在计算深度(保存depth-buffer),肯定是需要转换回世界空间计算的,但是如果是纹理坐标这种其他属性,我感觉没有必要转换回世界坐标,因为其他属性的插值,本身都是被人为定义出来的,只有坐标的插值公式是“真的”

    in reply to: mipmap微分方程求助 #5336 Score: 1
    cmc233
    Participant
    6 pts

    渲染图上x轴方向相邻两个点是(x,y),(x+dx,y),它们之间的距离是dx,其对应的纹理坐标分别是(u,v),(u+du,v+dv),距离是sqrt(du^2+dv^2),这个l算的是这两个距离的比例,然后在Mipmap log_2(L) 层找贴图颜色(相当于是把纹理贴图缩小 2的log_2(L)倍,从而使渲染图和纹理贴图比例相当)

    This post has received 1 vote up.
    in reply to: 作业六 一片蓝问题 #5206 Score: 1
    cmc233
    Participant
    6 pts

    eye ray和eye pos无关,它和你朝哪个方向看有关,默认的应该就是朝“正前方”看,即eye到画面中心是(0,0,-1)

    This post has received 1 vote up.
    in reply to: 作业6 提高题结果比较(提升似乎有限?) #5196 Score: -1
    cmc233
    Participant
    6 pts

    感谢安利

    This post has received 1 vote down.
    in reply to: 作业6 提高题结果比较(提升似乎有限?) #5193 Score: -3
    cmc233
    Participant
    6 pts

    hhhh,奇怪的知识突然增加了,从没想过换个terminal(大概是因为用的少吧orz

    This post has received 1 vote down.
    in reply to: 作业6 提高题结果比较(提升似乎有限?) #5176 Score: -1
    cmc233
    Participant
    6 pts

    在Renderer::Render里光源方向是Vector3f dir = normalize(Vector3f(x, y, -1)),z一直都是负数啊

    This post has received 1 vote down.
    in reply to: 作业6 提高题结果比较(提升似乎有限?) #5172 Score: 1
    cmc233
    Participant
    6 pts

    这是我刚刚跑的,确实只改了那一句话,不过也有可能是系统原因,我的macos。但是,如果建树时间差不多(在bvh建树没改助教源代码的情况下),但渲染时间相差很大,就不应该只是硬件问题了

    This post has received 1 vote up.
    Attachments:
    You must be logged in to view attached files.
    in reply to: 作业6 提高题结果比较(提升似乎有限?) #5168 Score: -1
    cmc233
    Participant
    6 pts

    除了硬件问题,渲染写法的一些细节上也会影响速度,例如我在BVHAccel::getIntersection里把dirIsNeg = {int(ray.direction.x > 0), int(ray.direction.y > 0), int(ray.direction.z > 0)}换成dirIsNeg = {int(ray.direction.x > 0), int(ray.direction.y > 0), 0},bunny的渲染速度直接快了一倍

    This post has received 1 vote down.
    in reply to: 作业6 提高题结果比较(提升似乎有限?) #5099 Score: 0
    cmc233
    Participant
    6 pts

    发现打错了,bunny的建树时间是0.2s,0.3s;SAH建树如果x,z,y都考虑,是0.8s

    This post has received 1 vote down.
    in reply to: 作业6 提高题结果比较(提升似乎有限?) #5097 Score: -1
    cmc233
    Participant
    6 pts

    上面两行是bunny,BVH建树2s,渲染3.6s; SAH建树3s,渲染3.2s
    下面两行是那个复杂的模型,BVH建树6.0s,渲染29.9s; SAH建树7.9s,渲染24.8s
    都是32个buckets

    想问下你们SAH建树的时候是不是只对bounding最长的边进行考虑?我只有这样才能得到上面这么短的建树时间,如果x,y,z轴都考虑,bunny的建树就得7s。。。。(ps,我看参考链接ppt的伪代码考虑了x,y,z)

    This post has received 1 vote down.
    Attachments:
    You must be logged in to view attached files.
    in reply to: 作业6着色错误 #5014 Score: 1
    cmc233
    Participant
    6 pts

    ps,在包围盒那步判断比在Triangle::getIntersection里判断,渲染时间更短

    This post has received 1 vote up.
    in reply to: 作业6着色错误 #5013 Score: 1
    cmc233
    Participant
    6 pts

    发现自己理解错了,scene.buildBVH()不用改orz,不过我没在框架加if(t_tmp<0)return inter也得到了正常图片,但我发现实现包围盒求交(Bounds3::IntersectP)的时候,如果不加判断t_exit>0就会得到黑黑的结果

    This post has received 1 vote up.
    in reply to: 作业6着色错误 #5007 Score: 0
    cmc233
    Participant
    6 pts

    三角形相交代码是指Triangle.hpp里的rayTriangleIntersect()?我没改得到了正确的着色orz,不过我倒是把main里的scene.buildBVH()改了

    cmc233
    Participant
    6 pts
    in reply to: bump和displacement变换得到的normal是否要normalize #3984 Score: 0
    cmc233
    Participant
    6 pts

    好的,谢谢助教

    cmc233
    Participant
    6 pts

    谢谢助教,我把所有的改成norm,并且把Position p = p + kh * n * h(u,v)改成了Position p = p + kn * n * h(u,v)后得到了和作业说明里一模一样的图。(这里你代码里的注释好像笔误了,如果不把kh改成kn,结果就是一团灰噗噗的orz)

    in reply to: 提高部分测试问题 #3242 Score: 1
    cmc233
    Participant
    6 pts

    我猜测不正常的黑边是指:如果没有对像素内的每个取样点维护depth-buffer,就会造成黄色三角形和蓝色三角形重叠边界有黑边(因为先画的黄色三角形,三角形的边界是黄色与黑色的混合色,如果不对每个取样点维护depth-buffer,在画蓝色三角形的时候就没有修改重叠的那部分边界为黄色与蓝色的混合色,就会出现黑边?)

    This post has received 1 vote up.
Viewing 22 posts - 31 through 52 (of 52 total)