提交 8a31cd8d 编写于 作者: M Mr.doob

Implemented gero3 normalToComponent optimisation.

上级 e85a0605
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -785,9 +785,8 @@ THREE.CanvasRenderer = function () {
function normalToComponent( normal ) {
// https://gist.github.com/665829
return normal < 0 ? _min( ( 1 + normal ) * 0.5, 0.5 ) : 0.5 + _min( normal * 0.5, 0.5 );
var component = ( normal + 1 ) * 0.5;
return component < 0 ? 0 : ( component > 1 ? 1 : component );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册