View Full Version : GLSL Compiler
mcbastian
10-14-2004, 09:40 AM
Hi!
Simple question:
is there a way to compile my shader outside my program? so that I can ship it with the bytecode of the shader and not the sourcecode? I mean, even crypting the shader a) slows down my prog and b) can be worked arround with a modified opengl32.dll ....
thanks for help!
Bastian
jra101
10-14-2004, 10:42 AM
Try Cg 1.3 beta 2. You can use cgc.exe and pass the -oglsl flag to indicate you are giving the compiler GLSL code.
For example:
cgc -oglsl -strict -profile arbfp1 input.glsl
ZbuffeR
10-14-2004, 10:48 AM
GLSL is expected to be eaten directly by the driver, there is no user visible bytecode. The compiled result sent to the card by the driver is most certainly hardware dependant anyway.
It was done that way to give more freedom to the hardware design.
You *can* use CG to compile offline from GLSL to whatever asm profile, but this is no more GLSL.
Humus
10-14-2004, 05:16 PM
I would not recommend using Cg instead of GLSL since it doesn't give you any advantage at all in this case. Not only that, but it's likely going to be a good deal slower than using GLSL on all non-nVidia hardware.
mcbastian
10-15-2004, 12:14 AM
means, theres no way at the moment to ship something like bytecode instead of uncompiled code...
I don't want to use workarounds like the cg-one. because this makes it more hardware-dependend.
thanks for help.
bastian
V-man
10-15-2004, 05:41 AM
1. No, it's not possible to send bytecode, although this issue was discussed by the ARB.
2. All machine code can be reversed engineered, unless some kind of high encryption method is implemented. Maybe PKE (public key encryption) between driver and your app.
That can be suggested in the other forum.
3. "modified opengl32.dll" can be easily detected. They will be present in the folder of your exe.
Tom Nuydens
10-15-2004, 08:07 AM
How about obfuscating your shader code before you ship your app?
-- Tom
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.