moved some logic to vertex shader