Shader Coding - Best Practices: Difference between revisions
Jump to navigation
Jump to search
← Older edit
Newer edit →
Shader Coding - Best Practices
(view source)
Revision as of 15:29, 22 February 2014
474 bytes removed
,
22 February 2014
m
→Vertex Shaders
:
removing as per i4dnf's expert advice
Revision as of 15:28, 22 February 2014
(
view source
)
Hooray
(
talk
|
contribs
)
m
No edit summary
← Older edit
Revision as of 15:29, 22 February 2014
(
view source
)
Hooray
(
talk
|
contribs
)
m
(
→Vertex Shaders
:
removing as per i4dnf's expert advice
)
Newer edit →
Line 18:
Line 18:
}
}
</syntaxhighlight>
</syntaxhighlight>
}}
{{Note| ftransform() is no longer available since GLSL 1.40 and GLSL ES 1.0. Instead, the programmer has to manage the projection and modelview matrices explicitly in order to comply with the new OpenGL 3.1 standard.
<syntaxhighlight lang="glsl">
#version 140
uniform Transformation {
mat4 projection_matrix;
mat4 modelview_matrix;
};
in vec3 vertex;
void main(void) {
gl_Position = projection_matrix * modelview_matrix * vec4(vertex, 1.0);
}</syntaxhighlight>
}}
}}
Hooray
Administrators
20,741
edits
Navigation menu
Personal tools
English
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
View source
View history
More
Search
Navigation
Main page
Recent changes
Village pump
Help
Portals
User
Developer
Wiki
FlightGear
Website
Forum
Mailing lists
Bug tracker
Source
Scenery
Liveries
Tools
Upload file
Special pages
Printable version