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.

Noob to Pro Shader writing in Unity 4

Discussion in 'Community Learning & Teaching' started by cgcookie, Jan 6, 2013.

  1. cgcookie

    cgcookie

    Joined:
    Dec 1, 2011
    Posts:
    37
    Hi Guys!
    We've teamed up with Alex Telford to bring you a new "Noob to Pro Shader writing in Unity 4" series!

    This multi-part multi-series series is aimed at taking your skills from flat color fragment shaders, to full on DirectX-11 uber-shaders!
    And of course, it's aimed at artists, not programmers so it's all human readable code ;)

    We will be learning how to write clean, well formatted vertex/fragment shaders from scratch without the need for any surface shaders or cgincludes, while explaining everything from what a float variable is to controlling shaders with scripts and even creating custom image effects!


    So here's a sneak peak at some of the shaders, and we are open for suggestions if you want to learn anything specific.



    And as an added bonus:
    Maya/Max users - these shaders are written in the same language as the viewport CGFX shaders so you will have the knowledge to write shaders in both unity and maya/max!

    I'm super excited to get this underway so I hope you're excited too!
    If you have any questions feel free to ask them here!
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    7,612
    Good stuff!

    How about,
    - Terrain shaders
    - Water!!
    - Shield fx?
    - Clouds (animated)
    - Sky (day night cycle?)
     
  3. cgcookie

    cgcookie

    Joined:
    Dec 1, 2011
    Posts:
    37
    Hi mgear,

    Terrain and Water - there seems to be a lot of requests for these, I'll add it to Alex's list and see if he can come up with something epic
    Shield fx - Can you link to an example? (movie or game, just helps us see what you mean)
    Clouds - We are covering volumetrics in the advanced portion
    Sky - This is as easy as a rotating sphere (top half has Day cube map, bottom half has night) or a color lerp. we will learn the techniques for this in the introduction portion ;)

    Thanks for the feedback!
     
  4. wccrawford

    wccrawford

    Joined:
    Sep 30, 2011
    Posts:
    2,038
    I've been meaning to learn to write shaders for a while. This seems like it'll be a great series. I don't have any shaders to request, though.
     
  5. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    Sounds very interesting. Looking forward to see it.
     
  6. kablammyman

    kablammyman

    Joined:
    Nov 22, 2010
    Posts:
    507
    nice. i know this is for artist, but I would love to see some actual CG code thrown in...so the skills will be more easily transferable outside of unity. I think both programmers and artist would benefit from that.
     
  7. cgcookie

    cgcookie

    Joined:
    Dec 1, 2011
    Posts:
    37
    Hi Kablammyman, The way CG shaders are written are like this:

    //Software Specific Interface stuff (interface stuff, culling etc)
    //CG Shader
    //Closing Tags and Fallbacks

    The CG Shader part will work in any software with the exception of things like _World2Object has a different name in other software. We also have a 3DS Max site where Alex may come in and do some conversion tutorials for max and maya after the series.
     
  8. erica.sampson

    erica.sampson

    Joined:
    Jul 9, 2009
    Posts:
    158
    This looks great! when are you thinking this will be avalible for viewing?
     
  9. cgcookie

    cgcookie

    Joined:
    Dec 1, 2011
    Posts:
    37
    Hi Erica, sorry for the late reply, the series is finished and just pending review so should be out in the next couple of days :)
     
  10. cgcookie

    cgcookie

    Joined:
    Dec 1, 2011
    Posts:
    37
  11. fano_linux

    fano_linux

    Joined:
    Jan 1, 2012
    Posts:
    909
    lol nice post. I'll take a look, thanks
     
  12. Rodesqa

    Rodesqa

    Joined:
    May 16, 2011
    Posts:
    181



    All of those shaders require you to be artistic and create them your self.
     
  13. William Squire

    William Squire

    Joined:
    Jun 29, 2013
    Posts:
    3
    Those tutorials were absolutely awesome, but is there any on how to take these shaders into maya and use them in there?

    It's kinda hard to design for a custom shader in another package without seeing what it will look like once the in-game shader is applied.

    Cheers
     
  14. deli73123

    deli73123

    Joined:
    Apr 16, 2014
    Posts:
    6
    Would anyone be willing to make a shader tutorial focused on creating negative light sources? I keep hearing that "it's possible with shaders", but no one's really explained how, and I don't really need shaders for anything else, so I don't want to have to learn the ins and outs of shader coding. Is that lazy? Probably. But I don't want to have to wade through the tutorials looking for a way to do one small thing.

    Still kind of pisses me off that Unity doesn't support simple negative light sources.
     
  15. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    7,612
  16. blackfxx

    blackfxx

    Joined:
    Nov 21, 2013
    Posts:
    4
    Where could I find the 3rd pard of tutorials(Advanced series)?
     
unityunity