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

First shader question (EyeLinear)

Discussion in 'Shaders' started by cebollinos, Nov 24, 2015.

  1. cebollinos

    cebollinos

    Joined:
    May 31, 2013
    Posts:
    2
    Hi all!

    I'm trying to get into shaders and I am hitting a wall quite soon. Im trying to get the "eyelinear" efect as shown in this video:



    But I cant get it to work, it just displays the texture normally (not with the eyelinear effect) as shown in this screenshot:

    shaderProblem.png

    The code is

    Code (CSharp):
    1. Shader "PabloShaders/Eyeliner"{
    2.  
    3. Properties
    4. {
    5.     _Color("Color", Color) = (1,1,0)
    6.     _MainTex("Texture", 2D) = "green" {TexGen EyeLinear}
    7. }
    8.  
    9. SubShader
    10.     {
    11.         Pass{
    12.             Color[_Color]
    13.             SetTexture[_MainTex]
    14.  
    15.         }
    16.     }
    17. }
    Any idea what I am doing wrong?

    Thanks in advance
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    Jessy is an amazing guy and his videos really helped me a lot back in the day, but sadly they are outdated now.

    Texgen stuff no longer works.

    For a similar effect look up screen space coords or screen projection.
     
  3. StevenGerrard

    StevenGerrard

    Joined:
    Jun 1, 2015
    Posts:
    97
    TexGen is outdated now.
    What you are looking for is Texture Coordinate Generation.
    For detail please read book <OpenGL Shading Language>, see Chapter9 Emulating OpenGL Fixed Functionality.
     
  4. cebollinos

    cebollinos

    Joined:
    May 31, 2013
    Posts:
    2
    Thank you guys for the reply. I will look into it