Skip to content

Instantly share code, notes, and snippets.

@pizzimenti
Created December 31, 2018 21:14
Show Gist options
  • Save pizzimenti/c78c3405c06858485e92aabf44b87b7a to your computer and use it in GitHub Desktop.
Save pizzimenti/c78c3405c06858485e92aabf44b87b7a to your computer and use it in GitHub Desktop.

Revisions

  1. Bradley Pizzimenti created this gist Dec 31, 2018.
    36 changes: 36 additions & 0 deletions Flipping Normals
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    Shader "Flipping Normals" {
    Properties {
    _MainTex ("Base (RGB)", 2D) = "white" {}
    }
    SubShader {

    Tags { "RenderType" = "Opaque" }

    Cull Off

    CGPROGRAM

    #pragma surface surf Lambert vertex:vert
    sampler2D _MainTex;

    struct Input {
    float2 uv_MainTex;
    float4 color : COLOR;
    };

    void vert(inout appdata_full v) {
    v.normal.xyz = v.normal * -1;
    }

    void surf (Input IN, inout SurfaceOutput o) {
    fixed3 result = tex2D(_MainTex, IN.uv_MainTex);
    o.Albedo = result.rgb;
    o.Alpha = 1;
    }

    ENDCG

    }

    Fallback "Diffuse"
    }