Koko-aio shader discussions and updates

Hi there guys, i’d like to introduce you a new feature of koko-aio.

I’ve named it DELTA RENDER and it is now statically enabled in development repo. It is meant to boost fps by render only the part of the screen that has been changed and reuse the already rendered one otherwise.

Tested on an heavy preset (at least on my haswell):

Enabled on almost static content: 124fps

enabled on almost completely moving content:113fps

Almost completely moving content: 103fps

disabled: 95fps

Without going too much in the technical details, it is statically enabled through the file config.inc, so if you want to play with its parameters you have to edit that file:

#define DELTA_RENDER 1.0
enables or disables (1.0/0.0) delta rendering, enabled by default.

#define DELTA_RENDER_CHECK_AREA 1.0
The lower, the higher the fps.
Set the area that has to be unchanged for the feature to kick in.
Setting it to 0.0 would likely produce artifacts, while setting higher may come handy to track wider blooms.

#define DELTA_RENDER_FORCE_REFRESH 4
The lower, the lower the fps gain.
Forces a full refresh every number of frames (4 by default).

Note that you can NOT rely on delta render to speed up your fps consistently, because it depends on the content, so if your potato gear is not able to run some preset, you cannot expect it to be able just now as it would be an alternating smooth/jerky jumpy experience.

Still, if you’re using a battery powered device, you can expect longer battery life between, i’d say, 10% on shoot-em ups and 30% on puzzle games.

11 Likes

Very nice! Just a quick question. Have you managed to get it working properly on the vulkan renderer and SNES cores? It seems there are issues.

Really?

Cannot test right now, btw I only tried on mame 2003 plus.

I just use mipmaps (thanks for the suggestion to check wider areas to clear stale pixels!) and feedbacks, for it to work, so nothing that i’ve had not already used for other things, I mean.

What kind of issues?

Btw i forgot to push the changes, done right now remotely (read: i’ll have the chance to test tomorrow, probably)

2 Likes

Mostly artifacts and bad refresh. Glcore is fine.

seems fine:

3 Likes

Oh, that’s nice. Great work anyway. :smiley:

3 Likes

@kokoko3k are those preset already present in the online updater? I don’t mean the new feature (that sounds vey interesting!) but the mask set up you have in this link to the past and aero fighter 2 from few posts up?

1 Like

It is the same mask used in all of the screenshots (just different bloom mixes) and it is not available nor feasible with the current retroarch shipped version because it uses features of the low level phosphorgrid emulation.

Check in the development build (zip in the first post) under:

presets-ng/WIP/pgrid4-Screenlevel_HMask-CoreLevel_SlotMask-Take3.slangp

1 Like

BSnes and Vulkan working fine on my amd setup.

Great work as usual!

UPDATE - ok, there are artifacts in some games - check out Rave Racer via Mame and you should be able to see it clearly enough.

So, not sure if it’s related to interlaced and or hires content?

1 Like

The 3DO emu is also a good place to see the artifacts at play.

Exactly that, interlaced content is not compatible with delta render, i was just checking flycast just now. It will never be, since the scanline alternating thing is skipped by the renderer. I’ve add a little note in config.inc about it and have to decide how to handle the thing. Disabling delta render when interaced emulation is enabled seems the obvious choice.

1 Like

Delta render disabled on interlaced content just now. You can get similar vibe by disabling scanlines on interlacing content and by forcing interlace flickering on non interlaced content tho.

Also added runtime parameters to change forced render interval and area check.

2 Likes

Just noticed that at least on my Linux rig, Ambient light is broken with nvidia+glcore:
flycast+nvidia+glcore: broken
flycast+intel+glcore: working
flycast+amd+glcore: working
flycast+nvidia+vulkan: working
…weird.

From memory, tha bug also affects PS2.

1 Like

Yesterday i checked nintendo64 and worked.
As soon as I have time, i’ll take a deeper look.

1 Like

Well, i managed to find the issue, i dont know why in this particular configuration, and only in that particular pass, the reported mod() function acted in a different, but predictable way.
Fortunately a workaround that does not break working cases was not only possible, but also gpu cycle free.

Just pushed, it should work now.

2 Likes

Cool. Did you get a chance to check the reflections for PS2?

You mean ambient light? Nope, no PS2 content here.
Still broken?

No, ambient light is working, but the bezel reflection doesn’t seem to be working (amd).

Yeah, now i remember. ps2+amd+glcore or ps2+amd+vulkan?