OpenGL ES 2.0 Practice 5 : Simple Texture두 개의 Triangle 에 Texture를 맵핑합니다. Texture 맵핑을 위해 Texture Binding, Texture Coordinate 설정, Shader 코드에 sampler 를 추가 합니다. 첫번째 Texture 초기화 코드 입니다. private void initTexture(Bitmap image) { int name[] = new int[1]; GLES20.glGenTextures(1, name, 0); if ( name[0] > 0 ) { GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, name[0]); // setting parameters GLES20.glTexParameter..
OpenGL ES 2.0 Practice 4 : Simple Light3차원 공간에서 Triangle 표면에 라이팅(Lighting) 처리를 통해 보다 실질적인 효과를 나타내게 합니다.Lighting 처리는 Light 의 감도 조절을 위해 각각의 Vertex(position)에 대한 Normal (법선벡터) 과 Light Direction 을 이용하며, 색상은 Light Color 와 Triangle 의 색상을 의미하는 Material Diffuser 값으로 연산합니다.Lighting 원리에 대해서는 http://www.opengl-tutorial.org/beginners-tutorials/tutorial-8-basic-shading/ 를 참조 하세요.. "precision mediump float;\n..
OpenGL ES 2.0 Practice 3 : Simple Projection지금까지 Projection matrix 없이 기본 영역에서 Triangle 그리기를 하였는데, 여기에 Projection matrix를 추가하여 명시적으로 3차원 영역을 지정하도록 합니다. 최종 position = Projection matrix * Model View matrix * vertex(position) 순으로 연산되도록 합니다. Vertex(Position) 와 연관된 연산으로 Vertex Shader Code 만 수정합니다. "precision mediump float;\n" + "attribute vec3 aPosition;\n" + "uniform mat4 uMatrix;\n" + "void main() {..
OpenGL ES 2.0 Practice 2 : Simple MatrixSimple Triangle 에서 shader 코드에 matrix 연산을 추가하여 Triangle 을 회전하는 코드 입니다. 기본 shader 코드에서 matrix 연산을 추가합니다. // no matrix transform "precision mediump float;\n" + "attribute vec3 aPosition;\n" + "void main() {\n" + "gl_Position = vec4(aPosition, 1.0);\n" + "}\n", // matrix transform "precision mediump float;\n" + "attribute vec3 aPosition;\n" + "uniform mat4 uMa..
OpenGL ES 2.0 Practice 1 : Simple Triangle OpenGL ES 2.0을 이용한 간단한 Triangle 그리는 예제 코드 입니다. (Android, Java)GLES20.glUseProgram(mProgram); // screen clear color GLES20.glClearColor(0.3f, 0.8f, 0.3f, 1.0f); // clear screen GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT); int aPositionLoc = GLES20.glGetAttribLocation(mProgram, "aPosition"); GLES20.glVertexAttribPointer(aPositionLoc, 3, GLES20.GL_FLOAT, fa..
- Total
- Today
- Yesterday
- Scrum
- 애자일
- XP
- OpenGL
- OpenGL ES
- practices
- OpenGL ES 2.0
- Practice
- OPENGLES
- 프랙티스
- 프로세스
- 툴
- process
- smapler2D
- TOOL
- talk
- Android
- projection
- 토크
- Matrix
- aglie
- light
- 실전
- 스크럼
- texture
- triangle
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |