Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
fragment Shader 内で Surface shader を展開する例
#include "UnityPBSLighting.cginc"
fixed4 frag(v2f i) : SV_Target
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
You can’t perform that action at this time.