[URP] Gray-scale Shader Graph
Unity3D/Shader 2021. 10. 26. 00:33반응형
Surface Shader
Shader "ShaderStudy/Part05/Tex"
{
Properties
{
_MainTex ("Albedo (RGB)", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
CGPROGRAM
#pragma surface surf Standard fullforwardshadows
sampler2D _MainTex;
struct Input
{
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutputStandard o)
{
fixed4 c = tex2D (_MainTex, IN.uv_MainTex);
o.Albedo = (c.r + c.g + c.b)/3;
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}
Shader Graph
반응형
'Unity3D > Shader' 카테고리의 다른 글
TRANSFORM_TEX (0) | 2021.11.17 |
---|---|
[URP] Fire Shader Graph (0) | 2021.10.26 |
[URP] Lerp Shader Graph (0) | 2021.10.26 |
인스펙터에 R, G, B 컬러 프로퍼티 만들고 출력하기 (0) | 2021.10.25 |
[Deep Dive] Shader Graph 10.2.2 : 나의 첫 셰이더 그래프 (My first Shader Graph) (0) | 2021.10.22 |