1Name
2
3    OES_texture_3D
4
5Name Strings
6
7    GL_OES_texture_3D
8
9Contributors
10
11    Benj Lipchak
12    Robert Simpson
13
14Contact
15
16    Aaftab Munshi (amunshi@apple.com)
17
18Notice
19
20    Copyright (c) 2005-2013 The Khronos Group Inc. Copyright terms at
21        http://www.khronos.org/registry/speccopyright.html
22
23IP Status
24
25    None.
26
27Status
28
29    Ratified by the Khronos BOP, July 22, 2005.
30    
31Version
32
33    Last Modifed Date: July 24, 2007
34
35Number
36
37    OpenGL ES Extension #34    
38
39Dependencies
40
41    OpenGL ES 2.0 is required.
42
43Overview
44
45    This extension adds support for 3D textures.  The OpenGL ES 2.0 texture wrap
46    modes and mip-mapping is supported for power of two 3D textures.  Mip-
47    mapping and texture wrap modes other than CLAMP_TO_EDGE are not supported 
48    for non-power of two 3D textures.
49    
50    The OES_texture_npot extension, if supported, will enable mip-mapping and 
51    other wrap modes for non-power of two 3D textures.
52
53Issues
54
55    None.
56 
57New Tokens
58
59    Accepted by the <target> parameter of TexImage3DOES, TexSubImage3DOES, 
60    CopyTexSubImage3DOES, CompressedTexImage3DOES and 
61    CompressedTexSubImage3DOES, GetTexParameteriv, and GetTexParameterfv:
62
63        TEXTURE_3D_OES              0x806F
64
65    Accepted by the <pname> parameter of TexParameteriv, TexParameterfv,
66    GetTexParameteriv, and GetTexParameterfv:
67
68        TEXTURE_WRAP_R_OES          0x8072
69
70    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, and 
71    GetFloatv:
72
73        MAX_3D_TEXTURE_SIZE_OES     0x8073
74        TEXTURE_BINDING_3D_OES      0x806A
75
76New Procedures and Functions
77
78    void TexImage3DOES(enum target, int level, enum internalFormat, 
79                       sizei width, sizei height, sizei depth, int border, 
80                       enum format, enum type, const void *pixels)
81
82    Similar to 2D textures and cubemaps,  <internalFormat> must match <format>.
83    Please refer to table 3.1 of the OpenGL ES 2.0 specification for a list of 
84    valid <format> and <type> values.  No texture borders are supported.
85
86    void TexSubImage3DOES(enum target, int level, 
87                          int xoffset, int yoffset, int zoffset, 
88                          sizei width, sizei height, sizei depth, 
89                          enum format, enum type, const void *pixels)
90
91    void CopyTexSubImage3DOES(enum target, int level, 
92                              int xoffset, int yoffset, int zoffset, 
93                              int x, int y, sizei width, sizei height)
94
95    CopyTexSubImage3DOES is supported.  The internal format parameter can be 
96    any of the base internal formats described for TexImage2D and TexImage3DOES 
97    subject to the constraint that color buffer components can be dropped during
98    the conversion to the base internal format, but new components cannot be 
99    added.  For example, an RGB color buffer can be used to create LUMINANCE or 
100    RGB textures, but not ALPHA, LUMINANCE_ALPHA, or RGBA textures.  Table 3.3 
101    of the OpenGL ES 2.0 specification summarizes the allowable framebuffer and 
102    base internal format combinations.
103
104    void CompressedTexImage3DOES(enum target, int level, enum internalformat, 
105                                 sizei width, sizei height, sizei depth, 
106                                 int border, sizei imageSize, const void *data)
107
108    void CompressedTexSubImage3DOES(enum target, int level, 
109                                    int xoffset, int yoffset, int zoffset, 
110                                    sizei width, sizei height, sizei depth, 
111                                    enum format, sizei imageSize, 
112                                    const void *data)
113
114    void FramebufferTexture3DOES(enum target, enum attachment,
115                                 enum textarget, uint texture,
116                                 int level, int zoffset);
117
118    FramebufferTexture3DOES is derived from FramebufferTexture3DEXT.  Please 
119    refer to the EXT_framebuffer_object extension specification for a detailed 
120    description of FramebufferTexture3DEXT.  The only difference is that 
121    FramebufferTexture3DOES can be used to render directly into the base level 
122    of a 3D texture image only.  The OES_fbo_render_mipmap extension removes
123    this limitation and allows rendering to any mip-level of a 3D texture.
124
125New Keywords
126
127    sampler3D
128
129Grammar changes
130
131    The token SAMPLER3D is added to the list of tokens returned from lexical 
132    analysis and the type_specifier_no_prec production.
133
134New Built-in Functions
135
136    texture3D()
137    texture3DProj()  
138    texture3DLod()
139    texture3DProjLod()
140
141New Macro Definitions
142
143    #define GL_OES_texture_3D 1
144
145Additions to Chapter 4 of the OpenGL ES Shading Language specification:
146
147    Add the following to the table of basic types in section 4.1:
148
149    Type:
150        sampler3D
151
152    Meaning:
153        a handle for accessing a 3D texture
154
155Additions to Chapter 8 of the OpenGL ES Shading Language specification:
156
157    Add the following to the table of built-in functions in section 8.7:
158
159    The built-in texture lookup functions texture3D, texture3DProj, 
160    texture3DLod, and texture3DProjLod are optional, and must be enabled by
161
162    #extension GL_OES_texture_3D : enable
163
164    before being used.  
165
166    Syntax:
167        vec4 texture3D (sampler3D sampler, vec3 coord [, float bias] )
168        vec4 texture3DProj (sampler3D sampler, vec4 coord [, float bias] )
169        vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod)
170        vec4 texture3DProjLod (sampler3D sampler, vec4 coord, float lod)
171
172    Description:
173        Use the texture coordinate coord to do a texture lookup in the 3D 
174        texture currently bound to sampler.  For the projective ("Proj") 
175        versions, the texture coordinate is divided by coord.q.
176
177Errors
178
179    None.
180
181New State
182
183Get Value                Type    Get Command        Value    Description
184---------                ----    -----------        -----    -----------
185TEXTURE_BINDING_3D_OES    Z+     GetIntegerv        0        texture object 
186                                                             bound to TEXTURE_3D
187TEXTURE_WRAP_R_OES        1xZ2   GetTexParameteriv  REPEAT   texture coord "r"
188                                                             wrap mode
189MAX_3D_TEXTURE_SIZE_OES   Z+     GetIntegerv        16       maximum 3D texture 
190                                                             image dimension
191
192Revision History
193
1947/06/2005    Aaftab Munshi    Created the extension
1956/09/2006    Aaftab Munshi    Added OES suffixes
1967/24/2007    Benj Lipchak     Merged in details of language changes, removed
197                              OES_framebuffer_object requirement (now core),
198                              reformatted to 80 columns
199