- 博客(10)
- 收藏
- 关注
原创 【OpenGL蓝宝书】Chapter 12. Controlling and Monitoring the Pipeline
一、Queries你可以向OpenGL的渲染管线“提问题”,问它现在的某个状况如何。就像上课提问要举手,你向OpenGL提问也要先举手。举手的时候,老师不知道你想问啥,但已经知道你有问题了。举手的操作就是glGenQueries(1, &query),query可以理解为“你”这个提问的人。和glGenTextures()很像有木有!举手之后就提问,使用glBeginQuery(t...
2019-09-24 15:50:03
340
原创 【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
365
原创 【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
328
原创 【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
752
原创 【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
200
原创 【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
1241
原创 【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
156
原创 【Scratchapixel】坐标系变换、光栅化
坐标系变换(理论)在这里,我们不碰齐次坐标,不碰w分量,从理论上来看看图形学中的坐标变换和光栅化。Local -> world -> camera -> projection-> NDC -> screenLocal, World, Camera coord: 只是分别以local, world, camera为原点的一个直角坐标系(笛卡尔坐标系)...
2019-08-21 17:10:20
605
原创 【D3D11 SDK】Direct3D 11, Tutorial 01~03
本系列的Tutorial源代码及示例均来自Microsoft DirectX SDK (June 2010)里的Samples。在学习Direct3D 11的过程中,产生了些许感悟,以此开篇记录下学习过程。P.S.本博客非教程,估计只有笔者自己看得懂,搜教程的各位如果看不懂就不要在这浪费时间了。。。Tutorial 01: Direct3D 11 BasicsQ1.创建资源...
2019-08-20 00:20:27
600
原创 c++函数传参之引用传递
引用传参(pass by reference)废话不多说,直接上代码。#include using namespace std;//交换两个数void swap(int a, int b){ int t = a; a = b; b = t;}//主函数int main(){ int x = 5; y = 10; swap(x, y);
2018-01-14 20:19:10
370
空空如也
指针对比的结果无法用auto或bool存下来,但可以用于if条件判断,如何解决?
2023-01-20
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅