Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How to mix CG/HLSL and GLSL shader langage

Discussion in 'Shaders' started by fmfranck, Sep 30, 2016.

  1. fmfranck

    fmfranck

    Joined:
    Apr 22, 2016
    Posts:
    7
    We need to define a CG/HLSL geometry shader along with a GLSL fragment shader. Is it possible to mix different programs / languages for the same material ?

    Thanks for your help
     
  2. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,495
    Is there a reason you can't just convert the GLSL frag method to HLSL? The languages are quite similar.
     
  3. fmfranck

    fmfranck

    Joined:
    Apr 22, 2016
    Posts:
    7
    @Invertex : thanks for reply : we need to access some OpenGL API like "textureQueryLod()" which is only available thru the GLSL language (#pragma target 5.0 => OpenGL 4.3+)

    Any clues ?
     
  4. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,495
  5. fmfranck

    fmfranck

    Joined:
    Apr 22, 2016
    Posts:
    7
    Thanks for the clue !
     
  6. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,863