当前位置:网站首页>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);
边栏推荐
- MySQL28-数据库的设计规范
- Emotional classification of 1.6 million comments on LSTM based on pytoch
- Complete web login process through filter
- Transactions have four characteristics?
- Preliminary introduction to C miscellaneous lecture document
- Moteur de stockage mysql23
- MySQL实战优化高手02 为了执行SQL语句,你知道MySQL用了什么样的架构设计吗?
- Not registered via @EnableConfigurationProperties, marked(@ConfigurationProperties的使用)
- 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.
- Mysql23 storage engine
猜你喜欢
Mysql30 transaction Basics
PyTorch RNN 实战案例_MNIST手写字体识别
Pytorch RNN actual combat case_ MNIST handwriting font recognition
MySQL的存储引擎
解决在window中远程连接Linux下的MySQL
如何搭建接口自动化测试框架?
C miscellaneous lecture continued
Mysql25 index creation and design principles
MySQL combat optimization expert 02 in order to execute SQL statements, do you know what kind of architectural design MySQL uses?
14 medical registration system_ [Alibaba cloud OSS, user authentication and patient]
随机推荐
MySQL实战优化高手02 为了执行SQL语句,你知道MySQL用了什么样的架构设计吗?
Windchill配置远程Oracle数据库连接
[after reading the series] how to realize app automation without programming (automatically start Kwai APP)
How to find the number of daffodils with simple and rough methods in C language
First blog
Pytorch LSTM实现流程(可视化版本)
Super detailed steps for pushing wechat official account H5 messages
Super detailed steps to implement Wechat public number H5 Message push
软件测试工程师必备之软技能:结构化思维
Set shell script execution error to exit automatically
[programmers' English growth path] English learning serial one (verb general tense)
Introduction tutorial of typescript (dark horse programmer of station B)
MySQL實戰優化高手08 生產經驗:在數據庫的壓測過程中,如何360度無死角觀察機器性能?
用于实时端到端文本识别的自适应Bezier曲线网络
A necessary soft skill for Software Test Engineers: structured thinking
MNIST implementation using pytoch in jupyter notebook
Mysql28 database design specification
C miscellaneous lecture continued
How to build an interface automation testing framework?
Global and Chinese market of transfer switches 2022-2028: Research Report on technology, participants, trends, market size and share