4 ms·
Does having a fixed isometric perspective give any benefits to performance or code quality?
by tgb 13y ago
Does having a fixed isometric perspective give any benefits to performance or code quality?
- corysama 13y agoMy guess: Because there is no perspective or camera rotation, changes in the appearance of the voxels are limited to screen-aligned translation, zooming and changes in lighting. Relighting is easy assuming he's using standard deferred rendering techniques. Zooming can be clamped to a certain range. If the voxels are rendered off-screen at maximum zoom, that just leaves panning the render around on the screen. In other words, he can render each tile once and cache them as 2D images to reuse in later frames. Each frame he only needs to render new tiles that have not been seen before. Unless you are panning really fast, that's a small amount of work compared to re-rendering the whole screen every frame like most 3D engines do.
- gavanwoolery 13y agoThat's pretty much exactly whats going on. It renders it to a frame and then uses deferred rendering for the lighting. Static objects (i.e. terrain) are not re-rendered until the camera moves, but dynamic objects (like the grass) are rendered in realtime (unless the grass animation is turned off, which I have included for weaker machines).
- gavanwoolery 13y agoYes! With a dynamic (traditional) perspective, you must obviously render every time the camera moves. Since the camera never changes angle, I can render once and be done with it until something is changed or the memory pool cycles back to the start (i.e. a chunk falls out of rendering distance). In terms of code quality, it is actually far more difficult (IMO) to do isometric projection with a 0.5 slope (not true isometric with 120 degrees between axes). You can build a projection matrix to handle it but I actually just worked out the math by hand to handle the projections and inverse projections. So, for a while this really put a dent in how clean my code was until I refactored everything several times.