Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CG Tutorial
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Suhyeon Han
CG Tutorial
Commits
8179b516
Commit
8179b516
authored
3 years ago
by
Suhyeon Han
Browse files
Options
Downloads
Patches
Plain Diff
Modified readme.md
parent
5dde55ad
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
readme.md
+2
-6
2 additions, 6 deletions
readme.md
with
2 additions
and
6 deletions
readme.md
+
2
−
6
View file @
8179b516
...
...
@@ -25,7 +25,7 @@
## 1장: 주제 및 목표
### 1.1 주제
제가 선정한 주제는
**라이트 셰프트(Light Shaft) 효과**
로,
간단한 레이 트레이싱 기법을 활용한
빛 줄기의 구현입니다.
제가 선정한 주제는
**라이트 셰프트(Light Shaft) 효과**
로,
오브젝트 사이로 스며들어오는
빛 줄기의 구현입니다.
기존 Three.js 예제에서 수정한 결과물은 아니지만 비슷한 예제로
**Godrays**
가 있습니다.
다만
**Godrays**
예제의 경우 셰이더 패스가 많고 과정이 복잡해서 필요없는 부분(
*FakeSun 패스*
,
*Combine 패스*
)을 빼고, 셰이더 코드도 더 쉽게 새로 만들었습니다.
세부적인 원리에 관한 설명은 2장부터 시작하는 실습에서부터 천천히 설명하도록 하겠습니다.
...
...
@@ -37,8 +37,7 @@
**4.**
EffectComposer와 ShaderPass 사용법 이해하기
**5.**
GLSL 프로그래밍 과정 및 문법 이해하기
**6.**
깊이 텍스처로부터 가중치 추출하기
**7.**
레이 트레이싱으로 라이트 셰프트 만들기
**8.**
결과물을 바라보며 자아도취에 빠지기
**7.**
라이트 셰프트 셰이더 만들기
## 2장: 기본 장면 렌더링

...
...
@@ -1044,8 +1043,6 @@ const controls = {
`stepCount`
는 방금 말했던 픽셀로부터 태양까지의 나눠진 수를 의미합니다.
그리고 그 스텝마다 가중치를 뽑아서 조금씩 늘어나는 감쇄량을 적용한 뒤 누적합니다.
슬슬 이해가 되시나요?
참고로 이건
**레이 트레이싱**
이라고 불리는 기법입니다.
물론 정확한 레이 트레이싱은 아니고요. 그냥 아주 간단한 흉내라고 보시면 됩니다.
그럼 이제 셰이더를 작성해봅시다!
...
...
@@ -1214,7 +1211,6 @@ float deltaLength = min(0.005, lengthToLight * 1.0 / float(stepCount - 1)); //
그 다음으로는
`min()`
함수가 보이네요.
왜 굳이
`0.005`
보다 크면
`0.005`
로 고정시켜주는 걸까요?
왜냐하면 추출 간격이 너무 넓어지면(
`stepCount`
값이 너무 작아지면)
**빛 줄기의 강도가 퍼지기 때문**
입니다.
원래 레이 트레이싱의 샘플 값이 낮으면 품질이 좋지 않죠. 같은 이유입니다.
그래서 최소한의 간격으로
`0.005`
를 지정해주었습니다.
이렇게 하면 태양까지 닿지 않을 수도 있지만, 빛 줄기가 퍼져서 이상한 모습을 보는 일은 없습니다.
추가로
`float(stepCount - 1)`
없이 그냥
`0.005`
로 고정시켜버리면 어떻게 될까요?
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment