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

learning to write shaders

Discussion in 'Shaders' started by DDDiscover, Mar 14, 2015.

  1. DDDiscover

    DDDiscover

    Joined:
    Dec 10, 2013
    Posts:
    17
    Hi,

    I want to learn to write shaders for Unity3D.
    It is not clear to me if I need to learn HLSL or Cg? Cg seems more generic, but is not supported by nVidia anymore (isn't it?).
    Is there some Unity reference that lists all variables and functions that can be used?
    I know there is a thread to do documentation requests. But I see no indication where existing documentation can be found.
     
  2. WhiteSkullDev

    WhiteSkullDev

    Joined:
    Mar 14, 2015
    Posts:
    8
    -you can write shaders using GLSL or Cg, although GLSL is usually not recommended.
    -you can find a list of built-in methods and variables from unity here. There's also a list on the nvidia site of standart functions used on Cg here.

    hope that helps you getting started
     
  3. DDDiscover

    DDDiscover

    Joined:
    Dec 10, 2013
    Posts:
    17
    Yes that helps.
    The nVidia Cg functions list is from 2003? Didn't nothing change since then? Isn't there an actual function list from Unity?
     
  4. domkia

    domkia

    Joined:
    Aug 19, 2012
    Posts:
    99
    Im also interested in this stuff :) pls post some useful links
     
  5. WhiteSkullDev

    WhiteSkullDev

    Joined:
    Mar 14, 2015
    Posts:
    8
    you should take a look at your "UnityCG.cginc" file, it details many helper functions and macros you can use
     
  6. KickBack

    KickBack

    Joined:
    Nov 18, 2014
    Posts:
    10