Skip to content

Commit f87f0e5

Browse files
author
태재영
committed
ko: ramp textures
1 parent 97f40de commit f87f0e5

15 files changed

+525
-32
lines changed

webgl/lessons/ko/webgl-2-textures.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ precision mediump float;
8282
uniform sampler2D u_image0;
8383
uniform sampler2D u_image1;
8484
85-
// 정점 셰이더에서 전달된 texCoords
85+
// 정점 셰이더에서 전달된 텍스처 좌표
8686
varying vec2 v_texCoord;
8787
8888
void main() {
@@ -153,12 +153,12 @@ WebGL에는 "텍스처 유닛"이 있습니다.
153153

154154
몇 가지 살펴봐야 할 것이 있습니다.
155155

156-
텍스처 유닛을 생각하는 간단한 방법: 모든 텍스처 함수는 "active texture unit"에서 작동한다.
157-
"active texture unit"은 작업하려는 텍스처 유닛의 전역 변수입니다.
158-
각 텍스처 유닛은 2가지 target을 가지는데요.
159-
TEXTURE_2D target과 TEXTURE_CUBE_MAP target입니다.
160-
모든 텍스처 함수는 current active texture unit에서 지정된 target과 함께 작동합니다.
161-
JavaScript로 WebGL을 구현한다면 다음과 같을 겁니다.
156+
텍스처 유닛을 생각하는 간단한 방법: 모든 텍스처 함수는 "활성 텍스처 유닛"에서 작동한다.
157+
"활성 텍스처 유닛"은 작업하려는 텍스처 유닛의 전역 변수입니다.
158+
각 텍스처 유닛은 2가지 대상을 가지는데요.
159+
TEXTURE_2D 대상과 TEXTURE_CUBE_MAP 대상입니다.
160+
모든 텍스처 함수는 현재 활성 텍스처 유닛에서 지정된 대상과 함께 작동합니다.
161+
자바스크립트로 WebGL을 구현한다면 다음과 같을 겁니다.
162162

163163
```
164164
var getContext = function() {
@@ -173,19 +173,19 @@ var getContext = function() {
173173
var activeTextureUnit = 0;
174174
175175
var activeTexture = function(unit) {
176-
// unit enum을 index로 변환
176+
// unit enum을 인덱스로 변환
177177
var index = unit - gl.TEXTURE0;
178-
// active texture unit 설정
178+
// 활성 텍스처 유닛 설정
179179
activeTextureUnit = index;
180180
};
181181
182182
var bindTexture = function(target, texture) {
183-
// active texture unit의 target에 대한 텍스처 설정
183+
// 활성 텍스처 유닛의 대상에 대한 텍스처 설정
184184
textureUnits[activeTextureUnit][target] = texture;
185185
};
186186
187187
var texImage2D = function(target, ... args ...) {
188-
// active texture unit의 current texture에서 texImage2D 호출
188+
// 활성 텍스처 유닛의 현재 텍스처에서 texImage2D 호출
189189
var texture = textureUnits[activeTextureUnit][target];
190190
texture.image2D(...args...);
191191
};

webgl/lessons/ko/webgl-3d-lighting-directional.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ function setNormals(gl) {
276276
```
277277
precision mediump float;
278278
279-
// 정점 셰이더에서 전달
279+
// 정점 셰이더에서 전달됩니다.
280280
-varying vec4 v_color;
281281
+varying vec3 v_normal;
282282

webgl/lessons/ko/webgl-3d-lighting-point.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ surface -> light 벡터는 단위 벡터가 아니기 때문에 프래그먼트
6969

7070
precision mediump float;
7171

72-
// 정점 셰이더에서 전달
72+
// 정점 셰이더에서 전달됩니다.
7373
varying vec3 v_normal;
7474
+varying vec3 v_surfaceToLight;
7575

@@ -190,7 +190,7 @@ surface -> light 벡터는 단위 벡터가 아니기 때문에 프래그먼트
190190
다음으로 프래그먼트 셰이더에서 surface -> view 벡터와 surface -> light 벡터 사이의 `halfVector`를 계산해야 합니다.
191191
그런 다음 `halfVector`와 법선의 스칼라곱을 구하여, 빛이 뷰로 반사되는지 확인할 수 있습니다.
192192

193-
// 정점 셰이더에서 전달
193+
// 정점 셰이더에서 전달됩니다.
194194
varying vec3 v_normal;
195195
varying vec3 v_surfaceToLight;
196196
+varying vec3 v_surfaceToView;

webgl/lessons/ko/webgl-3d-lighting-spot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Limit로 *dot limit*를 계산하고, limit의 cosine을 구합니다.
5858
```
5959
precision mediump float;
6060
61-
// 정점 셰이더에서 전달
61+
// 정점 셰이더에서 전달됩니다.
6262
varying vec3 v_normal;
6363
varying vec3 v_surfaceToLight;
6464
varying vec3 v_surfaceToView;

webgl/lessons/ko/webgl-3d-orthographic.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ void main() {
417417
<script id="fragment-shader-3d" type="x-shader/x-fragment">
418418
precision mediump float;
419419
420-
+// 정점 셰이더에서 전달
420+
+// 정점 셰이더에서 전달됩니다.
421421
+varying vec4 v_color;
422422
423423
void main() {

webgl/lessons/ko/webgl-3d-textures.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ WebGL에서 어떻게 텍스처를 적용할까요?
3434

3535
precision mediump float;
3636

37-
// 정점 셰이더에서 전달
37+
// 정점 셰이더에서 전달됩니다.
3838
*varying vec2 v_texcoord;
3939

4040
*// 텍스처

webgl/lessons/ko/webgl-cube-maps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void main() {
117117
```glsl
118118
precision mediump float;
119119
120-
// 정점 셰이더에서 전달
120+
// 정점 셰이더에서 전달됩니다.
121121
varying vec3 v_normal;
122122
123123
// 텍스처

webgl/lessons/ko/webgl-drawing-multiple-things.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ WebGL은 두 번째 방법으로 동작하는데요.
7878
여기 해당 코드입니다.
7979
정점 색상을 곱하기 위해 `u_colorMult`를 추가한 걸 제외하고는 [perspective 예제](webgl-3d-perspective.html)와 같은 간단한 셰이더입니다.
8080

81-
// 정점 셰이더에서 전달
81+
// 정점 셰이더에서 전달됩니다.
8282
varying vec4 v_color;
8383

8484
uniform vec4 u_colorMult;

webgl/lessons/ko/webgl-environment-maps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ void main() {
203203
```glsl
204204
precision highp float;
205205
206-
// 정점 셰이더에서 전달
206+
// 정점 셰이더에서 전달됩니다.
207207
varying vec3 v_worldPosition;
208208
varying vec3 v_worldNormal;
209209

webgl/lessons/ko/webgl-fog.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ gl_FragColor = originalColor + (fogColor - originalColor) * fogAmount;
3434
```glsl
3535
precision mediump float;
3636
37-
// 정점 셰이더에서 전달
37+
// 정점 셰이더에서 전달됩니다.
3838
varying vec2 v_texcoord;
3939
4040
// 텍스처
@@ -136,7 +136,7 @@ void main() {
136136
```glsl
137137
precision mediump float;
138138
139-
// 정점 셰이더에서 전달
139+
// 정점 셰이더에서 전달됩니다.
140140
varying vec2 v_texcoord;
141141
varying float v_fogDepth;
142142
@@ -317,7 +317,7 @@ void main() {
317317
```
318318
precision mediump float;
319319

320-
// 정점 셰이더에서 전달
320+
// 정점 셰이더에서 전달됩니다.
321321
varying vec2 v_texcoord;
322322
-varying float v_fogDepth;
323323
+varying vec3 v_position;
@@ -361,7 +361,7 @@ fogAmount = clamp(fogAmount, 0., 1.);
361361
```
362362
precision mediump float;
363363

364-
// 정점 셰이더에서 전달
364+
// 정점 셰이더에서 전달됩니다.
365365
varying vec2 v_texcoord;
366366
varying vec3 v_position;
367367

0 commit comments

Comments
 (0)