Jump to content
  • Advertisement

DX11 HLSL shader auto run with unique file extension

This topic is 406 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi all

I want to enable and disable shader in MPCH Media player Classic

the MPCH have shader option using HLSL shaders

I want the shader to read each file extension before it plays the file

so if the video file name is video.GR.Mp4 it will play it in Grayscale shader 

if it is not and standard file name Video.Mp4 without GR. unique extension so it plays standard without shader or end the shader

here is the shader I have for grayscale

// $MinimumShaderProfile: ps_2_0

sampler s0 : register(s0);

float4 main(float2 tex : TEXCOORD0) : COLOR {
    float c0 = dot(tex2D(s0, tex), float4(0.299, 0.587, 0.114, 0));

    return c0;

I want to add if or block stantement or bloean to detect file name before it call the shader in order to go to the procedure or disable it or goto end direct without it


any thoughts or help

Share this post

Link to post
Share on other sites

There's no way you can have your shader detect the file that the host media player is playing, at least not without help from the app. The media player itself would have to detect the file name and pick the correct shader, or pass some information to the shader so that it can branch on.

Share this post

Link to post
Share on other sites

thank you so much for your reply

I have the source code of Media Classic Player Black Edition

can you help me out figure how to add simple code to choose the shader or enable which shader related to which unique extension

such as XXXXXXXXXXxx.gray.Mp4 so any name with .gray.mp4 will call the shader grayscale

and XXXXXXXXXXXXXX.123.Mp4 will call the shader 123 for example


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!