是否有任何方法可以隐藏Web应用程序中使用的着色器,以免被着色器编辑器或其他工具检查 [英] Is there any method to hide shader used in web application from being inspect by shader editor or other tools

查看:77
本文介绍了是否有任何方法可以隐藏Web应用程序中使用的着色器,以免被着色器编辑器或其他工具检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在挖掘VR的3D Web应用程序.我想隐藏我的着色器,使其不被Firefox着色器编辑器和webGL检查器检查.我使用了丑化着色器的方法,并将着色器放置在返回函数中,而不是在var中.但是它们都不起作用.

I am digging 3D web application for VR. And I want to hide my shader from being inspected by firefox shader editer and webGL inspector. I used the way to uglify the shader and put the shader in a return function rather than in a var. But none of them works.

那么,有什么方法可以隐藏Web应用程序的着色器?

So, is there any method to hide web application's shader?

推荐答案

答案很简单,没有答案

打印出着色器非常简单.某人要做的就是编写一个扩展程序来完成此操作

Just printing out the shaders is pretty easy. All someone has to do is write an extension that does this

WebGLRenderingContext.prototype.shaderSource = function(origFn) {
  return function(shader, src) {
    console.log(src);
    origFn.call(this, shader, src);
  };
}(WebGLRenderingContext.prototype.shaderSource);

即使您确实找到了防止某人在检查器中查看着色器的方法,他们也可以像 OSMesa 运行浏览器并将其编译以打印出着色器. Chrome已经在其测试设置中与OSMesa一起运行.使其打印出着色器,然后使用它来运行/查看您的网站将是微不足道的.

Even if you did find a way to prevent someone from looking at the shader in the inspector they could just as easily run system level tools like Microsoft's PIX, or Apple's OpenGL Profiler. They could even run the browser using OSMesa and compile it to print out the shaders. Chrome already runs with OSMesa as part of their testing setup. It would be trivial to make it print out the shaders, then use it to run/view your website.

更好的问题是,您为什么在乎?人们一直在检查着色器,即使在AAA游戏中,也总是 .人们可以根据需要反汇编汇编语言.您的着色器并不特殊.您正在浪费时间试图阻止对它们的检查.

The better question is why do you care? People inspect shaders all the time, even in AAA games. People can decompile assembly language if they want. Your shaders are not special. You're wasting your time trying to prevent them from being inspected.

这篇关于是否有任何方法可以隐藏Web应用程序中使用的着色器,以免被着色器编辑器或其他工具检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆