home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / documents / OpenGL / extensions / spec / texture_object.spec < prev    next >
Encoding:
Text File  |  1996-11-11  |  17.9 KB  |  431 lines

  1. Name
  2.  
  3.     EXT_texture_object
  4.  
  5. Name Strings
  6.  
  7.     GL_EXT_texture_object
  8.  
  9. Version
  10.  
  11.     $Date: 1995/09/30 02:33:18 $ $Revision: 1.1 $
  12.  
  13. Number
  14.  
  15.     20
  16.  
  17. Dependencies
  18.  
  19.     EXT_texture3D affects the definition of this extension
  20.  
  21. Overview
  22.  
  23.     This extension introduces named texture objects.  The only way to name
  24.     a texture in GL 1.0 is by defining it as a single display list.  Because
  25.     display lists cannot be edited, these objects are static.  Yet it is
  26.     important to be able to change the images and parameters of a texture.
  27.  
  28. Issues
  29.  
  30.     *    Should the dimensions of a texture be static once they are
  31.     changed from zero?  This might simplify the management of texture
  32.     memory.  What about other properties of a texture?
  33.  
  34.     No.
  35.  
  36. Reasoning
  37.  
  38.     *    Previous proposals overloaded the <target> parameter of many
  39.     Tex commands with texture names, as well as the original enumerated
  40.     values.  This proposal eliminated such overloading, choosing
  41.     instead to require an application to bind a texture, and then
  42.     operate on in through the binding reference.  If this constraint
  43.     ultimately proves to be unacceptable, we can always extend the
  44.     extension with additional binding points for editing and querying
  45.     only, but if we expect to do this, we might choose to bite the
  46.     bullet and overload the <target> parameters now.
  47.  
  48.     *    Commands to directly set the priority of a texture and to query
  49.     the resident status of a texture are included.  I feel that binding
  50.     a texture would be an unacceptable burden for these management
  51.     operations.  These commands also allow queries and operations on
  52.     lists of textures, which should improve efficiency.
  53.  
  54.     *    GenTexturesEXT does not return a success/failure boolean because
  55.     it should never fail in practice.
  56.  
  57. New Procedures and Functions
  58.  
  59.     void GenTexturesEXT(sizei n,
  60.             uint* textures);
  61.  
  62.     void DeleteTexturesEXT(sizei n,
  63.                const uint* textures);
  64.  
  65.     void BindTextureEXT(enum target,
  66.             uint texture);
  67.  
  68.     void PrioritizeTexturesEXT(sizei n,
  69.                    const uint* textures,
  70.                    const clampf* priorities);
  71.  
  72.     boolean AreTexturesResidentEXT(sizei n,
  73.                    const uint* textures,
  74.                    boolean* residences);
  75.  
  76.     boolean IsTextureEXT(uint texture);
  77.  
  78. New Tokens
  79.  
  80.     Accepted by the <pname> parameters of TexParameteri, TexParameterf,
  81.     TexParameteriv, TexParameterfv, GetTexParameteriv, and GetTexParameterfv:
  82.  
  83.     TEXTURE_PRIORITY_EXT        0x8066
  84.  
  85.     Accepted by the <pname> parameters of GetTexParameteriv and
  86.     GetTexParameterfv:
  87.  
  88.     TEXTURE_RESIDENT_EXT        0x8067
  89.  
  90.     Accepted by the <pname> parameters of GetBooleanv, GetIntegerv,
  91.     GetFloatv, and GetDoublev:
  92.  
  93.     TEXTURE_1D_BINDING_EXT        0x8068
  94.     TEXTURE_2D_BINDING_EXT        0x8069
  95.     TEXTURE_3D_BINDING_EXT        0x806A
  96.  
  97. Additions to Chapter 2 of the 1.0 Specification (OpenGL Operation)
  98.  
  99.     None
  100.  
  101. Additions to Chapter 3 of the 1.0 Specification (Rasterization)
  102.  
  103.     Add the following discussion to section 3.8 (Texturing).  In addition
  104.     to the default textures TEXTURE_1D, TEXTURE_2D, and TEXTURE_3D_EXT, it
  105.     is possible to create named 1, 2, and 3-dimensional textures.  The name
  106.     space for textures is the unsigned integers, with zero reserved by
  107.     the GL.
  108.     
  109.     A texture is created by simply binding a previously unused texture name
  110.     to TEXTURE_1D, TEXTURE_2D, or TEXTURE_3D_EXT.  This binding is
  111.     accomplished by calling BindTextureEXT with <target> set to TEXTURE_1D,
  112.     TEXTURE_2D, or TEXTURE_3D_EXT, and <texture> set to the name of the new
  113.     texture.  When a texture is bound to a target, the previous binding for
  114.     that target is automatically broken.
  115.     
  116.     When a texture is first bound it takes the dimensionality of its target.
  117.     Thus, a texture first bound to TEXTURE_1D is 1-dimensional; a texture
  118.     first bound to TEXTURE_2D is 2-dimensional, and a texture first bound to
  119.     TEXTURE_3D_EXT is 3-dimensional.  The state of a 1-dimensional texture
  120.     immediately after it is first bound is equivalent to the state of the
  121.     default TEXTURE_1D at GL initialization.  Likewise, the state of a
  122.     2-dimensional or 3-dimensional texture immediately after it is first
  123.     bound is equivalent to the state of the default TEXTURE_2D or
  124.     TEXTURE_3D_EXT at GL initialization.  Subsequent bindings of a texture
  125.     have no effect on its state.  The error INVALID_OPERATION is generated
  126.     if an attempt is made to bind a texture to a target of different
  127.     dimensionality.
  128.  
  129.     While a texture is bound, GL operations on the target to which it is
  130.     bound affect the bound texture, and queries of the target to which it
  131.     is bound return state from the bound texture.  If texture mapping of
  132.     the dimensionality of the target to which a texture is bound is
  133.     active, the bound texture is used.
  134.     
  135.     By default when an OpenGL context is created, TEXTURE_1D, TEXTURE_2D,
  136.     and TEXTURE_3D_EXT have 1, 2, and 3-dimensional textures associated
  137.     with them.  In order that access to these default textures not be
  138.     lost, this extension treats them as though their names were all zero.
  139.     Thus the default 1-dimensional texture is operated on, queried, and
  140.     applied as TEXTURE_1D while zero is bound to TEXTURE_1D.  Likewise,
  141.     the default 2-dimensional texture is operated on, queried, and applied
  142.     as TEXTURE_2D while zero is bound to TEXTURE_2D, and the default
  143.     3-dimensional texture is operated on, queried, and applied as
  144.     TEXTURE_3D_EXT while zero is bound to TEXTURE_3D_EXT.
  145.  
  146.     Named textures are deleted by calling DeleteTexturesEXT with <textures>
  147.     pointing to a list of <n> texture names to be deleted.  After a texture
  148.     is deleted, it has no contents or dimensionality, and its name is freed.
  149.     If a texture that is currently bound is deleted, the binding reverts to
  150.     zero.  DeleteTexturesEXT ignores names that do not correspond to
  151.     textures, including zero.
  152.  
  153.     GenTexturesEXT returns <n> texture names in <textures>.  These names
  154.     are chosen in an unspecified manner, the only condition being that
  155.     only names that were not in use immediately prior to the call to
  156.     GenTexturesEXT are considered.  The dimensionality of textures created by
  157.     GenTexturesEXT is indeterminate; such textures assume a dimensionality
  158.     only when they are first bound.  Textures created by GenTexturesEXT
  159.     are 'used', however, in the sense that they will not be returned by
  160.     subsequent calls to GenTexturesEXT until they are deleted.
  161.  
  162.     An implementation may choose to establish a "working set" of textures
  163.     on which binding operations are performed with higher performance.  A
  164.     texture that is currently being treated as a part of the working set is
  165.     said to be resident.  AreTexturesResidentEXT returns TRUE if all of the
  166.     <n> textures named in <textures> are resident, FALSE otherwise.  If
  167.     FALSE is returned, the residence of each texture is returned in
  168.     <residences>.  Otherwise the contents of the <residences> array are not
  169.     changed.  If any of the names in <textures> is not the name of a
  170.     texture, FALSE is returned, the error INVALID_VALUE is generated, and
  171.     the contents of <residences> are indeterminate.  The resident status of
  172.     a single bound texture can also be queried by calling GetTexParameteriv
  173.     or GetTexParameterfv with <target> set to the target to which the
  174.     texture is bound, and <pname> set to TEXTURE_RESIDENT_EXT.  This is the
  175.     only way that the resident status of a default texture can be queried.
  176.  
  177.     Applications guide the OpenGL implementation in determining which
  178.     textures should be resident by specifying a priority for each texture.
  179.     PrioritizeTexturesEXT sets the priorities of the <n> textures in
  180.     <textures> to the values in <priorities>.  Each priority value is
  181.     clamped to the range [0.0, 1.0] before it is assigned.  Zero indicates
  182.     the lowest priority, and hence the least likelihood of being resident.
  183.     One indicates the highest priority, and hence the greatest likelihood
  184.     of being resident.  The priority of a single bound texture can also be
  185.     changed by calling TexParameteri, TexParameterf, TexParameteriv, or
  186.     TexParameterfv with <target> set to the target to which the texture is
  187.     bound, <pname> set to TEXTURE_PRIORITY_EXT, and <param> or <params>
  188.     specifying the new priority value (which is clamped to [0.0,1.0] before
  189.     being assigned).  This is the only way that the priority of a default
  190.     texture can be specified.  (PrioritizeTexturesEXT silently ignores
  191.     attempts to prioritize nontextures, and texture zero.)
  192.  
  193. Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations
  194. and the Frame Buffer)
  195.  
  196.     None
  197.  
  198. Additions to Chapter 5 of the 1.0 Specification (Special Functions)
  199.  
  200.     BindTextureEXT and PrioritizeTexturesEXT are included in display lists.
  201.     All other commands defined by this extension are not included in display
  202.     lists.
  203.  
  204. Additions to Chapter 6 of the 1.0 Specification (State and State Requests)
  205.  
  206.     IsTextureEXT returns TRUE if <texture> is the name of a valid texture.
  207.     If <texture> is zero, or is a non-zero value that is not the name of
  208.     a texture, or if an error condition occurs, IsTextureEXT returns FALSE.
  209.  
  210.     Because the query values of TEXTURE_1D, TEXTURE_2D, and TEXTURE_3D_EXT
  211.     are already defined as booleans indicating whether these textures are
  212.     enabled or disabled, another mechanism is required to query the
  213.     binding associated with each of these texture targets.  The name
  214.     of the texture currently bound to TEXTURE_1D is returned in <params>
  215.     when GetIntegerv is called with <pname> set to TEXTURE_1D_BINDING_EXT.
  216.     If no texture is currently bound to TEXTURE_1D, zero is returned.
  217.     Likewise, the name of the texture bound to TEXTURE_2D or TEXTURE_3D_EXT
  218.     is returned in <params> when GetIntegerv is called with <pname> set to
  219.     TEXTURE_2D_BINDING_EXT or TEXTURE_3D_BINDING_EXT.  If no texture is
  220.     currently bound to TEXTURE_2D or to TEXTURE_3D_EXT, zero is returned.
  221.  
  222.     A texture object comprises the image arrays, priority, border color,
  223.     filter modes, and wrap modes that are associated with that object.  More
  224.     explicitly, the state list
  225.     
  226.     TEXTURE,
  227.     TEXTURE_PRIORITY_EXT
  228.     TEXTURE_RED_SIZE,
  229.     TEXTURE_GREEN_SIZE,
  230.     TEXTURE_BLUE_SIZE,
  231.     TEXTURE_ALPHA_SIZE,
  232.     TEXTURE_LUMINANCE_SIZE,
  233.     TEXTURE_INTENSITY_SIZE,
  234.     TEXTURE_WIDTH,
  235.     TEXTURE_HEIGHT,
  236.     TEXTURE_DEPTH_EXT,
  237.     TEXTURE_BORDER,
  238.     TEXTURE_COMPONENTS,
  239.     TEXTURE_BORDER_COLOR,
  240.     TEXTURE_MIN_FILTER,
  241.     TEXTURE_MAG_FILTER,
  242.     TEXTURE_WRAP_S,
  243.     TEXTURE_WRAP_T,
  244.     TEXTURE_WRAP_R_EXT
  245.  
  246.     composes a single texture object.
  247.  
  248.     When PushAttrib is called with TEXTURE_BIT enabled, the priorities,
  249.     border colors, filter modes, and wrap modes of the currently bound
  250.     textures are pushed, as well as the current texture bindings and
  251.     enables.  When an attribute set that includes texture information is
  252.     popped, the bindings and enables are first restored to their pushed
  253.     values, then the bound textures have their priorities, border colors,
  254.     filter modes, and wrap modes restored to their pushed values.
  255.  
  256. Additions to the GLX Specification
  257.  
  258.     Texture objects are shared between GLX rendering contexts if and only
  259.     if the rendering contexts share display lists.  No change is made to
  260.     the GLX API.
  261.  
  262. GLX Protocol
  263.  
  264.     Six new GL commands are added.
  265.   
  266.     The following rendering command is sent to the server as part of a glXRender
  267.     request:
  268.  
  269.         BindTextureEXT
  270.             2           12              rendering command length
  271.             2           4117            rendering command opcode
  272.             4           ENUM            target
  273.             4           CARD32          texture 
  274.  
  275.     The following rendering command can be sent to the server as part of a glXRender
  276.     request or as part of a glXRenderLarge request:
  277.  
  278.     PrioritizeTexturesEXT
  279.         2           8+(n*8)         rendering command length
  280.             2           4118            rendering command opcode
  281.             4           INT32           n
  282.             n*4         LISTofCARD32    textures
  283.             n*4         LISTofFLOAT32   priorities
  284.  
  285.         If the command is encoded in a glXRenderLarge request, the command
  286.             opcode and command length fields above are expanded to 4 bytes each:
  287.  
  288.             4           12+(n*8)        rendering command length
  289.             4           4118            rendering command opcode
  290.  
  291.     The remaining commands are non-rendering commands. These commands are sent 
  292.     separately (i.e., not as part of a glXRender or glXRenderLarge request), using 
  293.     either the glXVendorPrivate request or the glXVendorPrivateWithReply request: 
  294.  
  295.         DeleteTexturesEXT
  296.         1        CARD8        opcode (X assigned)
  297.         1         16        GLX opcode (glXVendorPrivate)
  298.         2            4+n        request length
  299.         4        12              vendor specific opcode
  300.         4           GLX_CONTEXT_TAG context tag
  301.         4        INT32        n
  302.         n*4        CARD32        textures
  303.  
  304.         GenTexturesEXT
  305.         1        CARD8        opcode (X assigned)
  306.         1         17        GLX opcode (glXVendorPrivateWithReply)
  307.         2            4        request length
  308.         4        13              vendor specific opcode
  309.         4           GLX_CONTEXT_TAG context tag
  310.         4        INT32        n
  311.       =>
  312.         1           1               reply
  313.             1                           unused
  314.             2        CARD16        sequence number
  315.             4        n               reply length
  316.             24                unused
  317.             4*n         LISTofCARD32    textures
  318.  
  319.         AreTexturesResidentEXT
  320.         1        CARD8        opcode (X assigned)
  321.         1         17        GLX opcode (glXVendorPrivateWithReply)
  322.         2            4+n        request length
  323.         4        11              vendor specific opcode
  324.         4           GLX_CONTEXT_TAG context tag
  325.         4        INT32        n
  326.         4*n        LISTofCARD32    textures
  327.       =>
  328.         1           1               reply
  329.             1                           unused
  330.             2        CARD16        sequence number
  331.             4        (n+p)/4     reply length
  332.             4           CARD32          return_value 
  333.             20                unused
  334.             n           LISTofBYTE      residences
  335.             p                   unused, p=pad(n)
  336.  
  337.         IsTextureEXT
  338.         1        CARD8        opcode (X assigned)
  339.         1         17        GLX opcode (glXVendorPrivateWithReply)
  340.         2            4        request length
  341.         4        14              vendor specific opcode
  342.         4           GLX_CONTEXT_TAG context tag
  343.         4        CARD32        textures
  344.       =>
  345.         1           1               reply
  346.             1                           unused
  347.             2        CARD16        sequence number
  348.             4        0         reply length
  349.             4           CARD32          return_value 
  350.             20                unused
  351.  
  352. Dependencies on EXT_texture3D
  353.  
  354.     If EXT_texture3D is not supported, then all references to 3D textures
  355.     in this specification are invalid.
  356.  
  357. Errors
  358.  
  359.     INVALID_VALUE is generated if GenTexturesEXT parameter <n> is negative.
  360.  
  361.     INVALID_VALUE is generated if DeleteTexturesEXT parameter <n> is
  362.     negative.
  363.  
  364.     INVALID_ENUM is generated if BindTextureEXT parameter <target> is not
  365.     TEXTURE_1D, TEXTURE_2D, or TEXTURE_3D_EXT.
  366.  
  367.     INVALID_OPERATION is generated if BindTextureEXT parameter <target> is
  368.     TEXTURE_1D, and parameter <texture> is not the name of a 1-dimensional
  369.     texture, the name of an as yet unbound texture, or zero.
  370.  
  371.     INVALID_OPERATION is generated if BindTextureEXT parameter <target> is
  372.     TEXTURE_2D, and parameter <texture> is not the name of a 2-dimensional
  373.     texture, the name of an as yet unbound texture, or zero.
  374.  
  375.     INVALID_OPERATION is generated if BindTextureEXT parameter <target> is
  376.     TEXTURE_3D_EXT, and parameter <texture> is not the name of a
  377.     3-dimensional texture, the name of an as yet unbound texture, or zero.
  378.  
  379.     INVALID_VALUE is generated if PrioritizeTexturesEXT parameter <n>
  380.     negative. 
  381.  
  382.     INVALID_VALUE is generated if AreTexturesResidentEXT parameter <n>
  383.     is negative.
  384.  
  385.     INVALID_VALUE is generated by AreTexturesResidentEXT if any of the
  386.     names in <textures> is zero, or is not the name of a texture.
  387.  
  388.     INVALID_OPERATION is generated if any of the commands defined in this
  389.     extension is executed between the execution of Begin and the
  390.     corresponding execution of End.
  391.  
  392. New State
  393.  
  394.  
  395.     Get Value                Get Command        Type            Initial Value        Attribute
  396.     ---------                -----------        ----            -------------        ---------
  397.     TEXTURE_1D                IsEnabled        B            FALSE            texture/enable
  398.     TEXTURE_2D                IsEnabled        B            FALSE            texture/enable
  399.     TEXTURE_3D_EXT            IsEnabled        B            FALSE            texture/enable
  400.     TEXTURE_1D_BINDING_EXT        GetIntegerv        Z+            0            texture
  401.     TEXTURE_2D_BINDING_EXT        GetIntegerv        Z+            0            texture
  402.     TEXTURE_3D_BINDING_EXT        GetIntegerv        Z+            0            texture
  403.     TEXTURE_PRIORITY_EXT        GetTexParameterfv    n x Z+            1            texture
  404.     TEXTURE_RESIDENT_EXT        AreTexturesResidentEXT    n x B            unknown               -
  405.  
  406.     TEXTURE                GetTexImage        n x levels x I        null               -
  407.     TEXTURE_RED_SIZE_EXT        GetTexLevelParameteriv    n x levels x Z+        0               -
  408.     TEXTURE_GREEN_SIZE_EXT        GetTexLevelParameteriv    n x levels x Z+        0               -
  409.     TEXTURE_BLUE_SIZE_EXT        GetTexLevelParameteriv    n x levels x Z+        0               -
  410.     TEXTURE_ALPHA_SIZE_EXT        GetTexLevelParameteriv    n x levels x Z+        0               -
  411.     TEXTURE_LUMINANCE_SIZE_EXT        GetTexLevelParameteriv    n x levels x Z+        0               -
  412.     TEXTURE_INTENSITY_SIZE_EXT        GetTexLevelParameteriv    n x levels x Z+        0               -
  413.     TEXTURE_WIDTH            GetTexLevelParameteriv    n x levels x Z+        0               -
  414.     TEXTURE_HEIGHT            GetTexLevelParameteriv    n x levels x Z+        0               -
  415.     TEXTURE_DEPTH_EXT            GetTexLevelParameteriv    n x levels x Z+        0               -
  416.     TEXTURE_4DSIZE_SGIS            GetTexLevelParameteriv    n x levels x Z+        0               -
  417.     TEXTURE_BORDER            GetTexLevelParameteriv    n x levels x Z+        0               -
  418.     TEXTURE_COMPONENTS (1D and 2D)    GetTexLevelParameteriv    n x levels x Z42    1               -
  419.     TEXTURE_COMPONENTS (3D and 4D)    GetTexLevelParameteriv    n x levels x Z38    LUMINANCE           -
  420.     TEXTURE_BORDER_COLOR        GetTexParameteriv    n x C            0, 0, 0, 0        texture
  421.     TEXTURE_MIN_FILTER            GetTexParameteriv    n x Z7            NEAREST_MIPMAP_LINEAR    texture
  422.     TEXTURE_MAG_FILTER            GetTexParameteriv    n x Z3            LINEAR            texture
  423.     TEXTURE_WRAP_S            GetTexParameteriv    n x Z2            REPEAT            texture
  424.     TEXTURE_WRAP_T            GetTexParameteriv    n x Z2            REPEAT            texture
  425.     TEXTURE_WRAP_R_EXT            GetTexParameteriv    n x Z2            REPEAT            texture
  426.     TEXTURE_WRAP_Q_SGIS            GetTexParameteriv    n x Z2            REPEAT            texture
  427.  
  428. New Implementation Dependent State
  429.  
  430.     None
  431.