Created
July 26, 2016 11:51
-
-
Save smokelore/55d4b499ceae94da9e6e1689caf0c7d6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Shader "CookbookShaders/Multiply" | |
| { | |
| Properties | |
| { | |
| _Color ("Color", Color) = (1, 0, 0, 1) | |
| _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} | |
| } | |
| SubShader | |
| { | |
| Pass | |
| { | |
| CGPROGRAM | |
| #pragma vertex vert | |
| #pragma fragment frag | |
| half4 _Color; | |
| sampler2D _MainTex; | |
| struct vertInput | |
| { | |
| float4 pos : POSITION; | |
| float2 texcoord : TEXCOORD0; | |
| }; | |
| struct vertOutput | |
| { | |
| float4 pos : SV_POSITION; | |
| float2 texcoord : TEXCOORD0; | |
| }; | |
| vertOutput vert(vertInput input) | |
| { | |
| vertOutput o; | |
| o.pos = mul(UNITY_MATRIX_MVP, input.pos); | |
| o.texcoord = input.texcoord; | |
| return o; | |
| } | |
| half4 frag(vertOutput output) : COLOR | |
| { | |
| half4 mainColor = tex2D(_MainTex, output.texcoord); | |
| return mainColor * _Color; | |
| } | |
| ENDCG | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment