- Home /
Fragment shaders; How do you get data from all three vertices of a primitive?
I'm very new to writing shaders, after writing my own simple shader using vertex colors and flat shading I ran into a problem that I couldn't find an answer to; Is it possible to get data, specifically the vertex color, from all three of the vertices that make up a primitive and then modify it before sending it to the fragment shader?
Answer by Destolos · Sep 11, 2017 at 06:49 AM
Yes, it is possible with a Geometry Shader https://msdn.microsoft.com/en-us/library/windows/desktop/bb509609(v=vs.85).aspx . An example for Unity can be found here: https://forum.unity3d.com/threads/geometry-shader-examples-for-opengl.372919/
Your answer
Follow this Question
Related Questions
Add vertex colors to Volund/Standard Scatter (Specular, Surface) 0 Answers
Vertex Color with shadows and texture? 1 Answer
Fading GL rendered grid 0 Answers
Vertex Color Shader Non Linear Blending 0 Answers