블로그 이미지
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-28 00:02

'Shadow'에 해당되는 글 3건

  1. 2024.01.25 [펌] NGUI-UILabel : Shadow+Outline
  2. 2014.03.29 유니티 3D에서 그림자 설정
  3. 2014.03.07 실시간 그림자

Unity 2021.3.33f1

NGUI 2023.08.01

----

 

NGUI-UILabel의 Effect에서 Shadow와 Outline을 같이 적용하고 싶어서 찾아보고 올려둠.

UILabel에 세 곳에 소스 추가

public class UILabel : UIWidget
{
    ....
    
    [DoNotObfuscateNGUI] public enum Effect
    {
        None,
        Shadow,
        Outline,
        Outline8,
        ShadowAndOutline,	// Add
    }   
    
    ....
    
    /// <summary>
    /// How many quads there are per printed character.
    /// </summary>

    public int quadsPerCharacter
    {
        get
        {
            if (mEffectStyle == Effect.Shadow) return 2;
            else if (mEffectStyle == Effect.Outline) return 5;
            else if (mEffectStyle == Effect.Outline8) return 9;
            else if (mEffectStyle == Effect.ShadowAndOutline) return 9;	// Add
            return 1;
        }
    }

	....
    
    public void Fill (List<Vector3> verts, List<Vector2> uvs, List<Color> cols, List<Vector3> symbolVerts, List<Vector2> symbolUVs, List<Color> symbolCols)
	{
        ...
        // Apply an effect if one was requested
		if (effectStyle != Effect.None)
		{
			int end = verts.Count;
			var symEnd = (symbolVerts != null) ? symbolVerts.Count : 0;

			pos.x = mEffectDistance.x;
			pos.y = mEffectDistance.y;

			ApplyShadow(verts, uvs, cols, offset, end, pos.x, -pos.y);
			if (symbolVerts != null) ApplyShadow(symbolVerts, symbolUVs, symbolCols, symOffset, symEnd, pos.x, -pos.y);

            #region Add ShadowAndOutline
            if (effectStyle == Effect.ShadowAndOutline)
            {
                pos.y /= 2;
                pos.x = pos.y;

                offset = end;
                end = verts.Count;

                ApplyShadow(verts, uvs, cols, offset, end, -pos.x, pos.y);

                offset = end;
                end = verts.Count;

                ApplyShadow(verts, uvs, cols, offset, end, pos.x, pos.y);

                offset = end;
                end = verts.Count;

                ApplyShadow(verts, uvs, cols, offset, end, -pos.x, -pos.y);

                offset = end;
                end = verts.Count;

                ApplyShadow(verts, uvs, cols, offset, end, -pos.x, 0);

                offset = end;
                end = verts.Count;

                ApplyShadow(verts, uvs, cols, offset, end, pos.x, 0);

                offset = end;
                end = verts.Count;

                ApplyShadow(verts, uvs, cols, offset, end, 0, pos.y);

                offset = end;
                end = verts.Count;

                ApplyShadow(verts, uvs, cols, offset, end, 0, -pos.y);
            }
			#endregion

            if ((effectStyle == Effect.Outline) || (effectStyle == Effect.Outline8))
			{        
        ...
    }
	
}

 

 

[출처] https://gamedev.stackexchange.com/questions/151329/all-sides-shadow-outline-in-unity-ngui

 

All sides shadow outline in Unity NGUI

How can I make such exactly the same shadow using NGUI?

gamedev.stackexchange.com

 

반응형
Posted by blueasa
, |

링크 : http://micropilot.tistory.com/2316

반응형

'Unity3D > Shadow' 카테고리의 다른 글

Projector Multiply Offset  (0) 2014.04.03
셰도우캐스터(ShadowCaster)를 활용한 그림자 생성 변경  (0) 2014.03.29
실시간 그림자  (0) 2014.03.07
Posted by blueasa
, |

실시간 그림자

Unity3D/Shadow / 2014. 3. 7. 01:00

배경이 평면이어야 된다는 제약이 있긴하지만 좋은 방법인 듯..


링크 : http://blog.naver.com/zeodtr/70186005934





반응형
Posted by blueasa
, |