GLSL: Difference between revisions

447 bytes added ,  14 September 2020
Line 4: Line 4:


==Pipeline==
==Pipeline==
===Vertex Shader===
===Vertex Shader===
In the vertex shader, your inputs are a model matrix, view matrix, and projection matrix uniforms as well as one vertex position in local coordinates.   
In the vertex shader, your inputs are a model matrix, view matrix, and projection matrix uniforms as well as one vertex position in local coordinates.   
Line 15: Line 17:
These values can be passed to the following stages as <code>varying</code>'s.   
These values can be passed to the following stages as <code>varying</code>'s.   
<code>varying</code>'s are linearly interpolated using barycentric coordinates.
<code>varying</code>'s are linearly interpolated using barycentric coordinates.
===Tesselation Shader===
This is an optional shader which can be used to dynamically upsample your triangles using subdivision.
It typically runs once per triangle.


===Geometry Shader===
===Geometry Shader===
===Tesselation Shader===
This is an optional shader which can be used to generate or remove triangles.
It typically runs once per point, line, or triangle. 
 
The outputs are typically new vertices and new triangles.
 
===Fragment Shader===
===Fragment Shader===
This shader outputs pixel color values based on information stored in each triangle. 
It runs once per pixel.