Shader source

A place for Ogre users to discuss non-Ogre subjects with friends from the community.
Post Reply
User avatar
insider
Orc
Posts: 462
Joined: Thu Sep 15, 2011 12:50 pm
x 2

Shader source

Post by insider » Sun Feb 05, 2017 5:23 pm

Quick question, once I have access to the HLSL/GLSL files of a program, I can see the way things are done correct, is there any way the shader code can be hidden/obfuscated by an author?
0 x

frostbyte
Orc Shaman
Posts: 737
Joined: Fri May 31, 2013 2:28 am
x 14

Re: Shader source

Post by frostbyte » Sun Feb 05, 2017 8:46 pm

1)http://www.ogre3d.org/tikiwiki/Merge+ex ... +media+zip
2)you can export your shaders to c++ strings declerations, link it with your project and load them programmatically from string using GpuProgramManager::loadFromString
afaik there is no tool to automate this, so it has to be done manually, but i did'nt dig the forum....

anyway it should'nt be too hard to write an shaders->sourceCode automation tool
ideally for supplying smooth resourceManager integration, you would also need to hook up with resourceManager and add a new dataStream/archive type that will map shaders to your c++ shader strings
alternativily you can just add the shader loading code using the export tool you write

both methods still would'nt protect your shaders from "hackers", so if you have million dollar shaders code search on...
0 x
the woods are lovely dark and deep
but i have promises to keep
and miles to code before i sleep
and miles to code before i sleep..

coolest videos link( two minutes paper )...
https://www.youtube.com/user/keeroyz/videos

Post Reply