위치가 색이야... 열라 멋지고 당연함..
Shader "Custom/holo"
{
Properties
{
_MainTex ("Albedo (RGB)", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Transparent" "Queue"="Transparent" }
CGPROGRAM
#pragma surface surf Lambert alpha:fade
sampler2D _MainTex;
struct Input
{
float2 uv_MainTex;
float3 viewDir;
float3 worldPos;
};
void surf (Input IN, inout SurfaceOutput o)
{
fixed4 c = tex2D(_MainTex, IN.uv_MainTex);
o.Emission = IN.worldPos;
float ndotv = saturate(dot(o.Normal, IN.viewDir));
float rim = pow(1 - ndotv, 3);
o.Alpha = 1;
}
ENDCG
}
FallBack "Diffuse"
}
'게임 그래픽 프로그래밍' 카테고리의 다른 글
셰이더: lerpf로 텍스쳐 섞기 (1) | 2024.09.04 |
---|---|
셰이더: 홀로그램 총 만들기 (0) | 2024.09.04 |
셰이더: 깜빡이는 투명 인간 만들기 (0) | 2024.09.04 |
셰이더: 림 라이트 (0) | 2024.09.04 |
셰이더: 하프 램버트 라이트에 색상 넣기 (0) | 2024.09.04 |