Shader "Custom/MyShader"
{
Properties
{
_Color ("Color", Color) = (1,1,1,1)
_Brightness ("Change Brightness!!", Range(0, 1)) = 0.5
_TestFloat ("Test Float", Float) = 0.5
_TestColor ("Test Color", Color) = (1,1,1,1)
_TestVector ("Test Vector", Vector) = (1,1,1,1)
_TestTexture ("Test Texture", 2D) = "white" {}
}
SubShader
{
//불투명
Tags { "RenderType"="Opaque" }
CGPROGRAM
#pragma surface surf Standard
struct Input
{
float2 uv_TestTexture;
};
fixed4 _Color;
sampler2D _TestTexture;
float _Brightness;
void surf (Input IN, inout SurfaceOutputStandard o)
{
float3 red = float3(1,0,0);
//float4 textureColor = tex2D(_TestTexture, IN.uv_TestTexture);
//o.Emission = float3(-1,0,0);
//red.r = 1 = (1,1,1) = red.rrr = 흰색
o.Albedo = float3(-1,1,0);
o.Alpha = 1;
}
ENDCG
}
FallBack "Diffuse"
}
Albedo = float3(r,b,g) r,b,g에 음수를 하나라도 넣으면 뜨는 경고
'유니티 > 수업 내용' 카테고리의 다른 글
[Shader] Texture polybrush (0) | 2022.01.18 |
---|---|
[Shader] Texture_Fire (0) | 2022.01.18 |
ML Agent - DinoRun (0) | 2022.01.18 |
게임인공지능 MLAgent RollerBall 복습 (0) | 2022.01.18 |
게임인공지능 Ml-Agents - RollerBall 환경 바꾸기 (벽 세우기) (0) | 2022.01.18 |