Author Topic: [REDUCED RES] Wire  (Read 11104 times)

0 Members and 1 Guest are viewing this topic.

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1289
  • Karma: 466
    • View Profile
    • my stuff
[REDUCED RES] Wire
« on: August 04, 2008 »
After I found so many great entries were already posted to this month' challenge-installment, I somehow felt like showing what I've got so far. It's not yet where I want it to be and I'll post some updates later on. It'll probably give some ideas and maybe it's interessting to see the progress, too.

After reading this...
Quote
You may change your colour pallette throughout the demo as long as you don't display more than 4 at once
...I figured it would be easy to alternate two (or more) different palettes from frame to frame, thus making two different colours at the same pixel-position appear as a new, different colour.
At a decent refresh rate of 100hz I thought this would work pretty well, yielding 4^2 colours. However, practice showed it's not that easy: LCDs don't handle much more than 60hz and don't blur pixels as nicely as CRTs did.
Flipping a pixel's colour between very different colours just results in heavy flickering, so I reduced the theory to a linear 8 colour-gradient with one frame showing the even colours of the gradient, the the next frame showing the odd colours, thus flipping a pixel's colour between two adjacent colours of the 8-colour palette to reduce the flickering.
See picture 1: gradient reduced to colours 1 3 5 7 (upper), reduced to colours 0 2 4 6 (middle), resulting gradient of alternating both (lower).
This still showed lots of flickering on larger single-coloured areas - so I figured I just wouldn't use single-coloured areas and go for wireframes!

So what I do here is drawing a wireframe-grid using anti-aliased lines with some wave-animation (the classic interference thing). Rendering happens in 8bit greyscale internally (see picture 2) and get's dithered (to reduce colour-banding) to 4 of 8 colours every frame using a 4x4 bayer-matrix. bayer has a less "noisy" layout than floyd-steinberg which works somewhat better with such big pixels. The matrix is then 2x2-transposed every frame to hide the dither-layout.

Now 8 colours aren't particularly much, so I chose the darkest colour not to be black and reduced contrast. Originally I planned a palette that gave a green-monitor's feeling, but that turned out to be a bad choice as the human eye is most sensitive on green. So I went for something amber-like instead.

Since the lighting produces some dark areas (larger single-coloured areas, see above) I chose the same darkest colour in both 4-colour-palettes to reduce the flickering here (didn't hurt much).

For the screenshot (picture 3) I blended two adjacent frames 50:50 to simulate the effect.
You can stop the executable at any time (eg by clicking the window-bar) and count the colours: there are four :)

Here is some pseudo-code for the bayer-dither:
Code: [Select]
void dither(unsigned int *dst, unsigned char *src, unsigned int *pal, int xres, int yres)
{
   // standard bayer dithering matrix:
   char bayer[16]=
   { 1, 9, 3,11,
    13, 5,15, 7,
     4,12, 2,10,
    16, 8,14, 6 };

   for (int y=0;y<yres;y++)
   {
      // select the corresponding line of the dither-matrix
      char *matrix= bayer + ((y & 3)<<2);
      for (int x=0;x<xres;x++)
      {
          unsigned char value= *src++ >> 2;  // no need for the lowest two bits (0..255 -> 0..63)
          unsigned char col= value >> 4; // upper two bits define colour (0..3)
          unsigned char sub= value & 0xf; // lower four bits are "sub-precision" for matrix-compare
          if (sub >= matrix[x & 3]) // use either "col" or "col+1"
            col++;
          // to avoid an overflow-check here you can simply set pal[4]=pal[3] initially.
          *dst++= pal[col]; // store actual colour
      }
   }
}

the c++ source is available here and the freebasic source here.

And here is a youtube link:
[youtube]0WU5yczRQ_o[/youtube]
« Last Edit: January 15, 2013 by hellfire »
Challenge Trophies Won:

Offline Pixel_Outlaw

  • Pentium
  • *****
  • Posts: 1382
  • Karma: 83
    • View Profile
Re: [REDUCED RES] Wire
« Reply #1 on: August 04, 2008 »
Awesome effect!

Concentric circle waveforms....yummy.
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2689
  • Karma: 483
    • View Profile
    • http://www.rbraz.com/
Re: [REDUCED RES] Wire
« Reply #2 on: August 04, 2008 »
Yeah, looking really nice  ;D

Challenge Trophies Won:

Offline AnimalMother

  • btst #6,$bfe001
  • Atari ST
  • ***
  • Posts: 113
  • Karma: 7
    • View Profile
Re: [REDUCED RES] Wire
« Reply #3 on: August 04, 2008 »
Looks really cool. Nice!

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4379
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: [REDUCED RES] Wire
« Reply #4 on: August 04, 2008 »
Indeed. Very nice effect. Simply beautiful.
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline Xalthorn

  • Amiga 1200
  • ****
  • Posts: 331
  • Karma: 100
    • View Profile
Re: [REDUCED RES] Wire
« Reply #5 on: August 04, 2008 »
That's really nice  :clap:
Challenge Trophies Won:

Offline Ghost^BHT

  • Clueless and Happy
  • ^GVY
  • Pentium
  • ******
  • Posts: 931
  • Karma: 49
  • BYTE ME!
    • View Profile
Re: [REDUCED RES] Wire
« Reply #6 on: August 04, 2008 »
Excellent effect
like it alot

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17373
  • Karma: 497
  • evil/good
    • View Profile
    • My Homepage
Re: [REDUCED RES] Wire
« Reply #7 on: August 04, 2008 »
I like it a lot already Hellfire :)

Thanks for being a great sport and explaining how you impliment the effect too, that's really good of you! There's things that you mentioned like the human eye's ability to perceive colours that I hadn't considered and wouldn't have evern thought of!
Shockwave ^ Codigos
Challenge Trophies Won:

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Re: [REDUCED RES] Wire
« Reply #8 on: August 04, 2008 »
Looks like you gave a lot of thought into the implementation, and one hell of a riple effect. I like the end result.

Challenge Trophies Won:

gooner

  • Guest
Re: [REDUCED RES] Wire
« Reply #9 on: August 04, 2008 »
Love the effect the perfect thing to veiw and unwind after a stressfull day.A real chill out routine.
 :clap:


Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: [REDUCED RES] Wire
« Reply #10 on: August 04, 2008 »
Excellent effect :)

Jim
Challenge Trophies Won:

Offline Optimus

  • DBF Aficionado
  • ******
  • Posts: 2452
  • Karma: 127
    • View Profile
    • Optimouse Demo Site
Re: [REDUCED RES] Wire
« Reply #11 on: August 05, 2008 »
Wow, that looks really great. At first it didn't looked lowres by the screenshots :)
Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: [REDUCED RES] Wire
« Reply #12 on: August 07, 2008 »
Nice one Hellfire :)
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1289
  • Karma: 466
    • View Profile
    • my stuff
Re: [REDUCED RES] Wire
« Reply #13 on: August 29, 2008 »
Thanks to everyone for the nice feedback!
Unluckily I didn't find time to make any progress on this for quite a while.
Now I finally attached the final version of this effect.
Used some more colours at the cost of flickering and tried to incorporate the flickering into the style.

The tune is by Dune (*) of Orange and minifmod plays it.

Enjoy!
« Last Edit: August 31, 2008 by hellfire »
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17373
  • Karma: 497
  • evil/good
    • View Profile
    • My Homepage
Re: [REDUCED RES] Wire
« Reply #14 on: August 29, 2008 »
Unbelievable.

I can't get over how well this works, I am not saying I am surprised because I have seen plenty of your past work but my gosh.

It even has a nice synth tune with sync to the music, radial blur and it's sick that it looks as shiny and nice as this with only 4 colours!

This really is a strong challenger to win in my eyes.

I wish that I had half this skill!
Shockwave ^ Codigos
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4379
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: [REDUCED RES] Wire
« Reply #15 on: August 29, 2008 »
I never ever enter a competition in which Hellfire competes ;-)

Awesome release, dude!
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

gooner

  • Guest
Re: [REDUCED RES] Wire
« Reply #16 on: August 29, 2008 »
OMG what an entry this is superb.Everything about this screams brilliant. :clap:
This is a production of blockbuster proportions. :carrot:
Well done Hellfire. :clap:

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Re: [REDUCED RES] Wire
« Reply #17 on: August 29, 2008 »
Awesome music, I dont know how you got this effect running but its one hell of an entry.

Challenge Trophies Won:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1289
  • Karma: 466
    • View Profile
    • my stuff
Re: [REDUCED RES] Wire
« Reply #18 on: August 29, 2008 »
Thank you guys, I really appreciate your comments!

Quote
I dont know how you got this effect running
Well, I didn't change that much.
I now toggle between two different 8-colour-palettes - one blue and one orange, obviously:
First frame shows odd (bit lighter) colours of palA,
2nd frame shows odd colours of palB,
3rd frame shows even (bit darker) colours of palA,
4th frame shows even colours of palB.
I also use differently transposed version of the dither matrix for each frame.
Apart from that I just added an extra light (each light has it's own palette), and the interference-effect got a bit larger wavelength and higher amplitude.
Also I just draw the horizontal lines of the grid.
That's basically it.

Anyway, I'll show the source later, just need a few days to clean that mess up ;)
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2689
  • Karma: 483
    • View Profile
    • http://www.rbraz.com/
Re: [REDUCED RES] Wire
« Reply #19 on: August 29, 2008 »
Very cool indeed, and the song create a nice mood  :clap:
Challenge Trophies Won: