当前位置:网站首页>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);
边栏推荐
- Global and Chinese market of thermal mixers 2022-2028: Research Report on technology, participants, trends, market size and share
- MySQL底层的逻辑架构
- 16 medical registration system_ [order by appointment]
- MySQL21-用户与权限管理
- MySQL实战优化高手03 用一次数据更新流程,初步了解InnoDB存储引擎的架构设计
- Use of dataset of pytorch
- [paper reading notes] - cryptographic analysis of short RSA secret exponents
- Transactions have four characteristics?
- The appearance is popular. Two JSON visualization tools are recommended for use with swagger. It's really fragrant
- 保姆级手把手教你用C语言写三子棋
猜你喜欢
高并发系统的限流方案研究,其实限流实现也不复杂
Unicode decodeerror: 'UTF-8' codec can't decode byte 0xd0 in position 0 successfully resolved
PyTorch RNN 实战案例_MNIST手写字体识别
【C语言】深度剖析数据存储的底层原理
MySQL26-性能分析工具的使用
MySQL实战优化高手02 为了执行SQL语句,你知道MySQL用了什么样的架构设计吗?
Super detailed steps for pushing wechat official account H5 messages
MySQL实战优化高手04 借着更新语句在InnoDB存储引擎中的执行流程,聊聊binlog是什么?
[after reading the series] how to realize app automation without programming (automatically start Kwai APP)
The appearance is popular. Two JSON visualization tools are recommended for use with swagger. It's really fragrant
随机推荐
用于实时端到端文本识别的自适应Bezier曲线网络
MySQL real battle optimization expert 11 starts with the addition, deletion and modification of data. Review the status of buffer pool in the database
Mysql23 storage engine
Mysql35 master slave replication
Advantages and disadvantages of evaluation methods
MySQL29-数据库其它调优策略
Download and installation of QT Creator
How to find the number of daffodils with simple and rough methods in C language
【C语言】深度剖析数据存储的底层原理
Case identification based on pytoch pulmonary infection (using RESNET network structure)
MySQL22-逻辑架构
Water and rain condition monitoring reservoir water and rain condition online monitoring
UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xd0 in position 0成功解决
MySQL实战优化高手07 生产经验:如何对生产环境中的数据库进行360度无死角压测?
C miscellaneous lecture continued
How to change php INI file supports PDO abstraction layer
软件测试工程师发展规划路线
Windchill配置远程Oracle数据库连接
[C language] deeply analyze the underlying principle of data storage
Google login prompt error code 12501