当前位置:网站首页>OpenGL job - texture
OpenGL job - texture
2022-07-07 22:08:00 【qq_ fifty-seven million two hundred and fifty-one thousand thre】
One 、 Modify Clip shader , only Let the smiling face pattern look in the other direction
#version 330 core
out vec4 FragColor;in vec3 ourColor;
in vec2 TexCoord;uniform sampler2D texture1;
uniform sampler2D texture2;void main()
{
FragColor = mix(texture(texture1, TexCoord), texture(texture2, vec2(1-TexCoord.x, TexCoord.y)), 0.2);
}
Two 、 Try different texture wrapping methods , Set a from 0.0f
To 2.0f
Within the scope of ( Not the original 0.0f
To 1.0f
) Texture coordinates . See if you can put... In the corner of the box 4 A smiling face
float vertices[] = {
// ---- Location ---- ---- Color ---- - Texture coordinates -
0.5f, 0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 2.0f, 2.0f, // The upper right
0.5f, -0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 2.0f, 0.0f, // The lower right
-0.5f, -0.5f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, // The lower left
-0.5f, 0.5f, 0.0f, 1.0f, 1.0f, 0.
边栏推荐
- 2022 how to evaluate and select low code development platforms?
- The function is really powerful!
- 使用 BlocConsumer 同时构建响应式组件和监听状态
- Reptile combat (VII): pictures of the king of reptiles' heroes
- How does win11 time display the day of the week? How does win11 display the day of the week today?
- Develop those things: go plus c.free to free memory, and what are the reasons for compilation errors?
- [JDBC Part 1] overview, get connection, CRUD
- Jerry's initiation of ear pairing, reconnection, and opening of discoverable and connectable cyclic functions [chapter]
- The cyberspace office announced the measures for data exit security assessment, which will come into force on September 1
- 嵌入式开发:如何为项目选择合适的RTOS?
猜你喜欢
[C language] advanced pointer --- do you really understand pointer?
海外代理推荐
Cv2.resize function reports an error: error: (-215:assertion failed) func= 0 in function ‘cv::hal::resize‘
如何选择合适的自动化测试工具?
Automatic classification of defective photovoltaic module cells in electronic images
应用实践 | 数仓体系效率全面提升!同程数科基于 Apache Doris 的数据仓库建设
Customer case | China law network, through observing the cloud, greatly shortens the time of fault location
How to quickly check whether the opening area ratio of steel mesh conforms to ipc7525
NVR硬盤錄像機通過國標GB28181協議接入EasyCVR,設備通道信息不顯示是什麼原因?
100million single men and women "online dating", supporting 13billion IPOs
随机推荐
How polardb-x does distributed database hotspot analysis
2022 how to evaluate and select low code development platforms?
嵌入式开发:如何为项目选择合适的RTOS?
#DAYU200体验官#MPPT光伏发电项目 DAYU200、Hi3861、华为云IotDA
Jerry's fast pairing does not support canceling pairing [article]
QT compile IOT management platform 39 alarm linkage
Ternary expressions, generative expressions, anonymous functions
Jerry's about TWS channel configuration [chapter]
Reinforcement learning - learning notes 9 | multi step TD target
Anti climbing killer
【JDBC Part 1】概述、获取连接、CRUD
Virtual machine network configuration in VMWare
Magic weapon - sensitive file discovery tool
Time standard library
Where is the big data open source project, one-stop fully automated full life cycle operation and maintenance steward Chengying (background)?
[开源] .Net ORM 访问 Firebird 数据库
海外代理推荐
Static test tool
反爬通杀神器
SAR image quality evaluation