<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">
<html
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:mml="http://www.w3.org/1998/Math/MathML"
><head><title>glCopyTexSubImage3D</title><link rel="stylesheet" href="style.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.59.1"/><link rel="home" href="index.xml" title="PyOpenGL 2.0.1.09 Man Pages"/><link rel="up" href="reference-GL.xml" title="GL"/><link rel="previous" href="glCopyTexSubImage2D.3G.xml" title="glCopyTexSubImage2D"/><link rel="next" href="glCullFace.3G.xml" title="glCullFace"/></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">glCopyTexSubImage3D</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="glCopyTexSubImage2D.3G.xml">Prev</a> </td><th width="60%" align="center">GL</th><td width="20%" align="right"> <a accesskey="n" href="glCullFace.3G.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="glCopyTexSubImage3D.3G"/><div class="titlepage"/><div class="refnamediv"><a name="glCopyTexSubImage3D.3G-name"/><h2>Name</h2><p>glCopyTexSubImage3D &#8212; copy a three-dimensional texture subimage</p></div><div class="refsynopsisdiv"><a name="glCopyTexSubImage3D.3G-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>void <tt>glCopyTexSubImage3D</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLenum <i><tt>target</tt></i>, GLint <i><tt>level</tt></i>, GLint <i><tt>xoffset</tt></i>, GLint <i><tt>yoffset</tt></i>, GLint <i><tt>zoffset</tt></i>, GLint <i><tt>x</tt></i>, GLint <i><tt>y</tt></i>, GLsizei <i><tt>width</tt></i>, GLsizei <i><tt>height</tt></i>);</code></td></tr></table></div><div class="refsynopsisdiv"><a name="glCopyTexSubImage3D.3G-python_spec"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code><tt>glCopyTexSubImage3D</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>target</tt></i>, <i><tt>level</tt></i>, <i><tt>xoffset</tt></i>, <i><tt>yoffset</tt></i>, <i><tt>zoffset</tt></i>, <i><tt>x</tt></i>, <i><tt>y</tt></i>, <i><tt>width</tt></i>, <i><tt>height</tt></i>) &#8594; <tt>None</tt></code></td></tr></table></div><div class="refsect1" lang="en"><a name="glCopyTexSubImage3D.3G-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><i><tt>target</tt></i></span></dt><dd>
						Specifies the target texture. Must be <tt>GL_TEXTURE_3D</tt>
					</dd><dt><span class="term"><i><tt>level</tt></i></span></dt><dd>
						Specifies the level-of-detail number. Level 0 is the base image level. Level <i><tt>n</tt></i> is
						the <i><tt>n</tt></i>th mipmap reduction image.
					</dd><dt><span class="term"><i><tt>xoffset</tt></i></span></dt><dd>
						Specifies a texel offset in the x direction within the texture array.
					</dd><dt><span class="term"><i><tt>yoffset</tt></i></span></dt><dd>
						Specifies a texel offset in the y direction within the texture array.
					</dd><dt><span class="term"><i><tt>zoffset</tt></i></span></dt><dd>
						Specifies a texel offset in the z direction within the texture array.
					</dd><dt><span class="term"><i><tt>x</tt></i>, <i><tt>y</tt></i></span></dt><dd>
						Specify the window coordinates of the lower left corner of the rectangular region of pixels to be copied.
					</dd><dt><span class="term"><i><tt>width</tt></i></span></dt><dd>
						Specifies the width of the texture subimage.
					</dd><dt><span class="term"><i><tt>height</tt></i></span></dt><dd>
						Specifies the height of the texture subimage.
					</dd></dl></div></div><div class="refsect1" lang="en"><a name="glCopyTexSubImage3D.3G-description"/><h2>Description</h2><p>
			<tt>glCopyTexSubImage3D</tt> replaces a rectangular portion of a three-dimensional texture image with
			pixels from the current <tt>GL_READ_BUFFER</tt> (rather than from main memory, as is the case for <a href="glTexSubImage3D.3G.xml"><tt>glTexSubImage3D</tt></a>).
		</p><p>
			The screen-aligned pixel rectangle with lower left corner at (<i><tt>x</tt></i>,<i><tt>y</tt></i>) and
			with width <i><tt>width</tt></i> and height <i><tt>height</tt></i> replaces the portion of the texture
			array with x indices <i><tt>xoffset</tt></i> through <i><tt>xoffset</tt></i><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:mo>+</mml:mo>
					</mml:mrow>
				</mml:math><i><tt>width</tt></i><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:mo>-</mml:mo>
					</mml:mrow>
				</mml:math>1, inclusive, and y indices <i><tt>yoffset</tt></i> through
			<i><tt>yoffset</tt></i><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:mo>+</mml:mo>
					</mml:mrow>
				</mml:math><i><tt>height</tt></i><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:mo>-</mml:mo>
					</mml:mrow>
				</mml:math>1, inclusive, at z index <i><tt>zoffset</tt></i> and at the mipmap level specified by
			<i><tt>level</tt></i>.
		</p><p>
			The pixels in the rectangle are processed exactly as if <a href="glCopyPixels.3G.xml"><tt>glCopyPixels</tt></a> had been
			called, but the process stops just before final conversion. At this point, all pixel component values are clamped to
			the range [0,1] and then converted to the texture's internal for storage in the texel array.
		</p><p>
			The destination rectangle in the texture array may not include any texels outside the texture array as it was
			originally specified. It is not an error to specify a subtexture with zero width or height, but such a specification
			has no effect.
		</p><p>
			If any of the pixels within the specified rectangle of the current <tt>GL_READ_BUFFER</tt> are outside the
			read window associated with the current rendering context, then the values obtained for those pixels are undefined.
		</p><p>
			No change is made to the <i><tt>internalformat</tt></i>, <i><tt>width</tt></i>,
			<i><tt>height</tt></i>, <i><tt>depth</tt></i>, or <i><tt>border</tt></i> parameters of the
			specified texture array or to texel values outside the specified subregion.
		</p></div><div class="refsect1" lang="en"><a name="glCopyTexSubImage3D.3G-notes"/><h2>Notes</h2><p>
			<tt>glCopyTexSubImage3D</tt> is available only if the GL version is 1.2 or greater.
		</p><p>
			Texturing has no effect in color index mode.
		</p><p>
			<tt>glPixelStore</tt> and <tt>glPixelTransfer</tt>
			modes affect texture images in exactly the way they affect <a href="glDrawPixels.3G.xml"><tt>glDrawPixels</tt></a>.
		</p><p>
			When the <tt>GL_ARB_imaging</tt> extension is supported, the RGBA components copied from the framebuffer
			may be processed by the imaging pipeline, as if they were a two-dimensional texture. See <a href="glTexImage2D.3G.xml"><tt>glTexImage2D</tt></a> for specific details.
		</p></div><div class="refsect1" lang="en"><a name="glCopyTexSubImage3D.3G-errors"/><h2>Errors</h2><p>
			<tt>GL_INVALID_ENUM</tt> is generated if <i><tt>target</tt></i> is not
			<tt>GL_TEXTURE_3D</tt>.
		</p><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if the texture array has not been defined by a previous
			<a href="glTexImage3D.3G.xml"><tt>glTexImage3D</tt></a> or <tt>glCopyTexImage3D</tt>
			operation.
		</p><p>
			<tt>GL_INVALID_VALUE</tt> is generated if <i><tt>level</tt></i> is less than 0.
		</p><p>
			<tt>GL_INVALID_VALUE</tt> may be generated if <i><tt>level</tt></i> is greater than <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:msub>
							<mml:mi>log</mml:mi>
							<mml:mn>2</mml:mn>
						</mml:msub>
						<mml:mi>max</mml:mi>
					</mml:mrow>
				</mml:math>, where <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>max</mml:mi>
				</mml:math> is the returned value of <tt>GL_MAX_3D_TEXTURE_SIZE</tt>.
		</p><p>
			<tt>GL_INVALID_VALUE</tt> is generated if <i><tt>x</tt></i><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:mo>&lt;</mml:mo>
						<mml:mo>-b</mml:mo>
					</mml:mrow>
				</mml:math> or if <i><tt>y</tt></i><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:mo>&lt;</mml:mo>
						<mml:mo>-b</mml:mo>
					</mml:mrow>
				</mml:math>, where <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>b</mml:mi>
				</mml:math> is the border width of the texture array.
		</p><p>
			<tt>GL_INVALID_VALUE</tt> is generated if <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:mi>xoffset</mml:mi>
						<mml:mo>&lt;</mml:mo>
						<mml:mo>-b</mml:mo>
					</mml:mrow>
				</mml:math>, (<i><tt>xoffset</tt></i><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:mo>+</mml:mo>
					</mml:mrow>
				</mml:math><i><tt>width</tt></i>)<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:mo>&gt;</mml:mo>
						<mml:mo>(</mml:mo>
						<mml:mi>w</mml:mi>
						<mml:mo>-</mml:mo>
						<mml:mi>b</mml:mi>
						<mml:mo>)</mml:mo>
					</mml:mrow>
				</mml:math>, <i><tt>yoffset</tt></i><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:mo>&lt;</mml:mo>
						<mml:mo>-b</mml:mo>
					</mml:mrow>
				</mml:math>, (<i><tt>yoffset</tt></i><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:mo>+</mml:mo>
					</mml:mrow>
				</mml:math><i><tt>height</tt></i>)<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:mo>&gt;</mml:mo>
						<mml:mo>(</mml:mo>
						<mml:mi>h</mml:mi>
						<mml:mo>-</mml:mo>
						<mml:mi>b</mml:mi>
						<mml:mo>)</mml:mo>
					</mml:mrow>
				</mml:math>, <i><tt>zoffset</tt></i><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:mo>&lt;</mml:mo>
						<mml:mo>-b</mml:mo>
					</mml:mrow>
				</mml:math>, or <i><tt>zoffset</tt></i><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:mo>&gt;</mml:mo>
						<mml:mo>(</mml:mo>
						<mml:mi>d</mml:mi>
						<mml:mo>-</mml:mo>
						<mml:mi>b</mml:mi>
						<mml:mo>)</mml:mo>
					</mml:mrow>
				</mml:math>, where <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>w</mml:mi>
				</mml:math> is the <tt>GL_TEXTURE_WIDTH</tt>, <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>h</mml:mi>
				</mml:math> is the <tt>GL_TEXTURE_HEIGHT</tt>, <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>d</mml:mi>
				</mml:math> is the <tt>GL_TEXTURE_DEPTH</tt>, and <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>b</mml:mi>
				</mml:math> is the <tt>GL_TEXTURE_BORDER</tt> of the texture image being modified. Note that
			<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>w</mml:mi>
				</mml:math>, <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>h</mml:mi>
				</mml:math>, and <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>d</mml:mi>
				</mml:math> include twice the border width.
		</p><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if <tt>glCopyTexSubImage3D</tt> is executed between
			the execution of <a href="glBegin.3G.xml"><tt>glBegin</tt></a> and the corresponding execution of <a href="glBegin.3G.xml"><tt>glEnd</tt></a>.
		</p></div><div class="refsect1" lang="en"><a name="glCopyTexSubImage3D.3G-associated_gets"/><h2>Associated Gets</h2><p>
			<a href="glGetTexImage.3G.xml"><tt>glGetTexImage</tt></a>
		</p><p>
			<a href="glIsEnabled.3G.xml"><tt>glIsEnabled</tt></a> with argument <tt>GL_TEXTURE_3D</tt>
		</p></div><div class="refsect1" lang="en"><a name="glCopyTexSubImage3D.3G-see_also"/><h2>See Also</h2><p>
			<span class="simplelist"><a href="glCopyPixels.3G.xml">glCopyPixels</a>, <a href="glCopyTexImage1D.3G.xml">glCopyTexImage1D</a>, <a href="glCopyTexImage2D.3G.xml">glCopyTexImage2D</a>, <a href="glCopyTexSubImage1D.3G.xml">glCopyTexSubImage1D</a>, <a href="glCopyTexSubImage2D.3G.xml">glCopyTexSubImage2D</a>, <a href="glPixelStore.3G.xml">glPixelStore</a>, <a href="glPixelTransfer.3G.xml">glPixelTransfer</a>, <a href="glReadBuffer.3G.xml">glReadBuffer</a>, <a href="glTexEnv.3G.xml">glTexEnv</a>, <a href="glTexGen.3G.xml">glTexGen</a>, <a href="glTexImage1D.3G.xml">glTexImage1D</a>, <a href="glTexImage2D.3G.xml">glTexImage2D</a>, <a href="glTexImage3D.3G.xml">glTexImage3D</a>, <a href="glTexParameter.3G.xml">glTexParameter</a>, <a href="glTexSubImage1D.3G.xml">glTexSubImage1D</a>, <a href="glTexSubImage2D.3G.xml">glTexSubImage2D</a>, <a href="glTexSubImage3D.3G.xml">glTexSubImage3D</a></span>
		</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="glCopyTexSubImage2D.3G.xml">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-GL.xml">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="glCullFace.3G.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">glCopyTexSubImage2D </td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top"> glCullFace</td></tr></table></div></body></html>