[Feature request] Posterization effect

Talk about the mods you'd like to see in Daggerfall Unity. Give mod creators some ideas!
User avatar
pango
Posts: 3347
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

[Feature request] Posterization effect

Post by pango »

To complete the retro rendering experience!

@DMadarasz on Twitter experimented with such effect using Redshift: https://twitter.com/DMadarasz/status/11 ... 2303082498
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
King of Worms
Posts: 4752
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: [Feature request] Posterization effect

Post by King of Worms »

Right :) looks more like the old 256 color palete with sharp color gradients

User avatar
pango
Posts: 3347
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: [Feature request] Posterization effect

Post by pango »

Coming in 0.10.23 :)
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
MasonFace
Posts: 543
Joined: Tue Nov 27, 2018 7:28 pm
Location: Tennessee, USA
Contact:

Re: [Feature request] Posterization effect

Post by MasonFace »

Niiiiiiiiice!

User avatar
pango
Posts: 3347
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: [Feature request] Posterization effect

Post by pango »

Here's a taste of the palettization effect:

(switch to 1080p for best result)

But you don't need to try to emulate classic as closely as I tried in this demo; It's fine in 640x400, mixed with mods compatible with retro mode too.
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
MasonFace
Posts: 543
Joined: Tue Nov 27, 2018 7:28 pm
Location: Tennessee, USA
Contact:

Re: [Feature request] Posterization effect

Post by MasonFace »

Done got me hot and bothered watching those videos. The posterization/color quantization/palletization looks great! I can't wait to use this setting.

User avatar
pango
Posts: 3347
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: [Feature request] Posterization effect

Post by pango »

Maybe I should explain what the options in 0.10.23 will be, because DFU will get 2 retro shaders for the price of none, so it could be confusing...
  • First you'll still be able to run retro mode with no shader; just the reduced resolution as before. If you used that mode before because that's all what your video card could handle, that will still be available;
  • Second, you can enable a posterization shader. That will reduce the display to about 5000 uniformly spaced RGB colors. That's very cheap to compute as shaders go (it can run at 400 fps on my GTX960), and produce color banding that gives a nice retro look. You could probably get a similar result with some Reshade posterization effect, but now it will be embedded in DFU and available on all platforms.
  • Third, palettization shader. This will replace each pixel's color with the nearest color taken from Daggerfall palettes. Right now I took all the colors from ART_PAL.COL, and added the 32 first very dark blue colors from NIGHTSKY.COL, because otherwise the night sky would look grey. I used k-d tree nearest neighbour algorithm and used code generation to optimize it as much as I could, and it often runs at 200 fps on my rig, so it's not that bad but obviously more expensive than posterization
Lastly, if you use any of those 2 shaders, you can turn them on and off at any time using Shift-F11, That was mostly useful for debugging, but it's still there to satisfy your curiosity or any other need.
And by the way, retro mode restrictions still apply, it's not compatible with mods that use extra "cameras", currently that's Enhanced Sky and Distant Terrain mods.
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
pango
Posts: 3347
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: [Feature request] Posterization effect

Post by pango »

With player item based light sources, low dungeon ambient light (say 0.1) and a touch of Postprocessing mod ambient occlusion, you can breath new life into classic textures... I really like all the copper tints you can get. I'm not sure browsers will give those pictures justice, but trying:
blocks.jpg
blocks.jpg (152.2 KiB) Viewed 4148 times
room.jpg
room.jpg (144.31 KiB) Viewed 4148 times
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: [Feature request] Posterization effect

Post by Interkarma »

This is lovely. I've scheduled for myself a leisurely playthrough sometime around beta. Not as a dev, but to try and just enjoy playing the game again like I used to. I really think this will be the format I go for when that happens.

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: [Feature request] Posterization effect

Post by Hazelnut »

Just dropping in to say nice job Pango! This really nails that classic feeling so well, and while I doubt I'd actually play with it - bloomin awesome the option is there if I feel like it.

Brilliant work mate.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

Post Reply