Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Can anyone create Team Fortress 2 Shader ?

Discussion in 'Shaders' started by BuildABurgerBurg, Apr 9, 2013.

  1. BuildABurgerBurg

    BuildABurgerBurg

    Joined:
    Nov 5, 2012
    Posts:
    566
    Hello All, I'm wondering if anyone can create (match) the Team Fortress 2 shader?

    I know there this one for unity TeamFortress2Shader but its not working with unity 4.

    I've seen this link, a TF2 shader has been made for UT3 and it looks like they have matched it.

    If you could make this shader, how much would you charge for it in the asset store?

    do you think it's possible to get the same result as UT3 shader?

    Thanks all and some opinions on this subject would be great.
     
  2. Farfarer

    Farfarer

    Joined:
    Aug 17, 2010
    Posts:
    2,249
    The first one you posted should work in Unity 4 with no issues. What problems are you having?
     
  3. jblazer

    jblazer

    Joined:
    Apr 17, 2009
    Posts:
    31
    I'm also having this issue in Unity Pro 4.1. The shader gives the error:
    Program 'vert_surf', incorrect number of arguments to numeric-type constructor (compiling for d3d11_9x)

    I'm trying to track this down but not very familiar with CG. Any ideas? I know DX11 is picky about syntax...

    Josh
     
  4. Annihlator

    Annihlator

    Joined:
    Oct 15, 2012
    Posts:
    378
    Disable D3d11 compilation if you're not using any specific d3d11 features in that shader :)
     
  5. jblazer

    jblazer

    Joined:
    Apr 17, 2009
    Posts:
    31
    #pragma target 3.0 along with #pragma only_renderers d3d9 does fix this script...
    Here's another shader that can produce TF2 style rendering if anyone is interested...
    http://www.jonatron.ca
     
    Last edited: May 21, 2013
  6. Mathieu Berube

    Mathieu Berube

    Joined:
    Sep 3, 2013
    Posts:
    1
    Hi, I can't pretend to be an expert in shaders
    But my understanding is that to fix this particular error,
    Instead of disabling d3d11 you just need to correct the error itself on line 36:
    a Float2 is only given 1 parameters and requires 2.

    Replace
    line36> fixed3 ramp = tex2D(_RampTex, float2(NdotL * atten)).rgb;
    By
    line36> fixed3 ramp = tex2D(_RampTex, float2((NdotL * atten).xx)).rgb;

    I think it should fix the issue,
    cheers.
     
    Last edited: Sep 3, 2013