News for hackers. Stuff that matters.
Re:True 8-bit Color Cycling with HTML5 by ajross on Wednesday April 25, 2012 @03:53PM (#3890721)
It's a nit, but this demo is "true" color cycling only in the sense of "faked" color cycling. The original hack used a series of color cells in the pallet to represent the object that was "moving", then updated the pallet (and only the palette) per-frame to effect the animation.

An HTML canvas has no palette. And in fact, for didactic emphasis, I just tried this on my phone -- where it works -- that has no color palette hardware at all. This code can only do what it does by doing what the original did not: modifying all the changed pixels every frame. It's emulating the original hack, not duplicating it.

Re:True 8-bit Color Cycling with HTML5 by FreeFull on Wednesday April 25, 2012 @04:30PM (#3890912)
Would you say that if I write a colour cycling program and run it in dosbox, it isn't real colour cycling because it is being emulated?
Re:True 8-bit Color Cycling with HTML5 by ajross on Wednesday April 25, 2012 @04:36PM (#3890938)
Given that dosbox is an "emulator" (says so right there in the man page!), yes. You expected a different answer? Dosbox doesn't support "true" palette animation either (well, unless you give it access to the real VGA registers of real hardware, which can be done in some emulators).

The point was that the programming technique required to make this work is not the same as the one used on palette hardware, so calling it the "true" effect is going to be confusing to people who don't know exactly how this works.

Re:True 8-bit Color Cycling with HTML5 by sp332 on Wednesday April 25, 2012 @05:09PM (#3891104)
An HTML canvas has no palette.

This one does. You can see it in the lower right.

I just tried this on my phone -- where it works -- that has no color palette hardware at all.

This is HTML. It's a software palette.

Re:True 8-bit Color Cycling with HTML5 by TazeTSchnitzel on Wednesday April 25, 2012 @05:22PM (#3891173)
No, he's right, an HTML canvas has no palette. It's a software emulation in JavaScript.
Re:True 8-bit Color Cycling with HTML5 by jamesrom on Wednesday April 25, 2012 @09:07PM (#3891892)
How does that even matter? The technique being used is real color cycling. Whether the palette is abstracted in hardware or software hardly makes a difference...
Re:True 8-bit Color Cycling with HTML5 by ajross on Wednesday April 25, 2012 @11:15PM (#3892206)
The point was narrower: If you don't already know how this works, calling it "true" pallet animation is terribly confusing (imagine someone looking through specs for where the pallet API for the canvas is). If the title was "8bit-style Color Cycling in HTML" I never would have posted.
Re:True 8-bit Color Cycling with HTML5 by henrikschroder on Thursday April 26, 2012 @03:19AM (#3892853)
And to nit-pick even further: These images resemble the graphics of the Amiga and Atari home systems, which were 16-bit systems. To do this on a PC you would need XGA graphics (VGA couldn't do 640x480x256) which arrived at the PC around the time of the 386 processor, which was 32-bit. I think you could probably attach a XGA card to a 286 PC, but that was still 16-bit. I don't think anyone ever paired a XGA card with an 8088 PC, which actually was an 8-bit system.

So, this isn't even 8-bit art, it's more likely 32-bit art. :-)

Re:True 8-bit Color Cycling with HTML5 by kronusaturn on Thursday April 26, 2012 @04:55AM (#3893018)
It's 8-bit color; 8 bits per pixel for 256 colors. Nothing to do with the CPU.
Re:True 8-bit Color Cycling with HTML5 by exDM69 on Thursday April 26, 2012 @05:58AM (#3893137)
Look at your CPU usage while viewing this page. The idea behind the original palette rotation tricks was to use less CPU. The actual palette values were deep inside the graphics adapter and was faster to change than the actual pixels on the screen.

Maybe we should do palette rotation tricks with (WebGL) shaders running on the GPU h/w to get a similar effect without the CPU hit.

Re:True 8-bit Color Cycling with HTML5 by ajross on Thursday April 26, 2012 @11:52AM (#3894492)
Even that wouldn't pass the "true" test. You could implement the "pallet" using a texture lookup on the GPU of course, but could only apply it by rewriting all the pixels.