10.03.2019 - Round 1 results of our "A Love Letter For FreeBASIC" game dev competition have been published. Please be sure to check the results thread: http://games.freebasic.net/forum/index.php?topic=629.0. Don't forget that the competition is continuing with a round 2, lasting till 29th of April, 300 USD first prize. Stay tuned!

Author Topic: HQ2X filter (better algorithm than Scale2X for doubling your graphics screen)  (Read 9217 times)

Lachie Dazdarian

  • Double dipper
  • Administrator
  • Forum Sage
  • *****
  • Posts: 1305
    • Yahoo Instant Messenger - lachie13
    • View Profile
    • The Maker Of Stuff
    • Email
This code is also by Mysoft.

http://lachie.phatcode.net/hq2x+16bit.zip

Thought someone might find it useful. It's only 16 bit, and in the specific test I get 65 FPS on my PC. With Scale2X in 16 bit I get 122 FPS. Still, HQ2X gives much better results.

See this website for more info: http://www.hiend3d.com/hq2x.html
"Things like Basic and Free Basic provide much-needed therapy and a return to sanity and a correct appreciation of people. The arrogant folk really hate a word like 'Basic' - fine, and good riddance." ~ pragmatist

notthecheatr

  • Global Moderator
  • Forum Sage
  • *****
  • Posts: 351
  • Who's the guy from 21 Jump Street?
    • AOL Instant Messenger - notthecheatr
    • Yahoo Instant Messenger - TheMysteriousStrangerFromMars
    • View Profile
    • notthecheatr Home
    • Email
Sweet, this is something we need.

But... 16-bit?!?!?!  Who in the world uses 16-bit colour?!
The funniest thing happened yesterday.

Lachie Dazdarian

  • Double dipper
  • Administrator
  • Forum Sage
  • *****
  • Posts: 1305
    • Yahoo Instant Messenger - lachie13
    • View Profile
    • The Maker Of Stuff
    • Email
Erm...did you try to display a 24-bit color depth image in 16-bit mode? You'll barely notice the difference from 32-bit mode. Of course, this does depend on the things you are doing, but for some random "no insane lighting effects" project 16-bit should do the trick. I wish people would allow users in processor demanding games to run their game in 16-bit mode, like syn9 plans to do with ZeroGTR.

The only downside of fbgfx 16-bit mode is no PNG transparency and no alpha primitives. If I'm not mistaken.
"Things like Basic and Free Basic provide much-needed therapy and a return to sanity and a correct appreciation of people. The arrogant folk really hate a word like 'Basic' - fine, and good riddance." ~ pragmatist

mysoft

  • Recruit
  • **
  • Posts: 48
    • MSN Messenger - mysoft@bol.com.br
    • View Profile
    • MyTDT Software
    • Email
othen than 16... the author said that 16 bpp is perfect for the calcs into the algorithm... so im saying that make this complicated scaler in 16  bpp is faster than do a 32>16>filter>32 conversion, i will look forward to get a 2xsai algo that is a little faster than the HQ2x the quality is a little better for corners... but it solves better some dithered (few colors) graphics... and is also 16bpp
Programming is like love... you will never acomplish anything by treating your language as if it was a tool, or a slave of yours...

N3trunn3r

  • Novice
  • ***
  • Posts: 73
    • View Profile
Does anyone know if there is a 32-bit version? Or what to change in the code so it would become 32?

darkhog

  • Recruit
  • **
  • Posts: 21
    • View Profile
If we are on scaling grounds, a little OT maybe. I always wondered why graphic editing programs like GIMP didn't implement scaling algorithms such as SuperEagle and the best they have is scaling method with blurs out image. I mean, since those algorithms works in games and emulators where performance matters and are IMO several times better than GIMP's "oh, let's rescale and use gaussian blur" method, why they aren't used in software where performance doesn't really matters such as graphic editors?

3D

  • Recruit
  • **
  • Posts: 24
    • View Profile
know this is an old post but its runs 160-200fps on my machine  ::)