2012년 봄학기 그래픽스 프로그래밍 기말고사 문제 1849271976.pdf
2012년 봄학기 그래픽스 프로그래밍 기말고사 답안5657020497.pdf
Monthly Archives: June 2012
lecture18
OpenGL Blending
Blending 예제
http://dis.dankook.ac.kr/lectures/cg08/entry/blending-예제
Blending Filter 예제
http://dis.dankook.ac.kr/lectures/cg08/entry/blending-filter-예제
//
Default (no blending) = Cs*1
glBlendFunc(GL_ONE, GL_ZERO)
![사용자 삽입 이미지](http://dis.dankook.ac.kr/lectures/cg11/attach/1/3105406659.png)
// Draw background only = Cd*1
glBlendFunc(GL_ZERO,
GL_ONE)
![사용자 삽입 이미지](http://dis.dankook.ac.kr/lectures/cg11/attach/1/7261762274.png)
// Addition Blending = Cs*1 + Cd*1
glBlendFunc(GL_ONE,
GL_ONE)
![사용자 삽입 이미지](http://dis.dankook.ac.kr/lectures/cg11/attach/1/7130476764.png)
// Alpha blending (back-to-front) = Cs*As + Cd*(1-As)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
![사용자 삽입 이미지](http://dis.dankook.ac.kr/lectures/cg11/attach/1/6802388731.png)
// Brighten the scene = Cs*As +
Cd*1
glBlendFunc(GL_SRC_ALPHA, GL_ONE)
![사용자 삽입 이미지](http://dis.dankook.ac.kr/lectures/cg11/attach/1/2554490839.png)
// Multiplicative blending = Cd*Cs
glBlendFunc(GL_ZERO,
GL_SRC_COLOR)
![사용자 삽입 이미지](http://dis.dankook.ac.kr/lectures/cg11/attach/1/6730404452.png)
// darken the scene = Cd*As
glBlendFunc(GL_ZERO,
GL_SRC_ALPHA);
![사용자 삽입 이미지](http://dis.dankook.ac.kr/lectures/cg11/attach/1/2728459188.png)
// Invert all the colors =
Cs*(1-Cd)
glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ZERO)
![사용자 삽입 이미지](http://dis.dankook.ac.kr/lectures/cg11/attach/1/5714378497.png)