티스토리 뷰
Shader "Custom/holo"
{
Properties
{
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_HoloColor("holo color",Color)=(1,1,1,1) //color추가
_BumpMap("BumpMap",2D) = "bump"{}
}
SubShader
{
Tags { "RenderType"="Transparent""Queue"="Transparent"} //"Transparent" } 반투명 옵션
CGPROGRAM
#pragma surface surf nolight noambient alpha:fade //alpha:fade 반투명 옵션
#pragma target 3.0
sampler2D _MainTex;
sampler2D _BumpMap;
float4 _HoloColor; //color추가
struct Input
{
float2 uv_MainTex;
float3 viewDir;
float3 worldPos;
float2 uv_BumpMap;
};
void surf (Input IN, inout SurfaceOutput o)
{
//노멀맵적용
float3 n = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
o.Normal = n;
//프레넬
float ndotv = max(0,dot(o.Normal, IN.viewDir));
float rim = pow(1 - ndotv,3); //프래넬 반전
//움직이는 라인만들기
rim += pow(frac(IN.worldPos.g * 10 - _Time.y), 30);
//컬러 적용
o.Emission = _HoloColor.rgb; //0~0.99 // _HoloColor;
//알파
//o.Alpha = rim; // rim;
o.Alpha = rim;
}
float4 Lightingnolight(SurfaceOutput s, float3 lightDir, float atten)
{
return float4(0, 0, 0, s.Alpha);
}
ENDCG
}
FallBack "Diffuse"
}
'게임클라이언트 프로그래밍 > Unity' 카테고리의 다른 글
Shader(라이트-Lambert, Blinn Phong, Standard) (0) | 2023.03.21 |
---|---|
삼각함수(sin,cos,tan)의 기본개념, 오브잭트의 내각 구하기 (0) | 2023.03.20 |
Shader(UV 텍스쳐 합치기, VertexColor,Metallic, Smoothness_Time,_BumpMap,_Metallic,_Smoothness) (0) | 2023.03.16 |
Shader (색상 설정, 텍스쳐 제어, lerp함수, UV) (0) | 2023.03.15 |
3D Animation controll,Dot (2) | 2023.03.06 |