Results 1 to 4 of 4

Thread: Disabling a stage in a multistage shader ?

  1. #1
    Member Newbie
    Join Date
    Mar 2004
    Location
    Craiova,Dolj,Romania
    Posts
    40

    Disabling a stage in a multistage shader ?

    I have a fragment shader containing normal & specular map calculations, can I disable the specular factor for examaple without writing a shader without those calculations ?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Aug 2005
    Posts
    145

    Re: Disabling a stage in a multistage shader ?

    Well, if you're writing your own fragment shader, you can do whatever you want. You can do whatever you think is best

  3. #3
    Member Newbie
    Join Date
    Mar 2004
    Location
    Craiova,Dolj,Romania
    Posts
    40

    Re: Disabling a stage in a multistage shader ?

    That`s not what i meant...

    I have a single shader with all operations.
    Let`s presume I don`t want to apply the specular factor to a poly but I don`t want to make another shader without the specular calculations.
    Can I disable the specular calculations from the original shader?

    PS:
    In doom3 for example you can disable bump mapping or specular and they only have 1 shader with all the operations

  4. #4
    Senior Member Frequent Contributor
    Join Date
    Feb 2004
    Location
    Long Island, New York
    Posts
    569

    Re: Disabling a stage in a multistage shader ?

    Pass a bool to your shader that is set in the application. Use the bool to conditionally call a block of code.

Similar Threads

  1. Separated Shader Objects : not declared in input from next stage.
    By imported_execom_rt in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 07-15-2017, 09:55 AM
  2. How to bind texture and uniform block for separate shader stage?
    By Xiongmao in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-15-2015, 08:58 PM
  3. Compile time shader stage information in GLSL
    By _blitz in forum OpenGL: General
    Replies: 2
    Last Post: 02-23-2013, 05:04 PM
  4. GLSL: variable telling which shader stage is compiled
    By guibou in forum OpenGL: General
    Replies: 3
    Last Post: 10-15-2012, 12:50 PM
  5. Shader Stage input output
    By zqueezy in forum OpenGL: General
    Replies: 7
    Last Post: 10-30-2011, 09:52 PM

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