Skip to content

Commit e8a6b38

Browse files
committed
补充说明
1 parent 60c730e commit e8a6b38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sample_04_gouraud.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ int main(void)
8787
// 而 model 矩阵就是模型坐标系到世界坐标系的唯一变换,所以要参与一下
8888
normal = (normal.xyz1() * mat_model).xyz();
8989
float intense = vector_dot(normal, vector_normalize(light_dir));
90-
intense = Max(0.0f, intense) + 0.1;
90+
intense = Max(0.0f, intense) + 0.1; // 避免越界同时加入一个常量环境光
9191
output.varying_float[VARYING_LIGHT] = Min(1.0f, intense);
9292
// std::cout << "color: " << input.attrib_vec4f[ATTR_COLOR] << "\n";
9393
});

0 commit comments

Comments
 (0)