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.

 

Go Back   Doom9's Forum > Hardware & Software > Software players
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 26th May 2014, 12:21   #61  |  Link
toniash
Registered User
 
Join Date: Oct 2010
Posts: 131
Quote:
Originally Posted by CeeJay.dk View Post
That type of filter is called Local Contrast Enhancement and it's not feasible with the current features available in MPC-HC.

To do this you need to do a very large radius blur and subtract that from the current pixel .. exactly what sharpening does, but with a much larger radius and a lower strength.
That unfortunately requires an insane high amount of texture samples which kills performance (it's also too many texture reads for old cards that use shader model 2).

You can drastically reduce the number needed if you can do 2 passes, use mipmap samples or downsample the original image and sample from that, which would make this filter feasible - but none of these things are possible in MPC-HC as it's single pass only, doesn't enable mipmap and it clears the alpha channel when passing the image from one shader to another so I can't fake 2 passes by making two shaders and chain them (we discussed this earlier in the thread)
Ok thanks!
toniash is offline   Reply With Quote
Old 1st June 2014, 21:02   #62  |  Link
Shiandow
Registered User
 
Join Date: Dec 2013
Posts: 753
Quote:
Originally Posted by CeeJay.dk View Post
You can drastically reduce the number needed if you can do 2 passes, use mipmap samples or downsample the original image and sample from that, which would make this filter feasible - but none of these things are possible in MPC-HC as it's single pass only, doesn't enable mipmap and it clears the alpha channel when passing the image from one shader to another so I can't fake 2 passes by making two shaders and chain them (we discussed this earlier in the thread)
FWIW MadVR doesn't erase the alpha channel.
Shiandow is offline   Reply With Quote
Old 1st June 2014, 21:15   #63  |  Link
XMonarchY
Guest
 
Posts: n/a
I read that SweetFX does not work with Windows 8.1...
  Reply With Quote
Old 2nd June 2014, 10:40   #64  |  Link
the_weirdo
Yes, I'm weird.
 
the_weirdo's Avatar
 
Join Date: May 2010
Location: Southeast Asia
Posts: 271
Quote:
Originally Posted by XMonarchY View Post
I read that SweetFX does not work with Windows 8.1...
SweetFX supposes to work well with DX9 games/applications on Windows 8.1. Only DX10/11 games/applications are not supported by the injector for now.

EDIT: Oh, I've forgot. These are Video Shaders based-on SweetFX, so they're not affected by the injector of SweetFX not supporting DX10/11 on Windows 8.1.
__________________
“Never argue with stupid people, they will drag you down to their level and then beat you with experience.” — Mark Twain

Last edited by the_weirdo; 2nd June 2014 at 10:50.
the_weirdo is offline   Reply With Quote
Old 3rd June 2014, 10:06   #65  |  Link
CeeJay.dk
Registered User
 
Join Date: Dec 2003
Location: Denmark
Posts: 122
Quote:
Originally Posted by XMonarchY View Post
I read that SweetFX does not work with Windows 8.1...
Quote:
Originally Posted by the_weirdo View Post
SweetFX supposes to work well with DX9 games/applications on Windows 8.1. Only DX10/11 games/applications are not supported by the injector for now.

EDIT: Oh, I've forgot. These are Video Shaders based-on SweetFX, so they're not affected by the injector of SweetFX not supporting DX10/11 on Windows 8.1.
The weirdo is correct. These shaders run using MPC so they are not affected by the problems of the DirectX hook I use for the regular SweetFX package.

The problem is that Windows introduced some new DirectX calls with DX11.2 and the InjectSMAA hook I use does not know how to handle them because it was written before DX11.2 existed.

These calls are correctly handled by RadeonPro and by the EFX alpha, so if you use SweetFX with them it should work with DX11 and Win8.1.

DirectX 9 and 10 games should not be affected.

I also suspect that running the games that have issues in Vista compatibility mode might force the game to only use DX11 or DX11.1 calls which are supported but I don't have Win8.1 so I need someone who do to test my hypothesis.

But again .. the video shader package is not affected by this because it doesn't use InjectSMAA.
CeeJay.dk is offline   Reply With Quote
Old 27th October 2014, 14:53   #66  |  Link
toniash
Registered User
 
Join Date: Oct 2010
Posts: 131
Quote:
Originally Posted by CeeJay.dk View Post
That type of filter is called Local Contrast Enhancement and it's not feasible with the current features available in MPC-HC.

To do this you need to do a very large radius blur and subtract that from the current pixel .. exactly what sharpening does, but with a much larger radius and a lower strength.
That unfortunately requires an insane high amount of texture samples which kills performance (it's also too many texture reads for old cards that use shader model 2).

You can drastically reduce the number needed if you can do 2 passes, use mipmap samples or downsample the original image and sample from that, which would make this filter feasible - but none of these things are possible in MPC-HC as it's single pass only, doesn't enable mipmap and it clears the alpha channel when passing the image from one shader to another so I can't fake 2 passes by making two shaders and chain them (we discussed this earlier in the thread)
Now with Media Player DotNet you can do multipass!!
http://forum.doom9.org/showthread.php?t=171120
toniash is offline   Reply With Quote
Old 29th October 2014, 03:06   #67  |  Link
Blight
Software Developer
 
Blight's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 1,005
CeeJay.dk:
I'm planning to add shader support through MadVR.
You previously mentioned that MPC-HC doesn't provide an interface for configuration, but I may be able to write one into Zoom Player.

Would you like to discuss how to expose the settings range and default values?
__________________
Yaron Gur
Zoom Player . Lead Developer
Blight is offline   Reply With Quote
Old 29th October 2014, 11:50   #68  |  Link
CeeJay.dk
Registered User
 
Join Date: Dec 2003
Location: Denmark
Posts: 122
Quote:
Originally Posted by toniash View Post
Now with Media Player DotNet you can do multipass!!
http://forum.doom9.org/showthread.php?t=171120
Nice! All my coding time is currently focused on releasing SweetFX 2.0, but I'll look into Media Player DotNet at a later date.
CeeJay.dk is offline   Reply With Quote
Old 29th October 2014, 11:52   #69  |  Link
CeeJay.dk
Registered User
 
Join Date: Dec 2003
Location: Denmark
Posts: 122
Quote:
Originally Posted by Blight View Post
CeeJay.dk:
I'm planning to add shader support through MadVR.
You previously mentioned that MPC-HC doesn't provide an interface for configuration, but I may be able to write one into Zoom Player.

Would you like to discuss how to expose the settings range and default values?
Sure.
My skype and gmail accounts are also named CeeJay.dk
CeeJay.dk is offline   Reply With Quote
Old 29th October 2014, 15:52   #70  |  Link
Blight
Software Developer
 
Blight's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 1,005
I tried searching skype, but couldn't find a CeeJay with ".dk" in there.

In any case, it may be useful to other devs if we discussed it here.
I'm thinking you can just specify a tag value for each setting and then in a comment add the "Display Name", "Start Range" and "End Range", something like:
AddSetting(DisplayName=Brightness,MinValue=0,MaxValue=100,Default=24.5,Type=Float)

And the tag value for this setting would be "<Brightness>".

Using this type of setup, I can easily create a GUI that dynamically edits the script in memory before sending it to MadVR.

What do you think?
__________________
Yaron Gur
Zoom Player . Lead Developer

Last edited by Blight; 29th October 2014 at 18:23.
Blight is offline   Reply With Quote
Old 29th October 2014, 18:27   #71  |  Link
CeeJay.dk
Registered User
 
Join Date: Dec 2003
Location: Denmark
Posts: 122
That must be microsofts fault .. my skype name is ceejay.dk and is associated with my gmail account.

All SweetFX effects write the settings in a special format that can be understood both by humans but also the SweetFX configurator or other GUIs.

#define Curves_contrast 0.15 //[-1.00 to 1.00]

Here the value is ofcourse 0.15 but [-1.00 to 1.00] means the range is from -1.00 (minvalue) to 1.00 (maxvalue)
The amount of decimal places is a hint to how big any increments to the value should be

"to" is a keyword that the configurator understands
other keywords are
"or" or "|" (both mean the same .. a logical OR)
"," is a delimiter that is used when the value is a float2, float3 or float4 (or other multi component type)

another example:
Vibrance_RGB_balance float3(1.00, 1.00, 1.00) //[-10.00 to 10.00,-10.00 to 10.00,-10.00 to 10.00]

Here the type is a float3 and I expressly specify the range for each component, but I could also state it implicitly as
Vibrance_RGB_balance float3(1.00, 1.00, 1.00) //[-10.00 to 10.00]

and it would use the -10.00 to 10.00 range for each component.

For SweetFX 2.0 the settings file is the same but Crosire and I use shader annotations to allow the shader code to communicate with the program running them. I suggest you do the same.

An example from the SweetFX 2.0 closed beta :
uniform float frametime < string source = "frametime"; >; // time in milliseconds it took for the last frame to complete

There are very few things that are hardcoded .. most values are defined using annotations.

Similarly you could get the DisplayName, MinValue and MaxValue from the shadercode using shader annotations and the Type from the variable type itself.
CeeJay.dk is offline   Reply With Quote
Old 29th October 2014, 23:29   #72  |  Link
Blight
Software Developer
 
Blight's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 1,005
What you are suggesting contains a lot more parsing overhead than what I was suggestion.

I'll have to give it some thought.
__________________
Yaron Gur
Zoom Player . Lead Developer
Blight is offline   Reply With Quote
Old 7th November 2014, 20:35   #73  |  Link
amayra
Quality Checker
 
amayra's Avatar
 
Join Date: Aug 2013
Posts: 285
any update ?
amayra is offline   Reply With Quote
Old 10th September 2015, 01:31   #74  |  Link
iakoboss7
Registered User
 
iakoboss7's Avatar
 
Join Date: Sep 2015
Posts: 13
any update??
iakoboss7 is offline   Reply With Quote
Old 15th October 2018, 20:53   #75  |  Link
CeeJay.dk
Registered User
 
Join Date: Dec 2003
Location: Denmark
Posts: 122
No updates. But also no issues. The SweetFX Video Shaders still work fine.

Have there been any updates to the ways you can add shaders to videos in the last 5 years?
If so maybe I could make some updates to use those.

I could also port some of the effects from Reshade to MPC-HC (especially the ones I wrote) but several of them are multipass which as far as I know MPC-HC still does not support right.

I did port the ASCII art effect to MPC-HC but I don't know if people are interested in seeing their videos in ASCII.
CeeJay.dk is offline   Reply With Quote
Old 19th October 2018, 14:02   #76  |  Link
ABDO
Registered User
 
Join Date: Dec 2016
Posts: 65
@CeeJay.dk
could you please port (Clarity, Deband,HighPassSharpen,Technicolor2,Layer) if it are Singlepass

Last edited by ABDO; 19th October 2018 at 20:29.
ABDO is offline   Reply With Quote
Old 24th October 2018, 16:11   #77  |  Link
CeeJay.dk
Registered User
 
Join Date: Dec 2003
Location: Denmark
Posts: 122
I've looked them over :

Clarity : 4 passes and uses 4 buffers too (3 of them at half-size). This is not something that MPC-HC can provide the shaders.

Deband : Was originally ported from MPV. Single pass with no special requirements so it can be ported. I also think I might be able to write a better and/or faster deband shader in the future and there are a few things that stand out to me as less than optimal.
Still a nice shader though.

HighPassSharpen : Single pass with no special requirements so it too can be ported.
It does not use bilinear sampling and hardly even uses linear sampling, but is mostly point sampling. This is hurting its performance.
Also Ioxas code is weird. Observe :

Code:
	if (HighPassSharpRadius == 1)
	{
		int sampleOffsetsX[25] = {  0.0, 	 1, 	  0, 	 1,     1,     2,     0,     2,     2,     1,      1,     2,     2,     3,     0,     3,     3,     1,    -1, 3, 3, 2, 2, 3, 3 };
		int sampleOffsetsY[25] = {  0.0,     0, 	  1, 	 1,    -1,     0,     2,     1,    -1,     2,     -2,     2,    -2,     0,     3,     1,    -1,     3,     3, 2, -2, 3, -3, 3, -3};	
		float sampleWeights[5] = { 0.225806, 0.150538, 0.150538, 0.0430108, 0.0430108 };
		
		color *= sampleWeights[0];
		
		[loop]
		for(int i = 1; i < 5; ++i) {
			color += tex2D(ReShade::BackBuffer, texcoord + float2(sampleOffsetsX[i] * ReShade::PixelSize.x, sampleOffsetsY[i] * ReShade::PixelSize.y) * HighPassSharpOffset).rgb * sampleWeights[i];
			color += tex2D(ReShade::BackBuffer, texcoord - float2(sampleOffsetsX[i] * ReShade::PixelSize.x, sampleOffsetsY[i] * ReShade::PixelSize.y) * HighPassSharpOffset).rgb * sampleWeights[i];
		}
	}
So he is setting up two arrays (I would have used one array of float2's but OK) with a length of 25
But then in his loop he uses :

for(int i = 1; i < 5; ++i)

So i is initialized to 1 and must be less than 5.

So he will get 4 loops before exit and because he uses ++i , i will be for those loops 2, 3, 4, and 5.
So what was the point of the array positions 0, 1 and from 6 and up?
Same with weights where he does not use position 0.
I'm also pretty sure this sampling pattern isn't cache friendly but cache friendliness is not something most people know about so I'll give him a pass on that one.

Though it does have some interesting ideas that I have wanted to try for LumaSharpen for a while, like other blend modes.

Technicolor2 : Singlepass and nothing special about it. Can be ported.

Layer : Singlepass but in order to merge the video image with another image we must be able to load another image as a texture that the shaders can use. MPC-HC cannot do this, so it cannot be ported.
May I ask what were you planning to use it for?
See I've only just added it to Reshade and still have many plans for improving it like options to wrap and repeat the layer and tons of blend modes and maybe also give it the possibility to use the depth texture as another layer.
This would open up for so many possibilities that I cannot predict them all but it would be interesting to see what users planned for it.
CeeJay.dk is offline   Reply With Quote
Old 4th December 2018, 21:15   #78  |  Link
ABDO
Registered User
 
Join Date: Dec 2016
Posts: 65
Ah, i feel so bad to forget about my request in SweetFX fourm, i am very sorry for that @CeeJay.dk, Please accept my high respect
and much thanks for your reply
Quote:
Originally Posted by CeeJay.dk View Post
Deband : Was originally ported from MPV. Single pass with no special requirements so it can be ported. I also think I might be able to write a better and/or faster deband shader in the future and there are a few things that stand out to me as less than optimal.
that would be great, then we can use it with fake hdr shader, as alternative to avisynth deband filters

Quote:
Originally Posted by CeeJay.dk View Post
Layer : Singlepass but in order to merge the video image with another image we must be able to load another image as a texture that the shaders can use. MPC-HC cannot do this, so it cannot be ported.
May I ask what were you planning to use it for?
I was planning to use it as alternative to avisynth layer, but i see now that MPC-HC cannot do this job

Quote:
Originally Posted by CeeJay.dk View Post
Though it does have some interesting ideas that I have wanted to try for LumaSharpen for a while, like other blend modes.
Technicolor2 : Singlepass and nothing special about it. Can be ported.
that is great news
@CeeJay.dk, any chance to an improvement to the fake hdr filter, it do very nice in fact, is it possible to limit it to the dark area or shadows pixls so we can use it as (enhance shadows) as hdragc filter does, but with much speed improvement, if we can keep the highlight area without any change, that would be nice, and no need to hdragc any more، i am now use your hdr shader In combination with YLevelss to recover highlight after using the fake hdr shader effect, and the result is great as hdragc but much much faster
ABDO is offline   Reply With Quote
Old 7th January 2019, 10:50   #79  |  Link
Foyn
Registered User
 
Join Date: Nov 2018
Posts: 1
Hello~
Was wondering if any1 would share their anime/movies shader presets
Just the shaders folder would be fine as well.. I'd like to try some different setups I guess
Foyn is offline   Reply With Quote
Old 22nd June 2020, 11:12   #80  |  Link
butterw2
Registered User
 
Join Date: Jun 2020
Posts: 303
SweetFX Video Shaders update ?

SweetFX shaders were ported by CeeJay.dk so they can run in MPC-HC (.hlsl). There seem to have been a few updates at https://github.com/CeeJayDK/SweetFX/tree/master/Shaders (.fx, MIT License) since the package "SweetFX Video Shaders.7z" was posted in this thread in 2014.

Has CeeJay.dk or anyone got mpc-hc versions of the updated/new shaders to share ?
Porting shaders from .fx to .hlsl is easy (unless the shader uses features not available by mpc-hc), but there is also the issue of parameters values which may need tuning for the shaders to be useful for video playback.

SweetFX Shaders I regularly use:
- Monochrome(ConvCoef float3(0.18, 0.41, 0.41) //Agfa 200X),
- Technicolor (defaults),
- LumaSharpen(Pattern 3, Post-resize)

I am curious about FilmGrain.fx (I currently use PS_Noise.hlsl(0.05), which looking at it more closely needs fixing). Any other suggestions for a good lightweight grain shader for video playback ?

I have also developed a couple of pixel shaders for mpc-hc myself: bar_Mask (inspired by the old SweetFX Border), bSide (similar to splitscreen maybe), bStrobe, etc.
They are available here: https://gist.github.com/butterw/
butterw2 is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 20:47.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.