   How to encrypt the shader file
  How to encrypt the shader file?I want to prevent from another seeing the content of the shader file I had written when I release the game.[Edited by - akira32 on August 26, 2007 8:58:16 AM]
  The words you want:encode -> encryptprovide -> preventfrom another -> anyone fromAnd the answer is, use any encryption scheme you want. They'll all fail equally miserably when someone competent decides to grab your shaders.   ;  Thank you.Can D3D load the shader file from memory like texture?   ;  Compile them as part of your build process (use a custom build step linked to fxc.exe in visual studio) and ship only the binary. It'll be faster to load and it's non-trivial to examine even the assembly, let alone decompile it back to readable HLSL [smile]You can create effects from data in-memory if you want to go down that route.Jack   ;Quote:Original post by akira32Can D3D load the shader file from memory like texture?Quote:Original post by jollyjeffersYou can create effects from data in-memory if you want to go down that route.D3DX makes this task trivial. For HLSL, D3DXCompileShader  is the function you're looking for; D3DXAssembleShader for shader ASM, if you're crazy enough to use it.You'd probably save yourself a headache by using D3DXCompileShaderFromResource, though.Admiral   