3D Graphics 101

Leonardo YongUk Kim
Leonardo YongUk KimAndroid Developer
3D Graphics 101
dalinaum@gmail.com
Who am I?
3D Graphics 101
3D Graphics 101
22 years ago
3D Graphics 101
3D Graphics 101
13 years later
3D Graphics 101
3D Graphics 101
3D Graphics 101
Polygon. 폐곡선 도형.

a polygon /ˈpɒlɪɡɒn/ is a plane figure that is bounded
by a finite chain of straight line segments closing in a
loop to form a closed chain or circuit.
Triangles…
Quadrangles? Old style
TriangleFan
TriangleStrip
Winding Order:시계방향 등의 그려질 방향.
Curling:방향이 안 맞는 경우는 그리지 않음.
3D Graphics 101
Goroud shading
3D Graphics 101
Phong shading
• Ambient: 주변의 물체들로 부터 받는 색상 값. 빛을
직접 하지 않고 추정을 담음.
• Diffuse: 물체 고유의 색
• Specular: 하이라이트 색
Transform and Lightning
• GPU Transform and Lightning of vertices (1999)
• Forced the use of Gouraud / Phong lightning.
3D Graphics 101
Shader
• 필요한 기능을 하드웨어에 내장하지 않고 소프트웨어 적으
로 구현.
• GLSL등의 언어를 사용함.
• 기본형은 버텍스 쉐이더와 프래그먼트(픽셀) 쉐이더.
Shader
• Vertex shader: 꼭지점 정보를 받아 그것을 가공하는 쉐이
더.
• Fragment(pixel) shader: 각 픽셀을 가공하는 쉐이더.
uniform mat4 u_mvpMatrix;
attribute vec4 a_position;
attribute vec4 a_color;
varying vec4 v_color;
void main()
{
gl_Position = u_mvpMatrix * a_position;
v_color = a_color;
}
Simple vertex shader
varying vec4 v_color;
void main()
{
gl_FragColor = v_color;
}
Simple fragment shader
varying vec4 vColor;
varying vec2 vTexCoord;
//declare uniforms
uniform sampler2D u_texture;
uniform float resolution;
uniform float radius;
uniform vec2 dir;
void main() {
vec4 sum = vec4(0.0);
vec2 tc = vTexCoord;
float blur = radius/resolution;
float hstep = dir.x;
float vstep = dir.y;
sum += texture2D(u_texture, vec2(tc.x - 4.0*blur*hstep, tc.y
sum += texture2D(u_texture, vec2(tc.x - 4.0*blur*hstep, tc.y
- 4.0*blur*vstep)) * 0.0162162162;
sum += texture2D(u_texture, vec2(tc.x - 3.0*blur*hstep, tc.y
- 3.0*blur*vstep)) * 0.0540540541;
sum += texture2D(u_texture, vec2(tc.x - 2.0*blur*hstep, tc.y
- 2.0*blur*vstep)) * 0.1216216216;
sum += texture2D(u_texture, vec2(tc.x - 1.0*blur*hstep, tc.y
- 1.0*blur*vstep)) * 0.1945945946;
sum += texture2D(u_texture, vec2(tc.x, tc.y)) *
0.2270270270;
sum += texture2D(u_texture, vec2(tc.x + 1.0*blur*hstep, tc.y
+ 1.0*blur*vstep)) * 0.1945945946;
sum += texture2D(u_texture, vec2(tc.x + 2.0*blur*hstep, tc.y
+ 2.0*blur*vstep)) * 0.1216216216;
sum += texture2D(u_texture, vec2(tc.x + 3.0*blur*hstep, tc.y
+ 3.0*blur*vstep)) * 0.0540540541;
- 2.0*blur*vstep)) * 0.1216216216;
sum += texture2D(u_texture, vec2(tc.x - 1.0*blur*hstep, tc.y
- 1.0*blur*vstep)) * 0.1945945946;
sum += texture2D(u_texture, vec2(tc.x, tc.y)) *
0.2270270270;
sum += texture2D(u_texture, vec2(tc.x + 1.0*blur*hstep, tc.y
+ 1.0*blur*vstep)) * 0.1945945946;
sum += texture2D(u_texture, vec2(tc.x + 2.0*blur*hstep, tc.y
+ 2.0*blur*vstep)) * 0.1216216216;
sum += texture2D(u_texture, vec2(tc.x + 3.0*blur*hstep, tc.y
+ 3.0*blur*vstep)) * 0.0540540541;
sum += texture2D(u_texture, vec2(tc.x + 4.0*blur*hstep, tc.y
+ 4.0*blur*vstep)) * 0.0162162162;
gl_FragColor = vColor * vec4(sum.rgb, 1.0);
}
• 음악의 필터에 프래그먼트 쉐이더를 사용하기도 합니다.
• 사진의 필터에 프래그먼트 쉐이더를 사용하기도 합니다.
• 정확하지 않은 대량의 연산에 프래그먼트 쉐이더를 사용하
기도 합니다.
Q & A
1 de 33

Recomendados

Html5 canvas study week1n2 por
Html5 canvas study week1n2Html5 canvas study week1n2
Html5 canvas study week1n2Juneyoung Oh
470 visualizações19 slides
Lay Picking por
Lay PickingLay Picking
Lay PickingChoKuangmin
127 visualizações21 slides
[week16] D3.js_Transition por
[week16] D3.js_Transition[week16] D3.js_Transition
[week16] D3.js_Transitionneuroassociates
850 visualizações11 slides
Picking por
PickingPicking
PickingQooJuice
447 visualizações37 slides
꿈데디 D3.js강의 6주차 por
꿈데디 D3.js강의 6주차꿈데디 D3.js강의 6주차
꿈데디 D3.js강의 6주차Songyi Lim
1.8K visualizações10 slides
GeoGebra Model : GC2015X-B201515043 por
GeoGebra Model : GC2015X-B201515043GeoGebra Model : GC2015X-B201515043
GeoGebra Model : GC2015X-B201515043Taehwan Kim
636 visualizações19 slides

Mais conteúdo relacionado

Mais procurados

SGL : 소프트웨어 3D 렌더링 엔진 por
SGL : 소프트웨어 3D 렌더링 엔진SGL : 소프트웨어 3D 렌더링 엔진
SGL : 소프트웨어 3D 렌더링 엔진SUNGCHEOL KIM
245 visualizações16 slides
[Week8]R_ggplot2 por
[Week8]R_ggplot2[Week8]R_ggplot2
[Week8]R_ggplot2neuroassociates
1.4K visualizações68 slides
12.05.26 roam algorithm por
12.05.26 roam algorithm12.05.26 roam algorithm
12.05.26 roam algorithm준섭 김
899 visualizações37 slides
[week6]R_Wrangling por
[week6]R_Wrangling[week6]R_Wrangling
[week6]R_Wranglingneuroassociates
1.3K visualizações44 slides
퍼시스턴트 세그먼트 트리 - Sogang ICPC Team, 2020 Winter por
퍼시스턴트 세그먼트 트리 - Sogang ICPC Team, 2020 Winter퍼시스턴트 세그먼트 트리 - Sogang ICPC Team, 2020 Winter
퍼시스턴트 세그먼트 트리 - Sogang ICPC Team, 2020 WinterSuhyun Park
559 visualizações29 slides
Unity Surface Shader for Artist 03 por
Unity Surface Shader for Artist 03Unity Surface Shader for Artist 03
Unity Surface Shader for Artist 03SangYun Yi
702 visualizações23 slides

Mais procurados(20)

SGL : 소프트웨어 3D 렌더링 엔진 por SUNGCHEOL KIM
SGL : 소프트웨어 3D 렌더링 엔진SGL : 소프트웨어 3D 렌더링 엔진
SGL : 소프트웨어 3D 렌더링 엔진
SUNGCHEOL KIM245 visualizações
[Week8]R_ggplot2 por neuroassociates
[Week8]R_ggplot2[Week8]R_ggplot2
[Week8]R_ggplot2
neuroassociates1.4K visualizações
12.05.26 roam algorithm por 준섭 김
12.05.26 roam algorithm12.05.26 roam algorithm
12.05.26 roam algorithm
준섭 김899 visualizações
[week6]R_Wrangling por neuroassociates
[week6]R_Wrangling[week6]R_Wrangling
[week6]R_Wrangling
neuroassociates1.3K visualizações
퍼시스턴트 세그먼트 트리 - Sogang ICPC Team, 2020 Winter por Suhyun Park
퍼시스턴트 세그먼트 트리 - Sogang ICPC Team, 2020 Winter퍼시스턴트 세그먼트 트리 - Sogang ICPC Team, 2020 Winter
퍼시스턴트 세그먼트 트리 - Sogang ICPC Team, 2020 Winter
Suhyun Park559 visualizações
Unity Surface Shader for Artist 03 por SangYun Yi
Unity Surface Shader for Artist 03Unity Surface Shader for Artist 03
Unity Surface Shader for Artist 03
SangYun Yi702 visualizações
G+ Summer C Study 20130717(7일차) por Jake Yoon
G+ Summer C Study 20130717(7일차)G+ Summer C Study 20130717(7일차)
G+ Summer C Study 20130717(7일차)
Jake Yoon1K visualizações
Unity Surface Shader for Artist 02 por SangYun Yi
Unity Surface Shader for Artist 02Unity Surface Shader for Artist 02
Unity Surface Shader for Artist 02
SangYun Yi856 visualizações
Fast Fourier Transform - Sogang ICPC Team, 2019 por Suhyun Park
Fast Fourier Transform - Sogang ICPC Team, 2019Fast Fourier Transform - Sogang ICPC Team, 2019
Fast Fourier Transform - Sogang ICPC Team, 2019
Suhyun Park761 visualizações
아일렛 온라인에서 사용한 블럭 렌더링 소개 por 정만 김
아일렛 온라인에서 사용한 블럭 렌더링 소개아일렛 온라인에서 사용한 블럭 렌더링 소개
아일렛 온라인에서 사용한 블럭 렌더링 소개
정만 김400 visualizações
Persistent Segment Tree - Sogang ICPC Team, 2019 por Suhyun Park
Persistent Segment Tree - Sogang ICPC Team, 2019Persistent Segment Tree - Sogang ICPC Team, 2019
Persistent Segment Tree - Sogang ICPC Team, 2019
Suhyun Park904 visualizações
정수론적 알고리즘 - Sogang ICPC Team, 2020 Winter por Suhyun Park
정수론적 알고리즘 - Sogang ICPC Team, 2020 Winter정수론적 알고리즘 - Sogang ICPC Team, 2020 Winter
정수론적 알고리즘 - Sogang ICPC Team, 2020 Winter
Suhyun Park1.6K visualizações
[week11] R_ggmap, leaflet por neuroassociates
[week11] R_ggmap, leaflet[week11] R_ggmap, leaflet
[week11] R_ggmap, leaflet
neuroassociates2.5K visualizações
Lazy Propagation on Segment Trees - Sogang ICPC Team, 2019 por Suhyun Park
Lazy Propagation on Segment Trees - Sogang ICPC Team, 2019Lazy Propagation on Segment Trees - Sogang ICPC Team, 2019
Lazy Propagation on Segment Trees - Sogang ICPC Team, 2019
Suhyun Park1K visualizações
Unity Surface Shader for Artist 04 por SangYun Yi
Unity Surface Shader for Artist 04Unity Surface Shader for Artist 04
Unity Surface Shader for Artist 04
SangYun Yi807 visualizações
세그먼트 트리 느리게 업데이트하기 - Sogang ICPC Team, 2020 Winter por Suhyun Park
세그먼트 트리 느리게 업데이트하기 - Sogang ICPC Team, 2020 Winter세그먼트 트리 느리게 업데이트하기 - Sogang ICPC Team, 2020 Winter
세그먼트 트리 느리게 업데이트하기 - Sogang ICPC Team, 2020 Winter
Suhyun Park731 visualizações
[시즌2, week3] R Basic por neuroassociates
[시즌2, week3] R Basic[시즌2, week3] R Basic
[시즌2, week3] R Basic
neuroassociates1.8K visualizações
밑바닥부터시작하는딥러닝 Ch05 por HyeonSeok Choi
밑바닥부터시작하는딥러닝 Ch05밑바닥부터시작하는딥러닝 Ch05
밑바닥부터시작하는딥러닝 Ch05
HyeonSeok Choi2K visualizações
Culling por ChoKuangmin
CullingCulling
Culling
ChoKuangmin269 visualizações
Voxel based game_optimazation_relelase por YEONG-CHEON YOU
Voxel based game_optimazation_relelaseVoxel based game_optimazation_relelase
Voxel based game_optimazation_relelase
YEONG-CHEON YOU1.7K visualizações

Destaque

Lecture 1.1 - Terms & Concepts por
Lecture 1.1 - Terms & ConceptsLecture 1.1 - Terms & Concepts
Lecture 1.1 - Terms & Conceptsmgordon320
319 visualizações13 slides
B.how to face_technological_tsunami_clustering_.pmi por
B.how to face_technological_tsunami_clustering_.pmiB.how to face_technological_tsunami_clustering_.pmi
B.how to face_technological_tsunami_clustering_.pmigunseli
753 visualizações19 slides
Launch of 3D project por
Launch of 3D projectLaunch of 3D project
Launch of 3D projectiain bruce
129 visualizações22 slides
3D Graphics por
3D Graphics3D Graphics
3D GraphicsViTAly
827 visualizações44 slides
Intro to 3D modeling a human por
Intro to 3D modeling a human Intro to 3D modeling a human
Intro to 3D modeling a human iain bruce
498 visualizações14 slides
Anatomy of an android por
Anatomy of an androidAnatomy of an android
Anatomy of an androidLeonardo YongUk Kim
1.7K visualizações53 slides

Destaque(20)

Lecture 1.1 - Terms & Concepts por mgordon320
Lecture 1.1 - Terms & ConceptsLecture 1.1 - Terms & Concepts
Lecture 1.1 - Terms & Concepts
mgordon320319 visualizações
B.how to face_technological_tsunami_clustering_.pmi por gunseli
B.how to face_technological_tsunami_clustering_.pmiB.how to face_technological_tsunami_clustering_.pmi
B.how to face_technological_tsunami_clustering_.pmi
gunseli753 visualizações
Launch of 3D project por iain bruce
Launch of 3D projectLaunch of 3D project
Launch of 3D project
iain bruce129 visualizações
3D Graphics por ViTAly
3D Graphics3D Graphics
3D Graphics
ViTAly 827 visualizações
Intro to 3D modeling a human por iain bruce
Intro to 3D modeling a human Intro to 3D modeling a human
Intro to 3D modeling a human
iain bruce498 visualizações
Anatomy of an android por Leonardo YongUk Kim
Anatomy of an androidAnatomy of an android
Anatomy of an android
Leonardo YongUk Kim1.7K visualizações
A brief guide to android gradle por Leonardo YongUk Kim
A brief guide to android gradleA brief guide to android gradle
A brief guide to android gradle
Leonardo YongUk Kim1.1K visualizações
Butter android views por Leonardo YongUk Kim
Butter android viewsButter android views
Butter android views
Leonardo YongUk Kim1.4K visualizações
Actionbar and fragment por Leonardo YongUk Kim
Actionbar and fragmentActionbar and fragment
Actionbar and fragment
Leonardo YongUk Kim25.3K visualizações
C++ 미정의 행동(undefined behavior) por 은아 정
C++ 미정의 행동(undefined behavior)C++ 미정의 행동(undefined behavior)
C++ 미정의 행동(undefined behavior)
은아 정2.2K visualizações
[0602 박민근] Direct2D por 흥배 최
[0602 박민근] Direct2D[0602 박민근] Direct2D
[0602 박민근] Direct2D
흥배 최9.5K visualizações
좋은 뷰, 나쁜 뷰, 이상한 뷰 por Leonardo YongUk Kim
좋은 뷰, 나쁜 뷰, 이상한 뷰좋은 뷰, 나쁜 뷰, 이상한 뷰
좋은 뷰, 나쁜 뷰, 이상한 뷰
Leonardo YongUk Kim5.7K visualizações
C++ stl por 은아 정
C++ stlC++ stl
C++ stl
은아 정2.1K visualizações
EventBus for Android por greenrobot
EventBus for AndroidEventBus for Android
EventBus for Android
greenrobot69.2K visualizações
A brief introduction to Realm with Kotlin por Leonardo YongUk Kim
A brief introduction to Realm with KotlinA brief introduction to Realm with Kotlin
A brief introduction to Realm with Kotlin
Leonardo YongUk Kim5.1K visualizações

Similar a 3D Graphics 101

[GPU Gems3] Chapter 28. Practical Post Process Depth Of Field por
[GPU Gems3] Chapter 28. Practical Post Process Depth Of Field[GPU Gems3] Chapter 28. Practical Post Process Depth Of Field
[GPU Gems3] Chapter 28. Practical Post Process Depth Of Field종빈 오
1.7K visualizações40 slides
Deferred Shading por
Deferred ShadingDeferred Shading
Deferred Shading종빈 오
1.6K visualizações28 slides
[Ndc11 박민근] deferred shading por
[Ndc11 박민근] deferred shading[Ndc11 박민근] deferred shading
[Ndc11 박민근] deferred shadingMinGeun Park
15.8K visualizações87 slides
Unity Surface Shader for Artist 01 por
Unity Surface Shader for Artist 01Unity Surface Shader for Artist 01
Unity Surface Shader for Artist 01SangYun Yi
1.7K visualizações48 slides
Light in screen_space(Light Pre Pass) por
Light in screen_space(Light Pre Pass)Light in screen_space(Light Pre Pass)
Light in screen_space(Light Pre Pass)민웅 이
3.5K visualizações37 slides
Rendering realistic Ice objects por
Rendering realistic Ice objectsRendering realistic Ice objects
Rendering realistic Ice objectsyong gyun im
924 visualizações15 slides

Similar a 3D Graphics 101(12)

[GPU Gems3] Chapter 28. Practical Post Process Depth Of Field por 종빈 오
[GPU Gems3] Chapter 28. Practical Post Process Depth Of Field[GPU Gems3] Chapter 28. Practical Post Process Depth Of Field
[GPU Gems3] Chapter 28. Practical Post Process Depth Of Field
종빈 오1.7K visualizações
Deferred Shading por 종빈 오
Deferred ShadingDeferred Shading
Deferred Shading
종빈 오1.6K visualizações
[Ndc11 박민근] deferred shading por MinGeun Park
[Ndc11 박민근] deferred shading[Ndc11 박민근] deferred shading
[Ndc11 박민근] deferred shading
MinGeun Park15.8K visualizações
Unity Surface Shader for Artist 01 por SangYun Yi
Unity Surface Shader for Artist 01Unity Surface Shader for Artist 01
Unity Surface Shader for Artist 01
SangYun Yi1.7K visualizações
Light in screen_space(Light Pre Pass) por 민웅 이
Light in screen_space(Light Pre Pass)Light in screen_space(Light Pre Pass)
Light in screen_space(Light Pre Pass)
민웅 이3.5K visualizações
Rendering realistic Ice objects por yong gyun im
Rendering realistic Ice objectsRendering realistic Ice objects
Rendering realistic Ice objects
yong gyun im924 visualizações
Rendering realistic Ice objects por yong gyun im
Rendering realistic Ice objectsRendering realistic Ice objects
Rendering realistic Ice objects
yong gyun im520 visualizações
D2 Rain (1/2) por Youpyo Choi
D2 Rain (1/2)D2 Rain (1/2)
D2 Rain (1/2)
Youpyo Choi1K visualizações
실전프로젝트 정서경 양현찬 por 현찬 양
실전프로젝트 정서경 양현찬실전프로젝트 정서경 양현찬
실전프로젝트 정서경 양현찬
현찬 양1.4K visualizações
[0326 박민근] deferred shading por MinGeun Park
[0326 박민근] deferred shading[0326 박민근] deferred shading
[0326 박민근] deferred shading
MinGeun Park634 visualizações
D2 Depth of field por Youpyo Choi
D2 Depth of fieldD2 Depth of field
D2 Depth of field
Youpyo Choi1.2K visualizações
2015.12.10 defferd renderring_ por 재현 최
2015.12.10 defferd renderring_2015.12.10 defferd renderring_
2015.12.10 defferd renderring_
재현 최126 visualizações

Mais de Leonardo YongUk Kim

Compose Multiplatform 101 por
Compose Multiplatform 101Compose Multiplatform 101
Compose Multiplatform 101Leonardo YongUk Kim
26 visualizações68 slides
Kotlin 2.0을 통해 알아보는 코틀린의 미래 por
Kotlin 2.0을 통해 알아보는 코틀린의 미래Kotlin 2.0을 통해 알아보는 코틀린의 미래
Kotlin 2.0을 통해 알아보는 코틀린의 미래Leonardo YongUk Kim
273 visualizações88 slides
안드로이드 빌드: 설탕없는 세계 por
안드로이드 빌드: 설탕없는 세계안드로이드 빌드: 설탕없는 세계
안드로이드 빌드: 설탕없는 세계Leonardo YongUk Kim
39 visualizações76 slides
Realm은 어떻게 효율적인 데이터베이스를 만들었나? por
Realm은 어떻게 효율적인 데이터베이스를 만들었나?Realm은 어떻게 효율적인 데이터베이스를 만들었나?
Realm은 어떻게 효율적인 데이터베이스를 만들었나?Leonardo YongUk Kim
652 visualizações73 slides
MVC부터 MVVM, 단방향 데이터 흐름까지 por
MVC부터 MVVM, 단방향 데이터 흐름까지MVC부터 MVVM, 단방향 데이터 흐름까지
MVC부터 MVVM, 단방향 데이터 흐름까지Leonardo YongUk Kim
2.4K visualizações29 slides
Anatomy of Realm por
Anatomy of RealmAnatomy of Realm
Anatomy of RealmLeonardo YongUk Kim
14.5K visualizações65 slides

Mais de Leonardo YongUk Kim(16)

Compose Multiplatform 101 por Leonardo YongUk Kim
Compose Multiplatform 101Compose Multiplatform 101
Compose Multiplatform 101
Leonardo YongUk Kim26 visualizações
Kotlin 2.0을 통해 알아보는 코틀린의 미래 por Leonardo YongUk Kim
Kotlin 2.0을 통해 알아보는 코틀린의 미래Kotlin 2.0을 통해 알아보는 코틀린의 미래
Kotlin 2.0을 통해 알아보는 코틀린의 미래
Leonardo YongUk Kim273 visualizações
안드로이드 빌드: 설탕없는 세계 por Leonardo YongUk Kim
안드로이드 빌드: 설탕없는 세계안드로이드 빌드: 설탕없는 세계
안드로이드 빌드: 설탕없는 세계
Leonardo YongUk Kim39 visualizações
Realm은 어떻게 효율적인 데이터베이스를 만들었나? por Leonardo YongUk Kim
Realm은 어떻게 효율적인 데이터베이스를 만들었나?Realm은 어떻게 효율적인 데이터베이스를 만들었나?
Realm은 어떻게 효율적인 데이터베이스를 만들었나?
Leonardo YongUk Kim652 visualizações
MVC부터 MVVM, 단방향 데이터 흐름까지 por Leonardo YongUk Kim
MVC부터 MVVM, 단방향 데이터 흐름까지MVC부터 MVVM, 단방향 데이터 흐름까지
MVC부터 MVVM, 단방향 데이터 흐름까지
Leonardo YongUk Kim2.4K visualizações
Anatomy of Realm por Leonardo YongUk Kim
Anatomy of RealmAnatomy of Realm
Anatomy of Realm
Leonardo YongUk Kim14.5K visualizações
PublishSubject por Leonardo YongUk Kim
PublishSubjectPublishSubject
PublishSubject
Leonardo YongUk Kim11.5K visualizações
오픈 소스로 취업하기: 나는 어떻게 오픈 소스를 하다 렘 개발자가 되었나? por Leonardo YongUk Kim
오픈 소스로 취업하기: 나는 어떻게 오픈 소스를 하다 렘 개발자가 되었나?오픈 소스로 취업하기: 나는 어떻게 오픈 소스를 하다 렘 개발자가 되었나?
오픈 소스로 취업하기: 나는 어떻게 오픈 소스를 하다 렘 개발자가 되었나?
Leonardo YongUk Kim7.8K visualizações
Realm: 초고속 데이터베이스 por Leonardo YongUk Kim
Realm: 초고속 데이터베이스Realm: 초고속 데이터베이스
Realm: 초고속 데이터베이스
Leonardo YongUk Kim3.7K visualizações
React Redux React Native por Leonardo YongUk Kim
React Redux React NativeReact Redux React Native
React Redux React Native
Leonardo YongUk Kim4.7K visualizações
Veni, Vide, Built: Android Gradle Plugin por Leonardo YongUk Kim
Veni, Vide, Built: Android Gradle PluginVeni, Vide, Built: Android Gradle Plugin
Veni, Vide, Built: Android Gradle Plugin
Leonardo YongUk Kim4.6K visualizações
GIt 마을로 이주하기 (Git -> Svn, svn-all-fast-export) por Leonardo YongUk Kim
GIt 마을로 이주하기 (Git -> Svn, svn-all-fast-export)GIt 마을로 이주하기 (Git -> Svn, svn-all-fast-export)
GIt 마을로 이주하기 (Git -> Svn, svn-all-fast-export)
Leonardo YongUk Kim1.5K visualizações

3D Graphics 101

  • 12. Polygon. 폐곡선 도형.
 a polygon /ˈpɒlɪɡɒn/ is a plane figure that is bounded by a finite chain of straight line segments closing in a loop to form a closed chain or circuit.
  • 17. Winding Order:시계방향 등의 그려질 방향. Curling:방향이 안 맞는 경우는 그리지 않음.
  • 22. • Ambient: 주변의 물체들로 부터 받는 색상 값. 빛을 직접 하지 않고 추정을 담음. • Diffuse: 물체 고유의 색 • Specular: 하이라이트 색
  • 23. Transform and Lightning • GPU Transform and Lightning of vertices (1999) • Forced the use of Gouraud / Phong lightning.
  • 25. Shader • 필요한 기능을 하드웨어에 내장하지 않고 소프트웨어 적으 로 구현. • GLSL등의 언어를 사용함. • 기본형은 버텍스 쉐이더와 프래그먼트(픽셀) 쉐이더.
  • 26. Shader • Vertex shader: 꼭지점 정보를 받아 그것을 가공하는 쉐이 더. • Fragment(pixel) shader: 각 픽셀을 가공하는 쉐이더.
  • 27. uniform mat4 u_mvpMatrix; attribute vec4 a_position; attribute vec4 a_color; varying vec4 v_color; void main() { gl_Position = u_mvpMatrix * a_position; v_color = a_color; } Simple vertex shader
  • 28. varying vec4 v_color; void main() { gl_FragColor = v_color; } Simple fragment shader
  • 29. varying vec4 vColor; varying vec2 vTexCoord; //declare uniforms uniform sampler2D u_texture; uniform float resolution; uniform float radius; uniform vec2 dir; void main() { vec4 sum = vec4(0.0); vec2 tc = vTexCoord; float blur = radius/resolution; float hstep = dir.x; float vstep = dir.y; sum += texture2D(u_texture, vec2(tc.x - 4.0*blur*hstep, tc.y
  • 30. sum += texture2D(u_texture, vec2(tc.x - 4.0*blur*hstep, tc.y - 4.0*blur*vstep)) * 0.0162162162; sum += texture2D(u_texture, vec2(tc.x - 3.0*blur*hstep, tc.y - 3.0*blur*vstep)) * 0.0540540541; sum += texture2D(u_texture, vec2(tc.x - 2.0*blur*hstep, tc.y - 2.0*blur*vstep)) * 0.1216216216; sum += texture2D(u_texture, vec2(tc.x - 1.0*blur*hstep, tc.y - 1.0*blur*vstep)) * 0.1945945946; sum += texture2D(u_texture, vec2(tc.x, tc.y)) * 0.2270270270; sum += texture2D(u_texture, vec2(tc.x + 1.0*blur*hstep, tc.y + 1.0*blur*vstep)) * 0.1945945946; sum += texture2D(u_texture, vec2(tc.x + 2.0*blur*hstep, tc.y + 2.0*blur*vstep)) * 0.1216216216; sum += texture2D(u_texture, vec2(tc.x + 3.0*blur*hstep, tc.y + 3.0*blur*vstep)) * 0.0540540541;
  • 31. - 2.0*blur*vstep)) * 0.1216216216; sum += texture2D(u_texture, vec2(tc.x - 1.0*blur*hstep, tc.y - 1.0*blur*vstep)) * 0.1945945946; sum += texture2D(u_texture, vec2(tc.x, tc.y)) * 0.2270270270; sum += texture2D(u_texture, vec2(tc.x + 1.0*blur*hstep, tc.y + 1.0*blur*vstep)) * 0.1945945946; sum += texture2D(u_texture, vec2(tc.x + 2.0*blur*hstep, tc.y + 2.0*blur*vstep)) * 0.1216216216; sum += texture2D(u_texture, vec2(tc.x + 3.0*blur*hstep, tc.y + 3.0*blur*vstep)) * 0.0540540541; sum += texture2D(u_texture, vec2(tc.x + 4.0*blur*hstep, tc.y + 4.0*blur*vstep)) * 0.0162162162; gl_FragColor = vColor * vec4(sum.rgb, 1.0); }
  • 32. • 음악의 필터에 프래그먼트 쉐이더를 사용하기도 합니다. • 사진의 필터에 프래그먼트 쉐이더를 사용하기도 합니다. • 정확하지 않은 대량의 연산에 프래그먼트 쉐이더를 사용하 기도 합니다.
  • 33. Q & A