glDepthRange - OpenGL 4 Reference Pages - Khronos Group

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

glDepthRange specifies a linear mapping of the normalized depth coordinates in this range to window depth coordinates. Regardless of the actual depth buffer ... Name glDepthRange—specifymappingofdepthvaluesfromnormalizeddevicecoordinatestowindowcoordinates CSpecification voidglDepthRange( GLdoublenearVal,   GLdoublefarVal);   voidglDepthRangef( GLfloatnearVal,   GLfloatfarVal);   Parameters nearVal Specifiesthemappingofthenearclippingplanetowindowcoordinates. Theinitialvalueis0. farVal Specifiesthemappingofthefarclippingplanetowindowcoordinates. Theinitialvalueis1. Description Afterclippinganddivisionbyw, depthcoordinatesrangefrom -1 to1, correspondingtothenearandfarclippingplanes. glDepthRangespecifiesalinearmappingofthenormalizeddepthcoordinates inthisrangetowindowdepthcoordinates. Regardlessoftheactualdepthbufferimplementation, windowcoordinatedepthvaluesaretreatedasthoughtheyrange from0through1(likecolorcomponents). Thus, thevaluesacceptedbyglDepthRangearebothclampedtothisrange beforetheyareaccepted. Thesettingof(0,1)mapsthenearplaneto0and thefarplaneto1. Withthismapping, thedepthbufferrangeisfullyutilized. Notes ItisnotnecessarythatnearValbelessthanfarVal. Reversemappingssuchas nearVal = 1 , and farVal = 0 areacceptable. ThetypeofthenearValand farValparameterswaschangedfrom GLclampftoGLfloatforglDepthRangef andfromGLclampdtoGLdoublefor glDepthRange.Thischangeis transparenttousercodeandisdescribedindetailonthe removedTypes page. AssociatedGets glGetwithargumentGL_DEPTH_RANGE VersionSupport OpenGLVersion Function/FeatureName 2.0 2.1 3.0 3.1 3.2 3.3 4.0 4.1 4.2 4.3 4.4 4.5 glDepthRange ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ glDepthRangef - - - - - - - ✔ ✔ ✔ ✔ ✔ SeeAlso glDepthFunc, glPolygonOffset, glViewport, removedTypes Copyright Copyright©1991-2006SiliconGraphics,Inc. Copyright©2010-2014KhronosGroup. ThisdocumentislicensedundertheSGIFreeSoftwareBLicense. Fordetails,see https://khronos.org/registry/OpenGL-Refpages/LICENSES/LicenseRef-FreeB.txt.



請為這篇文章評分?