当前位置:网站首页>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 .
边栏推荐
- Pat grade a 1103 integer factorizatio
- PAT 甲级 1103 Integer Factorizatio
- MySQL bit类型解析
- 银行需要搭建智能客服模块的中台能力,驱动全场景智能客服务升级
- The download button and debug button in keil are grayed out
- 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
- postman生成时间戳,未来时间戳
- 【深度学习】图像超分实验:SRCNN/FSRCNN
- 【数字IC验证快速入门】29、SystemVerilog项目实践之AHB-SRAMC(9)(AHB-SRAMC SVTB Overview)
- Wechat applet 01
猜你喜欢
Spin animation of Cocos performance optimization
[quick start of Digital IC Verification] 23. AHB sramc of SystemVerilog project practice (3) (basic points of AHB protocol)
2022全开源企业发卡网修复短网址等BUG_2022企业级多商户发卡平台源码
[quick start for Digital IC Validation] 26. Ahb - sramc (6) for system verilog project practice (Basic Points of APB Protocol)
Do you know the relationship between the most important indicators of two strong wind control and the quality of the customer base
HW初级流量监控,到底该怎么做
Getting started with webgl (4)
Typescript release 4.8 beta
2022 all open source enterprise card issuing network repair short website and other bugs_ 2022 enterprise level multi merchant card issuing platform source code
Unity之ASE实现全屏风沙效果
随机推荐
Mathematical modeling -- what is mathematical modeling
Matlab experience summary
Getting started with webgl (3)
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
[quick start of Digital IC Verification] 19. Basic grammar of SystemVerilog learning 6 (thread internal communication... Including practical exercises)
What are the safest securities trading apps
How to understand that binary complement represents negative numbers
[understanding of opportunity -40]: direction, rules, choice, effort, fairness, cognition, ability, action, read the five layers of perception of 3GPP 6G white paper
The significance of XOR in embedded C language
Runnable是否可以中断
Nacos一致性协议 CP/AP/JRaft/Distro协议
Implementation of crawling web pages and saving them to MySQL using the scrapy framework
Ctfshow, information collection: web7
[quick start of Digital IC Verification] 25. AHB sramc of SystemVerilog project practice (5) (AHB key review, key points refining)
【深度学习】语义分割实验:Unet网络/MSRC2数据集
A need to review all the knowledge, H5 form is blocked by the keyboard, event agent, event delegation
有钱人买房就是不一样
What is data leakage
HW初级流量监控,到底该怎么做
#HPDC智能基座人才发展峰会随笔