Added maximum texture size to resolution calculation.
Prevents large planes from overflowing buffer