Last active
January 26, 2019 16:26
-
-
Save shop-0761/7452ca0da6a63205fe605aa838313abc to your computer and use it in GitHub Desktop.
fragment Shader 内で Surface shader を展開する例
This file contains 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
#include "UnityPBSLighting.cginc" | |
fixed4 frag(v2f i) : SV_Target | |
{ | |
Input surfIN; | |
UNITY_INITIALIZE_OUTPUT(Input, surfIN); | |
SurfaceOutputStandard o; | |
UNITY_INITIALIZE_OUTPUT(SurfaceOutputStandard, o); | |
surf(surfIN, o); | |
return fixed4(o.Albedo,0); | |
} | |
void surf(Input IN, inout SurfaceOutputStandard o) | |
{ | |
fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; | |
o.Albedo = c.rgb; | |
o.Metallic = _Metallic; | |
o.Smoothness = _Glossiness; | |
o.Alpha = c.a; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment