当前位置:网站首页>Getting started with QT & OpenGL
Getting started with QT & OpenGL
2022-07-28 18:59:00 【Days_ It's not on yet】
Catalog
8、 ... and 、 Matrix transformation
Introduction chapter
One 、 Window building

Add the style

add to OpenGL Area

Create a new class Convenient for OpenGLwidget The operation of . Inherited classes can be changed

Control promotion

add to , Choose promote

Two 、 Draw triangle
triangle graphic data





After binding Drawing
glDrawArrays(GL_TRIANGLES,0,6); // from 0 Start looking for 6 A little bit

3、 ... and 、 Compile and connect fixed-point shaders
Before drawing figures Using shaders ,VBO Actual stored data ,VAO Store a series of operations

Index buffer object EBO

Switch to 4 A little bit





stay EBO After binding Then untie VAO

VAO Record EBO Unbind operation Cannot draw , but VAO Don't record VBO Unbundling
Four 、 Interaction control





The interface already has You also need to call

Change the drawing style

5、 ... and 、QT External use Shaders


Coding rule settings

Include header file

link 
The difference in use

Delete EBO 
6、 ... and 、 Shader explanation
Assembly line Input and output




Input and output
Rely on the name Transfer data on the pipeline , Fixed point shaders Pass to Fragment Shader 
Fixed point shaders

layout (location = 0) in vec3 aPos; Indexes


inquiry apos Location

Binding method Location


uniform




If not called resize paint When to quit Will report a mistake 
Multiple attributes 0=position 1=color

glVertexAttribPointer(); // Offset





7、 ... and 、 Texture loading

Tell the triangle that a certain point needs to be loaded Which point of the texture pattern



Texture units 0


QT It's encapsulated You can use it directly QT encapsulation 


When adding textures VAO Final unbinding Easy to record

The channel is 0 So binding 0 
Add a reddening effect



Loading of multiple textures


CPU End separation 
Activate the channel 1

Texture wrapping




Texture filtering

8、 ... and 、 Matrix transformation





Rotate first and then move , Zoom in first and then shift 
The vertices In the shader 




Nine 、 Coordinate system

Ten
...
边栏推荐
- 我的创作纪念日 -- 2022年7月25日
- Redis cache avalanche, penetration, breakdown, bloom filter, detailed explanation of distributed lock
- Redis advantages and data structure related knowledge
- [GXYCTF2019]StrongestMind
- Differences between RDB and AOF for redis persistence
- What kind of knowledge payment system functions are more conducive to the development of the platform and lecturers?
- JVM tuning
- C# 之 观察者模式实例 -- 订牛奶
- Live broadcast platform software development, JS implementation by alphabetical order
- Three minutes to understand, come to new media
猜你喜欢

Introduction and advanced level of MySQL (6)

面试官:ThreadLocal使用场景有哪些?内存泄露问题如何避免?

Win11系统svchost.exe一直在下载怎么办?

AI 改变千行万业,开发者如何投身 AI 语音新“声”态

New progress in the implementation of the industry | the openatom openharmony sub forum of the 2022 open atom global open source summit was successfully held

十进制转二进制进阶版(可转化负数以及边界值)

广告推荐CTR点击率预测实践项目!

APP为什么用JSON协议与服务端交互:序列化相关知识

Introduction and advanced MySQL (7)

kotlin:Nothing
随机推荐
Unity 之 切换语言导致报错:System.FormatException:String was not recognized as a valid DateTime.
What is the future of software testing? How to learn?
MYSQL入门与进阶(三)
现代化个人博客系统 ModStartBlog v5.4.0 登录界面改版,新增联系方式
Meta Q2 earnings: revenue fell for the first time, and metaverse will compete with apple
Log base zap of go language series
The switching language of unity causes an error: system FormatException:String was not recognized as a valid DateTime.
微信安装包11年膨胀575倍,UP主:“98%的文件是垃圾”;苹果应用商店被曝大量色情App;四大科技巨头呼吁废除闰秒|极客头条...
Introduction and advanced MySQL (III)
配置教程:新版本EasyCVR(v2.5.0)组织结构如何级联到上级平台?
Attention mechanism and code implementation
Can the training software test be employed
Introduction and advanced level of MySQL (9)
Software testing dry goods
How to use the white list function of the video fusion cloud service easycvr platform?
Implementation of grayscale publishing with haproxy
注意力机制及代码实现
APP为什么用JSON协议与服务端交互:序列化相关知识
How new people get started learning software testing
C# 之 观察者模式实例 -- 订牛奶