Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
During summer vacation, Gitlab will be restart frequently. Use it carefully.
Show more breadcrumbs
Seonghak Lee
CG Tutorial
Commits
0c374a9d
Commit
0c374a9d
authored
Jun 26, 2022
by
Seonghak Lee
Browse files
Options
Downloads
Patches
Plain Diff
Update index.html
parent
25b20fb7
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
index.html
+12
-21
12 additions, 21 deletions
index.html
with
12 additions
and
21 deletions
index.html
+
12
−
21
View file @
0c374a9d
...
...
@@ -9,7 +9,7 @@
<div
class=
"bodyobj"
>
<header>
<br>
<h2>
Three.js 를 활용한 Custom Color Blending
제작
</h2>
<h2>
Three.js 를 활용한 Custom Color Blending
</h2>
<br>
<h3>
201820721 이성학(Seonghak Lee)
</h3>
</header>
...
...
@@ -23,13 +23,12 @@
<h2>
- Blending Equation
</h2>
<p>
기본적인 Blending Equation은 다음과 같습니다
</p>
<br>
<p>
AddEquation : Blend(Source, Destination) = (Source * 상수
1
) + (Destination * 상수
2
)
</p>
<p>
SubtractEquation : Blend(Source, Destination) = (Source * 상수
1
) - (Destination * 상수
2
)
</p>
<p>
ReverseSubtractEquation : Blend(Source, Destination) = (Destination * 상수
2
) - (Source * 상수
1
)
</p>
<p>
MinEquation : Blend(Source, Destination) = Min((Source * 상수
1
), (Destination * 상수
2
))
</p>
<p>
MaxEquation : Blend(Source, Destination) = Max((Source * 상수
1
), (Destination * 상수
2
))
</p>
<p>
AddEquation : Blend(Source, Destination) = (Source *
Source
상수) + (Destination *
Destination
상수)
</p>
<p>
SubtractEquation : Blend(Source, Destination) = (Source *
Source
상수) - (Destination *
Destination
상수)
</p>
<p>
ReverseSubtractEquation : Blend(Source, Destination) = (Destination *
Destination
상수) - (Source *
Source
상수)
</p>
<p>
MinEquation : Blend(Source, Destination) = Min((Source *
Source
상수), (Destination *
Destination
상수))
</p>
<p>
MaxEquation : Blend(Source, Destination) = Max((Source *
Source
상수), (Destination *
Destination
상수))
</p>
<br>
<p>
source와 destination에 각각 특정한 상수를 곱하고, 그 값들을 Equation 규칙에 따라 연산해줍니다.
</p>
<p>
곱할수 있는 상수들은 다음과 같습니다.
</p>
<br>
<p>
Zero : 0
</p>
...
...
@@ -45,36 +44,28 @@
<br>
<h2>
- Blending Example
</h2>
<p>
자주 쓰이는 몇가지 Color Blending들을 소개해보겠습니다
</p>
<br>
<h3>
Normal
</h3>
<p>
Blend(Source, Destination) = (Source *
Srcalpha
) + (
Destination
*
OneMinusSrcAlpha
)
</p>
<p>
Source상수 :
Srcalpha
,
Destination
상수 :
OneMinusSrcAlpha
, AddEquation
</p>
<p>
three.js에서 material을 만들면 기본적으로 적용되어있는 Blending입니다.
</p>
<P>
그릴 대상에 Alpha값을 곱해주고, 배경에는 1-(Source의 Alpha값)을 곱해줍니다.
</P>
<p>
그 다음, 그 두 색상을 더합니다.
</p>
<img
src=
"1.png"
></br>
<p>
위 그림과 같이 Alpha값이 0.5인 빨강 원과 파랑원을 겹치게 되면
</p>
<p>
Alpha0.75의 보라색 원이 그려지게 됩니다.
</p>
<br><br>
<h3>
Add
</h3>
<p>
Blend(Source, Destination) = (Source * One) + (Destination * One)
</p>
<p>
Add blending은 그림에서 빛 표현을 할 때 자주 쓰이는 방식입니다.
</p>
<p>
단순히 Source와 Destination의 색을 더하는 방법으로, 가산 혼합과 같은 결과가 나오게 됩니다.
</p>
<p>
Source상수 : One, Destination상수 : One, AddEquation
</p>
<p>
Add blending은 그림에서 가산 혼합을 할때와 같은 결과가 나오게 됩니다.
</p>
<img
src=
"2.png"
>
<br>
<br>
<br>
<h2>
-
Blending 에서
Transparent의 역할
</h2>
<h2>
- Transparent의 역할
</h2>
<p>
Transparent가 false이고, 먼저 생성된 Material가 다른 것보다 더 앞에 놓여져 있을때,
</p>
<p>
뒷쪽의 배경에 대한 연산을 아예 수행하지 않기 때문에, Blending이 제대로 되지 않을 수 있습니다.
</p>
<p>
따라서 원활한 Blending을 위해 opacity를 변경하지 않더라도 Transparent는 true로 설정해야 합니다.
</p>
<img
src=
"3.png"
>
<br>
<br>
<br>
<h
2
>
- Custom Color Blending Example
</h
2
>
<h
1
>
- Custom Color Blending Example
</h
1
>
<p>
three.js를 활용해서 Color Blending의 예제를 구현하였습니다.
</p>
<p>
우측의 메뉴로 Sphere의 Material, Blend Equation, Source, Destination, Color등
</p>
<p>
여러가지 값을 변경해보면서 Blending의 이해를 도울 수 있습니다.
</p>
...
...
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