일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
- 언리얼 pan
- 애프터이펙트 aftereffect ram preview no sound 소리 안날때
- shader
- unity5
- msi gf63
- legacy lightmap
- 노트북 아답터
- 로스트 아크
- Unity2018
- Unreal5
- 내장 그래픽
- 3dsmax
- gtx1050
- 노트북 그래픽 카드
- 언리얼 뷰포트 움직임
- 유니티
- 언리얼5
- gitea
- mx150
- 랜더러
- 언리얼5 화면 움직임
- 요가북
- 와콤 feel 드라이버
- 언리얼 팁
- unity4
- wacom feel
- 3ds max #spring #스프링
- 언리얼 한글
- 언리얼 메뉴 한글
- legacy lightmapped
- Today
- Total
애니메이터
Unity 엔진의 내장 쉐이더 본문
Unity Editor에서는 내장된 쉐이더를 볼 수 없다. 모든 Built in Shader는 이미 Compile이 완료된 형태로 존재 하므로 기본 제공 쉐이더들이 어떻게 작성되었나 참고하려면 직접 다운 받아야 한다.
Unity download archive 위치 : https://unity3d.com/kr/get-unity/download/archive?_ga=2.34527777.1410280179.1529972917-657720498.1512367994
에서 원하는 Unity 버전으로 가서 다운로드 메뉴를 열어서 "내장 셰이더"를 다운로드 한다.
다운로드 받은 파일의 압축을 풀면~
이런식으로 *.shader 파일들이 나타난다.
각 셰이더 파일은 Monodevelop 등에서 열어 보면 됩니다.
참고 - Unlit-AlphaTest.shader
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
// Unlit alpha-cutout shader.
// - no lighting
// - no lightmap support
// - no per-material color
Shader "Unlit/Transparent Cutout" {
Properties {
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
}
SubShader {
Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"}
LOD 100
Lighting Off
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 2.0
#pragma multi_compile_fog
#include "UnityCG.cginc"
struct appdata_t {
float4 vertex : POSITION;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f {
float4 vertex : SV_POSITION;
float2 texcoord : TEXCOORD0;
UNITY_FOG_COORDS(1)
UNITY_VERTEX_OUTPUT_STEREO
};
sampler2D _MainTex;
float4 _MainTex_ST;
fixed _Cutoff;
v2f vert (appdata_t v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.vertex = UnityObjectToClipPos(v.vertex);
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
UNITY_TRANSFER_FOG(o,o.vertex);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
fixed4 col = tex2D(_MainTex, i.texcoord);
clip(col.a - _Cutoff);
UNITY_APPLY_FOG(i.fogCoord, col);
return col;
}
ENDCG
}
}
}