flat assembler
Message board for the users of flat assembler.

Index > Main > memory,convolution & life game

Author
Thread Post new topic Reply to topic
edfed



Joined: 20 Feb 2006
Posts: 4353
Location: Now
edfed 26 Feb 2010, 10:54
while coding my first program (game of life in colors) in 2005, i played on video memory directlly to process the pixel sum.

it is horribly slow.


soon, i played with cpu ram only, and a triple buffering.
it is very fast now.


there, i post 3 versions.


it is to show the difference beetwen direct to screen and triple buffering speed

Smile
enjoy


Description: 3 versions. the slowers are old versions.

slowver=2005,
big ver=2008,
fastver=2010

Download
Filename: life.zip
Filesize: 7.01 KB
Downloaded: 673 Time(s)



Last edited by edfed on 27 Feb 2010, 10:30; edited 1 time in total
Post 26 Feb 2010, 10:54
View user's profile Send private message Visit poster's website Reply with quote
DJ Mauretto



Joined: 14 Mar 2007
Posts: 464
Location: Rome,Italy
DJ Mauretto 26 Feb 2010, 12:11
I like your psychedelic vision of life Smile
Post 26 Feb 2010, 12:11
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4353
Location: Now
edfed 27 Feb 2010, 10:25
it is crazy to seee how a single and simple algorythm can create variious effects.

the pixel sum is a convolution algorythm with a matrix like this one:

Code:
1,1,1
1,0,1
1,1,1
    

replacing the sum by a proportional calculation will create a very complex effect capability.

for example, imagine a convolution matrix like this:

Code:
1,2,1
2,3,2
1,2,1
    


in this case, pixels are additioned after a multiplication by it's weight in the matrix.

etc, etc.

the same thing is possible with 1D and 3D of course.

with 1D, it will act on a signal, for example, a sound.

Code:
0.25,0.5,0.25
    


the 0.5 value will take the half of the current sample, and 0.25 values will take the quart of neibourg samples.

adding them will act as a low-pass filter on the signal, something like a convolution or a FIR or IIR.

better explanatioàns can be found on sites related to DSP.

enjoy algo!
Post 27 Feb 2010, 10:25
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.