ํ๋ก์ ํธ ์นด์ผ๋ ์ ๋ํฐ ์ฝ๋ฆฌ์์์ ์งํํ๋ URP๋ฅผ ํ์ฉํ ๋ชจ๋ฐ์ผ ์์ ํ๋ก์ ํธ ์
๋๋ค.
๊ณต๊ฐ๋ repository๋ ์ง์์ ์ผ๋ก ์
๋ฐ์ดํธ ๋๋ฉฐ, ์ฌ์ฉ์๊ฐ ํ๋ก์ ํธ์ ๊ธฐ์ฌํ๋ ๊ฒ๋ ๊ฐ๋ฅํฉ๋๋ค.
Mobile Platform์ ์ํ ์ถ๊ฐ์ ์ธ ์ต์ ํ๋ ๋ชจ๋ฐ์ผ ๊ฒ์ ์ฑ๋ฅ ์ต์ ํ 01 ๋ชจ๋ฐ์ผ ๊ฒ์ ์ฑ๋ฅ ์ต์ ํ 02 ๋ฌธ์๋ฅผ ์ฐธ๊ณ ํ์๊ธฐ ๋ฐ๋๋๋ค.
ํ๋ก์ ํธ์ ๋ํ ๋ณด๋ค ๋ง์ ์ ๋ณด๋ Unity Webinar์ UniteSeoul 2020 Session ์์์ ์ฐธ๊ณ ๋ฐ๋๋๋ค.
Project Kaya๋ Unity Technologies Korea์ URP ๋ชจ๋ฐ์ผ ํ๋ซํผ์ ์ฌ์ฉํ๋ Unity ์ฌ์ฉ์๋ฅผ ์ํ ์์ ํ๋ก์ ํธ์ ๋๋ค. ์ ๋ํฐ ํ๋ก์ ํธ ๋ด์์ ๋ณธ ํ๋ก์ ํธ์ ์์์ ์์ ์ /๋น ์์ ์ ์ผ๋ก ์ฌ์ฉํ๋ ๊ฒ์ ํ์ฉ๋์ง๋ง ์ฌ๋ฐฐํฌ๋ ํ์ฉ๋์ง ์์ต๋๋ค. ์ด ํ๋ก์ ํธ์ ์ ์๊ถ์ ์ ๋ํฐ์ฝ๋ฆฌ์์ ์์ต๋๋ค. ๋ผ์ด์ผ์ค์ ๊ด๋ จํ ์์ธํ ๋ด์ฉ์ ํ๋ก์ ํธ๋ด์ Asset End User License Agreement ๋ฌธ์๋ฅผ ์ฐธ๊ณ ํด์ฃผ์ธ์.
Project Kaya is an example project for unity users using URP mobile platform from Unity Technologies Korea. Commercial/non-commercial use of this project's resources is permitted in the unity project, but redistribution is not permitted. All right reserved by copyrights of this project belong to Unity Korea.For further details, please refer to the Asset End User License Agreement document in the project.
- UI anchor setting, UI Transform ์ ๋ฆฌ
- skill, action UI layout ๋ณ๊ฒฝ. ๊ธฐํ ์ธ๋ถ์ฌํญ ์ ๋ฆฌ
- Hierarchy ์ ๋ฆฌ
- Material example scene ๊ฐ์ ์ค(์์ ์์ )
- shader graph node ์์
- at least Unity 2021.3.2f1 LTS (Android module required) or above (2021.1.13f1 ์ด์ ๋ฒ์ ์ ์ฃผ์ ์ฒ๋ฆฌ๋ unpacknormal์ ํ์ฑํํด์ผ ํฉ๋๋ค.)
- URP 12.1
- Android Platform module Required
- Vulkan API supported(Visual Effect Graph๋ฅผ ์ฌ์ฉํ์ง ์๋๋ค๋ฉด ES 3.1์ด์)
- ์๋์ฐ ํฐ๋ฏธ๋, cmd, git bash ๋ฑ์์ ๋ช
๋ น์ด ์คํ
git clone https://github.com/UnityKorea/ProjectKaya
Kaya project๋ android ํ๋ซํผ์ ๊ธฐ์ค์ผ๋ก ์์
๋๊ณ ์์ต๋๋ค. ์ด๋ฅผ ์ํด์ editor๋ฅผ ์ด์ ๊ฐ์ ํ๊ฒฝ์ผ๋ก ์
ํ
ํด์ฃผ์ด์ผ ํฉ๋๋ค. ์ปค๋งจ๋๋ผ์ธ ์ธ์ ์ถ๊ฐ์ -force-vulkan
์ ์
๋ ฅํด vulkan api๋ก ๋์ํ๋๋ก ์ค์ ํฉ๋๋ค.
ํ๋ซํผ์ android๋ก ์ ํํฉ๋๋ค(์๋ํฐ ์ค์น์์ android ๋ชจ๋์ด ์ค์น๋์ด์ผ ํฉ๋๋ค
๋ชจ๋ฐ์ผ ํ๋ก์ ํธ์์ ์ฌ์ฉํ๋ MSAA ์ต์
์ ํ๋ก์ ํธ ์ํฉ์ ๋ฐ๋ผ ์ ์ ํ๊ฒ ์กฐ์ ํด์ฃผ๋๊ฒ์ด ์ข์ต๋๋ค. ์๋๋ MSAA ์ํ๋ง ์์ ๋ฐ๋ฅธ ๋ฉ์ ์ธ๊ณฝ์ ํ๋ฆฌํฐ ๋น๊ต์
๋๋ค. quality setting์ด Low, medium, high์ ๋ฐ๋ผ ์๋์ ๊ฐ์ด ๋ณ๊ฒฝ๋ฉ๋๋ค.
๋๋ถ๋ถ์ Texture compression์ ASTC ๋ฅผ ์ฌ์ฉํ๊ณ ์์ต๋๋ค.
์ผ๋ถ ๋ฆฌ์์ค์ ๊ฒฝ์ฐ ์์ถํ์ง ์์ RGB24 ํน์ RGBA32์
๋๋ค.
- 2048 normal texture๋ฅผ ASTC12x12(0.6MB)์ผ๋ก ์์ถํ๊ฒ(์ข)๊ณผ ASTC6x6(2.4MB)๋ก ์์ถํ ๊ฒฐ๊ณผ(์ฐ) ๋น๊ต
Albedo texture์ ๊ฒฝ์ฐ๋ณด๋ค normal texture์์ ์ด๋ฐ ์ฆ์์ด ๋๋๋ฌ์ง๋ฉฐ ์ด๋ด๊ฒฝ์ฐ๋ ๋ฆฌ์์ค ์์ถ ํฌ๋งท๊ณผ ์ต์
์ ์ง์ ์ ํํ๋ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค.
Lobby scene์ ๋ก๋น ๊ตฌํ์ ํ์ํ ์ฐ์ถ๊ณผ shader ์์ ๋ฅผ ์ ๊ณตํ๊ณ ์์ต๋๋ค.
Animation type์ Generic์ผ๋ก mechanim์ผ๋ก ๊ตฌ์ฑ๋์ด ์์ต๋๋ค.
- Frame Rate Counter : ํ๋ฉด ์ผ์ธก ์๋จ์๋ ํ์ฌ Frame Rate์ ๋ํ ์ ๋ณด๋ฅผ ๋ฐ๋ฆฌ์ธ์ปจ(millisecond, ms)๊ณผ ํ๋ ์์ผ๋ก ํ์๋๊ณ ์์ต๋๋ค.
- Display pixel Resoultion : Rendering ๋๊ณ ์๋ ํ์ฌ ํด์๋๋ฅผ ๋ณด์ฌ์ค๋๋ค.
- Graphics API : ํ์ฌ ๋ ๋๋ง ๋๊ณ ์๋ Graphics API ์ ๋ณด๋ฅผ ๋ณด์ฌ์ค๋๋ค.
Lobby Scene์์ ์นด๋ฉ๋ผ ์ ํ์ Cinemachine์ ํ์ฉํด์ ์ด๋ฃจ์ด์ง๊ณ ์์ต๋๋ค. ์นด๋ฉ๋ผ์ Priority๊ฐ์ UI์์ ๋ฐ๊ฟ์ค์ผ๋ก์จ ์นด๋ฉ๋ผ๊ฐ ์ ํ์ด ์ด๋ฃจ์ด์ง๊ฒ ๋ฉ๋๋ค.
Scene์ CinemachineVirtualCamera๋ฅผ ๋ฐฐ์นํ๋ฉด ์นด๋ฉ๋ผ๋ ํด๋น ๋ฒ์ถ์ผ ์นด๋ฉ๋ผ์ ํฌ์ง์
์ผ๋ก ์ด๋ํ๊ฒ ๋ฉ๋๋ค.
- 1๋ฒ ์นด๋ฉ๋ผ : ์ผ๊ตด ๊ทผ์ CM Face Shot. 1๋ฒ ์นด๋ฉ๋ผ์๋ง Depth of Field๊ฐ ์ ์ฉ๋์ด ์์ต๋๋ค.
- 2๋ฒ ์นด๋ฉ๋ผ : ์ ์ CM FullBody shot
- 3๋ฒ ์นด๋ฉ๋ผ : ์คํฌ CM Skill Shot
Render texture์ shader custom์ ํตํ ์ค์๊ฐ reflection์ ๊ตฌํํ ์์ ์
๋๋ค.
- Resoultion Mutiplier : ๋ ๋๋ง๋๋ ๋ฐ์ฌ์ด๋ฏธ์ง์ ํด์๋๋ฅผ ์ค์
- Clip Plane Offset : ๋ฐ์ฌ๋๋ ์ด๋ฏธ์ง์ ์์์ ์ ์ค์
- Reflect Layer : ๋ฐ์ฌ๋ฅผ ์ ์ฉํ ์ค๋ธ์ ํธ ๋ ์ด์ด๋ฅผ ์ ํ
- Draw Dithering : ์บ๋ฆญํฐ ๋๋๋ง์ ๋ฐ์ฌ์ ๊ทธ๋ฆด์ง ์ฌ๋ถ
kaya์ ์ฐ์ด๋ ๊ธฐ๋ณธ shader๋ URP Lit shader๋ฅผ ๊ธฐ๋ฐ์ผ๋ก shader graph์์ ์ ์ํ ์
ฐ์ด๋๊ฐ ์ฐ์ด๊ณ ์์ต๋๋ค.
ํ๋์ ์บ๋ฆญํฐ ๊ธ์, ์ฒ, ๊ฐ์ฃฝ๋ฑ ๋ค์ํ ์ฌ์ง์ ํํํ๊ธฐ ์ํด ์บ๋ฆญํฐ ์ปจ์
์์๋ถํฐ ์ด๋ฐ ์ ์ ๊ณ ๋ คํ์ฌ ์งํํ์์ต๋๋ค.
Shader Graph๋ฅผ ์ฌ์ฉํด์ Lit shader์ metallic๊ณผ smoothness, AO๋ฅผ ํ๋์ mask texture๋ก ์ฌ์ฉํ๊ฒ ๋์์ผ๋ฉฐ, smoothness ๊ฐ์ remap์ผ๋ก ์ฒ๋ฆฌํ๊ณ ์์ต๋๋ค.
์บ๋ฆญํฐ๊ฐ ์ค๋ธ์ ํธ์ ๊ฒน์ณ์ง๋์ ํ์๋ Renderer์ Render Features๋ฅผ ์ฌ์ฉํด ๊ตฌํํ์ต๋๋ค. ์์ธํ ๋ด์ฉ์ Universal Rendering Examples์์ ํ์ธํ ์ ์์ต๋๋ค.
Character Layer๋ง ๊ทธ๋ฆฌ์ง ์๊ณ Dither๋ฅผ Depth Testํ opaque๋ฅผ ๊ทธ๋ฆฐ๋ค(AfterRenderingOpaques) ๋๋จธ์ง๋ฅผ ๊ทธ๋ฆฌ๊ฒ ์ค์ ๋์ด ์์ต๋๋ค.
ํค์ด์
ฐ์ด๋์์ ๋ง์ด ์ฌ์ฉ๋๋ UV๋ฅผ ์ธ๋ก๋ก ํด์ง ์ฌ์ฉํ๋ ๋ฐฉ์์ด ์๋ flowmap์ ์ฌ์ฉํด ๋ผ์ดํ
์ ๊ตฌํํ ์์ ์
๋๋ค. flowmap์ผ๋ก ํค์ด์ ๋ฐฉํฅ์ ๊ธฐ๋กํ๊ณ shiftmap์ผ๋ก ํ์ด๋ผ์ดํธ์ ์์น๋ฅผ ์กฐ์ ํ ์ ์์ต๋๋ค.
flowmap์ ํ๋๋์์ LabsFlowmap ๋
ธ๋๋ฅผ ์ฌ์ฉํด์ ๋จธ๋ฆฌ์นด๋ฝ์ ๋ฐฉํฅ๋๋ก vector์ ์ ํ๊ณ ๊ทธ๊ฑธ ๋ ๋๋งํด์ ์ฌ์ฉํ์ต๋๋ค.
์ฌ์ฉ์์ ํ
์ค์ณ์ sRGB์ต์
(Gamma correction)์ ๋๊ณ ์ฌ์ฉํด์ผ ํฉ๋๋ค.
์ด ์
ฐ์ด๋๋ addlight, addlightshadow ๊น์ง ๋ชจ๋ ์ง์ํฉ๋๋ค.
์๋ฐฉ์๊ณผ ๋ค๋ฅด๊ฒ Shader Graph๋ก ์์ฑ๋์ด์์ผ๋ฉฐ, ๋๊ฐ์ ํ์ด๋ผ์ดํธ๋ฅผ ์กฐ์ ํด ํค์ด์ ํ์ด๋ผ์ดํธ๋ฅผ ํํํ๋ ๋ฐฉ์์
๋๋ค.
SSS(SubSurface Scattering)์ ๊ตฌํ์ Shader Graph๋ฅผ ์ฌ์ฉํด ๊ตฌํ๋์์ต๋๋ค. Skin Texture์ Alpha Channel์ด Thickness map์ผ๋ก ์ฌ์ฉ๋ฉ๋๋ค.
Animation Setting์ Generic์ ์ฌ์ฉํ๊ณ ์์ต๋๋ค. ์ ๋ํฐ์ Humanoid๋ ์ ๋๋ฉ์ด์
๋ฆฌํ๊ฒํ
์ ๋ชฉ์ ์ผ๋ก ํ์ง ์๋ ๊ฒฝ์ฐ๋ฅผ ์ ์ธํ๊ณ ๋ ๊ถ์ฅํ์ง ์์ต๋๋ค. ์ ๋๋ฆญ๊ณผ ํด๋จธ๋
ธ์ด๋์ ์ต์ ํ ๊ด๋ จ ๋ฌธ์๋ unity forum์ ๋ฌธ์๋ฅผ ์ฐธ์กฐํ์ธ์.์บ๋ฆญํฐ์ Rig setting์ Model์ optimize Game Objects๋ฅผ ํด๋ฆญํด ์ฑ๋ฅ์ ๋์ด๋ฉฐ, ์ฌ์ฉํ๋ ๋ฌด๊ธฐ ์ฌ๋กฏ๋ง ํ์ด๋ผํค์ ๋
ธ์ถํ๊ฒ ๋ฉ๋๋ค(Extra Transforms to Expose)
๋ณธ์ ๊ฐฏ์๋ 88๊ฐ ์
๋๋ค.
๋ฐฐ๊ฒฝ์ ์ฐ์ธ VFX Graph๋ ๋ฎ์๋ ๋ฒ๊ฝ, ๋ฐค์๋ ๋ถ์จ๊ฐ ํฉ๋ ๋ฆฌ๋ฉฐ ์ถ๊ฐ๋ก ๋ฐค์ ๋ถ๊ธธ์ VFX Graph๋ก ๊ตฌํํ์ต๋๋ค.
์บ๋ฆญํฐ 1๋ฒ๊ณผ 2๋ฒ ์ฌ๋กฏ์ ์คํฌ์๋ ์บ๋ฆญํฐ ์ดํํธ๊ฐ ๋ถ์ด์์ต๋๋ค. ์ด ์ดํํธ๋ shuriken์ด ์๋ Visual effect graph๋ก ์ ์๋์ด ์์ต๋๋ค.
์ค์ ๋ชจ๋ฐ์ผ ๋น๋์ OpenGL ES 3.2 ํ๊ฒฝ์์๋ ์ ๋๋ก ์ถ๋ ฅ๋์ง ์๋ ๋ถ๋ถ๋ค์ด ์์ต๋๋ค.(vulkan ๊ถ์ฅ)
์ ์ฒด์ ์ผ๋ก ์ต์ปค ์ ์ฉํ์ฌ ์ปดํฌ๋ํธ ๋ฐฐ์น๋ฅผ ๊ฐ์ ํ๊ณ ํ ๋ง๋ฅผ ์ผ์นํ๋ ์ ๋ฐ์ดํธ๊ฐ ์งํ๋์์ต๋๋ค.