본문 바로가기

게임개발/게임 그래픽 프로그래밍28

Water Refraction Shader "Custom/water" { Properties { _Normal("NormalMap",2D)= "bump"{} _Cube("cube",Cube) = ""{} } SubShader { Tags { "RenderType"="Transparent" "Queue"="Transparent" } GrabPass {} CGPROGRAM #pragma surface surf _Water alpha:fade vertex:vert #pragma target 3.0 sampler2D _Normal; samplerCUBE _Cube; sampler2D _GrabTexture; void vert(inout appdata_full v) //버텍스 { //절대값해주면 1~0~1 float movementX = si.. 2024. 2. 26.
Refraction : 노이즈 굴절효과 Shader "Custom/Refraction" { Properties { _MainTex ("Albedo (RGB)", 2D) = "white" {} } SubShader { Tags { "RenderType"="Transparent" "Queue"="Transparent" } GrabPass{} //스크린 캡처 CGPROGRAM #pragma surface surf Lambert #pragma target 3.0 sampler2D _GrabTexture; sampler2D _MainTex; struct Input { float2 uv_MainTex; float4 screenPos; }; void surf (Input IN, inout SurfaceOutput o) { fixed4 c = tex2D (.. 2024. 2. 26.
Triplanar : WorldNormal x= >red y =>green z=> blue Shader "Custom/triplanar" { Properties { _MainTex ("Albedo (RGB)1", 2D) = "white" {} _MainTex2 ("Albedo (RGB)2", 2D) = "white" {} _MainTex3 ("Albedo (RGB)3", 2D) = "white" {} } SubShader { Tags { "RenderType"="Opaque" } CGPROGRAM #pragma surface surf Lambert #pragma target 3.0 sampler2D _MainTex; sampler2D _MainTex2; sampler2D _MainTex3; struct Input { float2 uv_MainTe.. 2024. 2. 26.
MatCap _Nolight Shader "Custom/matcap" { Properties { _MainTex ("Albedo (RGB)", 2D) = "white" {} _MatcapTex("MatcapTex",2D) = "white" {} } SubShader { Tags { "RenderType"="Opaque" } CGPROGRAM #pragma surface surf _Nolight noambient #pragma target 3.0 sampler2D _MainTex; sampler2D _MatcapTex; struct Input { float2 uv_MainTex; float3 worldNormal; }; void surf (Input IN, inout SurfaceOutput o) { fixed4 c = tex2D (.. 2024. 2. 26.
Alphatest addshadow Shader "Custom/leaves" { Properties { _Color("Main Color",Color)=(1,1,1,1) //그림자 _MainTex ("Albedo (RGB)", 2D) = "white" {} _Cutoff("Alpha cutoff",Range(0,1))=0.5 _Speed("speed",Range(0,1))=0.1 //속도 _Timing("Timing",Range(0,5))=0.5 //간격 } SubShader { Tags { "RenderType"="Transparent" "Queue"="AlphaTest" } CGPROGRAM #pragma surface surf Lambert alphatest:_Cutoff vertex:vert addshadow//알파테스트 버텍스 #.. 2024. 2. 26.
Dissove Shader "Custom/dissolve" { Properties { _MainTex ("Albedo (RGB)", 2D) = "white" {} _NoiseTex ("Noise", 2D) = "white" {} _Cut("Cut",Range(0,1)) = 0 //디졸브 정도 _Outline("outline",Color) =(1,1,1,1) //라인색 _Line("Line",Range(1,2)) = 1.1 //라인두께 } SubShader { Tags { "RenderType"="Transparent" "Queue"="Transparent" } //1pass //z버퍼쓰기 ZWrite On //랜더링안하기 ColorMask 0 CGPROGRAM #pragma surface surf _Nolight #p.. 2024. 2. 23.
Alpha Blink Shader "Custom/alpha3"// 눈 깜빡이게 { Properties { _MainTex ("Albedo (RGB)", 2D) = "white" {} _MaskTex ("Mask", 2D) = "white" {} _RampTex("Ram",2D) ="white"{} } SubShader { Tags { "RenderType"="Opaque" } CGPROGRAM #pragma surface surf Lambert #pragma target 3.0 sampler2D _MainTex; sampler2D _MaskTex; sampler2D _RampTex; struct Input { float2 uv_MainTex; }; void surf (Input IN, inout SurfaceOutput o).. 2024. 2. 23.
Hologram Alpha blend Shader "Custom/alpha4" //홀로그램 입안 안보이게 { Properties { _MainTex ("Albedo (RGB)", 2D) = "white" {} _BumpMap("Normalmap",2D) ="bump"{} _Color("",Color)=(1,1,1,1) _RimPow("RimPow",Range(1,10)) =3 } SubShader { Tags { "RenderType"="Transparent" "Queue"="Transparent" } //z버퍼쓰기 ZWrite On //랜더링안하기 ColorMask 0 //1pass CGPROGRAM #pragma surface surf _Nolight noambient #pragma target 3.0 struct Input { floa.. 2024. 2. 23.
Alphatest_Cutoff 알파의 원리 불투명(Opaque) 오브젝트 먼저 그린다 반투명(Transparent) 오브젝트 나중에 그린다 반투명 오브젝트끼리는 뒤에서부터 그린다 알파 테스트 Shader "Custom/alpha2" { Properties { _Color("Main Color",Color)=(1,1,1,1) //그림자 _MainTex ("Albedo (RGB)", 2D) = "white" {} _Cutoff("Alpha cutoff",Range(0,1))=0.5 } SubShader { Tags { "RenderType"="Transparent" "Queue"="AlphaTest" } CGPROGRAM #pragma surface surf Lambert alphatest:_Cutoff #pragma target 3.0.. 2024. 2. 23.