This------------------------->
My head -> :S
In a good way![]()
Edit: Updated the attachments to support the new variable-resolution digital screens, but this example is still 32x32. Also increased the rendering to match the scanning rate (runs even smoother now). New video too.
This is basically a 32x32 pixel digital camera that has been sped up substantially. The small expression runs nearly 3000 times per second to display live moving greyscale images at over 10 FPS. Here's a video that demonstrates its speed:
How is it running so fast? A single Random chip feeds four inputs of an expression ("cascader") whose sole operation is flipping a persistent variable between 0 and 1 (Out = !Out). Since the Random chip generates a consistent stream of 67 random numbers per second and expressions execute once for any change in input, this chip becomes an On/Off flip-flop that runs at 67x4=268 Hz. Incidentally, 268 Hz is also the maximum speed that both E1 and E2 expressions can be triggered by change in a single input; any faster and they will begin to skip execution.
The output of the first expression feeds 11 inputs of the main camera expression ("eye") to multiply the running speed to 2948 Hz. Four ranger readings per run give a speed of 11,792 pixels/second (by comparison, the external Ranger supplies data at only 22 pixels/second). Since a 32x32 screen is 1024 pixels, this means a whole picture can be captured and displayed every 0.087 seconds (11.5 FPS).
A mechanism I implemented to avoid lag was to skip re-rendering the parts of the image that had stayed the same and only update that which had actually changed. To do that I saved each calculated pixel brightness to an array, and only updated the pixel on the screen if the value no longer matches the previous stored one.
Feel free to tune my design to your own liking. If you don't plan on using a video screen (i.e. you'll be storing pictures first and displaying them later like a regular camera), then adding more inputs and/or more internal ranger readings per execution would increase the data collection rate to even more stupendous heights. You might be able to take a true 1 megapixel photo in a reasonable amount of time. Just be sure to post a reply in this thread so that I can see what you've built.
Last edited by Josef; 06-13-2009 at 03:35 PM.
This------------------------->
My head -> :S
In a good way![]()
Man, that thing gets better FPS than my old computer.
Nice work!
/me forks over a cookie
why not set interval? or use a square pulse? why a random gate?
ЗАГРУЗКА...................
I will attempt this later with some of the tools in my toybox.
I got my E2 to execute 172,000 times a second, on multiplayer with 6 people connected, and that was me being liberal. I will do further tests tomorrow on singleplayer to see how high I can crank it up before it goes Kaput.
I also have a GPU made that works like a digital screen, I still need to do more testing on it, but it should be able to handle much greater painting speeds.
overclock i like it
PS
box head....
all the player model have box heads......... ö
Youtube :http://www.youtube.com/user/oen2oen
Very nice!
You could try using writeString per character, it has that functionality built-in (skip redrawing the same chars and colors), and it does both char and color at the same time in Lua. You should probably see decent performance gain if you use that instead.
Because random is more reliable, pulses can "merge" if they are too fast and then nothing happens.
Syranide why can't you just officialy allow e2 to run at this speed, instead of forcing people to use workarounds like random inputs?
btw Josef that thing is frikken awesome.
Because then people would on public servers and everyone come whining here that the E2 is crashing and slowing down servers.
When you run at that rate you're creating serious performance problems.
Additionally, people would use it for non-sense stuff anyway, like having interval(0.1) for updating their spaceship, even though it would only make the spaceship perform worse.
Bookmarks