当前位置:网站首页>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);边栏推荐
- MySQL35-主从复制
- Good blog good material record link
- Mysql34 other database logs
- Complete web login process through filter
- Mysql36 database backup and recovery
- 在jupyter NoteBook使用Pytorch进行MNIST实现
- Emotional classification of 1.6 million comments on LSTM based on pytoch
- 如何搭建接口自动化测试框架?
- Pytoch LSTM implementation process (visual version)
- MySQL27-索引优化与查询优化
猜你喜欢

Unicode decodeerror: 'UTF-8' codec can't decode byte 0xd0 in position 0 successfully resolved

Opencv uses freetype to display Chinese

Not registered via @EnableConfigurationProperties, marked(@ConfigurationProperties的使用)

C miscellaneous lecture continued

Mysql23 storage engine
![16 medical registration system_ [order by appointment]](/img/7f/d94ac2b3398bf123bc97d44499bb42.png)
16 medical registration system_ [order by appointment]

Pytorch RNN actual combat case_ MNIST handwriting font recognition

MySQL storage engine
![14 medical registration system_ [Alibaba cloud OSS, user authentication and patient]](/img/c4/81f00c8b7037b5fb4c5df4d2aa7571.png)
14 medical registration system_ [Alibaba cloud OSS, user authentication and patient]

MySQL36-数据库备份与恢复
随机推荐
Security design verification of API interface: ticket, signature, timestamp
Several errors encountered when installing opencv
Export virtual machines from esxi 6.7 using OVF tool
MySQL ERROR 1040: Too many connections
[Julia] exit notes - Serial
Water and rain condition monitoring reservoir water and rain condition online monitoring
MySQL 29 other database tuning strategies
MySQL learning diary (II)
MySQL实战优化高手11 从数据的增删改开始讲起,回顾一下Buffer Pool在数据库里的地位
MySQL combat optimization expert 10 production experience: how to deploy visual reporting system for database monitoring system?
MySQL实战优化高手04 借着更新语句在InnoDB存储引擎中的执行流程,聊聊binlog是什么?
MySQL31-MySQL事务日志
Baidu Encyclopedia data crawling and content classification and recognition
If someone asks you about the consistency of database cache, send this article directly to him
15 medical registration system_ [appointment registration]
MySQL底层的逻辑架构
Super detailed steps to implement Wechat public number H5 Message push
Database middleware_ MYCAT summary
[unity] simulate jelly effect (with collision) -- tutorial on using jellysprites plug-in
Time complexity (see which sentence is executed the most times)