> 엔진에 저장된 Vertex안에 내장되어 있는 값
• 위치(Position)
• UV (Texcoord)
• 컬러(Color)
• 노멀(Normal)
• 탄젠트(Tangent)
> 기본 흰색 float4(1,1,1,1)
float4 color: COLOR; 버택스 칼라다
> 버택스 칼라 출력하기
poly brush 설치
Shader "Custom/vertexcolor"
{
Properties
{
_MainTex ("Albedo (RGB)", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
CGPROGRAM
#pragma surface surf Standard
#pragma target 3.0
sampler2D _MainTex;
struct Input
{
float2 uv_MainTex;
float4 color : COLOR; // 버택스 칼라
};
void surf (Input IN, inout SurfaceOutputStandard o)
{
fixed4 c = tex2D (_MainTex, IN.uv_MainTex);
o.Albedo = IN.color.rgb; // 버택스 칼라 보기
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}
'게임 그래픽 프로그래밍' 카테고리의 다른 글
셰이더: 하프 램버트 라이트에 색상 넣기 (0) | 2024.09.04 |
---|---|
셰이더9: 하프 램버트 라이트 만들기 (0) | 2024.09.04 |
셰이더5: 불! 타올라라 (0) | 2024.09.04 |
셰이더4: 텍스쳐 애니메이션 (0) | 2024.09.03 |
셰이더3: 색 반전 및 밝기 조정 (0) | 2024.09.03 |