Shader Coding - Best Practices: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
|||
Line 18: | Line 18: | ||
<syntaxhighlight lang="glsl"> | <syntaxhighlight lang="glsl"> | ||
gl_FragColor = vec4 (0.0,0.0,0.0,1.0); | gl_FragColor = vec4 (0.0,0.0,0.0,1.0); | ||
</syntaxhighlight> | |||
}} | |||
{{Note|This is how you can make a pixel darker: | |||
<syntaxhighlight lang="glsl"> | |||
gl_FragColor = color * 0.5; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} |
Revision as of 13:19, 22 February 2014
Work in progress This article or section will be worked on in the upcoming hours or days. Note: Will be based on: http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg35934.html See history for the latest developments. |
Vertex Shaders
Note For testing purposes, you can use a simple pass-through vertex shader:
#version 120
void main(void) {
gl_Position = ftransform();
}
|
Fragment Shaders
Note To check if your shader is working, add this as the last line, it should turn all pixels black:
gl_FragColor = vec4 (0.0,0.0,0.0,1.0);
|
Note This is how you can make a pixel darker:
gl_FragColor = color * 0.5;
|