🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Extract shaders from unreal engine?

Started by
3 comments, last by JoeJ 3 years, 2 months ago

Hi guys,

I wonder if it is possible to extract vertex and pixel shaders out of a game built using the unreal engine? any thoughts?

thanks

Jack

Advertisement

From a compiled game, this is unlikely possible as most games are under some kind of DRM and so protected against access to there resources. If you have the code, then you could easily get the shader source from it.

On the other hand, if you are really crazy and have a lot of time to waste, you could try to reverse engeneer the shader code from your GPU memory when the game is running

I saw in a interview with people who work for NV, a workstation with 4 top-tier Quadros installed on it. They said that they use the workstation to emulate any kind of NV GPUs in real time. These guys surely can get the shaders.

If you have a hypervisor that virtualizes your OS/game, you can get the shaders too.

There must be many other ways to do it too.

IMO:

I would not invest time in it. Unreal, as a product is not about shaders only. It is about the whole. You can not steal all that whole. Unreal takes parameters from the GUI and generates all king of shaders in real time, a lot of them that work in a combined fashion. You would need to steal the DX12 interactions too. Still you can not steal the richness of such a big product as Unreal. A single shader is not useful in practice. If you want to peek at the formulas, it would take less time to search for the technical papers explaining PBR and RT and to implement it yourself.

It is not worth the effort to get a single shader(or 10 shaders).

I mean, if you do it, you would learn more about hacking, than about rendering 3D scenes.

Maybe if you work for a competitor company that already has lot of that “whole” implemented and working, then it makes sense to get only the shader you miss. It makes sense then. It is called industrial espionage.

I would recommend you to go the legal way, you would have your own(though not so cool as Unity/Unreal) game engine running sooner than if you cheat. It is very often much easier to code it yourself than demystify the cryptic code of third persons.

Babylon.js is open source. You can learn from there the important thing to learn - how to get user options and produce new shaders based on these options.

What about shader cache? I noticed copies of my OpenCL shaders were stored by driver somewhere on harddisk, and for games the drivers do this too to avoid constant recompilation at game launch. Probably just some byte code which is not readable, but in case of OpenCL the full source was stored as well. (I did not really like to see that, though)

This topic is closed to new replies.

Advertisement