OpenGL
机长与茶
这个作者很懒,什么都没留下…
展开
-
【OpenGL蓝宝书】Chapter 2. Our First OpenGL Program
1. VAO: ...which is an object that represents the vertex fetch stage of the OpenGL pipeline and is used to supply input to the vertex shader.就算不传数据,没有VAO也是不能画的。2. gl_VertexID: VS的内建变量。表示当前处理的vertex的...原创 2019-08-25 10:38:06 · 98 阅读 · 0 评论 -
【OpenGL蓝宝书】Chapter 3. Following the Pipeline
1.Vertex Attributes----glVertexAttrib*(location, data): 往VS的 layout (location = x) 里灌数据2. Intetface block:out VS_OUT //block name{vec4 color;} vs_out; //instance nameInterface bl...原创 2019-08-26 17:01:21 · 143 阅读 · 0 评论 -
【OpenGL蓝宝书】Chapter 5. Data
一、Buffers1. OpenGL在4.5为所有的glGen*()函数增加了glCreate*()版本。二者区别如下:glGen*()只有在bind之后才会生成真正的object,而glCreate*()在create时立刻生成真正object。所以,想调用glNamedBufferStorage()之类带Named的函数,要么先bind一次buffer,要么直接在创建buffer时...原创 2019-08-26 16:59:39 · 1077 阅读 · 0 评论 -
【OpenGL蓝宝书】Chapter 7. Vertex Processing and Drawing Commands
一、VAO再谈OpenGL 3.x时代,一般使用glGenVertexArrays(1, &vao);glBindVertexAttay(vao);glVertexAttribPointer(attribIndex, ...);glEnableVertexAttribArray(attribIndex)glBindBuffer(..., buffer);所有dat...原创 2019-08-29 14:15:05 · 606 阅读 · 0 评论 -
【OpenGL蓝宝书】Chapter 8. Primitive Processing
一、Tessellation1.Tessellation Primitive ModesFirst thing first,若想使用tessellation shader,在draw的时候要使用:glDrawArrays(GL_PATCHS, ...)tessellation control shader接收一系列顶点(这些顶点的合集被称为patch),输出一系列点(输出的点被...原创 2019-09-03 12:48:50 · 248 阅读 · 0 评论 -
【OpenGL蓝宝书】Chapter 9. Fragment Processing and the Framebuffer
四、Off-Screen Rendering1. 自定义framebuffer。glGenFramebuffers(1, &fbo);glBindFramebuffer(GL_FRAMEBUFFER, fbo);glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, color_texture, 0);glFra...原创 2019-09-04 11:24:48 · 288 阅读 · 0 评论 -
【OpenGL蓝宝书】Chapter 12. Controlling and Monitoring the Pipeline
一、Queries你可以向OpenGL的渲染管线“提问题”,问它现在的某个状况如何。就像上课提问要举手,你向OpenGL提问也要先举手。举手的时候,老师不知道你想问啥,但已经知道你有问题了。举手的操作就是glGenQueries(1, &query),query可以理解为“你”这个提问的人。和glGenTextures()很像有木有!举手之后就提问,使用glBeginQuery(t...原创 2019-09-24 15:50:03 · 261 阅读 · 0 评论