Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Handling #include directives in shaders #140

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

on-situ
Copy link

@on-situ on-situ commented Aug 29, 2014

Hi,
I'd like to add new features in order to strengthen the support of shaders in MPC-HC.
This pull request concerns what I believe is the very first step for that: handling #include directives in shaders.
Supporting includes will help users create more complex shaders and organize them.
Currently, included files are simply ignored during compilation.

I have made the following changes:

  • includes directives are now taken into account,
  • includes can refer to local files (ie. relative to the shader file) or system files (ie. relative to a directory defined in the mpc-hc options in which user can store includes common to different shaders),
  • changes in included files are tracked, and cause the reloading of the shader,
  • missing #include files cause warning in the shaders debug window,
  • #include directives work for the Custom EVR Presenter and SyncRenderer (not MadVR).

I added an edit box and a directory browser button to allow users to easily change the system-wide include directory.

Please decide whether the project would benefit from this change. This is only the first step, as I am planning to add the possibility to pass external data to the shader (like textures or matrices).

Regards.

@on-situ
Copy link
Author

on-situ commented Sep 1, 2014

Understood. I'll create a single patch with everything. Sorry for the inconvenience.
By the way, I am trying to find an elegant manner to also support MadVR.

@kasper93
Copy link
Contributor

I think we should maintain the same shader support between all renderers, madVR too. If you need changes on madVR side, madshi will probably help you without a problem :)

@on-situ
Copy link
Author

on-situ commented Sep 16, 2014

I agree. This is actually what I am working on, even though I don't have much time.
Their are at least 3 main things that I think would be useful:

  • handling DirectX effects system,
  • supporting user defined parameters and textures,
  • upgrading to shader model 5.

For the first and second point, this implies quite a lot of changes in the way shaders are handled (in MPC and also in MadVR).
For this last point, I guess it requires to leave DX9 behind us. Has the upgrade to DX10 ever been discussed ?

@kasper93
Copy link
Contributor

For this last point, I guess it requires to leave DX9 behind us. Has the upgrade to DX10 ever been discussed ?

We're still maintaining support for XP. There isn't any date so far, but we will drop it eventually. Year after EOL is reasonable date, but this need to be discussed. Good reason for dropping XP will also make decision easier :) Like let say if VS2014 will no longer support XP nor will we .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
3 participants