GPU-Accelerated Path Rendering - Presentation - GTC 2012

gputechconf.com

GPU-Accelerated Path Rendering - Presentation - GTC 2012

Path Rendering Example (3 of 3)• Render star with non-zero fill style– Stencil pathglStencilFillPathNV(pathObj, GL_COUNT_UP_NV, 0x1F);– Cover pathglEnable(GL_STENCIL_TEST);glStencilFunc(GL_NOTEQUAL, 0, 0x1F);glStencilOp(GL_KEEP, GL_KEEP, GL_ZERO);glColor3f(0,1,0); // greenglCoverFillPathNV(pathObj, GL_BOUNDING_BOX_NV);• Alternative: for even-odd fill style– Just program glStencilFunc differentlyglStencilFunc(GL_NOTEQUAL, 0, 0x1); // alternative masknon-zero fill styleeven-odd fill style

More magazines by this user
Similar magazines