Skip to content

강의자료 수정 #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Day5/5-2.프리팹개념과활용.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

- 프리팹을 씬으로 다시 끌어오면 **인스턴스(Instance)** 생성됨
- 여러 개의 인스턴스를 만들어도 원본 프리팹과 연결 유지됨
- 코드로 인스턴스화하기 1
- 코드로 인스턴스화하기 1(런타임 프리팹 인스턴스화)
```csharp
using UnityEngine;
public class InstantiationExample : MonoBehaviour
Expand All @@ -47,8 +47,6 @@ public class InstantiationExample : MonoBehaviour
}
}
```
- 코드로 인스턴스화하기 2: List 사용(설명 필요)<br>
🔩 List_Prefab 씬


### ③ 수정하기
Expand Down
7 changes: 7 additions & 0 deletions Day5/5-4.Light구성이해(Point,Spot).md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ Unity에는 여러 조명 타입이 있으며, 대표적으로 아래 세 가지
2. 다양한 오브젝트에 그림자 옵션 추가 (Mesh Renderer > Cast/Receive Shadows)
3. Light > Realtime / Baked / Mixed 설정 실험

### 🎮 baked light 설정법
1. light의 모드를 baked로 변경
2. 빛을 받을 오브젝트를 contibute illumination로 설정
3. light 창의 generate light 클릭

오브젝트나 빛을 움직이면 다시 generate 해야 함

### 🌃 장면 구성 예시

- 어두운 방 안 → 천장에 Point Light
Expand Down
21 changes: 14 additions & 7 deletions Day5/5-5.Material제작실습(PBR기반).md
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,32 @@
---

## 3. 🧪 텍스처 적용 실습
**🔩 PBR 씬. 텍스쳐 없이, 텍스쳐 있이**
**🔩 LightTest씬. PBR 씬. 텍스쳐 없이, 텍스쳐 있이**

1. [cc0textures.com](https://ambientcg.com/) 또는 [polyhaven.com](https://polyhaven.com/)에서 PBR 텍스처 세트 다운로드
2. Unity로 임포트 후, 각각 슬롯에 드래그하여 적용:
- Albedo → Base Map
- Normal → Normal Map (압축 해제 후 Fix 버튼 클릭)
- Metallic / Roughness → Mask Map 또는 별도 연결
- Normal → Normal Map (Texture Type을 Normal map으로 변경)
- dx용 normal map일 경우, opengl용으로 값을 뒤집어주는 과정이 필요
- dx용 normal map은 움푹 들어간 느낌임.
- [ ![텍스트](https://europe1.discourse-cdn.com/unity/optimized/4X/b/8/3/b83fc6ae3eb5a4022e82c545a268be5d4689bf71_2_1035x517.jpeg) ]( https://europe1.discourse-cdn.com/unity/optimized/4X/b/8/3/b83fc6ae3eb5a4022e82c545a268be5d4689bf71_2_1035x517.jpeg )
- Height -> Height Map, Ao -> OCClusion Map
- Metallic / Roughness → Unity는 Metalic과, Roughness를 뒤집은 Smoothness가 합쳐져있는걸 쓰기 때문에, 먼저 합쳐주는 과정 필요
3. Metallic/Smoothness 값 조절하며 결과 확인

💡 Normal map을 뒤집고, metallc과 roughness를 합치는 데 유용한 프로그램
- https://github.com/Fidifis/TextureMerge/releases
- zip 압축 풀어서 사용

💡 Texture 임포트 시 `sRGB` 체크 해제 필요 (Metallic 등)

---

## 4. 🧱 씬에 적용

- 3D 오브젝트(Plane, Cube, Wall 등)에 머티리얼 드래그
- 조명 변경 후 반사/음영 변화 확인
- 카메라 위치 및 포스트 프로세싱으로 최종 효과 연출
- 카메라 위치로 최종 효과 연출

---

Expand All @@ -81,9 +91,6 @@
---

## 💡 팁

- Texture 임포트 시 `sRGB` 체크 해제 필요 (Metallic 등)
- Roughness → Smoothness 변환 필요할 수 있음 (Photoshop 또는 Unity MaskMap 사용)
- URP 사용 시 Shader Graph로 커스텀 셰이더도 가능

---
Expand Down
1 change: 0 additions & 1 deletion Day5/5-7.실습_3DPlayground씬구성.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
- 반복적으로 사용할 오브젝트들을 **Prefab**으로 저장
- 예시:
- `Obstacle01` (큐브 + 머티리얼)
- `PickUpItem` (회전하는 구체)

👉 `Assets/Prefabs/` 폴더에 정리

Expand Down
1 change: 1 addition & 0 deletions Day5/5-8.FPSController조작실습.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ public class FPSController : MonoBehaviour

- 3D 플레이그라운드 유니티 화면(씬뷰+게임뷰+pbr material 하나 인스펙터) 스크린샷 1장만
- velog 글 링크 하나
- 플레이 데모 영상 하나

## 💡 팁

Expand Down
12 changes: 8 additions & 4 deletions Day6/6-1.RigidbodyvsCharacterController.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
---

## 🧠 학습 목표

dd
- Rigidbody와 Character Controller의 차이를 명확히 이해한다.
- 각각의 장단점과 사용 시나리오를 비교한다.
- 실제 프로젝트에서 어떤 컨트롤러를 사용할지 판단할 수 있다.

---

🔩예시 씬: rigidbody, characterController 값들, 함수설명
🔩예시 씬: rigidbody, characterController 값들, 함수설명. playerController.cs로

## 1. Rigidbody란?

Expand All @@ -23,7 +23,12 @@
### ✅ 특징
- 실제 물리 법칙을 시뮬레이션함
- 외부 힘(Force, Torque) 적용 가능
- 이동/회전은 `AddForce()` 등으로 수행(함수설명)
- 이동/회전은 `AddForce()`, `MovePosition()`, `velocity` 등으로 수행(함수설명)

### 예시코드
```chsarp
rb.MovePosition(rb.position + move * moveSpeed * Time.deltaTime);
```

---

Expand Down Expand Up @@ -75,7 +80,6 @@
## 5. 사용 팁

- 두 컴포넌트를 동시에 사용하면 충돌 문제가 발생하므로 **둘 중 하나만 사용**!
- Rigidbody를 사용할 경우 **이동은 Force로**, Character Controller는 **Move() 함수 사용**
- 캐릭터의 발 아래에 `Ground Check` 로직 추가 시 안정성 향상

---
Expand Down
30 changes: 28 additions & 2 deletions Day6/6-2.Trigger&Collider활용.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,33 @@
- `Is Trigger` 체크 해제 시, **충돌 처리** 전용

```csharp
void OnCollisionEnter(Collision collision) {
// 충돌 시 한번만: 충돌체 둘 중 하나에 rigidbody 있어야 함
void OnCollisionEnter(Collision collision)
{
Debug.Log("충돌 발생: " + collision.gameObject.name);
}

// 충돌 할 때마다: 충돌체 둘 중 하나에 rigidbody 있어야 함
private void OnCollisionStay(Collision collision)
{

}

// 충돌 할 때마다: 충돌체 둘 중 하나에 CharacterController 있어야 함
void OnControllerColliderHit(ControllerColliderHit hit)
{
Debug.Log("충돌 발생: " + hit.gameObject.name);
}

void OnCollisionStay(Collision collision)
{
if(collision.gameObject.tag == "Player")
{
Debug.Log("충돌");
rb.AddForce(force * collision.transform.forward);
}
}

```

---
Expand All @@ -33,7 +57,9 @@ void OnCollisionEnter(Collision collision) {
- 물리적 충돌 없이 겹쳐지는 순간을 감지

```csharp
void OnTriggerEnter(Collider other) {
// 트리거에 들어왔을 때
void OnTriggerEnter(Collider other)
{
Debug.Log("트리거 진입: " + other.name);
}
```
Expand Down
4 changes: 3 additions & 1 deletion Day6/6-3.Cinemachine카메라시스템.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- 다양한 Virtual Camera와 Blend 설정으로 장면 전환 효과를 연출한다.

---
🔩예시 씬
🔩예시 씬. CM_Scene

## 1. Cinemachine이란?

Expand Down Expand Up @@ -49,6 +49,8 @@

## 4. 실습 예시: 플레이어 추적 카메라

5일차에 만든 fps controller 활용

1. Main Camera에 Cinemachine Brain 추가
2. Hierarchy > Cinemachine > Create Virtual Camera
3. Virtual Camera 선택 후:
Expand Down
Loading