Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Tutorial/04_surface" {
- Properties {
- _Color ("Tint", Color) = (0, 0, 0, 1)
- _MainTex ("Texture", 2D) = "white" {}
- _Smoothness ("Smoothness", Range(0, 1)) = 0
- _Metallic ("Metalness", Range(0, 1)) = 0
- [HDR] _Emission ("Emission", color) = (0,0,0)
- }
- SubShader {
- Tags{ "RenderType"="Opaque" "Queue"="Geometry"}
- CGPROGRAM
- #pragma surface surf Standard fullforwardshadows
- #pragma target 3.0
- sampler2D _MainTex;
- fixed4 _Color;
- half _Smoothness;
- half _Metallic;
- half3 _Emission;
- struct Input {
- float2 uv_MainTex;
- };
- void surf (Input i, inout SurfaceOutputStandard o) {
- fixed4 col = tex2D(_MainTex, i.uv_MainTex);
- col *= _Color;
- //changed this to only use the rgb values because this color doesn't take a alpha value
- //(the alpha is cut automatically, but I think it's better to do it explicitly)
- o.Albedo = col.rgb;
- o.Metallic = _Metallic;
- o.Smoothness = _Smoothness;
- o.Emission = _Emission;
- }
- ENDCG
- }
- FallBack "Standard"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement