lerp and mix

x*(1- weight) + y*weight 의 연산을 정리하면  x + weight(y-x) 로 할 수 있다. 
 
 float3(float x , float y , float weight) 
{ 
//return x*(1-weight)+y*(weight); 
return x+weight*(y-x); //--operator saved 
} 
Game Developer Leegoon copyright all right reserved since 2010.

Comments