   [DX10] loading/compiling effects
  Hello everyone,I'm trying to encrypt my shaders in un-readable files, but my only problem is how to load them without D3DX10CreateEffectFromFile()? I mean, if i will have to read the encrypted shader, and store the true shader code in a string, and then create a new file containing the actual data, and then use D3DX10CreateEffectFromFile to load it and then delete the file, people would easily get the shader code, you dont really want that to happen.so i was wondering, is there a way to load my shader code from a string for example? or do you have any idea for doing it in a better wayThanks-Hassan   
  You don't need to encrypt them. There is a better way:just precompile them via the fxc tool, or use the D3DXPreprocessShader*() functions. (See the documentation) So they will be un-readable for everyone, and even faster to load! :)   ;  If you don't precompile them then look at the D3DXCompileFrom* functions.   ;Quote:Original post by dustin10If you don't precompile them then look at the D3DXCompileFrom* functions.what's the point of that? it compiles from a file right? then it cannot be encryptedAll i want is a way to compile from a string, instead of a file@mind in a box: how does D3DPreprocessShader work?[href]http://msdn.microsoft.com/en-au/library/bb205100%28v=VS.85%29.aspx[/href]it requires both string and file, how come? also, it doesn't return a pointer to an ID3DX10Effect   ;  Use fxc at the command line to compile the shader. One of the options compiles it into a header file with it's bytecode declared in a char array. From there, you can create a shader from memory.You could even make the running of fxc be a precompile step in Visual Studio if you want to automate it.fxc /E VS /T vs_4_0 /Fh SpriteVertexShader.h SpriteShader.hlsl;  Well now i exported the compiled shader as a file, now what? use D3DX10PreprocessShaderFromFile? how can i get the ID3D10Effect pointer? is it stored int the ppShaderText parameter?   ;  Docs on the various compile functions: hereDocs showing how some parameters are optional (use a string or a file name) here;  You can load a preprocessed shader just as a normal one. :)   