Would it be possible to implement the function of screen filters in GLB?
Kind of like it's done in almost any retro game emulato - filters that process the whole screen, making it look different, scaled 2x, with scanlines, etc...
Here's an example I googled out, to illustrate the usage of those filters. Pay attention how the Yoshi's island looks for example - it's amazing!
http://www.neogaf.com/forum/showthread.php?s=4269ccbc52dc1d8dc6b8a4dac401229f&t=221725 (http://www.neogaf.com/forum/showthread.php?s=4269ccbc52dc1d8dc6b8a4dac401229f&t=221725)
Here's another example of PAL filtering for the Amiga emulator. Really brings out the charm in retro graphics.
http://eab.abime.net/showthread.php?t=29206 (http://eab.abime.net/showthread.php?t=29206)
Sorry, bad English :puke:
Can help this?
SETSCREEN 320,240,0
GETSCREENSIZE x,y
line = 2
DRAWRECT 0,0,x,y,RGB(0xff, 0x00, 0x80)
FOR i = 0 TO y/line-1 STEP line
DRAWRECT 0,line*i,800,line,RGB(0x11, 0x11, 0x11)
NEXT
SAVEBMP "scanline.png"
BLACKSCREEN
LOADSPRITE "scanline.png",0
WHILE TRUE
DRAWRECT 0,0,x,y,RGB(0xfc, 0x83, 0xb6)
ALPHAMODE -0.5
DRAWSPRITE 0,0,0
ALPHAMODE 0.0
SHOWSCREEN
WEND
END
No, that's just a workaround if you need scanlines.
Filters offer much, much more, and the code is already available.
For example, you are developing on the PC, for Wiz which has 320x240 screen.
If you use windowed mode on the PC, everything is too small on screen. If you use fullscreen then everything is just too big and pixelated.
If we had filters, you could possibly enable "2x filter" that would scale everything on screen by two, thus having 640x480 window, without hacks in the code.
for example, the command would be something like this
GLFILTER type, value1, value2, etc...
so for HQ3x resize filter(like in above yoshi island example) it would be:
type = 1 (resize)
value1 = resize times (2x, 3x)
value2 = 0 -normal, 1 -high quality
SETSCREEN 320, 240, 0
GLFILTER 1, 3, 1
That way you could easily manipulate multiple filters, or remove them easily.
Here's the website:
http://www.hiend3d.com/demos.html (http://www.hiend3d.com/demos.html)
Yes, possible.
Procedure:
Draw to your backbuffer and GRABSPRITE, or even to a SCREEN in the first place.
Load and apply a shader (X_LOADSHADER).
Draw the sprite with DRAWSPRITE.
I did this here:
http://www.glbasic.com/showroom.php?game=C64colorshader (http://www.glbasic.com/showroom.php?game=C64colorshader) which is exacly what you want, but the other way round ( I make images look worse instead of better ;) )
This might be interesting for you:
http://wiki.github.com/pdjonov/hqnx (http://wiki.github.com/pdjonov/hqnx)