Make distance fog calculation overflow less in mediump

上级 4a412320
#ifdef USE_FOG #ifdef USE_FOG
float fogDepth = length( vFogPosition ); // divide then multiply by max component to try to avoid saturating mediump precision
vec3 fogPositionAbs = abs( vFogPosition );
float fogMaxComponent = max( fogPositionAbs.x, max( fogPositionAbs.y, fogPositionAbs.z ) );
float fogDepth = length( vFogPosition / fogMaxComponent ) * fogMaxComponent;
#ifdef FOG_EXP2 #ifdef FOG_EXP2
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册