GLSL: Difference between revisions

No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 12: Line 12:
===Fragment Shader===
===Fragment Shader===
In the fragment shader, you will typically sample a base color and apply lighting to your object.
In the fragment shader, you will typically sample a base color and apply lighting to your object.
Sampling is typically done with <code>texture2D</code> which returns an interpolated and mipmaped color from your <code>sampler2D<code> texture.
Sampling is typically done with <code>texture2D</code> which returns an interpolated and mipmaped color from your <code>sampler2D</code> texture.


==Pipeline==
==Pipeline==
Line 42: Line 42:
This shader outputs pixel color values based on information stored in each triangle.   
This shader outputs pixel color values based on information stored in each triangle.   
It runs once per pixel.
It runs once per pixel.
==Resources==
===Reference cards===
* [https://www.khronos.org/files/opengl45-quick-reference-card.pdf OpenGL 4.5 Reference card]
* [https://www.khronos.org/opengles/sdk/docs/reference_cards/OpenGL-ES-2_0-Reference-card.pdf OpenGL ES 2.0 Reference card]
* [https://www.khronos.org/assets/uploads/developers/presentations/opengles31-quick-reference-card.pdf OpenGL ES 3.1 Reference card]
* [https://www.khronos.org/files/webgl/webgl-reference-card-1_0.pdf WebGL 1.0 Reference card]
* [https://www.khronos.org/files/webgl20-reference-guide.pdf WebGL 2.0 Reference card]
[[Category:Programming languages]]
[[Category:GPU Programming languages]]