arc

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • in reply to: 作业7 简单抗锯齿出现毛边 #6488 Score: 1
    arc
    Participant
    5 pts

    直接修改的话会导致每个像素都取到某一个固定的位置上,产生毛边是正常的。
    你需要在计算每一个样本的时候都计算一个随机的位置,这样才会产生平滑的结果。

    This post has received 1 vote up.
    • This reply was modified 3 years, 11 months ago by arc.
    Attachments:
    You must be logged in to view attached files.
    in reply to: 作业8 构建rope时出错 #6145 Score: 0
    arc
    Participant
    5 pts

    这样创建的 m 和 s 的生命周期仅仅在循环体中,每次退出循环都会将它们销毁。这样直接取指针会导致之后使用已销毁的对象,产生运行时错误。
    你需要使用动态内存分配的方法对对象的生命周期进行管理。
    masses[i] = new Mass(position, node_mass, false), 下面的 springs 也类似。

    in reply to: 作业7多线程结果较暗 #6110 Score: 1
    arc
    Participant
    5 pts

    因为这样写的话计算每个像素都需要创建 num_threads 个线程,开销比较大。
    最好是将每个线程的任务量尽可能多分配些。

    This post has received 1 vote up.
    in reply to: 作业7多线程结果较暗 #6108 Score: 0
    arc
    Participant
    5 pts

    int id = n_threads * tid + i 改成 int id = n_loops * tid + i 看看?

    in reply to: 作业二提高部分思考 #6018 Score: 0
    arc
    Participant
    5 pts

    在两个三角形边界处进行超采样后,如果产生黑线,说明超采样时越过了被覆盖的蓝色三角形,采样了背景的黑色(或者混合的结果包含背景的黑色)。正确的结果应该是将蓝色和绿色进行混合,边界处产生平滑的过渡。
    另外如果背景是白色,那么非交界处的边缘应该是三角形颜色和白色混合,如附图所示,看不见明显的黑边。

    Attachments:
    You must be logged in to view attached files.
    in reply to: 作业7的基础上处理其他材质 #6016 Score: 0
    arc
    Participant
    5 pts

    spp 好像是 1024。

    in reply to: 作业7的基础上处理其他材质 #6009 Score: 1
    arc
    Participant
    5 pts

    我渲染的结果是这样(加上了色调映射和伽马矫正),好像是差不多的。

    This post has received 1 vote up.
    Attachments:
    You must be logged in to view attached files.
    in reply to: 作业7 OpenMP更新进度条问题 #5939 Score: 0
    arc
    Participant
    5 pts

    你可以把最内层的 UpdateProgress() 去掉,再对外层的 UpdateProgress() 加锁。

    in reply to: 作业7的一个报错 #5849 Score: 0
    arc
    Participant
    5 pts

    Vector.hpp 中的 Vector3f 类只实现了 double operator[](int index) const 没有实现 double& operator[](int index)
    在链接的时候编译器找不到这个符号的实现所以报错。

    • This reply was modified 4 years ago by arc.
    Attachments:
    You must be logged in to view attached files.
    in reply to: 作业7,测试结果全黑 #5848 Score: -1
    arc
    Participant
    5 pts

    1. 浮点运算是有误差的,直接等于的话大概率会判定为不穿过 p。
    2. 为什么要判定光线是否穿过一个法向量?

    This post has received 1 vote down.
    in reply to: Triangle.hpp中两个重名函数的区别是什么? #5299 Score: 1
    arc
    Participant
    5 pts

    首先调用链 Renderer:Render() –> Scene::castRay() –> Scene::Intersect() -> BVHAccel::Intersect() –> BVHAccel::getIntersection(), 此时求的是光线与 Scene 的 BVH 的交, 从 main.cpp 可以知道 BVH 里的物体只有类型为 MeshTriangle 的对象, 那么在 Scene 的叶结点处调用光线与 MeshTriangle 的求交, 即 BVHAccel::getIntersection() –> MeshTriangle::getIntersection().
    MeshTriangle 构造时从 .obj 读取三角形的信息, 将三角形坐标存放在成员 std::vector<Triangle> triangles 内, 并在构造函数的最后构造了它的 BVH. 那么对一个 MeshTriangle 求交时光线就和它的 BVH 求交, 遍历到叶结点时与 Triangle 求交, 即 MeshTriangle::getIntersection() –> BVHAccel::Intersect() –> BVHAccel::getIntersection() –> … –> Triangle::getIntersection().
    总的来说, 就是光线先与 Scene 的 BVH 求交, 再与 MeshTriangle 的 BVH 求交, 最后与 Triangle 求交.

    This post has received 1 vote up.
    • This reply was modified 4 years ago by arc.
    in reply to: Triangle.hpp中两个重名函数的区别是什么? #5297 Score: 0
    arc
    Participant
    5 pts

    这是两个不同类的方法吧, 一个是 Triangle 的, 另一个是 MeshTriangle 的.

    in reply to: 作业六 编译报错 #5237 Score: 2
    arc
    Participant
    5 pts

    Vector.hpp 中只声明了 double& operator[](int index), 但没有给出其定义, 导致编译器在链接时找不到该函数.

    This post has received 2 votes up.
    in reply to: 作业5,结果中地面为什么不平 #4825 Score: 0
    arc
    Participant
    5 pts

    E2 错了。

    in reply to: 作业三在运行Rasterizer时core dump #4245 Score: 0
    arc
    Participant
    5 pts

    你可以使用 gdb,在编译时加上 -g 选项,之后用 gdb 跑出错误再打 bt就可以看到调用链中的内容。

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