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