How to hide shaders code when deliverying a plugin

My plugin contains a butch of compute shaders (usf & ush), I would like to delivery it to other colleagues, but i want hide or encrypt the shader part because it contains some core calculations, so what should I do and thanks for any help!

1 Like

Can anyone please help? :rofl:

Im also looking for info about this, i was thinking maybe precompile shaders but there doesnt seem to be a way to preload them in UE

Did you ever found a way to hide the shader code? :sweat_smile:

It is impossible to hide shader code. The GPU needs to run the shader code, so it’s always available at the driver level, so anyone can use the debug driver to intercept the API calls and read the shader code.
Hiding shader code is the same “problem” as hiding your assets, it simply cannot be done, no matter how much you want to.

You have two options:

  1. Build a good reputation as a person who delivers good product and is easy to work with. This means you will get more work in the future, even if your current shader work happens to be exposed.
  2. Build a business around secrecy. Before selling your stuff to anyone else, qualify that they are a trustworthy purchaser. Make them sign a strong IP protection agreement, with auditing affordances. Add per-customer peturbation to your shader code (like, naming variables based on their customer ID or something.) Actually do auditing. Charge enough for your work that it covers all the legal and business negotiation extra costs, and the extra cost to customize the solution for each customer.

When what you do actually provides significant additional value compared to what any other competent developer can do, then option 2 can work.

When what you do really isn’t that special compared to other equally good developers, option 1 is the better option. In fact, you might even want to teach users how it works, to help build your reputation as a helpful person people want to work with!

Whichever way you go, good luck with your project, and let us know how it goes!

I finally used a C++ program to turn the shader into an encrypted file, then decrypted them before loading them into UE. After recognition or compilation (when opening UE editor), I encrypted them again. There really is no particularly good way :joy:

Can you share your implementation?