From 52a4c2cd5f4e773892fb5fd9095d41a27d6900af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B1=84=EC=84=B1=ED=9D=AC?= <spring013@ajou.ac.kr> Date: Sat, 22 Jun 2019 23:02:07 +0900 Subject: [PATCH] Update README.md --- README.md | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0589eb0..5e4fcef 100644 --- a/README.md +++ b/README.md @@ -22,10 +22,38 @@ - 또한, 완성한 3D객체를 보면 rotate하는 각도에 따라, 고양이의 표정이 변화하는 것을 볼 수있다. <br> - 삼각형을 더 잘게자른다면, 굴곡이 더욱 자연스러워 질 것이다. <br><br> + + ``` + varying mediump vec2 texCoord; + uniform sampler2D sampler2d; + void main(void) + { + gl_FragColor = texture2D(sampler2d, texCoord); + gl_FragColor.a = 1.0 ; + } + ``` + + - Vertex shader source code : attribute로 현재 vertex의정보와 각 vertex에서의 color및 texture의 uv vector정보가 있다. 또한, vertex들의 이동을 통해 object를 trasnformation 할 수 있는데, 이때 matrix의 곱의 형태로 사용되어진다. <br>texture의 uv vector는 varying으로 fragment에 전해진다. <br><br> - - Vertex shader source code : attribute로 현재 vertex의정보와 각 vertex에서의 color및 texture의 uv vector정보가 있다. <br>또한, vertex들의 이동을 통해 object를 trasnformation 할 수 있는데, <br>이때 matrix의 곱의 형태로 사용되어진다. <br>texture의 uv vector는 varying으로 fragment에 전해진다. <br><br> - - - Fragment shader source code : vertex fragment로부터 varing을 통해 전달받은 texture의 uv vector를 통해<br> uniform 으로 선언된 texture를 mapping 할 수 있게 된다. <br> + + ``` + attribute highp vec3 myVertex; + attribute highp vec4 myColor; + attribute highp vec2 myUV; + uniform mediump mat4 Pmatrix; + uniform mediump mat4 Vmatrix; + uniform mediump mat4 Mmatrix; + varying mediump vec4 color; + varying mediump vec2 texCoord; + void main(void) + { + gl_Position = Pmatrix*Vmatrix*Mmatrix*vec4(myVertex, 1.0); + color = myColor; + texCoord = myUV; + } + ``` + + - Fragment shader source code : vertex fragment로부터 varing을 통해 전달받은 texture의 uv vector를 통해 uniform 으로 선언된 texture를 mapping 할 수 있게 된다. <br> -- GitLab