当前位置:网站首页>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 .
边栏推荐
- leetcode 241. Different ways to add parentheses design priority for operational expressions (medium)
- 如何在opensea批量发布NFT(Rinkeby测试网)
- Pit avoidance: description of null values in in and not in SQL
- PAT 甲级 1103 Integer Factorizatio
- Excerpted words
- 【数据挖掘】视觉模式挖掘:Hog特征+余弦相似度/k-means聚类
- 【服务器数据恢复】某品牌StorageWorks服务器raid数据恢复案例
- Ida Pro reverse tool finds the IP and port of the socket server
- 【深度学习】图像超分实验:SRCNN/FSRCNN
- Matlab experience summary
猜你喜欢

【OBS】RTMPSockBuf_ Fill, remote host closed connection.

Unity之ASE实现全屏风沙效果

全日制研究生和非全日制研究生的区别!
![[quick start of Digital IC Verification] 18. Basic grammar of SystemVerilog learning 5 (concurrent threads... Including practical exercises)](/img/91/16a370ac41adc8fe31507765a82b0a.png)
[quick start of Digital IC Verification] 18. Basic grammar of SystemVerilog learning 5 (concurrent threads... Including practical exercises)
Implementation of crawling web pages and saving them to MySQL using the scrapy framework

Ida Pro reverse tool finds the IP and port of the socket server

webgl_ Graphic transformation (rotation, translation, zoom)

OpenGL's distinction and understanding of VAO, VBO and EBO

Ctfshow, information collection: web7

使用cpolar建立一个商业网站(2)
随机推荐
如何在opensea批量发布NFT(Rinkeby测试网)
2. 堆排序『较难理解的排序』
Getting started with webgl (4)
【数字IC验证快速入门】22、SystemVerilog项目实践之AHB-SRAMC(2)(AMBA总线介绍)
MySQL bit type resolution
微信小程序 01
How to build your own super signature system (yunxiaoduo)?
连接ftp服务器教程
Runnable是否可以中断
[follow Jiangke University STM32] stm32f103c8t6_ PWM controlled DC motor_ code
Ctfshow, information collection: web14
Implementation of crawling web pages and saving them to MySQL using the scrapy framework
The significance of XOR in embedded C language
【OBS】RTMPSockBuf_ Fill, remote host closed connection.
【數字IC驗證快速入門】20、SystemVerilog學習之基本語法7(覆蓋率驅動...內含實踐練習)
Actually changed from 408 to self proposition! 211 North China Electric Power University (Beijing)
摘抄的只言片语
With 8 modules and 40 thinking models, you can break the shackles of thinking and meet the thinking needs of different stages and scenes of your work. Collect it quickly and learn it slowly
Cocos makes Scrollview to realize the effect of zooming in the middle and zooming out on both sides
How to deploy the super signature distribution platform system?