gl_FragCoord - contains the window-relative coordinates of ...

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

By default, gl_FragCoord assumes a lower-left origin for window coordinates and assumes pixel centers are located at half-pixel centers. For example, the (x ... Providedby:opengl-4-man-doc_1.0~svn33624-1_all NAME gl_FragCoord-containsthewindow-relativecoordinatesofthecurrentfragment DECLARATION invec4gl_FragCoord;.SH"DESCRIPTION" Availableonlyinthefragmentlanguage,gl_FragCoordisaninputvariablethatcontains thewindowrelativecoordinate(x,y,z,1/w)valuesforthefragment.Ifmulti-sampling, thisvaluecanbeforanylocationwithinthepixel,oroneofthefragmentsamples.This valueistheresultoffixedfunctionalitythatinterpolatesprimitivesaftervertex processingtogeneratefragments.Thezcomponentisthedepthvaluethatwouldbeused forthefragment'sdepthifnoshadercontainedanywritestogl_FragDepth(). gl_FragCoordmayberedeclaredwiththeadditionallayoutqualifieridentifiers origin_upper_leftorpixel_center_integer.Bydefault,gl_FragCoordassumesalower-left originforwindowcoordinatesandassumespixelcentersarelocatedathalf-pixelcenters. Forexample,the(x,y)location(0.5,0.5)isreturnedforthelower-left-mostpixelina window.Theoriginofgl_FragCoordmaybechangedbyredeclaringgl_FragCoordwiththe origin_upper_leftidentifier.Thevaluesreturnedcanalsobeshiftedbyhalfapixelin bothxandybypixel_center_integersoitappearsthepixelsarecenteredatwholenumber pixeloffsets.Thismovesthe(x,y)valuereturnedbygl_FragCoordof(0.5,0.5)by defaultto(0.0,0.0)withpixel_center_integer. Ifgl_FragCoordisredeclaredinanyfragmentshaderinaprogram,itmustberedeclared inallfragmentshadersinthatprogramthathavestaticuseofgl_FragCoord.Redeclaring gl_FragCoordwithanyacceptedqualifieraffectsonlygl_FragCoord.xandgl_FragCoord.y. Ithasnoaffectonrasterization,transformationoranyotherpartoftheOpenGLpipline orlanguagefeatures. VERSIONSUPPORT ┌─────────────┬───────────────────────────────────────────────────────────────────────────────────┐ ││OpenGLShadingLanguageVersion│ ├─────────────┼──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┤ │Variable│1.10│1.20│1.30│1.40│1.50│3.30│4.00│4.10│4.20│4.30│4.40│4.50│ │Name│││││││││││││ ├─────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤ │gl_FragCoord│✔│✔│✔│✔│✔│✔│✔│✔│✔│✔│✔│✔│ └─────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘ SEEALSO gl_FragCoord() COPYRIGHT Copyright©2011-2014KhronosGroup.Thismaterialmaybedistributedsubjecttotheterms andconditionssetforthintheOpenPublicationLicense,v1.0,8June1999. http://opencontent.org/openpub/. COPYRIGHT Copyright©2011-2014KhronosGroup [FIXME:source]01/03/2018GL_FRAGCOORD(3G)



請為這篇文章評分?