Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
GLSL Essentials

You're reading from   GLSL Essentials If you're involved in graphics programming, you need to know about shaders, and this is the book to do it. A hands-on guide to the OpenGL Shading Language, it walks you through the absolute basics to advanced techniques.

Arrow left icon
Product type Paperback
Published in Dec 2013
Publisher Packt
ISBN-13 9781849698009
Length 116 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Jacobo Rodriguez Jacobo Rodriguez
Author Profile Icon Jacobo Rodriguez
Jacobo Rodriguez
Arrow right icon
View More author details
Toc

Chapter 3. Vertex Shaders

Vertex shaders are responsible for transforming the incoming geometry into something suitable to be rasterized, according to the rendering pipeline laws. In order to make this work, a vertex shader's inputs and outputs must be very well defined.

In this chapter we will see how the inputs must be prepared and how we can compute the outputs. Also, we will talk extensively about the operations we are allowed to perform.

A vertex shader executes once and only once for each vertex sent to the GPU. Inside a vertex shader, you have access to all information about that vertex, but you can't access the other sibling vertices of the primitive that is being processed.

It doesn't matter for the vertex shader which type of primitive and how you had arranged it before sending it to the GPU (indexed, non-indexed, interleaved, non-interleaved, VBO, VAO, and so on).

So, in the end, a vertex shader is a "give me one vertex that I'll transform for you" machine, and nothing else. Things...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at AU $24.99/month. Cancel anytime