픽사포럼에서 발견...
이번 게임동영상 프로젝트를 하면서 필요했던 쉐이더.
surface reelSmartMotionBlur(
uniform float MaxDisplace = 32;
// I don't need float option...
) {
// Get blur vector on image plane in pixels
point rasterP = transform( "raster", P );
point rasterPdPdtime = transform( "raster", P + dPdtime );
vector pixelsMoved = rasterPdPdtime - rasterP;
pixelsMoved *= vector( 1, -1, 0 ); // Revert y-axis
// Original lm2dmv - r->r = (miScalar)( (-v_rMVx/v_dMVNorm) + 1.0f )*0.5f
pixelsMoved = .5 * ( -pixelsMoved / MaxDisplace + 1 );
Oi = 1;
Ci = color( pixelsMoved );
// We dont need blue channel - rsmv takes onlu r, g;
Ci *=color (1,1,0);
}
댓글 없음:
댓글 쓰기