Top "Vertex-shader" questions

Vertex shaders are executable programs that execute as part of the programmable geometry pipeline in modern graphics APIs such as e.g. Direct3D or OpenGL.

Vertex shader vs Fragment Shader

I've read some tutorials regarding Cg, yet one thing is not quite clear to me. What exactly is the difference …

opengl cg fragment-shader vertex-shader
In OpenGL vertex shaders, what is w, and why do I divide by it?

void main(void) { vec4 clipCoord = glModelViewProjectionmatrix * gl_Vertex; gl_Position = clipCoord; gl_FrontColor = gl_Color; vec3 ndc = clipCoord.xyz / clipCoord.…

opengl vertex-shader
Passing uniform 4x4 matrix to vertex shader program

I am trying to learn OpenGL and following this: http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/ Up until the point …

opengl glsl vertex-shader
What is the relationship between gl_Color and gl_FrontColor in both vertex and fragment shaders

I have pass-through vertex and fragment shaders. vertex shader void main(void) { gl_TexCoord[0] = gl_MultiTexCoord0; gl_Position = gl_ModelViewProjectionMatrix * …

opengl shader pixel-shader vertex-shader
change the color of a vertex in a vertex shader

Is it possible to set the color of a single vertex using a GLSL vertex shader program, in the same …

opengl glsl vertex-shader
Drawing a border on a 2d polygon with a fragment shader

I have some simple polygons (fewer than 20 vertices) rendering flat on a simple xy plane, using GL_TRIANGLES and a …

opengl-es opengl-es-2.0 glsl fragment-shader vertex-shader
Is it important to call glDisableVertexAttribArray()?

I'm not entirely clear on the scope of enabling vertex attrib arrays. I've got several different shader programs with differing …

opengl-es webgl vertex-shader
OpenGL rotation and translation done correctly

Im a bit stuck when it comes to rotation and translation in OpenGL. I got 3 Matrices, projection, view and model. …

opengl vertex-shader
How to write pass-through vertex and fragment shaders for a framebuffer with attached texture?

I'm attempting to use shaders to modify a texture that is bound to a framebuffer, but I'm confused as to …

opengl fragment-shader vertex-shader
Screen coordinates in fragment shader

In a fragment shader like the below: Shader "ColorReplacement" { Properties { _MainTex ("Greyscale (R) Alpha (A)", 2D) = "white" {} } SubShader { ZTest LEqual …

unity3d shader fragment-shader vertex-shader cg