gl_FrontFacing - OpenGL 4 Reference Pages - Khronos Group

文章推薦指數: 80 %
投票人數:10人

Available only in the fragment language, gl_FrontFacing is an input variable whose value is true if the fragment belongs to a front-facing primitive and ... Name gl_FrontFacing—indicateswhetheraprimitiveisfrontorbackfacing Declaration in bool gl_FrontFacing ; Description Availableonlyinthefragmentlanguage,gl_FrontFacingisaninputvariable whosevalueistrueifthefragmentbelongstoafront-facingprimitiveand falseotherwise.Thedeterminationofwhetheratriangleprimitiveisfront-facingismadeby examiningthesignoftheareaofthetriangle,includingapossiblereversalofthissign ascontrolledbyglFrontFace.Onewaytocomputethisareais: a=12 ∑ j=0 n-1 x w i y w i+1 - x w i+1 y w i where x w i and y w i are thexandywindowcoordinatesoftheithvertexofthen-vertexpolygon. Thesignofthiscomputationisnegatedwhenthevalueof GL_CLIP_ORIGIN(theclipvolumeorigin,set with glClipControl) isGL_UPPER_LEFT. VersionSupport OpenGLShadingLanguageVersion VariableName 1.10 1.20 1.30 1.40 1.50 3.30 4.00 4.10 4.20 4.30 4.40 4.50 gl_FrontFacing ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ SeeAlso gl_FragCoord, glClipControl Copyright Copyright©2011-2014KhronosGroup. Thismaterialmaybedistributedsubjecttothetermsandconditionssetforthin theOpenPublicationLicense,v1.0,8June1999. http://opencontent.org/openpub/.



請為這篇文章評分?