当前位置:网站首页>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 .
边栏推荐
- 【服务器数据恢复】某品牌StorageWorks服务器raid数据恢复案例
- How to create Apple Developer personal account P8 certificate
- TypeScript 发布 4.8 beta 版本
- Use cpolar to build a business website (2)
- 2. Heap sort "hard to understand sort"
- 什么是数据泄露
- 【搞船日记】【Shapr3D的STL格式转Gcode】
- [quick start of Digital IC Verification] 24. AHB sramc of SystemVerilog project practice (4) (AHB continues to deepen)
- jacoco代码覆盖率
- Pat grade a 1103 integer factorizatio
猜你喜欢
Typescript release 4.8 beta
Vertex shader to slice shader procedure, varying variable
webgl_ Enter the three-dimensional world (2)
【數字IC驗證快速入門】20、SystemVerilog學習之基本語法7(覆蓋率驅動...內含實踐練習)
众昂矿业:萤石继续引领新能源市场增长
【深度学习】图像超分实验:SRCNN/FSRCNN
Unity's ASE achieves full screen sand blowing effect
[quick start of Digital IC Verification] 23. AHB sramc of SystemVerilog project practice (3) (basic points of AHB protocol)
Use cpolar to build a business website (2)
Cocos creator collision and collision callback do not take effect
随机推荐
What are the safest securities trading apps
Starting from 1.5, build a microservice framework link tracking traceid
Ctfshow, information collection: web14
HW primary flow monitoring, what should we do
Introduction of mongod management database method
Create lib Library in keil and use lib Library
[Data Mining] Visual Pattern Mining: Hog Feature + cosinus Similarity / K - means Clustering
【OBS】RTMPSockBuf_Fill, remote host closed connection.
使用cpolar建立一个商业网站(2)
webgl_ Graphic transformation (rotation, translation, zoom)
Cocos creator collision and collision callback do not take effect
什么是pv和uv? pv、uv
Stm32f103c8t6 PWM drive steering gear (sg90)
2.Golang基础知识
The bank needs to build the middle office capability of the intelligent customer service module to drive the upgrade of the whole scene intelligent customer service
[deep learning] semantic segmentation experiment: UNET network /msrc2 dataset
[quick start of Digital IC Verification] 29. Ahb-sramc (9) (ahb-sramc svtb overview) of SystemVerilog project practice
Actually changed from 408 to self proposition! 211 North China Electric Power University (Beijing)
STM32F103C8T6 PWM驱动舵机(SG90)
Gd32 F3 pin mapping problem SW interface cannot be burned