Questions tagged [vertex-shader]

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 shaders are usually hardware accelerated on consumer hardware nowadays. The vertex shader processes one vertex at a time, followed by primitive assembly, optionally geometry shader and transform feedback, clipping, and finally rasterization and fragment processing.

Vertex shaders were introduced as an extension to OpenGL 1.3 and as a feature of Direct3D 8.0 around 2001. They were the first step in making part of the render pipeline on consumer hardware freely programmable as opposed to hardwired functionality like the TnL stage or register combiners which until then were at best configurable in some limited way.

The vertex shader is typically the first programmable part of the pipeline. The scope of a vertex shader is a single vertex without any information about the connectivity between vertices or any other vertices and any state set as "uniform", i.e. data that is constant across everything in the current draw call. A vertex shader cannot create vertices nor discard them, and a vertex shader has no local memory or other way that can be used to communicate data from one vertex to another.

After vertices have been transformed by the vertex shader, they are assembled into primitives and optionally processed by a geometry shader, which runs on the scope of all vertices within a single primitive (such as a triangle) and optionally the surrounding vertices.

Resources:

911 questions
0
votes
1 answer

Unity Shader: Deform a 3D model using vertex shader then apply specular using surface shader

I need help in applying a specular shade in a 3D model after I deformed it in CG vertex shader. I don't know how to do it in Unity shader. I already searched in google and there are no hits of what I am looking for. Below is my current solution. The…
acegs
  • 2,621
  • 1
  • 22
  • 31
0
votes
1 answer

Android OpenGL ES 2.0: Invalid Vertex Shader. Link Cannot Proceed

This is the best I can do with obtaining the debug errors. Link for a larger image version As you can see, glGetProgramInfoLog() returns the following sentence: "Invalid vertex shader. Link cannot proceed." The yellow line in the Eclipse IDE is…
tom_mai78101
  • 2,383
  • 2
  • 32
  • 59
0
votes
2 answers

Bad openGL version for GLSL shaders

I just want to make an OpenGL program using GLSL shader. But when I'm compiling it I have the following error message : Version number not supported by GL2. Here's my vertex shader code : #version 400 in vec3 Color; out vec4 FragColor; void main()…
user1364743
  • 5,283
  • 6
  • 51
  • 90
0
votes
1 answer

Direct3D custom shader lagging a few frames behind

I was having problems getting textures to display properly on trapezoids (quad with one side smaller as if viewed from a perspective) in C# Managed DirectX. I ended up solving it with a custom shader (not the solution I was looking for, but the…
HypnoToad
  • 585
  • 1
  • 6
  • 18
0
votes
1 answer

how to move the vertex transform to vertex shader

I need your help! I am trying to move the vertex transform part from the cpu code to the vertex shader, here's the cpp code of the vertex transform: //calculate the transform matrix of a refelcting surface //@point: a point on the surface //@normal:…
Sunf71
  • 93
  • 2
  • 8
0
votes
2 answers

LibGdx shader "no uniform with name..." in phong shader

I'm very new to OpenGL and LibGdx. I started with these tutorials but wanted to apply a phong texture. I've tried to merge a number of examples but am having issues. I've got a sphere and spinning cube on the center of the screen. I've still got…
Basic
  • 26,321
  • 24
  • 115
  • 201
0
votes
1 answer

Stage3d shader weird behavior adding variable

I am using this shaders with this results: