33#ifndef GL_TEXTURE_MAX_ANISOTROPY_EXT
34 #define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
39#ifndef GL_TEXTURE_SWIZZLE_RGBA
40 #define GL_TEXTURE_SWIZZLE_RGBA 0x8E46
43#ifndef GL_ARB_texture_compression
44 #define GL_COMPRESSED_ALPHA_ARB 0x84E9
45 #define GL_COMPRESSED_LUMINANCE_ARB 0x84EA
46 #define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
47 #define GL_COMPRESSED_INTENSITY_ARB 0x84EC
48 #define GL_COMPRESSED_RGB_ARB 0x84ED
49 #define GL_COMPRESSED_RGBA_ARB 0x84EE
50 #define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF
51 #define GL_TEXTURE_COMPRESSED_ARB 0x86A1
52 #define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
53 #define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
56#ifndef GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB
57 #define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0
60#ifndef GL_EXT_texture_compression_s3tc
61 #define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
62 #define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
63 #define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
64 #define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
67#ifndef GL_EXT_texture_compression_rgtc
68 #define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB
69 #define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC
70 #define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD
71 #define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE
74#ifndef GL_IMG_texture_compression_pvrtc
75 #define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00
76 #define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01
77 #define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02
78 #define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
81#ifndef GL_OES_compressed_ETC1_RGB8_texture
82 #define GL_ETC1_RGB8_OES 0x8D64
85#ifndef GL_ARB_INTERNAL_TEXTURE_FORMAT
86 #define GL_RGBA32F_ARB 0x8814
87 #define GL_RGB32F_ARB 0x8815
88 #define GL_ALPHA32F_ARB 0x8816
89 #define GL_INTENSITY32F_ARB 0x8817
90 #define GL_LUMINANCE32F_ARB 0x8818
91 #define GL_LUMINANCE_ALPHA32F_ARB 0x8819
92 #define GL_RGBA16F_ARB 0x881A
93 #define GL_RGB16F_ARB 0x881B
94 #define GL_ALPHA16F_ARB 0x881C
95 #define GL_INTENSITY16F_ARB 0x881D
96 #define GL_LUMINANCE16F_ARB 0x881E
97 #define GL_LUMINANCE_ALPHA16F_ARB 0x881F
101 #define GL_HALF_FLOAT 0x140B
104#ifndef GL_NV_texture_shader
105 #define GL_HILO_NV 0x86F4
106 #define GL_DSDT_NV 0x86F5
107 #define GL_DSDT_MAG_NV 0x86F6
108 #define GL_DSDT_MAG_VIB_NV 0x86F7
109 #define GL_HILO16_NV 0x86F8
110 #define GL_SIGNED_HILO_NV 0x86F9
111 #define GL_SIGNED_HILO16_NV 0x86FA
112 #define GL_SIGNED_RGBA_NV 0x86FB
113 #define GL_SIGNED_RGBA8_NV 0x86FC
114 #define GL_SIGNED_RGB_NV 0x86FE
115 #define GL_SIGNED_RGB8_NV 0x86FF
116 #define GL_SIGNED_LUMINANCE_NV 0x8701
117 #define GL_SIGNED_LUMINANCE8_NV 0x8702
118 #define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703
119 #define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704
120 #define GL_SIGNED_ALPHA_NV 0x8705
121 #define GL_SIGNED_ALPHA8_NV 0x8706
122 #define GL_SIGNED_INTENSITY_NV 0x8707
123 #define GL_SIGNED_INTENSITY8_NV 0x8708
124 #define GL_DSDT8_NV 0x8709
125 #define GL_DSDT8_MAG8_NV 0x870A
126 #define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B
127 #define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C
128 #define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
131#ifndef GL_NV_float_buffer
132 #define GL_FLOAT_R_NV 0x8880
133 #define GL_FLOAT_RG_NV 0x8881
134 #define GL_FLOAT_RGB_NV 0x8882
135 #define GL_FLOAT_RGBA_NV 0x8883
136 #define GL_FLOAT_R16_NV 0x8884
137 #define GL_FLOAT_R32_NV 0x8885
138 #define GL_FLOAT_RG16_NV 0x8886
139 #define GL_FLOAT_RG32_NV 0x8887
140 #define GL_FLOAT_RGB16_NV 0x8888
141 #define GL_FLOAT_RGB32_NV 0x8889
142 #define GL_FLOAT_RGBA16_NV 0x888A
143 #define GL_FLOAT_RGBA32_NV 0x888B
146#ifndef GL_ATI_texture_float
147 #define GL_RGBA_FLOAT32_ATI 0x8814
148 #define GL_RGB_FLOAT32_ATI 0x8815
149 #define GL_ALPHA_FLOAT32_ATI 0x8816
150 #define GL_INTENSITY_FLOAT32_ATI 0x8817
151 #define GL_LUMINANCE_FLOAT32_ATI 0x8818
152 #define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819
153 #define GL_RGBA_FLOAT16_ATI 0x881A
154 #define GL_RGB_FLOAT16_ATI 0x881B
155 #define GL_ALPHA_FLOAT16_ATI 0x881C
156 #define GL_INTENSITY_FLOAT16_ATI 0x881D
157 #define GL_LUMINANCE_FLOAT16_ATI 0x881E
158 #define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F
161#ifndef GL_MIRRORED_REPEAT_IBM
162 #define GL_MIRRORED_REPEAT_IBM 0x8370
165#ifndef GL_CLAMP_TO_EDGE
166 #define GL_CLAMP_TO_EDGE 0x812F
170 #define GL_CLAMP 0x2900
173#ifndef GL_CLAMP_TO_BORDER_ARB
174 #define GL_CLAMP_TO_BORDER_ARB 0x812D
179 #define GL_INTENSITY 0x8049
182#ifndef GL_GENERATE_MIPMAP_SGIS
183 #define GL_GENERATE_MIPMAP_SGIS 0x8191
184 #define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192
188 #define GL_TEXTURE_3D 0x806F
192#ifndef GL_TEXTURE_CUBE_MAP
193 #define GL_TEXTURE_CUBE_MAP 0x8513
194 #define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
195 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
196 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
197 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
198 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
199 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
200 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
201 #define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
202 #define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
205#ifndef GL_TEXTURE_BINDING_3D
206 #define GL_TEXTURE_BINDING_3D 0x806A
209#ifndef GL_DEPTH_TEXTURE_MODE_ARB
210 #define GL_DEPTH_TEXTURE_MODE_ARB 0x884B
213#ifndef GL_TEXTURE_COMPARE_MODE_ARB
214 #define GL_TEXTURE_COMPARE_MODE_ARB 0x884C
216#ifndef GL_TEXTURE_COMPARE_FUNC_ARB
217 #define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D
219#ifndef GL_COMPARE_R_TO_TEXTURE_ARB
220 #define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E
223#ifndef TEXTURE_COMPARE_FAIL_VALUE_ARB
224 #define TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF
227#if !defined( GL_MAX_TEXTURE_UNITS )
228 #define GL_MAX_TEXTURE_UNITS 0x84E2
231#ifndef GL_TEXTURE_DEPTH
232 #define GL_TEXTURE_DEPTH 0x8071
235#ifndef GL_TEXTURE_2D_MULTISAMPLE
236 #define GL_TEXTURE_2D_MULTISAMPLE 0x9100
240#ifndef GL_EXT_texture_integer
241 #define GL_RGBA32UI_EXT 0x8D70
242 #define GL_RGB32UI_EXT 0x8D71
243 #define GL_ALPHA32UI_EXT 0x8D72
244 #define GL_INTENSITY32UI_EXT 0x8D73
245 #define GL_LUMINANCE32UI_EXT 0x8D74
246 #define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75
248 #define GL_RGBA16UI_EXT 0x8D76
249 #define GL_RGB16UI_EXT 0x8D77
250 #define GL_ALPHA16UI_EXT 0x8D78
251 #define GL_INTENSITY16UI_EXT 0x8D79
252 #define GL_LUMINANCE16UI_EXT 0x8D7A
253 #define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B
255 #define GL_RGBA8UI_EXT 0x8D7C
256 #define GL_RGB8UI_EXT 0x8D7D
257 #define GL_ALPHA8UI_EXT 0x8D7E
258 #define GL_INTENSITY8UI_EXT 0x8D7F
259 #define GL_LUMINANCE8UI_EXT 0x8D80
260 #define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81
262 #define GL_RGBA32I_EXT 0x8D82
263 #define GL_RGB32I_EXT 0x8D83
264 #define GL_ALPHA32I_EXT 0x8D84
265 #define GL_INTENSITY32I_EXT 0x8D85
266 #define GL_LUMINANCE32I_EXT 0x8D86
267 #define GL_LUMINANCE_ALPHA32I_EXT 0x8D87
269 #define GL_RGBA16I_EXT 0x8D88
270 #define GL_RGB16I_EXT 0x8D89
271 #define GL_ALPHA16I_EXT 0x8D8A
272 #define GL_INTENSITY16I_EXT 0x8D8B
273 #define GL_LUMINANCE16I_EXT 0x8D8C
274 #define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D
276 #define GL_RGBA8I_EXT 0x8D8E
277 #define GL_RGB8I_EXT 0x8D8F
278 #define GL_ALPHA8I_EXT 0x8D90
279 #define GL_INTENSITY8I_EXT 0x8D91
280 #define GL_LUMINANCE8I_EXT 0x8D92
281 #define GL_LUMINANCE_ALPHA8I_EXT 0x8D93
283 #define GL_RED_INTEGER_EXT 0x8D94
284 #define GL_GREEN_INTEGER_EXT 0x8D95
285 #define GL_BLUE_INTEGER_EXT 0x8D96
286 #define GL_ALPHA_INTEGER_EXT 0x8D97
287 #define GL_RGB_INTEGER_EXT 0x8D98
288 #define GL_RGBA_INTEGER_EXT 0x8D99
289 #define GL_BGR_INTEGER_EXT 0x8D9A
290 #define GL_BGRA_INTEGER_EXT 0x8D9B
291 #define GL_LUMINANCE_INTEGER_EXT 0x8D9C
292 #define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D
294 #define GL_RGBA_INTEGER_MODE_EXT 0x8D9E
297#ifndef GL_VERSION_1_1
298#define GL_R3_G3_B2 0x2A10
299#define GL_RGB4 0x804F
300#define GL_RGB5 0x8050
301#define GL_RGB8 0x8051
302#define GL_RGB10 0x8052
303#define GL_RGB12 0x8053
304#define GL_RGB16 0x8054
305#define GL_RGBA2 0x8055
306#define GL_RGBA4 0x8056
307#define GL_RGB5_A1 0x8057
308#define GL_RGBA8 0x8058
309#define GL_RGB10_A2 0x8059
310#define GL_RGBA12 0x805A
311#define GL_RGBA16 0x805B
312#define GL_BGR_EXT 0x80E0
313#define GL_BGRA_EXT 0x80E1
316#ifndef GL_ARB_texture_rg
318 #define GL_RG_INTEGER 0x8228
320 #define GL_R16 0x822A
321 #define GL_RG8 0x822B
322 #define GL_RG16 0x822C
323 #define GL_R16F 0x822D
324 #define GL_R32F 0x822E
325 #define GL_RG16F 0x822F
326 #define GL_RG32F 0x8230
327 #define GL_R8I 0x8231
328 #define GL_R8UI 0x8232
329 #define GL_R16I 0x8233
330 #define GL_R16UI 0x8234
331 #define GL_R32I 0x8235
332 #define GL_R32UI 0x8236
333 #define GL_RG8I 0x8237
334 #define GL_RG8UI 0x8238
335 #define GL_RG16I 0x8239
336 #define GL_RG16UI 0x823A
337 #define GL_RG32I 0x823B
338 #define GL_RG32UI 0x823C
341#ifndef GL_ARB_shader_image_load_store
342 #define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001
343 #define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002
344 #define GL_UNIFORM_BARRIER_BIT 0x00000004
345 #define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008
346 #define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020
347 #define GL_COMMAND_BARRIER_BIT 0x00000040
348 #define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080
349 #define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100
350 #define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200
351 #define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400
352 #define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800
353 #define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000
354 #define GL_ALL_BARRIER_BITS 0xFFFFFFFF
355 #define GL_MAX_IMAGE_UNITS 0x8F38
356 #define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39
357 #define GL_IMAGE_BINDING_NAME 0x8F3A
358 #define GL_IMAGE_BINDING_LEVEL 0x8F3B
359 #define GL_IMAGE_BINDING_LAYERED 0x8F3C
360 #define GL_IMAGE_BINDING_LAYER 0x8F3D
361 #define GL_IMAGE_BINDING_ACCESS 0x8F3E
362 #define GL_IMAGE_1D 0x904C
363 #define GL_IMAGE_2D 0x904D
364 #define GL_IMAGE_3D 0x904E
365 #define GL_IMAGE_2D_RECT 0x904F
366 #define GL_IMAGE_CUBE 0x9050
367 #define GL_IMAGE_BUFFER 0x9051
368 #define GL_IMAGE_1D_ARRAY 0x9052
369 #define GL_IMAGE_2D_ARRAY 0x9053
370 #define GL_IMAGE_CUBE_MAP_ARRAY 0x9054
371 #define GL_IMAGE_2D_MULTISAMPLE 0x9055
372 #define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056
373 #define GL_INT_IMAGE_1D 0x9057
374 #define GL_INT_IMAGE_2D 0x9058
375 #define GL_INT_IMAGE_3D 0x9059
376 #define GL_INT_IMAGE_2D_RECT 0x905A
377 #define GL_INT_IMAGE_CUBE 0x905B
378 #define GL_INT_IMAGE_BUFFER 0x905C
379 #define GL_INT_IMAGE_1D_ARRAY 0x905D
380 #define GL_INT_IMAGE_2D_ARRAY 0x905E
381 #define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F
382 #define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060
383 #define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061
384 #define GL_UNSIGNED_INT_IMAGE_1D 0x9062
385 #define GL_UNSIGNED_INT_IMAGE_2D 0x9063
386 #define GL_UNSIGNED_INT_IMAGE_3D 0x9064
387 #define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065
388 #define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066
389 #define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067
390 #define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068
391 #define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069
392 #define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A
393 #define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B
394 #define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C
395 #define GL_MAX_IMAGE_SAMPLES 0x906D
396 #define GL_IMAGE_BINDING_FORMAT 0x906E
397 #define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7
398 #define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8
399 #define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9
400 #define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA
401 #define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB
402 #define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC
403 #define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD
404 #define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE
405 #define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF
414class TextureObjectSet;
415class TextureObjectManager;
435 virtual const char*
className()
const {
return "Texture"; }
449 #ifdef OSG_GL_FIXED_FUNCTION_AVAILABLE
661 virtual bool isDirty(
unsigned int )
const {
return false; }
788 static void getCompressedSize(GLenum internalFormat, GLint width, GLint height, GLint depth, GLint& blockSize, GLint& size);
905 GLint numMipmapLevels,
906 GLenum internalFormat,
921 #define LESSTHAN(A,B) if (A<B) return true; if (B<A) return false;
922 #define FINALLESSTHAN(A,B) return (A<B);
947 inline void set(GLint numMipmapLevels,
948 GLenum internalFormat,
964 GLint numMipmapLevels,
965 GLenum internalFormat,
1021 GLint numMipmapLevels,
1022 GLenum internalFormat,
1028 _profile(
target,numMipmapLevels,internalFormat,width,height,depth,border),
1038 GLint numMipmapLevels,
1039 GLenum internalFormat,
1046 _profile.match(
target,numMipmapLevels,internalFormat,width,height,depth,border);
1052 inline GLenum
id()
const {
return _id; }
1066 GLenum internalFormat,
1100 unsigned int contextID,
1102 GLint numMipmapLevels,
1103 GLenum internalFormat,
1113 GLint numMipmapLevels,
1114 GLenum internalFormat,
1118 GLint border)
const;
1209 GLint numMipmapLevels,
1210 GLenum internalFormat,
1244 typedef std::map< Texture::TextureProfile, osg::ref_ptr<TextureObjectSet> >
TextureSetMap;
#define GL_CLAMP
Definition Texture:170
#define GL_INTENSITY
Definition Texture:179
#define GL_CLAMP_TO_BORDER_ARB
Definition Texture:174
#define GL_MIRRORED_REPEAT_IBM
Definition Texture:162
#define LESSTHAN(A, B)
Definition Texture:921
#define FINALLESSTHAN(A, B)
Definition Texture:922
#define GL_CLAMP_TO_EDGE
Definition Texture:166
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
Implements a simple buffered value for values that need to be buffered on a per graphics context basi...
Definition buffered_value:27
Definition buffered_value:79
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Class which encapsulates the frame number, reference time and calendar time of specific frame,...
Definition FrameStamp:35
GraphicsObjectManager(const std::string &name, unsigned int contextID)
Base class for providing Windowing API agnostic access to creating and managing graphics context.
Definition GraphicsContext:30
Image class for encapsulating the storage texture image data.
Definition Image:179
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
T * get() const
Definition ref_ptr:117
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
unsigned int getMaxTexturePoolSize() const
Definition State:898
Base class for state attributes.
Definition StateAttribute:77
Type
Type identifier to differentiate between different state types.
Definition StateAttribute:124
@ TEXTURE
Definition StateAttribute:125
virtual bool getModeUsage(ModeUsage &) const
Return the modes associated with this StateAttribute.
Definition StateAttribute:315
Definition StateAttribute:308
virtual void usesTextureMode(GLMode mode)=0
Texture pure virtual base class that encapsulates OpenGL texture functionality common to the various ...
Definition Texture:422
bool isCompressedInternalFormat() const
Return true if the internal format is one of the compressed formats.
WrapMode _wrap_t
Definition Texture:861
void setClientStorageHint(bool flag)
Sets whether to use client storage for the texture, if supported by the graphics system.
Definition Texture:567
ShadowCompareFunc
Definition Texture:709
@ LESS
Definition Texture:711
@ NOTEQUAL
Definition Texture:715
@ GREATER
Definition Texture:714
@ GEQUAL
Definition Texture:716
@ EQUAL
Definition Texture:712
@ ALWAYS
Definition Texture:717
@ NEVER
Definition Texture:710
@ LEQUAL
Definition Texture:713
bool getResizeNonPowerOfTwoHint() const
Gets whether texture will force non power to two images to be resized.
Definition Texture:579
bool getShadowComparison() const
Definition Texture:707
void applyTexParameters(GLenum target, State &state) const
Helper method.
Vec4i _swizzle
Definition Texture:870
void applyTexImage2D_load(State &state, GLenum target, const Image *image, GLsizei width, GLsizei height, GLsizei numMipmapLevels) const
Helper method.
void generateMipmap(State &state) const
Helper method to generate mipmap levels by calling of glGenerateMipmapEXT.
const Vec4d & getBorderColor() const
Gets the border color.
Definition Texture:487
float _lodbias
Definition Texture:869
virtual int getTextureHeight() const
Definition Texture:458
void setTextureObject(unsigned int contextID, TextureObject *to)
Definition Texture:670
bool isSafeToUnrefImageData(const State &state) const
Returns true if the associated Image should be released and it's safe to do so.
Definition Texture:834
virtual void releaseGLObjects(State *state=0) const
If State is non-zero, this function releases OpenGL objects for the specified graphics context.
virtual bool isSameKindAs(const osg::Object *obj) const
Return true if this and obj are of the same kind of object.
Definition Texture:433
bool getUseHardwareMipMapGeneration() const
Gets the hardware mipmap generation hint.
Definition Texture:553
Vec4d _borderColor
Definition Texture:876
float getMinLOD() const
Gets the minimum level of detail value.
Definition Texture:528
void setResizeNonPowerOfTwoHint(bool flag)
Sets whether to force the texture to resize images that have dimensions that are not a power of two.
Definition Texture:576
ShadowTextureMode
Definition Texture:724
@ ALPHA
Definition Texture:727
@ LUMINANCE
Definition Texture:725
@ INTENSITY
Definition Texture:726
@ NONE
Definition Texture:728
float _minlod
Definition Texture:867
virtual void allocateMipmap(State &state) const =0
Allocate mipmap levels of the texture by subsequent calling of glTexImage* function.
float _shadow_ambient
Definition Texture:888
virtual void computeInternalFormat() const =0
ShadowCompareFunc _shadow_compare_func
Definition Texture:886
void setReadPBuffer(GraphicsContext *context)
Set the PBuffer graphics context to read from when using PBuffers for RenderToTexture.
Definition Texture:757
float getMaxLOD() const
Gets the maximum level of detail value.
Definition Texture:534
void setShadowTextureMode(ShadowTextureMode mode)
Sets shadow texture mode after comparison.
Definition Texture:732
float getShadowAmbient() const
Definition Texture:738
void setFilter(FilterParameter which, FilterMode filter)
Sets the texture filter mode.
void setUnRefImageDataAfterApply(bool flag)
Sets whether or not the apply() function will unreference the image data.
Definition Texture:558
static osg::ref_ptr< TextureObject > generateTextureObject(const Texture *texture, unsigned int contextID, GLenum target)
int compareTextureObjects(const Texture &rhs) const
Returns -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
GLint getBorderWidth() const
Definition Texture:492
TexParameterDirtyList _texMipmapGenerationDirtyList
Definition Texture:858
bool _useHardwareMipMapGeneration
Definition Texture:871
void setBorderWidth(GLint width)
Sets the border width.
Definition Texture:490
virtual osg::Object * clone(const CopyOp ©op) const =0
Clone an attribute, with Object* return type.
void setShadowCompareFunc(ShadowCompareFunc func)
Sets shadow texture comparison function.
Definition Texture:721
void dirtyTextureObject()
Forces a recompile on next apply() of associated OpenGL texture objects.
GLint getInternalFormat() const
Gets the internal texture format.
Definition Texture:619
virtual Texture * asTexture()
Fast alternative to dynamic_cast<> for determining if state attribute is a Texture.
Definition Texture:438
buffered_object< ref_ptr< TextureObject > > TextureObjectBuffer
Definition Texture:1122
InternalFormatMode
Definition Texture:581
@ USE_S3TC_DXT1a_COMPRESSION
Definition Texture:595
@ USE_PVRTC_2BPP_COMPRESSION
Definition Texture:588
@ USE_PVRTC_4BPP_COMPRESSION
Definition Texture:589
@ USE_RGTC2_COMPRESSION
Definition Texture:593
@ USE_S3TC_DXT3_COMPRESSION
Definition Texture:586
@ USE_S3TC_DXT1c_COMPRESSION
Definition Texture:594
@ USE_USER_DEFINED_FORMAT
Definition Texture:583
@ USE_S3TC_DXT5_COMPRESSION
Definition Texture:587
@ USE_ETC_COMPRESSION
Definition Texture:590
@ USE_ETC2_COMPRESSION
Definition Texture:591
@ USE_S3TC_DXT1_COMPRESSION
Definition Texture:585
@ USE_ARB_COMPRESSION
Definition Texture:584
@ USE_RGTC1_COMPRESSION
Definition Texture:592
@ USE_IMAGE_DATA_FORMAT
Definition Texture:582
void setUseHardwareMipMapGeneration(bool useHardwareMipMapGeneration)
Sets the hardware mipmap generation hint.
Definition Texture:550
FilterMode getFilter(FilterParameter which) const
Gets the texture filter mode.
bool getClientStorageHint() const
Gets whether to use client storage for the texture.
Definition Texture:570
FilterMode _mag_filter
Definition Texture:865
ShadowTextureMode getShadowTextureMode() const
Definition Texture:733
GenerateMipmapMode mipmapBeforeTexImage(const State &state, bool hardwareMipmapOn) const
Helper methods to be called before and after calling gl[Compressed][Copy]Tex[Sub]Image2D to handle ge...
float getLODBias() const
Sets the level of detail bias value.
Definition Texture:540
void mipmapAfterTexImage(State &state, GenerateMipmapMode beforeResult) const
static osg::ref_ptr< TextureObject > generateTextureObject(const Texture *texture, unsigned int contextID, GLenum target, GLint numMipmapLevels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border)
void computeInternalFormatWithImage(const osg::Image &image) const
Computes the internal format from Image parameters.
InternalFormatType _internalFormatType
Definition Texture:880
virtual bool isTextureAttribute() const
Return true if StateAttribute is a type which controls texturing and needs to be issued w....
Definition Texture:445
void setSourceFormat(GLenum sourceFormat)
Sets the external source image format, used as a fallback when no osg::Image is attached to provide t...
Definition Texture:625
GraphicsContext * getReadPBuffer()
Get the PBuffer graphics context to read from when using PBuffers for RenderToTexture.
Definition Texture:762
GLint _borderWidth
Definition Texture:877
ShadowTextureMode _shadow_texture_mode
Definition Texture:887
buffered_value< unsigned int > TexParameterDirtyList
Definition Texture:856
virtual unsigned int getNumImages() const =0
Gets the number of images that can be assigned to this Texture.
WrapMode getWrap(WrapParameter which) const
Gets the texture wrap mode.
virtual const char * className() const
Return the name of the attribute's class type.
Definition Texture:435
FilterMode
Definition Texture:499
@ NEAREST_MIPMAP_LINEAR
Definition Texture:504
@ NEAREST
Definition Texture:503
@ LINEAR_MIPMAP_NEAREST
Definition Texture:502
@ NEAREST_MIPMAP_NEAREST
Definition Texture:505
@ LINEAR
Definition Texture:500
@ LINEAR_MIPMAP_LINEAR
Definition Texture:501
float _maxAnisotropy
Definition Texture:866
WrapMode _wrap_s
Definition Texture:860
void setInternalFormat(GLint internalFormat)
Sets the internal texture format.
Definition Texture:610
virtual int getTextureWidth() const
Definition Texture:457
void setMinLOD(float minlod)
Sets the minimum level of detail value.
WrapMode
Definition Texture:467
@ CLAMP_TO_EDGE
Definition Texture:469
@ CLAMP_TO_BORDER
Definition Texture:470
@ REPEAT
Definition Texture:471
@ CLAMP
Definition Texture:468
@ MIRROR
Definition Texture:472
bool _resizeNonPowerOfTwoHint
Definition Texture:874
ref_ptr< GraphicsContext > _readPBuffer
Definition Texture:1124
ShadowCompareFunc getShadowCompareFunc() const
Definition Texture:722
GLenum _sourceType
Definition Texture:883
void setImage(unsigned int face, const ref_ptr< T > &image)
Definition Texture:744
bool _clientStorageHint
Definition Texture:873
FilterMode _min_filter
Definition Texture:864
void setReadPBuffer(const ref_ptr< T > &context)
Definition Texture:759
virtual Type getType() const
Return the Type identifier of the attribute's class type.
Definition Texture:443
GenerateMipmapMode
Returned by mipmapBeforeTexImage() to indicate what mipmapAfterTexImage() should do.
Definition Texture:805
@ GENERATE_MIPMAP_NONE
Definition Texture:806
@ GENERATE_MIPMAP_TEX_PARAMETER
Definition Texture:808
@ GENERATE_MIPMAP
Definition Texture:807
TextureObject * getTextureObject(unsigned int contextID) const
Returns a pointer to the TextureObject for the current context.
Definition Texture:665
std::list< ref_ptr< TextureObject > > TextureObjectList
Definition Texture:1094
bool areAllTextureObjectsLoaded() const
Returns true if the texture objects for all the required graphics contexts are loaded.
const GraphicsContext * getReadPBuffer() const
Get the const PBuffer graphics context to read from when using PBuffers for RenderToTexture.
Definition Texture:765
InternalFormatType
Texture type determined by the internal texture format.
Definition Texture:637
@ SIGNED_INTEGER
Signed integer values (see EXT_texture_integer)
Definition Texture:646
@ UNSIGNED_INTEGER
Unsigned integer value (see EXT_texture_integer)
Definition Texture:649
@ NORMALIZED
default OpenGL format (clamped values to [0,1) or [0,255])
Definition Texture:640
@ FLOAT
float values, Shader Model 3.0 (see ARB_texture_float)
Definition Texture:643
GLenum _sourceFormat
Definition Texture:882
bool getUnRefImageDataAfterApply() const
Gets whether or not apply() unreferences image data.
Definition Texture:561
void setMaxLOD(float maxlod)
Sets the maximum level of detail value.
InternalFormatMode getInternalFormatMode() const
Gets the internal texture format mode.
Definition Texture:605
void setInternalFormatMode(InternalFormatMode mode)
Sets the internal texture format mode.
Definition Texture:602
void setShadowAmbient(float shadow_ambient)
Sets the TEXTURE_COMPARE_FAIL_VALUE_ARB texture parameter.
Definition Texture:737
GLint _internalFormat
Definition Texture:881
void setBorderColor(const Vec4d &color)
Sets the border color.
Definition Texture:484
virtual bool isDirty(unsigned int) const
return true if the texture image data has been modified and the associated GL texture object needs to...
Definition Texture:661
void allocateMipmapLevels()
Force a manual allocation of the mipmap levels on the next apply() call.
bool _use_shadow_comparison
Definition Texture:885
void setMaxAnisotropy(float anis)
Sets the maximum anisotropy value, default value is 1.0 for no anisotropic filtering.
int compareTexture(const Texture &rhs) const
Returns -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
virtual Image * getImage(unsigned int face)=0
Gets the texture image for the specified face.
virtual int getTextureDepth() const
Definition Texture:459
static void getCompressedSize(GLenum internalFormat, GLint width, GLint height, GLint depth, GLint &blockSize, GLint &size)
Determine the size of a compressed image, given the internalFormat, the width, the height,...
bool _unrefImageDataAfterApply
Definition Texture:872
virtual osg::Object * cloneType() const =0
Clone the type of an attribute, with Object* return type.
GLenum selectSizedInternalFormat(const osg::Image *image=0) const
virtual void setImage(unsigned int face, Image *image)=0
Sets the texture image for the specified face.
virtual const Texture * asTexture() const
Fast alternative to dynamic_cast<> for determining if state attribute is a Texture.
Definition Texture:441
void setSwizzle(const Vec4i &swizzle)
Configure the source of texture swizzling for all channels.
Definition Texture:543
static bool isCompressedInternalFormat(GLint internalFormat)
Determine whether the given internalFormat is a compressed image format.
void applyTexImage2D_subload(State &state, GLenum target, const Image *image, GLsizei width, GLsizei height, GLint inInternalFormat, GLsizei numMipmapLevels) const
Helper method.
virtual void resizeGLObjectBuffers(unsigned int maxSize)
Resize any per context GLObject buffers to specified size.
GLenum getSourceType() const
Gets the external source data type.
Definition Texture:634
virtual const Image * getImage(unsigned int face) const =0
Gets the const texture image for specified face.
InternalFormatType getInternalFormatType() const
Get the internal texture format type.
Definition Texture:653
void setSourceType(GLenum sourceType)
Sets the external source data type, used as a fallback when no osg::Image is attached to provide the ...
Definition Texture:631
float _maxlod
Definition Texture:868
TextureObjectBuffer _textureObjectBuffer
Definition Texture:1123
virtual const char * libraryName() const
Return the name of the attribute's library.
Definition Texture:434
GLenum getSourceFormat() const
Gets the external source image format.
Definition Texture:628
virtual GLenum getTextureTarget() const =0
WrapParameter
Definition Texture:461
@ WRAP_S
Definition Texture:462
@ WRAP_T
Definition Texture:463
@ WRAP_R
Definition Texture:464
virtual void compileGLObjects(State &state) const
Calls apply(state) to compile the texture.
float getMaxAnisotropy() const
Gets the maximum anisotropy value.
Definition Texture:522
FilterParameter
Definition Texture:494
@ MAG_FILTER
Definition Texture:496
@ MIN_FILTER
Definition Texture:495
bool isHardwareMipmapGenerationEnabled(const State &state) const
Returns true if _useHardwareMipMapGeneration is true and either glGenerateMipmapEXT() or GL_GENERATE_...
void setLODBias(float lodbias)
Gets the level of detail bias value.
WrapMode _wrap_r
Definition Texture:862
virtual void apply(State &state) const =0
Texture is a pure virtual base class, apply must be overridden.
void computeInternalFormatType() const
Computes the internal format type.
InternalFormatMode _internalFormatMode
Definition Texture:879
void computeRequiredTextureDimensions(State &state, const osg::Image &image, GLsizei &width, GLsizei &height, GLsizei &numMipmapLevels) const
Computes the texture dimension for the given Image.
Texture(const Texture &text, const CopyOp ©op=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy.
TexParameterDirtyList _texParametersDirtyList
Definition Texture:857
void setShadowComparison(bool flag)
Sets GL_TEXTURE_COMPARE_MODE_ARB to GL_COMPARE_R_TO_TEXTURE_ARB See http://oss.sgi....
Definition Texture:706
void dirtyTextureParameters()
Force a reset on next apply() of associated OpenGL texture parameters.
unsigned int & getTextureParameterDirty(unsigned int contextID) const
Gets the dirty flag for the current contextID.
Definition Texture:685
const Vec4i & getSwizzle() const
Gets the source of texture swizzling for all channels.
Definition Texture:546
TextureObject * generateAndAssignTextureObject(unsigned int contextID, GLenum target) const
TextureObject * generateAndAssignTextureObject(unsigned int contextID, GLenum target, GLint numMipmapLevels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border) const
void setWrap(WrapParameter which, WrapMode wrap)
Sets the texture wrap mode.
GLsizei _depth
Definition Texture:987
GLenum _target
Definition Texture:982
TextureProfile(GLenum target, GLint numMipmapLevels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border)
Definition Texture:904
GLsizei _height
Definition Texture:986
unsigned int _size
Definition Texture:989
GLsizei _width
Definition Texture:985
bool match(GLenum target, GLint numMipmapLevels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border)
Definition Texture:963
TextureProfile(GLenum target)
Definition Texture:894
GLint _numMipmapLevels
Definition Texture:983
GLenum _internalFormat
Definition Texture:984
GLint _border
Definition Texture:988
void set(GLint numMipmapLevels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border)
Definition Texture:947
TextureObject * _next
Definition Texture:1083
GLenum target() const
Definition Texture:1053
unsigned int _frameLastUsed
Definition Texture:1086
TextureObject(Texture *texture, GLuint id, GLenum target)
Definition Texture:996
bool isReusable() const
Definition Texture:1074
void setAllocated(bool allocated=true)
Definition Texture:1063
double _timeStamp
Definition Texture:1087
TextureObject(Texture *texture, GLuint id, GLenum target, GLint numMipmapLevels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border)
Definition Texture:1018
GLenum id() const
Definition Texture:1052
bool _allocated
Definition Texture:1085
Texture * getTexture() const
Definition Texture:1058
TextureObjectSet * _set
Definition Texture:1081
void release()
release TextureObject to the orphan list to be reused or deleted.
Texture * _texture
Definition Texture:1084
unsigned int size() const
Definition Texture:1055
TextureObject(Texture *texture, GLuint id, const TextureProfile &profile)
Definition Texture:1007
void setTexture(Texture *texture)
Definition Texture:1057
void setAllocated(GLint numMipmapLevels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border)
TextureProfile _profile
Definition Texture:1080
void setTimeStamp(double timestamp)
Definition Texture:1060
double getTimeStamp() const
Definition Texture:1061
GLuint _id
Definition Texture:1079
TextureObject * _previous
Definition Texture:1082
bool match(GLenum target, GLint numMipmapLevels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border)
Definition Texture:1037
bool isAllocated() const
Definition Texture:1072
void discardAllTextureObjects()
unsigned int getNumOfTextureObjects() const
Definition Texture:1160
bool makeSpace(unsigned int &size)
Texture::TextureProfile _profile
Definition Texture:1172
Texture::TextureObjectList _pendingOrphanedTextureObjects
Definition Texture:1175
unsigned int size() const
Definition Texture:1151
unsigned int getNumOrphans() const
Definition Texture:1161
void moveToBack(Texture::TextureObject *to)
void addToBack(Texture::TextureObject *to)
void remove(Texture::TextureObject *to)
unsigned int _numOfTextureObjects
Definition Texture:1173
void deleteAllTextureObjects()
void handlePendingOrphandedTextureObjects()
Texture::TextureObject * _head
Definition Texture:1177
virtual ~TextureObjectSet()
bool checkConsistency() const
OpenThreads::Mutex _mutex
Definition Texture:1168
TextureObjectManager * _parent
Definition Texture:1170
void flushAllDeletedTextureObjects()
void orphan(Texture::TextureObject *to)
TextureObjectSet(TextureObjectManager *parent, const Texture::TextureProfile &profile)
unsigned int _contextID
Definition Texture:1171
osg::ref_ptr< Texture::TextureObject > takeFromOrphans(Texture *texture)
Texture::TextureObject * _tail
Definition Texture:1178
void moveToSet(Texture::TextureObject *to, TextureObjectSet *set)
unsigned int computeNumTextureObjectsInList() const
void discardAllDeletedTextureObjects()
TextureObjectManager * getParent()
Definition Texture:1157
unsigned int getNumPendingOrphans() const
Definition Texture:1162
Texture::TextureObjectList _orphanedTextureObjects
Definition Texture:1174
const Texture::TextureProfile & getProfile() const
Definition Texture:1133
osg::ref_ptr< Texture::TextureObject > takeOrGenerate(Texture *texture)
void flushDeletedTextureObjects(double currentTime, double &availableTime)
void flushDeletedGLObjects(double currentTime, double &availableTime)
Flush all deleted OpenGL objects within the specified availableTime.
double & getDeleteTime()
Definition Texture:1235
void setCurrTexturePoolSize(unsigned int size)
Definition Texture:1196
void flushAllDeletedGLObjects()
Flush all deleted OpenGL objects.
unsigned int & getNumberFrames()
Definition Texture:1232
double _deleteTime
Definition Texture:1256
osg::ref_ptr< Texture::TextureObject > generateTextureObject(const Texture *texture, GLenum target, GLint numMipmapLevels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border)
TextureObjectManager(unsigned int contextID)
unsigned int _maxTexturePoolSize
Definition Texture:1249
void handlePendingOrphandedTextureObjects()
void recomputeStats(std::ostream &out) const
unsigned int & getNumberOrphanedTextureObjects()
Definition Texture:1193
unsigned int _currTexturePoolSize
Definition Texture:1248
void discardAllDeletedGLObjects()
std::map< Texture::TextureProfile, osg::ref_ptr< TextureObjectSet > > TextureSetMap
Definition Texture:1244
unsigned int _numFrames
Definition Texture:1254
osg::ref_ptr< Texture::TextureObject > generateTextureObject(const Texture *texture, GLenum target)
void reportStats(std::ostream &out)
unsigned int getNumberOrphanedTextureObjects() const
Definition Texture:1194
unsigned int _numGenerated
Definition Texture:1258
unsigned int & getNumberDeleted()
Definition Texture:1234
unsigned int & getCurrTexturePoolSize()
Definition Texture:1197
bool hasSpace(unsigned int size) const
Definition Texture:1203
void newFrame(osg::FrameStamp *fs)
Signal that a new frame has started.
void setNumberOrphanedTextureObjects(unsigned int size)
Definition Texture:1192
unsigned int & getNumberGenerated()
Definition Texture:1237
bool checkConsistency() const
void setNumberActiveTextureObjects(unsigned int size)
Definition Texture:1188
void setMaxTexturePoolSize(unsigned int size)
bool makeSpace(unsigned int size)
unsigned int _numDeleted
Definition Texture:1255
unsigned int _frameNumber
Definition Texture:1252
unsigned int getNumberActiveTextureObjects() const
Definition Texture:1190
TextureSetMap _textureSetMap
Definition Texture:1250
double & getGenerateTime()
Definition Texture:1238
TextureObjectSet * getTextureObjectSet(const Texture::TextureProfile &profile)
unsigned int getMaxTexturePoolSize() const
Definition Texture:1201
unsigned int & getNumberActiveTextureObjects()
Definition Texture:1189
void discardAllGLObjects()
Discard all OpenGL objects.
unsigned int getCurrTexturePoolSize() const
Definition Texture:1198
double _generateTime
Definition Texture:1259
unsigned int & getFrameNumber()
Definition Texture:1231
unsigned int _numActiveTextureObjects
Definition Texture:1246
unsigned int _numOrphanedTextureObjects
Definition Texture:1247
void deleteAllGLObjects()
Do a GL delete all OpenGL objects.
General purpose double quad.
Definition Vec4d:29
General purpose integer quad.
Definition Vec4i:22
#define NULL
Definition Export:55
#define OSG_EXPORT
Definition Export:39