base model

Albedo, Smoothness

Normal, Smoothness

Albedo, Normal, Smoothness


Shader "Custom/CussionShader"
{
Properties
{
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_NormalMap ("Normal Map", 2D) = "white" {}
_Metallic ("Metallic", Range(0,1)) = 0.0
_Smoothness ("Smoothness", Range(0,1)) = 0.5
}
SubShader
{
Tags { "RenderType"="Opaque" }
CGPROGRAM
#pragma surface surf Standard
sampler2D _MainTex, _NormalMap;
struct Input
{
float2 uv_MainTex, uv_NormalMap;
};
float _Metallic;
float _Smoothness;
void surf (Input IN, inout SurfaceOutputStandard o)
{
fixed4 c = tex2D (_MainTex, IN.uv_MainTex);
o.Albedo = c;
fixed4 n = tex2D (_NormalMap, IN.uv_NormalMap);
o.Normal = UnpackNormal(n);
o.Metallic = _Metallic;
o.Smoothness = _Smoothness;
}
ENDCG
}
FallBack "Diffuse"
}'Unity > 수업 내용' 카테고리의 다른 글
| [Unity 2020.3] Alpha Shader 투명 오브젝트 뒷면까지 출력되는 문제 (0) | 2021.11.25 |
|---|---|
| [Unity 2020.3] Shader 코드 Occlusion (0) | 2021.11.19 |
| [Unity 2020.3] 11-16 MLDino (1) | 2021.11.16 |
| [Unity 2020.3] 11-09 ml-agents penguin (0) | 2021.11.09 |
| [Unity 2020.3] ml-agents 설치 (작성중) (0) | 2021.11.09 |