From Art Tevs,

"A new texture class Texture2DArray derived from
Texture extends the osg to support the new
EXT_texture_array extensions. Texture arrays provides
a feature for people interesting in GPGPU programming.


Faetures and changes:

- Full support for layered 2D textures.

- New uniform types were added (sampler2DArray)

- FrameBufferObject implementation were changed to
support attaching of 2D array textures to the
framebuffer

- StateSet was slightly changed to support texture
arrays. NOTE: array textures can not be used in fixed
function pipeline. Thus using the layered texture as a
statemode for a Drawable produce invalid enumerant
OpenGL errors.

- Image class was extended to support handling of
array textures

Tests:
I have used this class as a new feature of my
application. It works for me without problems (Note:
Texture arrays were introduced only for shading
languages and not for fixed function pipelines!!!).
RTT with Texture2DArray works, as I have tested them
as texture targets for a camera with 6 layers/faces
(i.e. replacement for cube maps). I am using the array
textures in shader programming. Array textures can be
attached to the FBO and used as input and as output."
This commit is contained in:
Robert Osfield
2007-09-07 11:21:02 +00:00
parent ed6322630f
commit c7a72c8435
11 changed files with 915 additions and 7 deletions

View File

@@ -265,10 +265,14 @@ const char* Uniform::getTypename( Type t )
case FLOAT_MAT4: return "mat4";
case SAMPLER_1D: return "sampler1D";
case SAMPLER_2D: return "sampler2D";
case SAMPLER_1D_ARRAY: return "sampler1DArray";
case SAMPLER_2D_ARRAY: return "sampler2DArray";
case SAMPLER_3D: return "sampler3D";
case SAMPLER_CUBE: return "samplerCube";
case SAMPLER_1D_SHADOW: return "sampler1DShadow";
case SAMPLER_2D_SHADOW: return "sampler2DShadow";
case SAMPLER_1D_ARRAY_SHADOW: return "sampler1DArrayShadow";
case SAMPLER_2D_ARRAY_SHADOW: return "sampler2DArrayShadow";
default: return "UNDEFINED";
}
}
@@ -282,10 +286,14 @@ int Uniform::getTypeNumComponents( Type t )
case BOOL:
case SAMPLER_1D:
case SAMPLER_2D:
case SAMPLER_1D_ARRAY:
case SAMPLER_2D_ARRAY:
case SAMPLER_3D:
case SAMPLER_CUBE:
case SAMPLER_1D_SHADOW:
case SAMPLER_2D_SHADOW:
case SAMPLER_1D_ARRAY_SHADOW:
case SAMPLER_2D_ARRAY_SHADOW:
return 1;
case FLOAT_VEC2:
@@ -334,10 +342,14 @@ Uniform::Type Uniform::getTypeId( const std::string& tname )
if( tname == "mat4" ) return FLOAT_MAT4;
if( tname == "sampler1D" ) return SAMPLER_1D;
if( tname == "sampler2D" ) return SAMPLER_2D;
if( tname == "sampler1DArray" ) return SAMPLER_1D_ARRAY;
if( tname == "sampler2DArray" ) return SAMPLER_2D_ARRAY;
if( tname == "sampler3D" ) return SAMPLER_3D;
if( tname == "samplerCube" ) return SAMPLER_CUBE;
if( tname == "sampler1DShadow" ) return SAMPLER_1D_SHADOW;
if( tname == "sampler2DShadow" ) return SAMPLER_2D_SHADOW;
if( tname == "sampler1DArrayShadow" ) return SAMPLER_1D_ARRAY_SHADOW;
if( tname == "sampler2DArrayShadow" ) return SAMPLER_2D_ARRAY_SHADOW;
return UNDEFINED;
}
@@ -348,10 +360,14 @@ Uniform::Type Uniform::getGlApiType( Type t )
case BOOL:
case SAMPLER_1D:
case SAMPLER_2D:
case SAMPLER_1D_ARRAY:
case SAMPLER_2D_ARRAY:
case SAMPLER_3D:
case SAMPLER_CUBE:
case SAMPLER_1D_SHADOW:
case SAMPLER_2D_SHADOW:
case SAMPLER_1D_ARRAY_SHADOW:
case SAMPLER_2D_ARRAY_SHADOW:
return INT;
case BOOL_VEC2:
@@ -391,10 +407,14 @@ GLenum Uniform::getInternalArrayType( Type t )
case BOOL_VEC4:
case SAMPLER_1D:
case SAMPLER_2D:
case SAMPLER_1D_ARRAY:
case SAMPLER_2D_ARRAY:
case SAMPLER_3D:
case SAMPLER_CUBE:
case SAMPLER_1D_SHADOW:
case SAMPLER_2D_SHADOW:
case SAMPLER_1D_ARRAY_SHADOW:
case SAMPLER_2D_ARRAY_SHADOW:
return GL_INT;
default: