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

Geometry shaders versus vertex shaders


Although geometry shaders transform vertices in a very similar way than vertex shaders do, we have to enumerate some important differences between them:

  • Vertex shaders are executed once by an incoming vertex. Geometry shaders are executed once (by default) by an incoming primitive.

  • Vertex shaders can't access any information about adjacent vertices. A geometry shader has all the information for a given primitive and adjacent ones.

  • Vertex shaders don't produce new vertices. Geometry shaders create new primitives (in fact, that's the main purpose).

In addition, there are other facts about geometry shaders that must be known:

  • The geometry shader stage happens after the primitive assembly stage.

  • A geometry shader receives assembled primitives. This means that it doesn't matter if you send triangles, triangle strips, or fans of triangles. A geometry shader will always receive a triangle. The same happens with lines, line strips, or line loops. The primitives that...

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 $19.99/month. Cancel anytime