opengl - How to deduce the triangle vertices in fragment shader -
if draw triangles using opengl, how deduce vertices each fragment? sending position vertex shader interpolates it, leading loss of information.
from geometry shader may access 3 vertices of triangle, may pass them fragment shader via in/out (aka varying) variables. prevent them interpolating, use flat
interpolation qualifier.
Comments
Post a Comment