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

OpenGL Shader Program Weird Result

I have created a basic shader program to brush up on my openGL GLSL. on the cpu side i have properly created my shader program .vp and .fp linked properly and error checked my result when i render is always a black Triangle Right before i link my…
Franky Rivera
  • 553
  • 8
  • 20
0
votes
1 answer

OpenGL ES 2.0 Shader Rotation Per Vertex

This Question is about Skinning actually. Lets say we have a model with vertex groups(bones) as a float buffer and we pass it to the shader. is there any way to partial rotate a vertex group? buffer is x,y,z,u,v,n1,n2,n3,boneid,rotfactor .…
0
votes
1 answer

Non-constant index into uniform array CG Shader

According to this nVidia CG tutorial (and my own experience) accessing uniform arrays in CG shaders with a non-constant index is either inefficient or unsupported (more often than not, unsupported it seems). My question is; how can I circumvent this…
DAVco
  • 325
  • 2
  • 3
  • 10
0
votes
0 answers

Three.js and GLSL - Kaleidoscope shader

I'm starting and experimenting with GLSL and WebGL. Using Three.js r52. I have a simple plane geom mesh with a Shader material. I'm already passing a texture as uniform property, and I was able to manipulate it in different ways. But, when I try to…
0
votes
0 answers

WebGL frame by frame animation from multiple textures

I am currently working on a prototype which aims to create a short interactive film made from a sequence of fast interchanging images. On each frame we plan to apply a fish-eye post-processing effect and leveraging WebGL to offload this computation…
Gixo
  • 389
  • 2
  • 4
0
votes
1 answer

Using vertex shader to move texture to pixel center

I am trying to move my texture to the center of the pixel as stated here OpenGL Texture Coordinates in Pixel Space but am struggling to do so. Are the pixels we are trying to center on in the texture or on the screen? How do we access them? Here is…
eBehbahani
  • 1,579
  • 5
  • 19
  • 41
0
votes
1 answer

What should my shader look like when doing diffuse/directional lighting with skeletal matrices?

I've found examples online of how to perform diffusion lighting but I can't seem to find any regarding how things would change when using skeletal matrices. Does anyone have an example I could look at? I specifically used this page as an example to…
Xavier
  • 8,828
  • 13
  • 64
  • 98
0
votes
3 answers

Any OpengGL Shader Spelling Checker?

I haven't found a tool for checking text spelling on OnpenGL shader for eclipse or another. Dealing with spelling errors on text based shaders like: protected String vertexShaderCode = // This matrix member variable provides a hook to…
Enriquillo
  • 37
  • 1
  • 12
0
votes
1 answer

transform feedback input and output size

I have a small question about transform feedbacks in OpenGL. Is it possible for my output to be a different size than my output ? Let say a VS like: in vec3 pos; in vec3 move; out vec3 newPos; void main() { newPos = pos + move; } So my output…
widgg
  • 1,358
  • 2
  • 16
  • 35
0
votes
1 answer

Get GlProgram binary from Cg vertex shader

I have some Cg Vertex shader and want to get the compiled binary from it to cache. The way I load the Cg vertex is using glProgramStringARB, the problem with that is that I can't retrieve any value from glGetProgramiv and glGetProgramBinary. Here is…
Sassa
  • 1,673
  • 2
  • 16
  • 30
0
votes
1 answer

three.js ParticleSystem creation gives INVALID_OPERATION: not bound BUFFER_ARRAY

I am trying to create a three.js ParticleSystem with the below Code. On my Chrome installed on a Linux host this works perfectly fine, but as soon as I am trying run run it on a Windows Chrome portable i get the following WegGL error on the first…
sebi
  • 46
  • 3
0
votes
1 answer

The vertex structure of a mesh vs the vertex structure of the vertex shader

[Using HLSL, an *.fx file and DirectX9] I'm new to using shaders and have got a scenario working but don't understand why. I'm confused as to how the mesh can have one version of the vertex decleration while the shader can define another. I create…
Jono
  • 3,949
  • 4
  • 28
  • 48
0
votes
1 answer

CGFX shader outputing vert data multiple times

How can I output something from the vertex shader to the pixel shader multiple times. Eg I need to output the vertex color as a float 4 to the pixel shader 4 times after performing some different math operations on the vertex color in the vert…
fghajhe
  • 239
  • 1
  • 2
  • 8
0
votes
1 answer

OpenGLES2 Shader : Lighting position and camera movement?

I tried to add lighting to my OpenGLES2 application following the tutorial at http://www.learnopengles.com/android-lesson-two-ambient-and-diffuse-lighting/ Unlike in above tutorial,I have FPS camera movements.In the vertex shader I have hard coded…
Ashika Umanga Umagiliya
  • 8,988
  • 28
  • 102
  • 185
0
votes
2 answers

vertices not being drawn in opengl

I've been having trouble drawing a simple vertex-specified (box-like) teapot model using shaders with some input for translation and rotation. I've checked my gl code and matrices (object position on -z, camera at origin, etc) over and over and…
Darksai
  • 11