Duke4.net Forums: Polymer Contrast Adaptive Sharpening - Duke4.net Forums

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Polymer Contrast Adaptive Sharpening

#1

I've been experimenting with Contrast Adaptive Sharpening in idTech 4, and I quickly just ported the shader to Polymer with latest eduke32. These screenshots are using the retail textures, without any HD packs. I imagine there will be bigger gains with more HD textures(stock textures are really low res, but there some gains with CaS). You will need to view these images on a PC to see the gains(i.e. don't view them on a phone).

CaS is a post process technique developed by AMD.

Github:
https://github.com/j...CaS/tree/master

Release:
https://github.com/j...merCaS/releases

https://i.ibb.co/X3dWkFk/duke-1.png
https://i.ibb.co/PmgF3QZ/duke2.png
https://i.ibb.co/ctkw4dr/duke4.png

This post has been edited by icecoldduke: 05 October 2019 - 02:21 AM

9

#2

Added the github with a binary release to the OP.
0

User is offline   TON 

#3

Nice job.

Apparently, in game now the image is less blurry and the image has better focus but it has too aliasing.

By the way the HUD stuff like weapons haven't CAS implemented.

This post has been edited by TON: 05 October 2019 - 06:28 AM

1

#4

View PostTON, on 05 October 2019 - 04:18 AM, said:

Nice job.

Apparently, in game now the image is less blurry and the image have better focus but it have too aliasing.

By the way the HUD stuff like weapons haven't CAS implemented.

CaS really works well on the world, and not the UI elements, so CaS is only applied to world, that is by design.

This post has been edited by icecoldduke: 05 October 2019 - 04:38 AM

0

User is offline   Phredreeke 

#5

Hmmm... makes me wonder how it would deal with upscaled textures (my upscale packs are deliberately sharpened, downscaled and palettised, but there are several models, some which produce a fairly soft image which may be conducive to this kind of algorithm)
0

#6

View PostPhredreeke, on 05 October 2019 - 04:43 AM, said:

Hmmm... makes me wonder how it would deal with upscaled textures (my upscale packs are deliberately sharpened, downscaled and palettised, but there are several models, some which produce a fairly soft image which may be conducive to this kind of algorithm)

The best way to answer that question is the binary from the OP and try it out :). Let me know.
0

#7

I posted the results I got from Quake 4, might be a good benchmark if your looking at the results with various Duke3D HD texture packs:
https://www.doomworl...comment-2033180

This post has been edited by icecoldduke: 05 October 2019 - 04:49 AM

0

User is offline   Phredreeke 

#8

Alright, here are the results - I used a 50/50 interpolation of the detoon and fatality models for this (also no objects with transparency have been processed)

https://imgur.com/a/zW1FXZv
0

User is offline   LeoD 

#9

View Posticecoldduke, on 05 October 2019 - 02:05 AM, said:

I've been experimenting with Contrast Adaptive Sharpening in idTech 4, and I quickly just ported the shader to Polymer with latest eduke32.
Nice. Any estimate about the performance impact?
0

User is offline   Mark 

  • Honored Donor

#10

I would have found out except his .rar file won't unpack using 7zip. I was going to test it in HHR.
0

User is offline   Vagan 

#11

No problems on this end, using 7-zip to unpack eduke.exe from the rar linked in the releases page above

7-zip 19.00 x64, windows 10
0

#12

View PostLeoD, on 05 October 2019 - 06:38 AM, said:

Nice. Any estimate about the performance impact?

Should be less then a millisecond hit on the GPU.

View PostMark, on 05 October 2019 - 07:35 AM, said:

I would have found out except his .rar file won't unpack using 7zip. I was going to test it in HHR.

Did you get this resolved? I just tried with 7-zip and it worked fine for me.
0

User is offline   oasiz 

  • Dr. Effector

#13

A for effort but I am not a fan of this look :(
Looks like those TV presets (or video scalers) that apply unsharp masking + contrast set to +50%.
This is the kind of post processing I hate since it's equal to just putting ketchup in to a good dish, everything ends up looking the same.

But I am biased, I hate sharpening/contrast tricks as they're abused too much to make things artificially pop, same as boosting saturation in my book.
0

#14

View Postoasiz, on 05 October 2019 - 08:14 AM, said:

A for effort but I am not a fan of this look :(
Looks like those TV presets (or video scalers) that apply unsharp masking + contrast set to +50%.
This is the kind of post processing I hate since it's equal to just putting ketchup in to a good dish, everything ends up looking the same.

But I am biased, I hate sharpening/contrast tricks as they're abused too much to make things artificially pop, same as boosting saturation in my book.

I'm not sure exactly what to say to this. The whole point with any sharpening effect is to make things pop, while looking the same? This also has no gain or loss to saturation. CaS was designed as AMD's answer to NVIDIA DLSS. So it was designed to help dev's render into a lower resolution framebuffer then upscale to native res.

This post has been edited by icecoldduke: 05 October 2019 - 08:21 AM

0

User is offline   oasiz 

  • Dr. Effector

#15

Problem is that in this case it's very easy tell when this effect has been applied, it has this easy to spot artifacting.
In case it wasn't clear, I don't claim saturation tweaks here :) Merely saying that it's about as easy to spot when someone has messed around with this as curves will usually be rather compressed.

I haven't read to CAS but in this case it (to me) sounds and looks like very similar to what cheap chinese video processors have been doing for years when upscaling content, basically everything ends up going through an unsharpen mask, which gives quite distinct ringing artifacts. Something that is quite undesirable especially when dealing pixel art (I've done a lot of work with video streaming/capture/scaling on older machines so that's where my bias also comes from).
But also I see this as quite undesirable even with higher resolution art due to the ringing artifacts. My pet peeves is that it's taken for granted as a silver bullet solution to make things look nicer, which maybe works for certain bits but you end up losing visual distinction as you start lacking proper softer/matte surfaces on textures/areas that are intended to look like such since everything gets boosted forcefully.

Sorry for going off for a rant but this look is just exactly what I dislike in certain processing chains :D
0

User is offline   MusicallyInspired 

  • Buy Mage's Initiation!

#16

I don't get it either. This is like the opposite of blinear filtering right (in terms of the end result effect)? Why do we want every pixel in a texture to pop?

But kudos for the work of course.

This post has been edited by MusicallyInspired: 05 October 2019 - 10:31 AM

0

#17

View PostMusicallyInspired, on 05 October 2019 - 10:31 AM, said:

I don't get it either. This is like the opposite of blinear filtering right (in terms of the end result effect)? Why do we want every pixel in a texture to pop?

But kudos for the work of course.

Have you tried it? Also this has nothing to do with bilinear filtering.

This post has been edited by icecoldduke: 05 October 2019 - 10:42 AM

0

User is offline   Phredreeke 

#18

It looks nice if you got hi-res preferably softer textures for it to work with, the stock textures are really too low res and ends up with ringing around individual pixels
1

#19

View PostPhredreeke, on 05 October 2019 - 10:43 AM, said:

It looks nice if you got hi-res preferably softer textures for it to work with, the stock textures are really too low res and ends up with ringing around individual pixels

That I agree with, in fact I actually have the opposite feeling, because the stock textures are so low res, it doesn't add that much compared to other games I've added CaS too.

This post has been edited by icecoldduke: 05 October 2019 - 10:44 AM

0

User is offline   Mark 

  • Honored Donor

#20

View PostVagan, on 05 October 2019 - 07:42 AM, said:

No problems on this end, using 7-zip to unpack eduke.exe from the rar linked in the releases page above

7-zip 19.00 x64, windows 10

I guess I shouldn't be surprised I had trouble with 7zip. I took a look and I'm still running my original version 9.2 from 9-10 years ago when I bought this computer. :blink: I don't see many .rar files these days so I didn't know I was running such an ancient version. All 7zipped and regular zipped files still unpack. Its just the rars that don't. I'll update.

This post has been edited by Mark: 05 October 2019 - 12:01 PM

0

User is offline   Mark 

  • Honored Donor

#21

I ran the new exe in my HHR project folder and after a couple of seconds of loading it crashes back to desktop and left this message along with an empty .dmp file. I'll try it in some other project folders later today.

Attached thumbnail(s)

  • Attached Image: ICDerror.jpg


This post has been edited by Mark: 05 October 2019 - 12:24 PM

0

User is offline   Phredreeke 

#22

I found it crashes if you already got a eduke32.cfg file present
0

User is offline   Mark 

  • Honored Donor

#23

Which I do.
edit: I removed it and I still crash. I had to remove ALL cfg files to get it to run. I'll test it out and then remove it. I need those files.

Phredreeke, exactly what did you type into the console to enable the feature. I tried a few different ways and got errors.

This post has been edited by Mark: 05 October 2019 - 12:39 PM

1

#24

View PostMark, on 05 October 2019 - 12:24 PM, said:

Which I do.
edit: I removed it and I still crash. I had to remove ALL cfg files to get it to run. I'll test it out and then remove it. I need those files.

Phreadreeke, exactly what did you type into the console to enable the feature. I tried a few different ways and got errors.

Make sure you have Polymer turned on, CaS should be on by default in Polymer, I think the way I coded it Polymost might crash, I'll fix that, so ensure Polymer is turned on.

This post has been edited by icecoldduke: 05 October 2019 - 12:52 PM

0

User is offline   TON 

#25

View PostMark, on 05 October 2019 - 12:24 PM, said:

Which I do.
edit: I removed it and I still crash. I had to remove ALL cfg files to get it to run. I'll test it out and then remove it. I need those files.

Phredreeke, exactly what did you type into the console to enable the feature. I tried a few different ways and got errors.


R_CASSHARPEN 1

This post has been edited by TON: 05 October 2019 - 12:54 PM

0

User is offline   Mark 

  • Honored Donor

#26

Polymer was checked. I tried it in a 2nd project. I did not have to remove any cfg files. But it screwed up my skybox with multiple color bars. I give up. Sorry.

R_CASSHARPEN 1 was the first way I typed it and it gave me some error message about not being a var or something. I didn't try typing in the 2nd project because I quit as soon as I saw the screwy skybox. But I guess it doesn't matter because it was supposed to be on by default.

Its possible my problems stem from trying this mod in projects with custom def, cfg and con files

This post has been edited by Mark: 05 October 2019 - 01:01 PM

0

User is offline   TON 

#27

View PostMark, on 05 October 2019 - 12:53 PM, said:

Its possible my problems stem from trying this mod in projects with custom def, cfg and con files


You can try removing texture cache files
0

User is offline   MusicallyInspired 

  • Buy Mage's Initiation!

#28

View Posticecoldduke, on 05 October 2019 - 10:36 AM, said:

Have you tried it? Also this has nothing to do with bilinear filtering.


Not yet.

I know it has nothing to do with bilinear filtering, but, again, in terms of the resulting effect, it makes pixels in the textures sharper and more contrasting while bilinear filtering blurs them; the opposite.

This post has been edited by MusicallyInspired: 05 October 2019 - 02:20 PM

0

User is offline   Trooper Dan 

  • Duke Plus Developer

#29

Looking at ICD's screens fro idTech 4, the biggest improvement seems to be that far away textures still look detailed:

https://static.doomworld.com/monthly_2019_10/image.png.baa2ffa2cb8ae12cc52a1a16e624475f.png

Vanilla Duke 3D doesn't provide very good cases for this? Maybe in a map with a large viewing range that had some of the higher-res textures on distant objects.
2

User is offline   Phredreeke 

#30

uploaded the texture set I tested with (+ added a few enemy upscales to the mix)

https://www.dropbox....repack.zip?dl=0

I'll probably delete this in a few days or whenever I need space
1

Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options