discard invalid regions
clamp float values