과제

c# 셰이더 컬러 조절

nonstory nonstory 2020. 12. 15. 23:02
//Color만 받는 shader만들기
Shader "Custom/MyShader"
{
	Properties
	{
		//속성 4개 RGB, 밝기
		_Red("Red", Range(0, 1)) = 0
		_Green("Green", Range(0, 1)) = 0
		_Blue("Blue", Range(0, 1)) = 0
		_BrightDark("Bright & Dark", Range(-1 , 1)) = 0
	}
		SubShader
	{
		Tags { "RenderType" = "Opaque" }
		

		CGPROGRAM
		// Physically based Standard lighting model, and enable shadows on all light types
		#pragma surface surf Standard fullforwardshadows

		struct Input
		{
			float2 uv_MainTex;
		};

	  fixed _Red;
	  fixed _Green;
	  fixed _Blue;
	  fixed _BrightDark;


	  void surf(Input IN, inout SurfaceOutputStandard o)
	  {
		  //Emission값 설정하기
          o.Emission = fixed3(_Red, _Green, _Blue) + _BrightDark;
		  o.Alpha = 1.0;
          
	  }
	  ENDCG
	}
		FallBack "Diffuse"
}

 

 

 

 

'과제' 카테고리의 다른 글

c# 셰이더 컬러 조절  (0) 2020.12.15
쿠키런 따라 만들어보기  (0) 2020.11.26
1 2