当前位置:网站首页>API learning of OpenGL (2003) gl_ TEXTURE_ WRAP_ S GL_ TEXTURE_ WRAP_ T
API learning of OpenGL (2003) gl_ TEXTURE_ WRAP_ S GL_ TEXTURE_ WRAP_ T
2022-07-06 10:36:00 【hankern】
Set texture coordinates beyond 0-1 How to handle range .
Using functions glTexParameteri() Set texture parameters .
// Set texture parameters GL_TEXTURE_WRAP_S by GL_REPEAT Represent texture X Direction cycling textures glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
// Set texture parameters GL_TEXTURE_WRAP_T by GL_MIRRORED_REPEAT Represent texture Y Direction mirroring loops through textures
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_MIRRORED_REPEAT);
Value GL_CLAMP_TO_EDGE, GL_CLAMP_TO_BORDER, GL_MIRRORED_REPEAT, GL_REPEAT, GL_MIRROR_CLAMP_TO_EDGE, The default value GL_REPEAT
There are also places to say value GL_CLAMP, Its effect and GL_CLAMP_TO_EDGE almost .
1、GL_CLAMP_TO_EDGE
Take the boundary color when the texture coordinates exceed .
2、GL_CLAMP_TO_BORDER
Texture coordinates out of range, take the border color , You need to set the border color through the following code .
float borderColor[] = {1.0f, 1.0f, 0.0f, 1.0f};
glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderColor);
3、GL_MIRRORED_REPEAT
When the integer part of texture coordinates is odd , Set the coordinates to the decimal part of the texture coordinates ; If the integer part is even , Then the coordinates are set to 1 - The fractional part , The decimal part here represents the decimal part after removing the integer part .
4、GL_REPEAT
Make the integer part of the coordinate be ignored ,GL Use only the decimal part , So as to create a repeated configuration .
5、GL_MIRROR_CLAMP_TO_EDGE
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
边栏推荐
- MySQL实战优化高手04 借着更新语句在InnoDB存储引擎中的执行流程,聊聊binlog是什么?
- Adaptive Bezier curve network for real-time end-to-end text recognition
- Security design verification of API interface: ticket, signature, timestamp
- MySQL實戰優化高手04 借著更新語句在InnoDB存儲引擎中的執行流程,聊聊binlog是什麼?
- Preliminary introduction to C miscellaneous lecture document
- C language string function summary
- Mysql30 transaction Basics
- Technology | diverse substrate formats
- 评估方法的优缺点
- What is the difference between TCP and UDP?
猜你喜欢
[after reading the series of must know] one of how to realize app automation without programming (preparation)
Pytorch LSTM实现流程(可视化版本)
Mysql27 index optimization and query optimization
Pytoch LSTM implementation process (visual version)
使用OVF Tool工具从Esxi 6.7中导出虚拟机
[after reading the series] how to realize app automation without programming (automatically start Kwai APP)
MySQL24-索引的数据结构
Just remember Balabala
数据库中间件_Mycat总结
Record the first JDBC
随机推荐
Mysql34 other database logs
C miscellaneous shallow copy and deep copy
PyTorch RNN 实战案例_MNIST手写字体识别
[paper reading notes] - cryptographic analysis of short RSA secret exponents
Not registered via @enableconfigurationproperties, marked (@configurationproperties use)
MySQL Real Time Optimization Master 04 discute de ce qu'est binlog en mettant à jour le processus d'exécution des déclarations dans le moteur de stockage InnoDB.
MySQL底层的逻辑架构
Water and rain condition monitoring reservoir water and rain condition online monitoring
Pytorch LSTM实现流程(可视化版本)
Isn't there anyone who doesn't know how to write mine sweeping games in C language
Introduction tutorial of typescript (dark horse programmer of station B)
Anaconda3 安装cv2
Use of dataset of pytorch
Global and Chinese market of operational amplifier 2022-2028: Research Report on technology, participants, trends, market size and share
MySQL combat optimization expert 07 production experience: how to conduct 360 degree dead angle pressure test on the database in the production environment?
16 medical registration system_ [order by appointment]
MySQL25-索引的创建与设计原则
Implement sending post request with form data parameter
First blog
Record the first JDBC