qbismSuper8 builds

Discuss programming topics for the various GPL'd game engine sources.
qbism
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am
Contact:

Re: qbismSuper8 builds

Post by qbism »

Tried spans code from engoo. Quite fast, and the concept of long horizontal runs w/o intensity recalc works with fog. One idea is to diff z with old z, and recalc if the delta is enough. Thereby edges keep sharp.

Regarding 32 levels/ slices of fog, that's all the palette can handle unless intermediate layers are dithered.

Rendering in slices, could be done with another Z-buffer that just tracks slice 0 to 31?

I'm finding pseudo-random dithering to be expensive, even with look-up tables, because it must be applied to each pixel (or very small grouping) to look good.
qbism
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am
Contact:

Re: qbismSuper8 builds

Post by qbism »

Image

Image

This is 256 'fake' fog levels obtained by dithering the 32 'real' levels in two axis: a two-steps-forward-and-one-step-back foglevel lookup table and a noise table to jitter the banding pattern. Computed every pixel but all lookup tables. Variable 'noise' is a byte so it just keeps looping over, cheap reproduceable pseudo-random with moire pattern side effect in smooth dark areas. The sequence must be the same every frame or the ants will be crawling.

I tried to speed this up by computing foglevel only at large differences in z. Therefore edges remain distinct. But the conditional statement and math canceled the gain.

The results are faster and prettier than where it started but still at least 20% FPS cost at high resolution. A lot of that is simply the price of looping through the buffers.

Code: Select all

void FogLevelInit(void)
{
    int i, j;
    for (i=0; i<32; i++)
    {
        j = (int)(i * (1.01-fog_density)*2.5);
        foglevel[i*8 + 0] = bound(0, j-1 , 31) * 256;
        foglevel[i*8 + 1] = bound(0, j-2 , 31) * 256;
        foglevel[i*8 + 2] = bound(0, j-1 , 31) * 256;
        foglevel[i*8 + 3] = bound(0, j , 31) * 256;
        foglevel[i*8 + 4] = bound(0, j+1 , 31) * 256;
        foglevel[i*8 + 5] = bound(0, j+2 , 31) * 256;
        foglevel[i*8 + 6] = bound(0, j+1 , 31) * 256;
        foglevel[i*8 + 7] = bound(0, j , 31) * 256;
    }
    for (i=0; i<256; i++)
    {
        j+=7;
        fognoise[i]=((i*6+j)%9);
    }
}
.
.
.
...in R_RenderView...
    if (fog_density && r_fog.value)
    {
        if(previous_fog_density != fog_density)
            FogLevelInit(); //dither includes density factor, so regenerate when it changes
        previous_fog_density = fog_density;
        fogindex = 32*256 + palmapnofb[(int)(fog_red*164)>>3][(int)(fog_green*164) >>3][(int)(fog_blue*164)>>3];
        vidfog = vid.colormap+fogindex;

        for (yref=r_refdef.vrect.y ; yref<(r_refdef.vrect.height+r_refdef.vrect.y); yref++)
        {
            pbuf = r_warpbuffer + d_scantable[yref];
            pz = d_pzbuffer + (d_zwidth * yref);
            for (xref=r_refdef.vrect.x; xref<(r_refdef.vrect.width+r_refdef.vrect.x); xref++)
            {
                level = *(pz++);
                if (level && level<248)
                    *pbuf = fogmap[*pbuf + vidfog[foglevel[level + fognoise[noise++]]]*256];
                pbuf++;
            }
            noise += 13;
        }
    
qbism
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am
Contact:

Re: qbismSuper8 builds

Post by qbism »

Just moved this to FlipScreen, that maddening burner of clock cycles. Because FlipScreen already loops through every pixel, it is big savings for per-pixel fog to just ride that train. The FPS cost drops to <10%. :D
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: qbismSuper8 builds

Post by ceriux »

so i downloaded the latest build and i cant seem to see the entire controls menu o.O also for modders it would be cool to add a text file you can edit or something so that in the options menu you can change the name of the guns.
mankrip
Posts: 924
Joined: Fri Jul 04, 2008 3:02 am

Re: qbismSuper8 builds

Post by mankrip »

ceriux wrote:for modders it would be cool to add a text file you can edit or something so that in the options menu you can change the name of the guns.
Already implemented. Makaqu's PAK10.PAK file even uses this.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
qbism
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am
Contact:

Re: qbismSuper8 builds

Post by qbism »

ceriux wrote:so i downloaded the latest build and i cant seem to see the entire controls menu o.O also for modders it would be cool to add a text file you can edit or something so that in the options menu you can change the name of the guns.
Oops, it's something that should change due to the menu scaling. Not hard to do, will pick it up for next release. Also noticed- mouse focused is released in menu mode (intentionally BTW), which means "mouse1" and "mouse2" can't be set from the meus unless fullscreen. Also the crosshair selection menu is out of alignment.
qbism
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am
Contact:

Re: qbismSuper8 builds

Post by qbism »

New release. Nearly finished with this project. Might even call it a 'beta'.
http://youtu.be/U5sTRO31UCA

Image

[edit] Download the newer one below...

Latest changes-
Faster/ better fog.
Bigger/better/ faster underwater warp from Mankrip tutorial.
Easy installer (or still get the zip if preferred).
Multi-threaded waterwarp, fog, and video buffer processing. Possible speed increase depending on the CPU.
Bugfix: video capture now picks up palette color shifts like power-ups and underwater tint.
Various minor fixes – HUD, colored lights, menu, video modes.
Last edited by qbism on Mon Jul 15, 2013 2:24 am, edited 2 times in total.
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: qbismSuper8 builds

Post by ceriux »

i have to say your engine is probably my favorite. although i wish it could do a few things fte and dp can do. qbism just makes quake look even more awesome!
qbism
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am
Contact:

Re: qbismSuper8 builds

Post by qbism »

Thanks for the feedback, especially since the forum is in a slow time... what would you add?
S8 supports a few extra DP extensions, but if it can play maps/mods geared to BJQ or FQ I'm happy. Beyond that I'd play DP or FTE with gl_nearest_mipmap_nearest :D

Another refinement: qbism Super8 v159 setup.exe
zip install and older versions: https://sourceforge.net/projects/qbism/files/

> Added ‘status bar scale’ to video setup menu.

> Added help text to cvars. Only a few are done so far. Type “chase_active” in the console for an example.

> Moved super8 files to /super8 mod directory to reduce clutter and reduce screwing-up of other engines that might inadvertently use pak88. The engine will sandwich super8 between id1 and any other mod in precidence. So if you're playing warpspasm, the stack is:
warpspasm
quoth
super8
id1

> Added colored lighting for original ID levels to pak88 for convenience, “THE MH UNOFFICIAL 2009 ID1 LIT FILE PACK”.
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: qbismSuper8 builds

Post by ceriux »

things only those engines have mainly just frik_file and csqc. i feel like they should be essential to all engines though. they allow for modders / game makers to do some real custom stuff with quake.
frag.machine
Posts: 2126
Joined: Sat Nov 25, 2006 1:49 pm

Re: qbismSuper8 builds

Post by frag.machine »

I'd also suggest the string manipulation builtins, although I suspect people consider those as part of FRIK_FILE anyway.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
mankrip
Posts: 924
Joined: Fri Jul 04, 2008 3:02 am

Re: qbismSuper8 builds

Post by mankrip »

frag.machine wrote:I'd also suggest the string manipulation builtins
Already implemented, IIRC.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
qbism
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am
Contact:

Re: qbismSuper8 builds

Post by qbism »

Super8 has the LH/QIP string commands inherited from Makaqu, and FRIK_FILE thanks to MH. csqc is not in the scope at this point. If anything, I'd lean toward moderate changes like more qc extensions and scripted menus/ effects.

Most super8 users play it as an alternative to glquake engines for existing mods and maps. One func_msg mapper mentioned using super8 as a preference but within the realm of FQ compatibility.
dreadlorde
Posts: 268
Joined: Tue Nov 24, 2009 2:20 am
Contact:

Re: qbismSuper8 builds

Post by dreadlorde »

working on a sin-city like palette. this is a wip.

http://imgur.com/a/bnJOU/all
Ken Thompson wrote:One of my most productive days was throwing away 1000 lines of code.
Get off my lawn!
qbism
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am
Contact:

Re: qbismSuper8 builds

Post by qbism »

Looks good, dread. Maybe try getting a few brighter highlights in there - lighten the top range a little more. I'd also suggest adding some noise to the palette to get some 'grit' into solid color areas, especially solid black.
Post Reply