본문 바로가기

버텍스 컬러 마스킹으로 활용하기 123456789101112131415161718192021222324252627282930313233343536Shader "Custom/vertexcolor" { Properties { _MainTex("Albedo (RGB)", 2D) = "white" {} _MainTex2("Albedo (RGB)", 2D) = "white" {} _MainTex3("Albedo (RGB)", 2D) = "white" {} _MainTex4("Albedo (RGB)", 2D) = "white" {} } SubShader { Tags { "RenderType"="Opaque" } CGPROGRAM #pragma surface surf Standard nomabient sampler2D _MainTex; sample.. 더보기
버텍스 컬러와 버텍스 컬러의 시각화 버텍스 컬러UV처럼 '인터페이스로 입력 받을 수 없고 버텍스 안에 내장되어 있는 값을 엔진으로부터 요청해야' 사용할 수 있는 정보들이 몇 개 더 존재하는데 버텍스 안에 내장되어 있는 정보들은 대표적으로 위치(Position), UV(Texcoord), 컬러(Color), 노멀(Normal), 탄젠트(Tangent) 등이 있음.아무런 작업도 진행하지 않은 버텍스 컬러는 무조건 흰색. (float(1,1,1,1)) 버텍스 컬러를 적용하는 법은 크게 두 가지 1. 3ds Max와 같은 3D DCC(Digital Contents Creation)툴에서 그려오는 것2. 엔진의 자체 기능을 이용해서 그리는 것 유니티는 버텍스 컬러 페인팅 기능을 엔진 자체적으로 지원하고 있지 않음버텍스 컬러를 오브젝트에 칠했더라도 .. 더보기
UV 숫자로 변화시키기 12345678910111213141516171819202122232425Shader "Custom/FirstSurfaceShader" { Properties{ _MainTex("Albedo (RGB)", 2D) = "white" {} } SubShader { Tags { "RenderType"="Opaque" } LOD 200 CGPROGRAM #pragma surface surf Standard fullforwardshadows sampler2D _MainTex; struct Input { float2 uv_MainTex; }; void surf (Input IN, inout SurfaceOutputStandard o) { fixed4 c = tex2D(_MainTex, IN.uv_MainTex); .. 더보기