在基于作业2来完成作业3的rst::rasterizer::rasterize_triangle
时,
我发现几个地方有点难以理解:
1) void rst::rasterizer::rasterize_triangle(const Triangle& t, const std::array<Eigen::Vector3f, 3>& view_pos)
中的view_pos参数的作用和意义?
2) 以法线插值为例:
我的实现如下, 请问在interpolate里面的weight参数是做什么用的? 我这里传的是1.0, 效果跟正常的normal shader 效果不一样…
`
…
auto[alpha2, beta2, gamma2] = computeBarycentric2D(x, y, t.normal);
auto interpolated_normal = interpolate(alpha2, beta2, gamma2, t.normal[0], t.normal[1], t.normal[2], 1.0);
…
`
3) interpolated_shadingcoords
是根据什么来进行插值? 是三角形的顶点坐标vertex还是别的?
感谢各位大佬, 再次谢过~
This post has received 2 votes up.
-
This topic was modified 4 years, 7 months ago by 欠你一枝花.
Attachments:
You must be
logged in to view attached files.