Shader "NewShader"
{
Properties
{
_Darkness("Darkness",Range(0,100)) =0
_Bright("Bright",Range(-1.0,1.0)) =1
_PowerOfNumber("Power Of Number",Integer) =3
_Intensity("Intensity",Float) = 1.0
_Color("Color",Color) =(1.0,1.0,1.0,1.0) //fixed4
_Vector("Vector",Vector) =(1.0,2.0,3.0,4.0)
_MyTexture2D("My Texture 2D",2D) ="white"{}
_MyTexture3D("My Texture 3D",3D) ="white"{}
_MyTextureCube("My Texture Cube",Cube) ="white"{}
}
SubShader
{
Tags { "RenderType"="Opaque" }
CGPROGRAM
#pragma surface surf Standard noambient//조명
#pragma target 3.0
// 프로퍼티 값을 자동으로 할당
float _Darkness;
float4 _Color; //fixed4 _Color;
struct Input
{
// 무조건 1개 이상의 멤버가 있어야함
float4 color :COLOR;
};
void surf (Input IN, inout SurfaceOutputStandard o)
{
//o.Albedo = fixed3(1,0,0); // 빛의 영향을 받음
// o.Emission = half3(1,0,0); // 빛의 영향을 받지않음
o.Emission = _Color;
}
ENDCG
}
FallBack "Diffuse"
}
https://docs.unity3d.com/Manual/SL-SurfaceShaders.html
Unity - Manual: Writing Surface Shaders
Surface Shaders and rendering paths Writing Surface Shaders In the Built-in Render PipelineA series of operations that take the contents of a Scene, and displays them on a screen. Unity lets you choose from pre-built render pipelines, or write your own. Mo
docs.unity3d.com
https://docs.unity3d.com/kr/2021.3/Manual/SL-SurfaceShaders.html
표면 셰이더 작성 - Unity 매뉴얼
빌트인 렌더 파이프라인에서 표면 셰이더는 조명과 상호작용하는 셰이더를 더욱 간단하게 작성하는 방법입니다.
docs.unity3d.com
'게임개발 > 게임 그래픽 프로그래밍' 카테고리의 다른 글
Standard - Lambert -HalfLambert (0) | 2024.02.20 |
---|---|
커스텀 라이트 만들기 (0) | 2024.02.20 |
Rock Golem 만들기 (0) | 2024.02.19 |
불 이펙트 만들기 (0) | 2024.02.19 |
Lerp 함수 사용하기 (0) | 2024.02.16 |