Submit Search
Upload
Unity Surface Shader for Artist 02
•
3 likes
•
857 views
SangYun Yi
Follow
아티스트를 위한 유니티 서피스 셰이더 기초강좌 #02
Read less
Read more
Software
Slideshow view
Report
Share
Slideshow view
Report
Share
1 of 21
Download now
Download to read offline
Recommended
Unity Surface Shader for Artist 03
Unity Surface Shader for Artist 03
SangYun Yi
Unity Surface Shader for Artist 04
Unity Surface Shader for Artist 04
SangYun Yi
Post processing in_color
Post processing in_color
민웅 이
실전프로젝트 정서경 양현찬
실전프로젝트 정서경 양현찬
현찬 양
Light in screen_space(Light Pre Pass)
Light in screen_space(Light Pre Pass)
민웅 이
[ShaderX5] 4.4 Edge Masking and Per-Texel Depth Extent Propagation For Comput...
[ShaderX5] 4.4 Edge Masking and Per-Texel Depth Extent Propagation For Comput...
종빈 오
[KOSSA] C++ Programming - 13th Study - exception handling
[KOSSA] C++ Programming - 13th Study - exception handling
Seok-joon Yun
Deferred Shading
Deferred Shading
종빈 오
Recommended
Unity Surface Shader for Artist 03
Unity Surface Shader for Artist 03
SangYun Yi
Unity Surface Shader for Artist 04
Unity Surface Shader for Artist 04
SangYun Yi
Post processing in_color
Post processing in_color
민웅 이
실전프로젝트 정서경 양현찬
실전프로젝트 정서경 양현찬
현찬 양
Light in screen_space(Light Pre Pass)
Light in screen_space(Light Pre Pass)
민웅 이
[ShaderX5] 4.4 Edge Masking and Per-Texel Depth Extent Propagation For Comput...
[ShaderX5] 4.4 Edge Masking and Per-Texel Depth Extent Propagation For Comput...
종빈 오
[KOSSA] C++ Programming - 13th Study - exception handling
[KOSSA] C++ Programming - 13th Study - exception handling
Seok-joon Yun
Deferred Shading
Deferred Shading
종빈 오
SGL : 소프트웨어 3D 렌더링 엔진
SGL : 소프트웨어 3D 렌더링 엔진
SUNGCHEOL KIM
2. c언어의 기본
2. c언어의 기본
SeonMan Kim
D2 Depth of field
D2 Depth of field
Youpyo Choi
D2 Rain (2/2)
D2 Rain (2/2)
Youpyo Choi
D2 Rain (1/2)
D2 Rain (1/2)
Youpyo Choi
13장 연산자 오버로딩
13장 연산자 오버로딩
유석 남
Startup JavaScript 4 - 객체
Startup JavaScript 4 - 객체
Circulus
Startup JavaScript 3 - 조건문, 반복문, 예외처리
Startup JavaScript 3 - 조건문, 반복문, 예외처리
Circulus
3D Graphics 101
3D Graphics 101
Leonardo YongUk Kim
Startup JavaScript 6 - 함수, 스코프, 클로저
Startup JavaScript 6 - 함수, 스코프, 클로저
Circulus
[GPU Gems3] Chapter 28. Practical Post Process Depth Of Field
[GPU Gems3] Chapter 28. Practical Post Process Depth Of Field
종빈 오
Rendering realistic Ice objects
Rendering realistic Ice objects
yong gyun im
TestBCD2018-2(answer)
TestBCD2018-2(answer)
Yong Heui Cho
2.Startup JavaScript - 연산자
2.Startup JavaScript - 연산자
Circulus
Implements Cascaded Shadow Maps with using Texture Array
Implements Cascaded Shadow Maps with using Texture Array
YEONG-CHEON YOU
Ch11
Ch11
Hankyo
Ch10
Ch10
Hankyo
[TechDays Korea 2015] 녹슨 C++ 코드에 모던 C++로 기름칠하기
[TechDays Korea 2015] 녹슨 C++ 코드에 모던 C++로 기름칠하기
Chris Ohk
Ssao
Ssao
ozlael ozlael
Cpp 0x kimRyungee
Cpp 0x kimRyungee
scor7910
Unity Surface Shader for Artist 01
Unity Surface Shader for Artist 01
SangYun Yi
Game Visual Art Technologies
Game Visual Art Technologies
SangYun Yi
More Related Content
What's hot
SGL : 소프트웨어 3D 렌더링 엔진
SGL : 소프트웨어 3D 렌더링 엔진
SUNGCHEOL KIM
2. c언어의 기본
2. c언어의 기본
SeonMan Kim
D2 Depth of field
D2 Depth of field
Youpyo Choi
D2 Rain (2/2)
D2 Rain (2/2)
Youpyo Choi
D2 Rain (1/2)
D2 Rain (1/2)
Youpyo Choi
13장 연산자 오버로딩
13장 연산자 오버로딩
유석 남
Startup JavaScript 4 - 객체
Startup JavaScript 4 - 객체
Circulus
Startup JavaScript 3 - 조건문, 반복문, 예외처리
Startup JavaScript 3 - 조건문, 반복문, 예외처리
Circulus
3D Graphics 101
3D Graphics 101
Leonardo YongUk Kim
Startup JavaScript 6 - 함수, 스코프, 클로저
Startup JavaScript 6 - 함수, 스코프, 클로저
Circulus
[GPU Gems3] Chapter 28. Practical Post Process Depth Of Field
[GPU Gems3] Chapter 28. Practical Post Process Depth Of Field
종빈 오
Rendering realistic Ice objects
Rendering realistic Ice objects
yong gyun im
TestBCD2018-2(answer)
TestBCD2018-2(answer)
Yong Heui Cho
2.Startup JavaScript - 연산자
2.Startup JavaScript - 연산자
Circulus
Implements Cascaded Shadow Maps with using Texture Array
Implements Cascaded Shadow Maps with using Texture Array
YEONG-CHEON YOU
Ch11
Ch11
Hankyo
Ch10
Ch10
Hankyo
[TechDays Korea 2015] 녹슨 C++ 코드에 모던 C++로 기름칠하기
[TechDays Korea 2015] 녹슨 C++ 코드에 모던 C++로 기름칠하기
Chris Ohk
Ssao
Ssao
ozlael ozlael
Cpp 0x kimRyungee
Cpp 0x kimRyungee
scor7910
What's hot
(20)
SGL : 소프트웨어 3D 렌더링 엔진
SGL : 소프트웨어 3D 렌더링 엔진
2. c언어의 기본
2. c언어의 기본
D2 Depth of field
D2 Depth of field
D2 Rain (2/2)
D2 Rain (2/2)
D2 Rain (1/2)
D2 Rain (1/2)
13장 연산자 오버로딩
13장 연산자 오버로딩
Startup JavaScript 4 - 객체
Startup JavaScript 4 - 객체
Startup JavaScript 3 - 조건문, 반복문, 예외처리
Startup JavaScript 3 - 조건문, 반복문, 예외처리
3D Graphics 101
3D Graphics 101
Startup JavaScript 6 - 함수, 스코프, 클로저
Startup JavaScript 6 - 함수, 스코프, 클로저
[GPU Gems3] Chapter 28. Practical Post Process Depth Of Field
[GPU Gems3] Chapter 28. Practical Post Process Depth Of Field
Rendering realistic Ice objects
Rendering realistic Ice objects
TestBCD2018-2(answer)
TestBCD2018-2(answer)
2.Startup JavaScript - 연산자
2.Startup JavaScript - 연산자
Implements Cascaded Shadow Maps with using Texture Array
Implements Cascaded Shadow Maps with using Texture Array
Ch11
Ch11
Ch10
Ch10
[TechDays Korea 2015] 녹슨 C++ 코드에 모던 C++로 기름칠하기
[TechDays Korea 2015] 녹슨 C++ 코드에 모던 C++로 기름칠하기
Ssao
Ssao
Cpp 0x kimRyungee
Cpp 0x kimRyungee
Viewers also liked
Unity Surface Shader for Artist 01
Unity Surface Shader for Artist 01
SangYun Yi
Game Visual Art Technologies
Game Visual Art Technologies
SangYun Yi
레퍼런스만 알면 언리얼 엔진이 제대로 보인다
레퍼런스만 알면 언리얼 엔진이 제대로 보인다
Lee Dustin
유니티 게임 그래픽스 아트 개발 사례 분석
유니티 게임 그래픽스 아트 개발 사례 분석
SangYun Yi
GameMath-Chapter 08 고급렌더링
GameMath-Chapter 08 고급렌더링
Mark Choi
전형규, 가성비 좋은 렌더링 테크닉 10선, NDC2012
전형규, 가성비 좋은 렌더링 테크닉 10선, NDC2012
devCAT Studio, NEXON
LCD Monitor 선택 가이드와 Gamma의 이해
LCD Monitor 선택 가이드와 Gamma의 이해
SangYun Yi
【Unite 2017 Tokyo】Unityライティング最新情報
【Unite 2017 Tokyo】Unityライティング最新情報
Unite2017Tokyo
Unite seoul 2016 Rooms2 mobile to VR
Unite seoul 2016 Rooms2 mobile to VR
SangYun Yi
Rooms2 vr ArtWorks
Rooms2 vr ArtWorks
SangYun Yi
Display color와 Digital texture format의 이해
Display color와 Digital texture format의 이해
SangYun Yi
Unite Seoul 2017 Yi SangYun
Unite Seoul 2017 Yi SangYun
SangYun Yi
Igc2016 Technical Artist가 뭐하는 사람이에요?
Igc2016 Technical Artist가 뭐하는 사람이에요?
SangYun Yi
Viewers also liked
(13)
Unity Surface Shader for Artist 01
Unity Surface Shader for Artist 01
Game Visual Art Technologies
Game Visual Art Technologies
레퍼런스만 알면 언리얼 엔진이 제대로 보인다
레퍼런스만 알면 언리얼 엔진이 제대로 보인다
유니티 게임 그래픽스 아트 개발 사례 분석
유니티 게임 그래픽스 아트 개발 사례 분석
GameMath-Chapter 08 고급렌더링
GameMath-Chapter 08 고급렌더링
전형규, 가성비 좋은 렌더링 테크닉 10선, NDC2012
전형규, 가성비 좋은 렌더링 테크닉 10선, NDC2012
LCD Monitor 선택 가이드와 Gamma의 이해
LCD Monitor 선택 가이드와 Gamma의 이해
【Unite 2017 Tokyo】Unityライティング最新情報
【Unite 2017 Tokyo】Unityライティング最新情報
Unite seoul 2016 Rooms2 mobile to VR
Unite seoul 2016 Rooms2 mobile to VR
Rooms2 vr ArtWorks
Rooms2 vr ArtWorks
Display color와 Digital texture format의 이해
Display color와 Digital texture format의 이해
Unite Seoul 2017 Yi SangYun
Unite Seoul 2017 Yi SangYun
Igc2016 Technical Artist가 뭐하는 사람이에요?
Igc2016 Technical Artist가 뭐하는 사람이에요?
More from SangYun Yi
Devtree lightmapping unity5_2_1stday
Devtree lightmapping unity5_2_1stday
SangYun Yi
Unity3D 엔진을 활용한 게임환경 분석 및 3D 그래픽스 기술 /제작 사례
Unity3D 엔진을 활용한 게임환경 분석 및 3D 그래픽스 기술 /제작 사례
SangYun Yi
Unite2015 probelight English version
Unite2015 probelight English version
SangYun Yi
Unite2015 probelight(150417)
Unite2015 probelight(150417)
SangYun Yi
Gametech2015
Gametech2015
SangYun Yi
Devtree illu
Devtree illu
SangYun Yi
Kgc2013 defense technica_converting_이상윤
Kgc2013 defense technica_converting_이상윤
SangYun Yi
More from SangYun Yi
(7)
Devtree lightmapping unity5_2_1stday
Devtree lightmapping unity5_2_1stday
Unity3D 엔진을 활용한 게임환경 분석 및 3D 그래픽스 기술 /제작 사례
Unity3D 엔진을 활용한 게임환경 분석 및 3D 그래픽스 기술 /제작 사례
Unite2015 probelight English version
Unite2015 probelight English version
Unite2015 probelight(150417)
Unite2015 probelight(150417)
Gametech2015
Gametech2015
Devtree illu
Devtree illu
Kgc2013 defense technica_converting_이상윤
Kgc2013 defense technica_converting_이상윤
Unity Surface Shader for Artist 02
1.
02. 기본 Unity
Surface Shader 작성 이상윤 http://illu.tistory.com
2.
1주차 과제 확인 Red(1,0,0) Orange(1,
0.5, 0) Yellow(1,1,0) Green(0,1,0) Blue(0,0,1) Indigo(0.25, 0, 0.5) Violet(0.5, 0, 1)
3.
Shader "Study/TintColor" { Properties
{ _TintColor(“색깔”, color) = (1,1,1,1) } SubShader { Tags { "RenderType"="Opaque" } CGPROGRAM #pragma surface surf Lambert fixed4 _TintColor; struct Input { float4 color:COLOR; }; void surf (Input IN, inout SurfaceOutput o) { o.Albedo = _TintColor; } ENDCG } }
4.
Shader "Study/RGBColor" { Properties
{ _Red (“빨간채널”, Range(0,1)) = 1 _Green (“초록채널”, Range(0,1)) = 1 _Blue (“파랑채널”, Range(0,1)) = 1 } SubShader { Tags { "RenderType"="Opaque" } CGPROGRAM #pragma surface surf Lambert fixed _Red; // fixed _Red, _Green, _Blue; fixed _Green; fixed _Blue; struct Input { float4 color:COLOR; }; void surf (Input IN, inout SurfaceOutput o) { o.Albedo = float3( _Red, _Green, _Blue); } ENDCG } }
5.
변수~ Properties에 정의되는 이름~ *
숫자로 시작하면 안됨 * 예약어는 안됨 * 대소문자 구별함 보통 많이 쓰는 _MainTex _TintColor _Emission _Gloss : 이런 변수명 그냥 씁시다… 스크립트로 이를 제어할때도 이걸 사용함.(그러니까 많이 쓰 는걸 걍 쓰자~!)
6.
이제 메쉬의 UV를
사용해 mapping을 해봅시다.
7.
Shader "Study/Diffuse" { Properties
{ _MainTex(“텍스쳐”, 2D) = “white” {} } SubShader { Tags { "RenderType"="Opaque" } CGPROGRAM #pragma surface surf Lambert sampler2D _MainTex; struct Input { float4 color:COLOR; // 얘는 vertex color를 사용하는 구조체 선언문입니다. float2 uv_MainTex; }; void surf (Input IN, inout SurfaceOutput o) { o.Albedo = tex2D(_MainTex, IN.uv_MainTex).rgb; } ENDCG } }
8.
o.Albedo = tex2D(_MainTex,
IN.uv_MainTex).rgb; 이걸 아래처럼. fixed3 c = tex2D(_MainTex, IN.uv_MainTex).rgb; o.Albedo = c.rgb; o.Albedo 출력을 치환해서 처리해봅시다. 텍스쳐를 한장 더 쓸수 있게 하여 두장을 더하고 빼고 곱해봅시다~! Hint _MainTex1(“텍스쳐1”, 2D) = “white” {} _MainTex2(“텍스쳐2”, 2D) = “white” {} c1 + c2 ; c1-c2; Reverse : 1-(c1+c2)
9.
흑백 이미지를 만들어
봅시다.
10.
fixed3 c =
tex2D(_MainTex, IN.uv_MainTex).rgb; fixed grayTex = (c.r + c.g + c.b) / 3; o.Albedo = grayTex; * NTSC 가중치에 따른 공식(National Television System Committee, 국가 텔레비전 시스템 위원회) (0.299 * R + 0.587 * G + 0.114 * B) - 대마왕님 자료 참조 흑백 이미지를 만들어 봅시다.
11.
o.Emission으로 Emissive effect를
만들어 봅시다.
12.
struct Input { float2
uv_MainTex; } fixed3 c = tex2D(_MainTex, IN.uv_MainTex).rgb; fixed3 e = tex2D(_MainTex2, IN.uv_MainTex).rgb; o.Albedo = c.rgb; o.Emission = e.rgb; Color를 변경할수 있게 만들어 봅시다. 변수에 Range 타입을 선언해 값의 세기를 변경할 수 있게 해봅시다.
13.
o. Albedo =
c; o. Emission = c * fixed3(1,1,0); o. Albedo = c.rgb; o. Emission = e * _EmissionColor; o. Albedo = c.rgb; o. Emission = e.rgb;
14.
Vertex color를 활용해
봅니다. Vertex color는 항상 검은색을 깔고 위에 RGB Color를 입힌다고 생각하면 됩니다.
15.
struct Input { fixed4
color:COLOR; } fixed3 c = tex2D(_MainTex, IN.uv_MainTex).rgb; o.Albedo = c.rgb * IN.color.rgb;
16.
Vertex Alpha도 적용해
봅니다. 흐르는 물을 표현할때 알파 텍스쳐와 더불어 활 용하기 좋은 방법입니다.
17.
struct Input { fixed4
color:COLOR; } fixed4 c = tex2D(_MainTex, IN.uv_MainTex); o.Albedo = c.rgb * IN.color.rgb; o.Alpha = c.a * IN.color.a;
18.
함수를 사용해 봅니다. Lerp(Linear
Interpolation) : 선형 보간법. Lerp(a, b, f) : (1-f) * a + b * f a 와 b의 사이의 f 값에 따른 값을 구할때 사용 하는 함수.
19.
Terrain splatting에 가장
기본적으로 사용하는 함수. A texture + B texture = blending texture.
20.
Texture 두장을 더하고
빼고 했던것을 Vertex color를 이용 해 lerp 함수를 사용해 만들어 봅시다. fixed3 c1 = tex2D(_MainTex1, IN.uv_MainTex).rgb; fixed3 c2 = tex2D(_MainTex2, IN.uv_MainTex).rgb; fixed3 c = lerp (a, b, ? ) ; o.Albedo = c ;
21.
수고하셨습니다.
Download now