Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
14th November 2014, 08:56 | #21 | Link |
Registered Developer
Join Date: Sep 2006
Posts: 9,140
|
Wow, this is great - I've always been a fan of FineSharp and planned to look into making it work for madVR at some point in the future. Now -Vit- has done all the work, thank you very much!
@-Vit-, have you found some madVR settings which damage the alpha channel? I think madVR's shader processing should preserve the alpha channel between passes. The alpha channel will probably get lost during scaling (I skip the alpha channel there to save performance). But since all the FineSharp scripts should probably be executed right after each other, there should be no problem, correct? FWIW, I plan to add a more complex shader editor to madVR in the near future, which should make it possible to put something like your HLSL FineSharp scripts into one "shader plugin" (or however it will be called). I plan to support multiple rendering passes, and also exportable options/parameters which the user can then modify through the madVR GUI or maybe assignable keyboard shortcuts etc. Of course the shaders will also be profilable, so users can use different shaders/settings depending on e.g. source resolution or framerate etc. Haven't thought this all fully through yet, though. Do you have any wishes that you'd like to see implemented in madVR to make porting of AviSynth scripts more easy/nice for you? One thing I've been wondering about is whether it might make sense to handle grain outside of the shaders. E.g. maybe it would make sense to remove/reduce the grain before running all the shaders and scaling etc, and then after all shaders and scaling is done, maybe the grain could be put back in somehow? As opposed to every script doing this on its own separately. To be honest, although I'm a fan of several AviSynth scripts, I haven't really looked into how most of them work inside yet. So maybe what I wrote above is an old hat for AviSynth experts. Just wondering if there's anything I could do in madVR to make things easier/better... > The shaders are not compatible with the MadVR > setting: "run custom pixel shaders in video levels > instead of PC levels". I expect several shaders might have problems with that setting. I still added it as an option to make some shaders perform faster for users of very slow GPUs. In the madVR shader editor I plan to offer an option like "this shader/plugin needs to run in PC levels", which would then effectively force that "run custom pixel shaders in video levels" option off, when such a shader is activated by the user. |
14th November 2014, 14:03 | #22 | Link | |
Suptitle, MediaPlayer.NET
Join Date: Nov 2001
Posts: 1,721
|
Quote:
Even better, you can now tell MPDN how / when you want to enable FineSharp via render script - e.g. you can choose to enable them for 720p videos only, or use different sets of FineSharp shader files for 1080p etc. |
|
14th November 2014, 18:36 | #23 | Link |
Registered User
Join Date: Jul 2010
Posts: 448
|
@madshi
No I haven't found any problem with the alpha channel. I only mentioned it because it's kinda undocumented to do that. If it's officially supported, then I'll remove that note. There is no need for the alpha channel after the shader chain completes so it's fine to drop it for the scaling afterwards. -- The single most powerful feature that could be added to shader chaining would be the ability to store intermediate results and then use multiple inputs for a later shader E.g. Source->Shader1->Shader2->A Source->Shader3->B Source and A and B->Shader4->Output That would make most non-temporal scripts achievable in theory I suppose (memory and performance notwithstanding). Technically it shouldn't be difficult. But what user interface to provide? The MPDN guys have some kind of C# meta-scripting language, I haven't looked at in in detail, but I think it can do something like that. Or some kind of GUI can work for simpler cases. -- There are a couple of scripts that remove grain then add it back later, QTGMC for example. It's not especially common though. You mention adding grain back in after scaling. QTGMC has an option to scale (well, deinterlace) the grain using a different process than the degrained image - it injects extra noise with similar local properties. Would people want something like that in the madVR scaling, "resampled grain"? I don't know... It would be ideal to do temporal (motion compensated) denoising for sharpening. With spatial-only denoising you might (temporarily) lose the fine detail that you want to sharpen. However, temporal work in the shaders will be a much greater challenge I guess. -- I ought to note that I'm mostly retired now, lol. (edit: from video-related development that is) Last edited by -Vit-; 14th November 2014 at 22:25. |
14th November 2014, 19:19 | #24 | Link | |||||
Registered Developer
Join Date: Sep 2006
Posts: 9,140
|
Quote:
Quote:
Quote:
Personally I like grain and I prefer not to remove it. But I do notice that some algorithms work much better if the grain is removed/reduced before. E.g. the madVR debanding algorithm (based on f3kdb) doesn't work well if there's lots of grain in the image. Quote:
In any case, I think it might be good for performance if grain is removed/reduced only once before all the custom shaders are run, and then eventually (if the user wants it) added back in at the very end. This way all the custom shaders could skip the de-graining. Quote:
From your daily job? Or from home cinema related development? If you're retired from your daily job, that should give you more time for home cinema related development, no? In any case, thanks a lot for your work, I much appreciate it! Would you be ok if I shipped your FinalSharp shaders with a future madVR version? I'm not sure yet in which form I would do that (e.g. preconfigured plugin or totally built into the settings GUI etc), but in any case I'd of course note somewhere, at least in the readme, that the original script is from Didée and that you did the HLSL conversion. And of course I'll ask Didée's permission, too, if you're ok with it. |
|||||
14th November 2014, 21:28 | #25 | Link | ||
Registered User
Join Date: Dec 2013
Posts: 753
|
Quote:
Quote:
PHP Code:
I think that MPDN's render scripts are currently the closest thing to the more advanced shader editor you had in mind, although we're still working on making it easier to write them yourself. It would be nice if MadVR could have something similar, or even better, if render scripts could be made compatible with MadVR. Anyway I think it's worth a look and if you have any questions, feel free to ask. |
||
14th November 2014, 22:17 | #26 | Link | ||||
Registered User
Join Date: Jul 2010
Posts: 448
|
Quote:
Quote:
Quote:
Retired from video related development. Too much other work. I can help out a little, but only a little... Quote:
I had a look at that NEDI script and saw it had the power needed to make complex chaining scripts. It's cool... but, and I mean this as constructive criticism, all that C# baggage decreases readability considerably. You mention that you want to make them easier to write, what do you have in mind? |
||||
14th November 2014, 22:55 | #27 | Link | ||||
Registered Developer
Join Date: Sep 2006
Posts: 9,140
|
Quote:
Quote:
Quote:
I'm not a big fan of using an additional scripting (or other) language to do shader chaining etc. Personally, I'd prefer to simply use whatever means HLSL offers, and to do the chaining/configuration with a nice and easy to use GUI. Quote:
Thank you! If you do have some development time available for video related stuff, and if I could voice my preferences for how to spend your limited resources I'd much prefer if you could convert maybe some other algorithm to HLSL without any optimization. With your AviSynth experience you could do that a hundred times faster than I ever could. Optimizing the HLSL shaders is something a lot of people can do (including myself). Understanding and converting AviSynth scripts is much harder - at least for me. But of course it's all up to you! I'm already very happy with getting FineSharp. It was a very nice surprise when I stumbled over this thread today. |
||||
14th November 2014, 23:05 | #28 | Link | |
Registered User
Join Date: Dec 2013
Posts: 753
|
Quote:
Anyway did you look at the "MyRenderScript.cs" class? That is currently the simplest way to write a render script. Hopefully it can be made even simpler, although I'm not sure how much more can be done without inventing some kind of script language. |
|
14th November 2014, 23:07 | #29 | Link | |
Registered Developer
Join Date: Sep 2006
Posts: 9,140
|
Quote:
|
|
14th November 2014, 23:24 | #30 | Link | |
Registered User
Join Date: Dec 2013
Posts: 753
|
Quote:
|
|
15th November 2014, 00:59 | #32 | Link |
Suptitle, MediaPlayer.NET
Join Date: Nov 2001
Posts: 1,721
|
The ultimate goal for MPDN's render script is to have AviSynth like simplicity with none of the C# baggage on the top level (AviSynth scripting level), yet allowing you to go deeper and deeper if you need to implement more complicated filters, which is exactly the model AviSynth offers via its 'plugin' system. For the plugin system, you could use C++/CLI, VB.NET, or C# if you compile them into DLLs for the former two languages, or either C# script or compiled DLL if you opt for the latter.
If anyone feels like joining MPDN's render script development, feel free to contact either Shiandow or myself. Last edited by Zachs; 15th November 2014 at 01:03. |
17th November 2014, 17:58 | #33 | Link |
Registered User
Join Date: Jul 2010
Posts: 448
|
Just updated the first post with v1.1. It's faster now.
I just had to get rid of those badly implemented sorts and medians, replaced them now with more efficient network-sort-style sequences in RemoveGrain4 and FineSharpB. Not theoretically optimal, but close enough - I wanted to avoid conditionals and excessively long shaders. I tweaked the second sharpening stage (xstr and xrep), which were not operating correctly. You'll probably not notice, that stage has a small impact in this script. I noticed how well the sharpener works with NNEDI3 luma doubling (the sharpener doesn't affect chroma). Really helps when using pre-resize and post-resize shaders together. Although NNEDI3 does use quite a bit of GPU time. |
17th November 2014, 18:08 | #34 | Link |
Registered Developer
Join Date: Sep 2006
Posts: 9,140
|
Thank you for the updated shaders! Yes, NNEDI3 + FineSharp works very well. When playing with doubling the resolution of test images I also like a combination of NNEDI3, FineSharp, LimitedSharpen and aWarpSharp2, though:
Code:
nnedi3x(dw=1, nns=2, qual=1) LimitedSharpenFaster(strength=100) aWarpSharp2(depth=5) FineSharp() |
17th November 2014, 18:21 | #35 | Link | |
Registered User
Join Date: Jul 2010
Posts: 448
|
Quote:
|
|
18th November 2014, 01:12 | #37 | Link |
Registered User
Join Date: Jul 2010
Posts: 448
|
Yes, thanks. Updated the first post, please update everyone - I double checked this time, lol
This happens because the shader editor in MPC-HC isn't connected to the files, so it's easy to get out of sync. It's better in the new versions of MPC-HC, but that's doesn't have shortcut keys for shaders, which makes using them annoying. |
18th November 2014, 02:58 | #38 | Link |
Registered User
Join Date: Sep 2010
Posts: 321
|
I can't seem to get any sharpening to work/be noticeable to my eyes with latest 1.7.7 MPC-HC using the CTRL+Y toggle which basically just toggles through all the different shader presets. I have the default set to no shaders, then I have one setup/labeled as FineSharp which has the order as detailed in first post for pre-size (figured this one would be the best to use to not over sharpen)
ToYUV RemoveGrain11 RemoveGrain4 FineSharpA FineSharpB FineSharpC ToRGB Then I have one which has the above shaders in both pre-resize and post-resize, and when I have a 720p clip on a 1080p screen and I toggle I don't see a difference at all in the image. I must be doing something wrong? (yes I'm using latest MadVR, tried with NNEDI3 luma doubling on and off and notice no difference)
__________________
MPC-HC/MPC-BE, Lav Filters, MadVR CPU: AMD Ryzen 5 1600, Video: AMD Radeon RX Vega 56 -> TCL S405 55", Audio: Audio-Technica M50S |
|
|