You are browsing as a guest. Sign up (or log in) to start making projects!

3h 50m 43s logged

Made rendering more than 4000% faster!

Premature optimisation is the root…

So initially my renderer drew all the cells, even when not in view. There were only 64x64 cells so it was no problem for my lappy at all! But when I increased it to 512x512 my laptop took huge load (45ms rendering time)! Currently after implementing a camera thingy it is now not an issue.

The terrain is generated once and only the visible part (80x45 cells) is rendered in the screen!

This change lead to render times go below 1ms again :)

The maths behind camera thing was really logical error prone, and took a lot of time + I had a rough time working with dynamic arrays of Odin. Apparently you got to use raw_data(array) function to get the underlying data from the array. This is not documented anywhere neither did LSP find me this function when I did try to find it!

Other stuff

I also changed the colours of the terrain.

Added background to the fps and frame_time texts

0
27

Comments 2

@tongyu

so cool :O

@Ankush

@tongyu 💖