Results 1 to 7 of 7

Thread: GLSL Compiler

  1. #1
    Member Contributor
    Join Date
    Nov 2000
    Location
    Thuringia, Germany
    Posts
    85

    GLSL Compiler

    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

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Jan 2001
    Location
    NVIDIA, Austin, TX
    Posts
    555

    Re: GLSL Compiler

    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:
    Code :
    cgc -oglsl -strict -profile arbfp1 input.glsl

  3. #3
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: GLSL Compiler

    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.

  4. #4
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,342

    Re: GLSL Compiler

    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.

  5. #5
    Member Contributor
    Join Date
    Nov 2000
    Location
    Thuringia, Germany
    Posts
    85

    Re: GLSL Compiler

    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

  6. #6
    V-man
    Guest

    Re: GLSL Compiler

    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.

  7. #7
    Senior Member Frequent Contributor
    Join Date
    Oct 2000
    Location
    Belgium
    Posts
    806

    Re: GLSL Compiler

    How about obfuscating your shader code before you ship your app?

    -- Tom

Similar Threads

  1. nVidia GLSL compiler bug?
    By BionicBytes in forum OpenGL: Drivers
    Replies: 7
    Last Post: 01-21-2012, 07:29 AM
  2. ATI GLSL compiler bug
    By l_belev in forum OpenGL: Drivers
    Replies: 2
    Last Post: 11-17-2011, 09:03 PM
  3. AMD's GLSL Compiler bug
    By YarUnderoaker in forum OpenGL: Drivers
    Replies: 31
    Last Post: 12-07-2010, 06:52 AM
  4. Bug in nvidia glsl compiler?
    By grisha in forum OpenGL: GLSL
    Replies: 3
    Last Post: 08-16-2005, 01:29 PM
  5. glsl compiler bug ?!
    By def in forum OpenGL: GLSL
    Replies: 8
    Last Post: 02-09-2004, 11:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean