Welcome, Guest.
Username: Password: Remember me

TOPIC: Chaining Shaders

Chaining Shaders 1 year 11 months ago #1

  • SunBroDave
  • SunBroDave's Avatar
  • Offline
  • Posts: 202
  • Thank you received: 174
Would it be possible at some point to support chaining multiple .fx files instead of just choosing either reshade.fx or sweet.fx, without the need to explicitly use include statements? In the current implementation, the possibilities of using multiple shaders from multiple different programmers are kind of squashed because the .fx files can't have conflicting references to variables and methods. Consequently, shaders need to be grouped into packages like mastereffect or sweetfx, and then users need to give up one package to use another. It would be incredible if the encapsulation of each shader file could be preserved, so that different shaders could be chained regardless of each file's individual implementation and naming conventions.
The administrator has disabled public write access.

Chaining Shaders 1 year 11 months ago #2

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2446
  • Thank you received: 1388
While possible, it would definitly increase loading times. All the includes are resolved in the preprocessing step, which basicly produces one single piece of text containing the entire shader. This is then compiled, all the resources are created and those are used at runtime to draw the effects. Now if there are multiple files the compiler would need to kick in multiple times, slowing down the process.

So it's either one main shader entry point file and fast loading times or multiple shader files, but slow loading times. Would need some testing on how much it is slowed down and if that makes it worth the additional simplification for users.
Cheers, crosire =)
The administrator has disabled public write access.
The following user(s) said Thank You: SunBroDave

Chaining Shaders 1 year 11 months ago #3

  • SunBroDave
  • SunBroDave's Avatar
  • Offline
  • Posts: 202
  • Thank you received: 174
Sure yeah that makes a lot of sense. Thanks for looking into it.
The administrator has disabled public write access.