H3D API  2.4.1
TextureProperties.h
Go to the documentation of this file.
1 // Copyright 2004-2019, SenseGraphics AB
3 //
4 // This file is part of H3D API.
5 //
6 // H3D API is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // H3D API is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with H3D API; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // A commercial license is also available. Please contact us at
21 // www.sensegraphics.com for more information.
22 //
23 //
27 //
29 #ifndef __TEXTUREPROPERTIES_H__
30 #define __TEXTUREPROPERTIES_H__
31 
32 #include <H3D/X3DNode.h>
34 #include <H3D/SFInt32.h>
35 #include <H3D/SFBool.h>
36 #include <H3D/SFString.h>
37 #include <H3D/SFFloat.h>
38 #include <H3D/SFColorRGBA.h>
39 #include <H3D/SFVec4f.h>
40 
41 namespace H3D {
194  class H3DAPI_API TextureProperties :
195  public X3DNode {
196  public:
197 
199  TextureProperties( Inst< SFNode > _metadata = 0,
200  Inst< SFFloat > _anisotropicDegree = 0,
201  Inst< SFColorRGBA > _borderColor = 0,
202  Inst< SFInt32 > _borderWidth = 0,
203  Inst< SFString > _boundaryModeS = 0,
204  Inst< SFString > _boundaryModeT = 0,
205  Inst< SFString > _boundaryModeR = 0,
206  Inst< SFString > _magnificationFilter = 0,
207  Inst< SFString > _minificationFilter = 0,
208  Inst< SFString > _textureCompression = 0,
209  Inst< SFFloat > _texturePriority = 0,
210  Inst< SFBool > _generateMipMaps = 0,
211  Inst< SFVec4f > _textureTransferScale = 0,
212  Inst< SFVec4f > _textureTransferBias = 0,
213  Inst< SFString > _textureCompareMode = 0,
214  Inst< SFFloat > _textureCompareFailValue = 0,
215  Inst< SFString > _textureType = 0,
216  Inst< SFString > _textureFormat = 0 );
217 
220  virtual string defaultXMLContainerField() {
221  return "textureProperties";
222  }
223 
226  virtual void renderTextureProperties( GLenum texture_target, bool texture_provided_mip_maps );
227 
228 
238  H3DUniquePtr< SFFloat > anisotropicDegree;
239 
246  H3DUniquePtr< SFColorRGBA > borderColor;
247 
254  H3DUniquePtr< SFInt32 > borderWidth;
255 
263  H3DUniquePtr< SFString > boundaryModeS;
264 
272  H3DUniquePtr< SFString > boundaryModeT;
273 
281  H3DUniquePtr< SFString > boundaryModeR;
282 
290  H3DUniquePtr< SFString > magnificationFilter;
291 
299  H3DUniquePtr< SFString > minificationFilter;
300 
308  H3DUniquePtr< SFString > textureCompression;
309 
318  H3DUniquePtr< SFFloat > texturePriority;
319 
328  H3DUniquePtr< SFBool > generateMipMaps;
329 
330 
347  H3DUniquePtr< SFVec4f > textureTransferScale;
348 
364  H3DUniquePtr< SFVec4f > textureTransferBias;
365 
366 
369  H3DUniquePtr< Field > propertyChanged;
370 
396  H3DUniquePtr< SFString > textureCompareMode;
397 
405  H3DUniquePtr< SFFloat > textureCompareFailValue;
406 
407 
430  H3DUniquePtr< SFString > textureType;
431 
434 
456  H3DUniquePtr< SFString > textureFormat;
457 
459  virtual bool glInternalFormat( Image *image, GLint &internal_format );
460 
462  virtual bool glPixelFormat( Image *image, GLenum &pixel_format );
463 
465  virtual bool match( const TextureProperties* tp );
466  };
467 }
468 
469 #endif
Header file for H3DDisplayListObject.
Contains the SFBool field class.
Contains the SFColorRGBA field class.
Contains the SFFloat field class.
Contains the SFInt32 field class.
Contains the SFString field class.
Contains the SFVec4f field class.
Header file for X3DNode, X3D scene-graph node.
TextureProperties allows fine control over a texture's application.
Definition: TextureProperties.h:195
H3DUniquePtr< SFColorRGBA > borderColor
The borderColor field describes the color to use for border pixels.
Definition: TextureProperties.h:246
H3DUniquePtr< SFVec4f > textureTransferBias
The textureTransferBias field defines the bias component of the transfer function from image value to...
Definition: TextureProperties.h:364
H3DUniquePtr< SFFloat > anisotropicDegree
The anisotropicDegree field describes the minimum degree of anisotropy to account for in texture filt...
Definition: TextureProperties.h:238
H3DUniquePtr< SFString > minificationFilter
The minificationFilter field describes the way textures are filtered when the image is larger then th...
Definition: TextureProperties.h:299
H3DUniquePtr< SFString > textureFormat
The textureFormat specifies the format of the texture.
Definition: TextureProperties.h:456
H3DUniquePtr< SFString > boundaryModeT
The boundaryModeT field describes the way T texture coordinate boundaries are handled.
Definition: TextureProperties.h:272
H3DUniquePtr< SFFloat > texturePriority
The texturePriority field describes the texture residence priority for allocating texture memory.
Definition: TextureProperties.h:318
H3DUniquePtr< Field > propertyChanged
Field that gets an event when any of the X3D fields in the TextureProperties generates an event.
Definition: TextureProperties.h:369
virtual string defaultXMLContainerField()
Returns the default xml containerField attribute value.
Definition: TextureProperties.h:220
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: TextureProperties.h:433
H3DUniquePtr< SFString > boundaryModeR
The boundaryModeR field describes the way R texture coordinate boundaries are handled.
Definition: TextureProperties.h:281
H3DUniquePtr< SFString > textureCompression
The textureCompression fields describes if/how a texture should be compressed.
Definition: TextureProperties.h:308
H3DUniquePtr< SFFloat > textureCompareFailValue
The textureCompareFailValue contains the value to use as texture output when the test in textureCompa...
Definition: TextureProperties.h:405
H3DUniquePtr< SFString > magnificationFilter
The magnificationFilter field describes the way textures are filtered when the image is smaller then ...
Definition: TextureProperties.h:290
H3DUniquePtr< SFString > textureType
The textureType specifies what texture target type should be used for the texture.
Definition: TextureProperties.h:430
H3DUniquePtr< SFString > boundaryModeS
The boundaryModeS field describes the way S texture coordinate boundaries are handled.
Definition: TextureProperties.h:263
H3DUniquePtr< SFVec4f > textureTransferScale
The textureTransferScale field defines the scale component of the transfer function from image value ...
Definition: TextureProperties.h:347
H3DUniquePtr< SFInt32 > borderWidth
The borderWidth field describes the color to use for border pixels.
Definition: TextureProperties.h:254
H3DUniquePtr< SFBool > generateMipMaps
The generateMipMaps field describes whether mipmaps should be generated for the texture.
Definition: TextureProperties.h:328
H3DUniquePtr< SFString > textureCompareMode
The textureCompareMode field specifies what texture compare function to use.
Definition: TextureProperties.h:396
This abstract node type is the base type for all nodes in the X3D system.
Definition: X3DNode.h:65
H3D API namespace.
Definition: Anchor.h:38
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194