Opengl_14_环境光

1,
光源颜色 * 物体表面颜色 => 得到反射回来的颜色
再乘以环境光的强度因素从而得到最终的颜色值。





2,
获取键盘事件修改环境强度因素值。


每次渲染的时候传入
光源颜色值和环境强度因素值。
glUniform3f(dirlight_colorlocation, directionallight.Color.x, directionallight.Color.y, directionallight.Color.z);

glUniform1f(dirlight_ambientintensitylocation, directionallight.AmbientIntensity);


3,

v++


b++

posted @ 2017-02-16 19:20  细雨细语  阅读(254)  评论(0编辑  收藏  举报