We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 60c730e commit e8a6b38Copy full SHA for e8a6b38
sample_04_gouraud.cpp
@@ -87,7 +87,7 @@ int main(void)
87
// 而 model 矩阵就是模型坐标系到世界坐标系的唯一变换,所以要参与一下
88
normal = (normal.xyz1() * mat_model).xyz();
89
float intense = vector_dot(normal, vector_normalize(light_dir));
90
- intense = Max(0.0f, intense) + 0.1;
+ intense = Max(0.0f, intense) + 0.1; // 避免越界同时加入一个常量环境光
91
output.varying_float[VARYING_LIGHT] = Min(1.0f, intense);
92
// std::cout << "color: " << input.attrib_vec4f[ATTR_COLOR] << "\n";
93
});
0 commit comments