블로그 이미지
Every unexpected event is a path to learning for you.

카테고리

분류 전체보기 (2731)
Unity3D (814)
Programming (474)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (228)
협업 (57)
3DS Max (3)
Game (12)
Utility (136)
Etc (96)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (51)
Android (14)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (38)
Thinking (38)
한글 (30)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (18)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total
Today
Yesterday
03-29 07:22

NGUI의 이미지를 밝게(Additive) 만들 필요가 있어서 간단하게 아틀라스가 사용할 쉐이더의 블랜딩만 수정했다.

 

[파일]

Unlit - Transparent Colored Additive.shader
0.00MB

수정하고 보니 수정된 쉐이더(Unlit - Transparent Colored Additive)가 다른 곳은 정상적으로 적용되는 데, 스크롤뷰(Grid) 사용부분은 적용이 되지 않았다.

 

그래서 검색하다보니 아래와 같은 내용이 있다.(링크 : http://www.tasharen.com/forum/index.php?topic=5180.0 )

NGUI's clipping is done by choosing a different shader with a similar name. Look at the existing shaders, for exmaple:

Unlit - Transparent Colored < -- used if no clipping is needed
Unlit - Transparent Colored 1 <-- used if there is 1 panel clipping the content
Unlit - Transparent Colored 2 <-- used if there are 2 panels clipping the content
Unlit - Transparent Colored 3 <-- used if there are 3 panels clipping the content

When making custom shaders, you would need to follow the same naming convention. The easiest thing to do is to just make a copy of at least two shaders (the first two) and modify them to suit your needs. In case of additive blending, all you would do is change the blend line from:

Code: [Select]
Blend SrcAlpha OneMinusSrcAlpha

to:

Code: [Select]
Blend One One

Source: https://docs.unity3d.com/Documentation/Components/SL-Blend.html

 

 

이름은 같고 뒤에 숫자가 달린 얘들은 Hidden이라 메뉴에 보이지 않는데 왜 있는지 궁금했었는데..

위 설명을 보니 뒤 숫자는 Panel Clipping의 개수였다.

NGUI에서 Panel을 체크해서 자동으로 Hidden인 애들 중에서 패널개수에 맞는 쉐이더를 찾아 쓰고 있다.

 

결론적으로 Clipping을 하는 스크롤뷰는 패널로 보기 때문에 숫자가 달린 애들 중 하나(1인가?)를 쓰는 것 같다.

그래서 숫자달린 파일들도 다 만들어 줬다.

 

[파일]

Unlit - Transparent Colored Additive 1.shader
0.00MB
Unlit - Transparent Colored Additive 2.shader
0.00MB
Unlit - Transparent Colored Additive 3.shader
0.00MB
Unlit - Transparent Colored Additive (TextureClip).shader
0.00MB
Unlit - Transparent Colored Additive (Packed) (TextureClip).shader
0.00MB

 

[결론]

NGUI에 쉐이더 추가할 때는 패널을 감안해서 뒤에 숫자(1~3)달린 애들도 같은 이름으로 함께 만들어 주자.

 

 

 

 

[기타참조]

 

[Unlit - Additive Colored]

Unlit - Additive Colored.shader
다운로드

 

http://sourceforge.net/p/merkabaos/git/ci/dbd2a9bddaba5e4580f4a93dc279255accecf19c/tree/Assets/NGUI/Resources/Shaders/Unlit%20-%20Additive%20Colored.shader

 
 
[Unlit Transparent Vertex Colored Additive]

 

 

반응형
Posted by blueasa
, |