webgl 2d img draw
'WebGL' 카테고리의 다른 글
webGL - 배울 수 있는곳 - learning webgl (0) | 2016.08.18 |
---|---|
OpenGL/webGL - 셰이더(쉐이더)? (0) | 2016.08.18 |
OpenGL/webGL - 성능향상 팁 (0) | 2016.08.18 |
webGL - 배울 수 있는곳 - learning webgl (0) | 2016.08.18 |
---|---|
OpenGL/webGL - 셰이더(쉐이더)? (0) | 2016.08.18 |
OpenGL/webGL - 성능향상 팁 (0) | 2016.08.18 |
nehe opengl 강좌처럼 되어 있습니다.
http://learningwebgl.com/blog/
Lesson 0: Getting Started shows you how to download, install and configure a web browser that can show WebGL content, and gives links to a set of pages that show what it can do. | |
Lesson 1: A Triangle and a Square gives you an overview of how WebGL works, with enough code to simply draw a static triangle and a square on the screen. | |
Lesson 2: Adding Colour builds on lesson 1, and adds colour to the triangle and the square. | |
Lesson 3: A Bit of Movement builds on lesson 2, making the triangle and the square spin around. | |
Lesson 4: Some Real 3D Objects builds on lesson 3, bringing us into the third dimension fully by replacing the triangle with a pyramid and the square with a cube. | |
Lesson 5: Introducing Textures shows how you can use an image file to “skin” your 3D objects, giving you a quick and easy way to make them look more interesting. | |
Lesson 6: Keyboard Input and Texture Filters builds on lesson 6, showing you some more advanced ways to use textures, and also gives some pointers on how to read the keyboard in a way appropriate for 3D scenes and for games. | |
Lesson 7: Basic Directional and Ambient Lighting introduces the two simplest forms of lighting. | |
Lesson 8: The Depth Buffer, Transparency and Blending shows one way in which you can simulate transparent materials in WebGL, teaching you a little more theory along the way. | |
Lesson 9: Improving the Code Structure With Lots of Moving Objects uses simple object-oriented techniques to give us number of independently-animated objects moving around the screen at the same time. | |
Lesson 10: Loading a World, and the Most Basic Kind of Camerauses techniques from the previous lesson, along with a new trick to simulate a camera that moves around the scene, and demonstrates a kind of nano-Doom | |
Lesson 11: Spheres, Rotation Matrices, and Mouse Events shows how to draw spheres, and how to write code so that the user can spin them using the mouse. | |
Lesson 12: point lighting shows how implement lighting that seems to come from points within your 3D scene. | |
WebGL Lesson 13: per-fragment lighting and multiple programsdescribes a way of doing more realistic lighting at the cost of more processing time for the graphics card. | |
WebGL Lesson 14: specular highlights and loading a JSON modelmakes the lighting even better by adding specular highlights, and also shows how to use load up models of 3D objects from JSON files. | |
WebGL Lesson 15: specular maps shows how to use specular maps, which give your scenes greater realism by making it easy to specify how reflective an object is at every point on its surface, just as normal textures allow you to specify its detailed colour. | |
WebGL Lesson 16: render-to-texture shows how to render a WebGL scene into a texture that can then be used in another scene — a neat trick in itself, and a useful foundation for other techiques. |
webgl 2d img draw (0) | 2017.03.01 |
---|---|
OpenGL/webGL - 셰이더(쉐이더)? (0) | 2016.08.18 |
OpenGL/webGL - 성능향상 팁 (0) | 2016.08.18 |
점, 선등을 이동,변환, 회전등의 연산을 사용자가 수정할 수 있게 하는 기능.
예) 버텍스 쉐이더, 픽셀쉐이더
이전에는 "파이프라인"이라고 해서, 3D출력 순서가 고정되어 있었습니다.
쉐이더는 이 기능들의 사이 사이에 들어가서, 사용자가 원하는 방식으로 수정할 수 있게 해주는 방법이라고 볼 수 있습니다.
참고
http://alleysark.tistory.com/264
webgl 2d img draw (0) | 2017.03.01 |
---|---|
webGL - 배울 수 있는곳 - learning webgl (0) | 2016.08.18 |
OpenGL/webGL - 성능향상 팁 (0) | 2016.08.18 |
OpenGL/webGL - 성능향상 팁
- CPU/GUP간 동기화는 매우느리다.
readPixels, finish, getError 등의 불필요한 함수호출은 자재한다.
필요한 정보는 변수에 저장해라.
- 함수 호출 1번으로 많은 내용을 그려라.
drawArrays, drawElements 등의 함수를 한번만 호출하여, 많은 물체를 그려라.
함수를 여러번 호출하면 느려진다.
- texture 이미지는 1장에 모두 그려서, 필요한 부분만 골라서 그리도록 한다.
texture 이미지를 교체할 수록 느려진다.
- 이미지는 가능하면 mipmapping 을 사용해라.
- 간단한 shaders는 빠르다. if문 같은 비교문은 제거해라.
나눗셈, sin,cos, log등의 수학 함수 호출등은 가능하면 피해라. 변수에 미리 값을 계산하여 저장.
- fragment shader(느림)보다는, vertex shader(빠름)에서 가능한 많은 작업을 해라.
- vertex attrib 0 array를 enable로 설정하라.
webgl 2d img draw (0) | 2017.03.01 |
---|---|
webGL - 배울 수 있는곳 - learning webgl (0) | 2016.08.18 |
OpenGL/webGL - 셰이더(쉐이더)? (0) | 2016.08.18 |