提交 69a8d3b3 编写于 作者: B Ben Adams

remove glsl square and bracket whiteCompliment

上级 1d163773
......@@ -4,9 +4,8 @@
#define LOG2 1.442695
#define EPSILON 1e-6
#define square(a) a * a
#define saturate(a) clamp( a, 0.0, 1.0 )
#define whiteCompliment(a) 1.0 - saturate( a )
#define whiteCompliment(a) ( 1.0 - saturate( a ) )
vec3 transformDirection( in vec3 normal, in mat4 matrix ) {
......
......@@ -12,7 +12,7 @@
#ifdef FOG_EXP2
float fogFactor = whiteCompliment( exp2( - square( fogDensity ) * square( depth ) * LOG2 ) );
float fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );
#else
......
......@@ -59,7 +59,8 @@ varying vec3 vViewPosition;
vec3 calcCosineTerm( in vec3 normal, in vec3 lightDir ) {
vec3 cosineTerm = vec3( saturate( dot( normal, lightDir ) ) );
float dotProduct = dot( normal, lightDir );
vec3 cosineTerm = vec3( saturate( dotProduct ) );
#ifdef WRAP_AROUND
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册