当前位置:网站首页>Shader Language
Shader Language
2022-07-07 15:41:00 【When can Xiaobai advance to success】
One 、 Simple rectangle
1、 Vertex shader
Below is a triangle vertex shader
#version 330 core
// input data aPos The input is a (x,y) Vector
// aColor It's a 4 Dimension vector
attribute vec2 aPos;
attribute vec4 aColor;
// Data output to clip shaders
out vec4 Color;
void main()
{
// color Not in vertex shaders , Direct output
Color=aColor;
// gl_Position It's a built-in function , Here is 4 Parameters ,x,y,z also alpha value , temporary alpha The value is 1
gl_Position = vec4(aPos, 0.0, 1.0);
}
2、 Fragment Shader
#version 330 core
// Input from vertex shader
in vec4 Color;
void main()
{
// gl_FragColor It's a built-in function , Here is 4 Parameters
gl_FragColor = Color;
}
This rectangle has only color , No texture .
边栏推荐
- 什么是数据泄露
- 从 1.5 开始搭建一个微服务框架链路追踪 traceId
- [server data recovery] a case of RAID data recovery of a brand StorageWorks server
- Webgl texture
- [follow Jiangke University STM32] stm32f103c8t6_ PWM controlled DC motor_ code
- 【数字IC验证快速入门】23、SystemVerilog项目实践之AHB-SRAMC(3)(AHB协议基本要点)
- STM32F103C8T6 PWM驱动舵机(SG90)
- 【数字IC验证快速入门】18、SystemVerilog学习之基本语法5(并发线程...内含实践练习)
- [quick start of Digital IC Verification] 25. AHB sramc of SystemVerilog project practice (5) (AHB key review, key points refining)
- [markdown grammar advanced] make your blog more exciting (IV: set font style and color comparison table)
猜你喜欢

【OBS】RTMPSockBuf_Fill, remote host closed connection.

知否|两大风控最重要指标与客群好坏的关系分析

【兰州大学】考研初试复试资料分享

Unity之ASE实现卡通火焰

webgl_ Graphic transformation (rotation, translation, zoom)

【数字IC验证快速入门】19、SystemVerilog学习之基本语法6(线程内部通信...内含实践练习)

postman生成时间戳,未来时间戳

2022 all open source enterprise card issuing network repair short website and other bugs_ 2022 enterprise level multi merchant card issuing platform source code

Gd32 F3 pin mapping problem SW interface cannot be burned

Typescript release 4.8 beta
随机推荐
[quick start of Digital IC Verification] 25. AHB sramc of SystemVerilog project practice (5) (AHB key review, key points refining)
【Markdown语法高级】让你的博客更精彩(四:设置字体样式以及颜色对照表)
Super simple and fully automated generation super signature system (cloud Xiaoduo minclouds.com cloud service instance), free application in-house test app distribution and hosting platform, maintenan
一个需求温习到的所有知识,h5的表单被键盘遮挡,事件代理,事件委托
【数字IC验证快速入门】20、SystemVerilog学习之基本语法7(覆盖率驱动...内含实践练习)
[quick start of Digital IC Verification] 18. Basic grammar of SystemVerilog learning 5 (concurrent threads... Including practical exercises)
webgl_ Enter the three-dimensional world (2)
MongoD管理数据库的方法介绍
#HPDC智能基座人才发展峰会随笔
[quick start of Digital IC Verification] 20. Basic grammar of SystemVerilog learning 7 (coverage driven... Including practical exercises)
[server data recovery] a case of RAID data recovery of a brand StorageWorks server
Do you know the relationship between the most important indicators of two strong wind control and the quality of the customer base
webgl_ Enter the three-dimensional world (1)
What is Base64?
全日制研究生和非全日制研究生的区别!
Android -- jetpack: the difference between livedata setValue and postvalue
Ctfshow, information collection: web8
Matlab experience summary
TypeScript 发布 4.8 beta 版本
Points for attention in porting gd32 F4 series programs to gd32 F3 series