当前位置:网站首页>glGetUniformLocation,glUniform4f
glGetUniformLocation,glUniform4f
2022-07-27 06:46:00 【汪汪富贵】
const char* vs = "void main()\
{\
gl_Position = ftransform();\
}";
const char* ps = "uniform vec4 _color;\
void main()\
{\
gl_FragColor = _color;\
}";
GLint program = createProgram(vs, ps);
//根据变量名_color获取着色器程序中对应uniform变量的位置,
//应用程序操作这个_colorId,就可以改变着色器中的uniform变量
uniform colorId = glGetUniformLocation(program,"_color");
//改变uniform
glUseProgram(program);
glUniform4f(colorId,0,1,0,1);//要在绘制之前调用
//....代码省略
glDrawArrays(GL_TRIANGLE_STRIP,0,4);
glUseProgram(0);
边栏推荐
- (2022 Niuke multi school III) j-journey (Dijkstra)
- 利用 Amazon DynamoDB 和 Amazon S3 结合 gzip 压缩,最大化存储玩家数据
- 记录一个自己挖的坑~
- C# 常用功能整合-2
- Use Amazon dynamodb and Amazon S3 combined with gzip compression to maximize the storage of player data
- SQL statement batch update time minus 1 day
- 连接MySQL时报错:Public Key Retrieval is not allowed 【解决方法】
- C winfrom common function integration-2
- 单臂路由(讲解+实验)
- Turn off the auto start function of Oracle service in centos7
猜你喜欢

TCP/IP协议分析(TCP/IP三次握手&四次挥手+OSI&TCP/IP模型)
![[wsl2] configure the USB camera connecting the USB device and using the host](/img/03/7ebc7eebeda1598c8f4fdd1e9188c7.png)
[wsl2] configure the USB camera connecting the USB device and using the host

Chapter 6 Shell Logic and Arithmetic

Properties类和properties配置文件的理解学习

VLAN trunk experiment

Advanced IO outline

Quickly update the information in a field in kettle

Use reflection to dynamically modify annotation attributes of @excel

我是不是被代码给耽误了……不幸沦为一名程序员……

在mac中使用docker来搭建oracle数据库服务器
随机推荐
在kettle使用循环来处理表中的数据
用shell来计算文本中的数字之和
Port forwarding summary
Federal Reserve SR 11-7: Guidance on model risk management - Wanzi collection
Plato farm is expected to further expand its ecosystem through elephant swap
Turn off the auto start function of Oracle service in centos7
在Perl程序中暴露Prometheus指标
Expose Prometheus metrics in Perl programs
oracle清理含有引用分区的表的数据库磁盘空间
Using loops to process data in tables in kettle
Prior Attention Enhanced Convolutional Neural Network Based Automatic Segmentation of Organs at Risk
Gossip: Recently, many friends talk about going abroad
STM32_找到导致进入HardFault_Handler的函数
Array method and loop in JS
The DrawImage method calls the solution of not displaying pictures for the first time
多线程【初阶-上篇】
漏风的小棉袄……
Perl: split the external command to be executed into multiple lines
UUID and secrets module
Panabit SNMP配置