PeterTh / gedosato

The Generic DownSampling Tool
GNU General Public License v3.0
462 stars 166 forks source link

Add Deband shader #339

Closed Alo81 closed 8 years ago

Alo81 commented 8 years ago

The shader functions perfectly, but I used some weird business that I feel there is probably a better solution for (seeing as its partly using passed in parameters.)

@line 1897, I used

tex2D(s0, texcoord).rgb;

tex2D(s0, texcoord) should be identical to vpos(the first passed in parameter) in this case. The reason I did this is because @line 1902, a for loop is used to iterate through the positions with:

tex2D(s0, texcoord + on[i]).rgb

I didn't know the proper way to utilize the above vpos, as well as adding the iteration to texcoord for each pass.

If there is a more elegant solution to this you know, feel free to modify it.

PeterTh commented 8 years ago

This -- and quite a few other things -- were basically impossible to accomplish correctly in the previous single-pass postprocessing infrastructure.

Since https://github.com/PeterTh/gedosato/commit/73847c73d08a6ecdc3a516daa78ca00b8f2f092d, GeDoSaTo now supports multi-pass postprocessing. Basically, if you want to do debanding in a game, you simply

enablePostprocessing true
addProcessingPass deband.fx

in the game's (user) config file.