Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

About HLSLPROGRAM VS CGPROGRAM

Discussion in 'Shaders' started by akilar1002, Oct 9, 2018.

  1. akilar1002

    akilar1002

    Joined:
    Jul 18, 2016
    Posts:
    11
    I am currently developing my own SRP. I see that LWRP is currently using HLSLPROGRAM. Does this mean that HLSLPROGRAM is the main language, so I should start using HLSLPROGRAM for development. Don't use CGPROGRAM anymore?
     
    monsieur_alpha likes this.
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    7,521
    The SRPs have been trying to remove alot of the old references to Cg where it can. Things like CGPROGRAM and .cginc files are prime examples as the SRPs use HLSLPROGRAM and .hlsl files. In reality Unity removed any actual use of Cg long ago, and these two examples are 100% equivalent in terms of functionality. It's all been HLSL for the last several years.

    Curiously they still use #pragma fragment, which is another Cg-ism. HLSL and DirectX call this shader stage the pixel shader. I'm not sure why they didn't change that.
     
    noio likes this.
  3. akilar1002

    akilar1002

    Joined:
    Jul 18, 2016
    Posts:
    11
    OK! thanks for your response.