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 / clipmap.spec < prev    next >
Encoding:
Text File  |  1996-11-11  |  11.5 KB  |  310 lines

  1. XXX - Not complete yet!!!
  2.  
  3. Name
  4.  
  5.     SGIX_clipmap
  6.  
  7. Name Strings
  8.  
  9.     GL_SGIX_clipmap
  10.  
  11. Version
  12.  
  13.     $Date: 1996/04/02 00:07:27 $ $Revision: 1.2 $
  14.  
  15. Number
  16.  
  17.     33
  18.  
  19. Dependencies
  20.  
  21.     EXT_texture is required
  22.     EXT_texture_object affects the definition of this extension
  23.     SGIS_texture_lod affects the definition of this extension
  24.     SGI_detail_texture affects the definition of this extension
  25.     SGI_sharpen_texture affects the definition of this extension
  26.  
  27. Overview
  28.  
  29.     Mipmaps provide a general but expensive solution when the texture image
  30.     is very large.  This extension defines clipmaps, which occupy a small
  31.     subset of the memory required by equivalent mipmaps, but provide much
  32.     of the mipmap rendering capabilities.  Clipmaps are especially useful
  33.     for rendering terrain.
  34.  
  35. Issues
  36.  
  37.     *   Is lod clamping treated properly if we have no texel data?
  38.     *   We may want to generalize the specification.
  39.  
  40. New Procedures and Functions
  41.  
  42.     None
  43.  
  44. New Tokens
  45.  
  46.     Accepted by the <param> parameter of TexParameteri and TexParameterf,
  47.     and by the <params> parameter of TexParameteriv and TexParameterfv,
  48.     when their <pname> parameter is TEXTURE_MIN_FILTER:
  49.  
  50.     LINEAR_CLIPMAP_LINEAR_SGIX
  51.  
  52.     Accepted by the <pname> parameter of TexParameteri, TexParameterf,
  53.     TexParameteriv, TexParameterfv, GetTexParameteriv, and GetTexParameterfv:
  54.  
  55.     TEXTURE_CLIPMAP_FRAME_SGIX
  56.  
  57.     Accepted by the <pname> parameter of TexParameteriv, TexParameterfv,
  58.     GetTexParameteriv, and GetTexParameterfv:
  59.  
  60.     TEXTURE_CLIPMAP_CENTER_SGIX
  61.     TEXTURE_CLIPMAP_OFFSET_SGIX
  62.  
  63.     Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
  64.     GetFloatv, and GetDoublev:
  65.  
  66.     MAX_CLIPMAP_DEPTH_SGIX
  67.  
  68. Additions to Chapter 2 of the 1.0 Specification (OpenGL Operation)
  69.  
  70.     None
  71.  
  72. Additions to Chapter 3 of the 1.0 Specification (Rasterization)
  73.  
  74.     GL Specification Table 3.7 is updated as follows:
  75.  
  76.     Name                Type        Legal Values
  77.     ----                ----        ------------
  78.     TEXTURE_WRAP_S            integer        CLAMP, REPEAT
  79.     TEXTURE_WRAP_T            integer        CLAMP, REPEAT
  80.     TEXTURE_WRAP_R_EXT        integer        CLAMP, REPEAT
  81.     TEXTURE_MIN_FILTER        integer        NEAREST, LINEAR,
  82.                             NEAREST_MIPMAP_NEAREST,
  83.                             NEAREST_MIPMAP_LINEAR,
  84.                             LINEAR_MIPMAP_NEAREST,
  85.                             LINEAR_MIPMAP_LINEAR,
  86.                             FILTER4_SGIS,
  87.                             LINEAR_CLIPMAP_LINEAR_SGIX
  88.     TEXTURE_MAG_FILTER        integer        NEAREST, LINEAR,
  89.                             FILTER4_SGIS,
  90.                             LINEAR_DETAIL_SGIS,
  91.                             LINEAR_DETAIL_ALPHA_SGIS,
  92.                             LINEAR_DETAIL_COLOR_SGIS,
  93.                             LINEAR_SHARPEN_SGIS,
  94.                             LINEAR_SHARPEN_ALPHA_SGIS,
  95.                             LINEAR_SHARPEN_COLOR_SGIS
  96.     TEXTURE_BORDER_COLOR        4 floats    any 4 values in [0,1]
  97.     DETAIL_TEXTURE_LEVEL_SGIS    integer        any non-negative integer
  98.     DETAIL_TEXTURE_MODE_SGIS    integer        ADD, MODULATE
  99.     TEXTURE_MIN_LOD_SGIS        float        any value
  100.     TEXTURE_MAX_LOD_SGIS        float        any value
  101.     TEXTURE_BASE_LEVEL_SGIS        integer        any non-negative integer
  102.     TEXTURE_MAX_LEVEL_SGIS        integer        any non-negative integer
  103.     GENERATE_MIPMAP_SGIS        boolean        TRUE or FALSE
  104.     TEXTURE_CLIPMAP_FRAME_SGIX    float       any non-negative value
  105.     TEXTURE_CLIPMAP_CENTER_SGIX    2 integers  any 2 non-negative integers
  106.     TEXTURE_CLIPMAP_OFFSET_SGIX    2 integers  any 2 non-negative integers
  107.  
  108.     Table 3.7: Texture parameters and their values.
  109.  
  110.     Notes:
  111.  
  112.     *   Clipmap filtering is supported only for 2D, borderless textures.
  113.  
  114.     *   Clipmap filtering is performed when the texture minification filter
  115.     is LINEAR_CLIPMAP_LINEAR_SGIX.  We could define other clipmap
  116.     filters with NEAREST sampling, but it probably isn't worth the
  117.     trouble.
  118.     
  119.     *    Clipmap filtering is supported with all magnification filters
  120.     except FILTER4_SGIS.  Detail and sharpen filtering are performed
  121.     only when the texture data are supplied by the level 0 image.
  122.  
  123.     *   A clipmap virtualizes a mipmap by holding, at any given time, only a
  124.     portion of a full mipmap pyramid.  A clipmap is complete only if
  125.     levels 0 through B have the same dimension, levels B through N form
  126.     the base of a valid mipmap, all image dimensions are a power of 2,
  127.     and N is less than MAX_CLIPMAP_DEPTH_SGIX.
  128.  
  129.     Each image level P, where P ranges from B through N, is treated as
  130.     though it contains the full image from the same level of the complete
  131.     (N+1) level mipmap.
  132.  
  133.     Each image level P, where P ranges from 0 through B-1, is treated as
  134.     though it contains a subimage from the same level of the complete
  135.     (N+1) level mipmap.  This subimage is centered at texel coordinates
  136.  
  137.                 S = (Scenter >> P)
  138.                 T = (Tcenter >> P)
  139.  
  140.     where Scenter and Tcenter are specified by the application.
  141.  
  142.     For instance, if the width of the clipmap is W=8, N=12, and Scenter=
  143.     2048, the clipmap will contain the data given by 0's in the S-edge
  144.     view below:
  145.  
  146.   0 .********************************00000000********************************.
  147.   1 .********************************00000000********************************.
  148.   2 .********************************00000000********************************.
  149.   3 .********************************00000000********************************.
  150.   4 .********************************00000000********************************.
  151.   5 .********************************00000000********************************.
  152.   6      ****************************00000000****************************
  153.   7                      ************00000000************
  154.   8                              ****00000000****
  155. B=9                                  00000000
  156.   10                                   0000
  157.   11                                    00
  158. N=12                                    0
  159.  
  160.     Likewise, if Scenter=2016 (32 less than above):
  161.  
  162.   0 .00000000****************************************************************.
  163.   1 .****************00000000************************************************.
  164.   2 .************************00000000****************************************.
  165.   3 .****************************00000000************************************.
  166.   4 .******************************00000000**********************************.
  167.   5 .*******************************00000000*********************************.
  168.   6      ****************************00000000*****************************
  169.   7                      ************00000000************
  170.   8                              ****00000000****
  171.   9                                  00000000
  172.   10                                   0000
  173.   11                                    00
  174. N=12                                    0
  175.  
  176.     *   Scenter and Tcenter are specified by the application by calling
  177.     TexParameteriv or TexParameterfv with <target> set to TEXTURE_2D,
  178.     <pname> set to <TEXTURE_CLIPMAP_CENTER_SGIX>, and <params> pointing
  179.     to a vector whose first component is Scenter and whose second
  180.     component is Tcenter.  The center can be changed at any time.
  181.  
  182.     *    The clipped levels (i.e. those levels P, where P<B) of the map can
  183.     be framed with a region of texels guaranteed not to be displayed.
  184.     The frames allow for paging of new texture data into a non-active
  185.     portion of texture memory, enabling efficient roaming throughout the
  186.     larger virtual mipmap.  The frames for all of the clipped levels are
  187.     the same width and are measured as a fraction of the width of the
  188.     clipped levels.  Specifically,
  189.  
  190.         width of frame in texels = Cframe * W / 2
  191.  
  192.     The floating point value Cframe can take on values from 0.0 to 1.0
  193.     and is specified by the application.
  194.  
  195.     Cframe is a non-negative fraction of half the level width specified
  196.     by calling TexParameterf or TexParameterfv with <target> set to
  197.     TEXTURE_2D, <pname> set to <TEXTURE_CLIPMAP_FRAME_SGIX>, and <param>
  198.     set to Cframe or <params> pointing to Cframe.  Cframe is clamped to
  199.     the range [0,1].  The frame width can be changed at any time.
  200.  
  201.     *    During filtering a level of detail is determined just as it would be
  202.     for the equivalent (N+1) level mipmap.  If the level of detail falls
  203.     into the clipped portion of the clipmap and the required texels are
  204.     not available within the framed region of the two closest image
  205.     levels, the level of detail is increased to the nearest image level
  206.     that does include the required texels.  The values of TEXTURE_WRAP_S
  207.     and TEXTURE_WRAP_T have no effect during clipmap minification.
  208.  
  209.     If SGIS_texture_lod is supported, the level of detail is clamped to
  210.     the range defined by TEXTURE_MIN_LOD_SGIS, TEXTURE_MAX_LOD_SGIS,
  211.     TEXTURE_BASE_LEVEL_SGIS, and TEXTURE_MAX_LEVEL_SGIS.  (Issue:  what
  212.     if texels do not exist on the level given by max_lod?)
  213.  
  214.     *    As the center moves, only texels along the edges of the clipmap levels
  215.     change.  To allow for incremental loading only of these texels via
  216.     TexSubImage2DEXT, torroidal offset values are added to the texture
  217.     addresses of each level.  For the Pth level where P ranges from 0 to
  218.     B-1, these offsets are
  219.  
  220.         Soffsetp = (Soffset >> P)
  221.         Toffsetp = (Toffset >> P)
  222.  
  223.     where Soffset and Toffset are specified by the application.  Note that
  224.     Soffset and Toffset for the top level defines the offsets for
  225.     subsequent levels by a simple shift just as with the center. 
  226.  
  227.     Soffset and Toffset are specified by calling TexParameteriv or
  228.     TexParameterfv with <target> set to TEXTURE_2D, <pname> set to
  229.     <TEXTURE_CLIPMAP_OFFSET_SGIX>, and <params> pointing to a vector
  230.     whose first component is Soffset and whose second component is
  231.     Toffset.  The offset can be changed at any time.
  232.  
  233. Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations
  234. and the Frame Buffer)
  235.  
  236.     None
  237.  
  238. Additions to Chapter 5 of the 1.0 Specification (Special Functions)
  239.  
  240.     None
  241.  
  242. Additions to Chapter 6 of the 1.0 Specification (State and State Requests)
  243.  
  244.     None
  245.  
  246. Additions to the GLX Specification
  247.  
  248.     None
  249.  
  250. Dependencies on EXT_texture
  251.  
  252.     EXT_texture is required
  253.  
  254. Dependencies on EXT_texture_object
  255.  
  256.     If EXT_texture_object is implemented, the state values named
  257.  
  258.     TEXTURE_CLIPMAP_FRAME_SGIX
  259.     TEXTURE_CLIPMAP_CENTER_SGIX
  260.     TEXTURE_CLIPMAP_OFFSET_SGIX
  261.  
  262.     are added to the state vector of each texture object. When an attribute
  263.     set that includes texture information is popped, the bindings and
  264.     enables are first restored to their pushed values, then the bound
  265.     textures have their TEXTURE_CLIPMAP_FRAME_SGIX,
  266.     TEXTURE_CLIPMAP_CENTER_SGIX, and TEXTURE_CLIPMAP_OFFSET_SGIX parameters
  267.     restored to their pushed values.
  268.  
  269. Dependencies on SGIS_texture_lod
  270.  
  271.     If SGIS_texture_lod is not supported, references to user-defined lod
  272.     clamping and ranges in this document are invalid and should be ignored.
  273.  
  274. Dependencies on SGIS_detail_texture
  275.  
  276.     If SGIS_detail_texture is not supported, references to detail texture
  277.     mapping in this document are invalid and should be ignored.
  278.  
  279. Dependencies on SGIS_sharpen_texture
  280.  
  281.     If SGIS_sharpen_texture is not supported, references to sharpen texture
  282.     mapping in this document are invalid and should be ignored.
  283.  
  284. Errors
  285.  
  286.     INVALID_VALUE is generated if TexParameteriv, TexParameterfv,
  287.     parameter <pname> is TEXTURE_CLIPMAP_CENTER_SGIX, and either of the two
  288.     parameters <params> points to are negative.
  289.  
  290.     INVALID_VALUE is generated if TexParameteriv, TexParameterfv,
  291.     parameter <pname> is TEXTURE_CLIPMAP_OFFSET_SGIX, and either of the two
  292.     parameters <params> points to are negative.
  293.  
  294. New State
  295.  
  296.                                  Initial
  297.     Get Value             Get Command        Type     Value    Attrib
  298.     ---------             -----------        ----     -------    ------
  299.     TEXTURE_CLIPMAP_FRAME_SGIX   GetTexParameterf  Z+   0        texture
  300.     TEXTURE_CLIPMAP_CENTER_SGIX     GetTexParameterfv  2 x Z+   0,0    texture
  301.     TEXTURE_CLIPMAP_OFFSET_SGIX     GetTexParameterfv  2 x Z+   0,0    texture
  302.  
  303.  
  304. New Implementation Dependent State
  305.  
  306.                                     Minimum
  307.     Get Value                Get Command    Type        Value
  308.     ---------                -----------    ----        -------
  309.     MAX_CLIPMAP_DEPTH_SGIX        GetIntegerv    Z+        10
  310.