Make the isChunkValidForRender check a lot faster.

Half of the render time was spent to check if a chunk is valid for render.

By precalculating this value when the chunks change, the frame rate
increases for me at a certain world with view distance ultra from
about 40 to 50 FRPS.
Merge PR #1383 by @flo - chunk optimization (commit redo)