Fragment Shader/Defined Outputs - OpenGL Wiki

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

gl_FragDepth: This output is the fragment's depth. ... The sample mask output here will be logically AND'd with the sample mask computed by ... FragmentShader/DefinedOutputs FromOpenGLWiki )outfloatgl_FragDepth; Thecondition​canbeoneofthefollowing: any Thedefault.Youmayfreelychangethedepth,butyoulosethemostpotentialperformance. greater Youwillonlymakethedepthlarger,comparedtogl_FragCoord.z. less Youwillonlymakethedepthsmaller,comparedtogl_FragCoord.z. unchanged Ifyouwritetogl_FragDepth,youwillwriteexactlygl_FragCoord.z. Violatingthecondition​yieldsundefinedbehavior. GLSL4.00orARB_sample_shadingbringsus: outintgl_SampleMask[]; gl_SampleMask Thisdefinesthesamplemaskforthefragmentwhenperformingmutlisampledrendering.Ifashaderdoesnotstaticallywritetoit,thenitwillbefilledinbygl_SampleMaskIn.ThesamplemaskoutputherewillbelogicallyAND'dwiththesamplemaskcomputedbytherasterizer. Warning:Justaswithgl_FragDepth,ifafragmentshaderwritestogl_SampleMaskatall,itmustmakesuretowritetothevalueforallexecutionpaths.Butitmustalsomakesuretowritetoeachelementinthearray.Thearrayhasthesamesizeasgl_SampleMaskIn. Retrievedfrom"http://www.khronos.org/opengl/wiki_opengl/index.php?title=Fragment_Shader/Defined_Outputs&oldid=13935" Category:Pagesusingdeprecatedsourcetags Navigationmenu Personaltools CreateaccountLogin Namespaces PageDiscussion Variants Views ReadViewsourceViewhistory More Search Navigation MainPageGettingStartedDownloadOpenGLRegistryReferencePagesReferenceGuideNewsCommunityForumsAboutOpenGL Help ContactUsPrivacyPolicyHelpEditingRecentchanges Tools WhatlinkshereRelatedchangesSpecialpagesPrintableversionPermanentlinkPageinformationCitethispage



請為這篇文章評分?