Mon Jul 27, 2015 8:20 pm
Mon Jul 27, 2015 9:43 pm
Valden wrote:NOTE : I would be very happy if someone could help me finding a faster way to render the "blocks". At the moment, the worst case scenario put the CPU at 110 % which I don't really like (even if it's barely noticeable). For the rendering, I use 2 "fillTiangles" per blocks. For comparison, a wire-frame rendering only use 35 % of the CPU, but the game is less readable.
Mon Jul 27, 2015 9:51 pm
jonnection wrote:Valden wrote:NOTE : I would be very happy if someone could help me finding a faster way to render the "blocks". At the moment, the worst case scenario put the CPU at 110 % which I don't really like (even if it's barely noticeable). For the rendering, I use 2 "fillTiangles" per blocks. For comparison, a wire-frame rendering only use 35 % of the CPU, but the game is less readable.
Hi Valden. Very nice game. I took a look at your 'drawWalls' code and the fillTriangle code in Gamebuino lib. The fillTriangle routine is very unoptimized (two divisions in inner loop). Division on atmega328 is a performance killer. You will not get decent speed unless you write a proper polyfill routine with scan conversion or someone optimizes fillTriangle. Furthermore fillTriangle actually uses fastHline routine which is also unoptimized as it draws the line pixel by pixel. Proper polyfill on this hardware means a) scan converting lines b) filling in with fast vertical lines using bitshifted bytes instead of pixel by pixel drawing. Literature and examples of how fast polyfill is done can be found aplenty in the internet. Offhand I believe your code is about 10% of what it could be. Floating point numbers is another killer on atmega, as it has no floating point hardware.
Mon Jul 27, 2015 10:09 pm
(I can't add more feature though like grayscale because of the fact I already use 100 % of the cpu).
An important note though : Disabling the sound offers a significant boost in performance for my game
Sat Aug 08, 2015 4:11 pm
Thu Nov 19, 2015 11:49 pm
Mon Nov 23, 2015 2:43 am