home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / documents / OpenGL / opengldoc / glspec / texture_lod.spec < prev    next >
Encoding:
Text File  |  1996-11-11  |  9.6 KB  |  266 lines

  1. Name
  2.  
  3.     SGIS_texture_lod
  4.  
  5. Name Strings
  6.  
  7.     GL_SGIS_texture_lod
  8.  
  9. Version
  10.  
  11.     $Date: 1996/04/02 00:09:15 $ $Revision: 1.2 $
  12.  
  13. Number
  14.  
  15.     24
  16.  
  17. Dependencies
  18.  
  19.     EXT_texture is required
  20.     EXT_texture3D affects the definition of this extension
  21.     EXT_texture_object affects the definition of this extension
  22.     SGI_detail_texture affects the definition of this extension
  23.     SGI_sharpen_texture affects the definition of this extension
  24.  
  25. Overview
  26.  
  27.     This extension imposes two constraints related to the texture level of
  28.     detail parameter LOD, which is represented by the Greek character lambda
  29.     in the GL Specification.  One constraint clamps LOD to a specified
  30.     floating point range.  The other limits the selection of mipmap image
  31.     arrays to a subset of the arrays that would otherwise be considered.
  32.  
  33.     Together these constraints allow a large texture to be loaded and
  34.     used initially at low resolution, and to have its resolution raised
  35.     gradually as more resolution is desired or available.  Image array
  36.     specification is necessarily integral, rather than continuous.  By
  37.     providing separate, continuous clamping of the LOD parameter, it is
  38.     possible to avoid "popping" artifacts when higher resolution images
  39.     are provided.
  40.  
  41. Issues
  42.  
  43.     *    Should detail and sharpen texture operate when the level 0 image
  44.     is not being used?
  45.  
  46. New Procedures and Functions
  47.  
  48.     None
  49.  
  50. New Tokens
  51.  
  52.     Accepted by the <pname> parameter of TexParameteri, TexParameterf,
  53.     TexParameteriv, TexParameterfv, GetTexParameteriv, and GetTexParameterfv:
  54.  
  55.     TEXTURE_MIN_LOD_SGIS
  56.     TEXTURE_MAX_LOD_SGIS
  57.     TEXTURE_BASE_LEVEL_SGIS
  58.     TEXTURE_MAX_LEVEL_SGIS
  59.  
  60. Additions to Chapter 2 of the 1.0 Specification (OpenGL Operation)
  61.  
  62.     None
  63.  
  64. Additions to Chapter 3 of the 1.0 Specification (Rasterization)
  65.  
  66.     GL Specification Table 3.7 is updated as follows:
  67.  
  68.     Name                Type        Legal Values
  69.     ----                ----        ------------
  70.     TEXTURE_WRAP_S            integer        CLAMP, REPEAT
  71.     TEXTURE_WRAP_T            integer        CLAMP, REPEAT
  72.     TEXTURE_WRAP_R_EXT        integer        CLAMP, REPEAT
  73.     TEXTURE_MIN_FILTER        integer        NEAREST, LINEAR,
  74.                             NEAREST_MIPMAP_NEAREST,
  75.                             NEAREST_MIPMAP_LINEAR,
  76.                             LINEAR_MIPMAP_NEAREST,
  77.                             LINEAR_MIPMAP_LINEAR,
  78.                             FILTER4_SGIS
  79.     TEXTURE_MAG_FILTER        integer        NEAREST, LINEAR,
  80.                             FILTER4_SGIS,
  81.                             LINEAR_DETAIL_SGIS,
  82.                             LINEAR_DETAIL_ALPHA_SGIS,
  83.                             LINEAR_DETAIL_COLOR_SGIS,
  84.                             LINEAR_SHARPEN_SGIS,
  85.                             LINEAR_SHARPEN_ALPHA_SGIS,
  86.                             LINEAR_SHARPEN_COLOR_SGIS
  87.     TEXTURE_BORDER_COLOR        4 floats    any 4 values in [0,1]
  88.     DETAIL_TEXTURE_LEVEL_SGIS    integer        any non-negative integer
  89.     DETAIL_TEXTURE_MODE_SGIS    integer        ADD, MODULATE
  90.     TEXTURE_MIN_LOD_SGIS        float        any value
  91.     TEXTURE_MAX_LOD_SGIS        float        any value
  92.     TEXTURE_BASE_LEVEL_SGIS        integer        any non-negative integer
  93.     TEXTURE_MAX_LEVEL_SGIS        integer        any non-negative integer
  94.  
  95.     Table 3.7: Texture parameters and their values.
  96.  
  97.    Level of Detail Clamping
  98.    ------------------------
  99.  
  100.    The level of detail parameter LOD is defined in the first paragraph
  101.    of Section 3.8.1 (Texture Minification) of the GL Specification, where
  102.    it is represented by the Greek character lambda.  This extension
  103.    redefines the definition of LOD as follows:
  104.  
  105.     LOD'(x,y) = log_base_2 (P(x,y))
  106.  
  107.  
  108.            /  MAX_LOD    LOD' > MAX_LOD
  109.     LOD = (   LOD'        LOD' >= MIN_LOD and LOD' <= MAX_LOD
  110.            \  MIN_LOD    LOD' < MIN_LOD
  111.         \ undefined    MIN_LOD > MAX_LOD
  112.  
  113.     The variable P in this definition represents the Greek character rho,
  114.     as it is used in the OpenGL Specification.  MIN_LOD is the value of
  115.     the per-texture variable TEXTURE_MIN_LOD_SGIS, and MAX_LOD is the value
  116.     of the per-texture variable TEXTURE_MAX_LOD_SGIS.
  117.  
  118.     By default TEXTURE_MIN_LOD_SGIS and TEXTURE_MAX_LOD_SGIS are -1000 and
  119.     1000 respectively, so they do not interfere with the normal operation of
  120.     texture mapping.  These values are respecified for a specific texture
  121.     by calling TexParameteri, TexParemeterf, TexParameteriv, or
  122.     TexParameterfv with <target> set to TEXTURE_1D, TEXTURE_2D, or
  123.     TEXTURE_3D_EXT, <pname> set to TEXTURE_MIN_LOD_SGIS or
  124.     TEXTURE_MAX_LOD_SGIS, and <param> set to (or <params> pointing to) the
  125.     new value.  It is not an error to specify a maximum LOD value that is
  126.     less than the minimum LOD value, but the resulting LOD values are
  127.     not defined.
  128.  
  129.     LOD is clamped to the specified range prior to any use.  Specifically,
  130.     the mipmap image array selection described in the Mipmapping Subsection
  131.     of the GL Specification is based on the clamped LOD value.  Also, the 
  132.     determination of whether the minification or magnification filter is
  133.     used is based on the clamped LOD.
  134.  
  135.     Image Array Availability
  136.     ------------------------
  137.  
  138.     The GL Specification describes a "complete" set of mipmap image arrays
  139.     as array levels 0 through p, where p is a well defined function of the
  140.     dimensions of the level 0 image.  Thus the level 0 image is the base of
  141.     a set of image arrays.  This extension allows any image level to be
  142.     redefined as the base level.  The base level is specified by calling
  143.     TexParameteri, TexParemeterf, TexParameteriv, or TexParameterfv with
  144.     <target> set to TEXTURE_1D, TEXTURE_2D, or TEXTURE_3D_EXT, <pname> set
  145.     to TEXTURE_BASE_LEVEL_SGIS, and <param> set to (or <params> pointing to)
  146.     the desired value.  The error INVALID_VALUE is generated if the
  147.     specified base level is negative.
  148.  
  149.     The discussion of array completeness in the GL Specification is
  150.     unchanged, understanding that the "first" array is the the array at the
  151.     base level.  The u, v, and w coordinates used to compute rho are
  152.     those of the base level array, rather than those of array level 0,
  153.     thus the resulting LOD values are relative to the base level array.
  154.     Mipmap selection is also relative to the base level array, so the dth
  155.     mipmap array is selected when
  156.  
  157.     (d - 1/2)  <  (LOD + BASE_LEVEL)  <=  (d + 1/2)
  158.  
  159.     And magnification, when selected, is performed on the base level array.
  160.     Sharpen filters (described in SGIS_sharpen_texture) operate on array
  161.     levels BASE_LEVEL and BASE_LEVEL+1.  Detail filters (described in
  162.     SGIS_detail_texture) operate only when the BASE_LEVEL is zero.
  163.  
  164.     It is also possible to truncate the set of mipmap image arrays by
  165.     specifying a maximum image level.  The maximum level is specified by
  166.     calling TexParameteri, TexParemeterf, TexParameteriv, or TexParameterfv
  167.     with <target> set to TEXTURE_1D, TEXTURE_2D, or TEXTURE_3D_EXT, <pname>
  168.     set to TEXTURE_MAX_LEVEL_SGIS, and <param> set to (or <params> pointing
  169.     to) the desired value.  The error INVALID_VALUE is generated if the
  170.     specified maximum level is negative.
  171.  
  172.     The maximum level is significant only when it is less than p, as
  173.     described above.  In this case the set of mipmap image arrays is
  174.     complete if levels BASE_LEVEL through MAX_LEVEL conform to the
  175.     completeness requirements.  Image levels less than BASE_LEVEL and
  176.     image levels greater than MAX_LEVEL are never accessed, and they have
  177.     no effect on the completeness of the mipmap array.
  178.  
  179.     If a maximum level less than p is specified, the GL will limit its
  180.     computed value of LOD so that no attempt is ever made to access an
  181.     image array at a level greater than MAX_LEVEL.  For the texture
  182.     minification filters that are currently defined, the limits are:
  183.  
  184.     Filter                Maximum LOD
  185.     ------                -----------
  186.     NEAREST                none
  187.     LINEAR                none
  188.     NEAREST_MIPMAP_NEAREST        MAX_LEVEL + 0.5
  189.     LINEAR_MIPMAP_NEAREST        MAX_LEVEL + 0.5
  190.     NEAREST_MIPMAP_LINEAR        MAX_LEVEL
  191.     LINEAR_MIPMAP_LINEAR        MAX_LEVEL
  192.     FILTER4_SGIS            none
  193.  
  194.     LOD is limited to the minimum of the table value (above) and MAX_LOD,
  195.     as specified by the application.
  196.  
  197. Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations
  198. and the Frame Buffer)
  199.  
  200.     None
  201.  
  202. Additions to Chapter 5 of the 1.0 Specification (Special Functions)
  203.  
  204.     None
  205.  
  206. Additions to Chapter 6 of the 1.0 Specification (State and State Requests)
  207.  
  208.     None
  209.  
  210. Additions to the GLX Specification
  211.  
  212.     None
  213.  
  214. Dependencies on EXT_texture
  215.  
  216.     EXT_texture is required.
  217.  
  218. Dependencies on EXT_texture3D
  219.  
  220.     If EXT_texture3D is not supported, references to 3D texture mapping and
  221.     to TEXTURE_3D_EXT in this document are invalid and should be ignored.
  222.  
  223. Dependencies on EXT_texture_object
  224.  
  225.     If EXT_texture_object is implemented, the state values named
  226.  
  227.     TEXTURE_MIN_LOD_SGIS
  228.     TEXTURE_MAX_LOD_SGIS
  229.     TEXTURE_BASE_LEVEL_SGIS
  230.     TEXTURE_MAX_LEVEL_SGIS
  231.  
  232.     are added to the state vector of each texture object. When an attribute
  233.     set that includes texture information is popped, the bindings and
  234.     enables are first restored to their pushed values, then the bound
  235.     textures have their LOD and LEVEL parameters restored to their pushed
  236.     values.
  237.  
  238. Dependencies on SGIS_detail_texture
  239.  
  240.     If SGIS_detail_texture is not supported, references to detail texture
  241.     mapping in this document are invalid and should be ignored.
  242.  
  243. Dependencies on SGIS_sharpen_texture
  244.  
  245.     If SGIS_sharpen_texture is not supported, references to sharpen texture
  246.     mapping in this document are invalid and should be ignored.
  247.  
  248. Errors
  249.  
  250.     INVALID_VALUE is generated if an attempt is made to set
  251.     TEXTURE_BASE_LEVEL_SGIS or TEXTURE_MAX_LEVEL_SGIS to a negative value.
  252.  
  253. New State
  254.  
  255.                                 Initial
  256.     Get Value            Get Command        Type    Value    Attrib
  257.     ---------            -----------        ----    -------    ------
  258.     TEXTURE_MIN_LOD_SGIS    GetTexParameterfv   n x R    -1000    texture
  259.     TEXTURE_MAX_LOD_SGIS    GetTexParameterfv   n x R     1000    texture
  260.     TEXTURE_BASE_LEVEL_SGIS    GetTexParameteriv   n x R        0    texture
  261.     TEXTURE_MAX_LEVEL_SGIS    GetTexParameteriv   n x R     1000    texture
  262.  
  263. New Implementation Dependent State
  264.  
  265.     None
  266.