L-Sun

Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • in reply to: 作业8verlet结果不正确 #6272 Score: 0
    L-Sun
    Participant

    一端固定了,另一端应该移动dist的2倍,而不是1倍。

    in reply to: 作业7:噪声太重 #5921 Score: 0
    L-Sun
    Participant

    你试试把castRay中相交测试的光线起点往对应方向移动一个epsilon。

    in reply to: 作业七的结果没有示例中的亮度高 #5899 Score: 0
    L-Sun
    Participant

    future.get会阻塞当前的线程,而且你图中castRay的每次递归都会重新创建一个线程,创建线程会有时间开销。
    你应该在spp循环里进行多线程调用castRay来更新framebuffer,而且线程应该要复用,不然每次创建一个线程都会有时间开销。你可以查查C++11怎么实现一个简单的线程池。正确实现的话784*784 32spp大概耗时1分钟多一点(i58400 6线程 Release编译)。

    in reply to: 作业5的结果为啥是倒的? #4766 Score: 0
    L-Sun
    Participant

    图片的原点在左上角,view space的原点正对着图片中心。所以应该是y轴的计算少了个负号。

    in reply to: 作业5编译选项 -fsanitize=undefined 必须吗? #4765 Score: 0
    L-Sun
    Participant

    这个flag是clang编译器在runtime检测一些未定义的行为,应该不是必须的。此flag的Ref

    in reply to: 作业5 render()的疑惑 #4711 Score: 0
    L-Sun
    Participant

    我的做法是先把near plane在view space 的大小确定下来,然后把它的水平分成width*height个小格,每个格子中心(x,y)对应一个像素(i,j),然后找到映射关系就能从(i,j)算出(x,y)。

    in reply to: 作业3双线性插值后效果更差了 #4529 Score: 0
    L-Sun
    Participant

    uv坐标是0到1,比如u刚好为1的时候,得到的width刚好是1024,而图片的坐标的范围是0~1023,所以要width-1。height同理

    in reply to: Vscode 引入eigen 库 #4475 Score: 0
    L-Sun
    Participant

    在Windows下使用vscode的话,可以用cmake-tools插件来配置代码,而eigen和opencv可以用vcpkg来统一安装。

Viewing 8 posts - 1 through 8 (of 8 total)