VTK  9.0.1
vtkTextureObject.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTextureObject.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
24 #ifndef vtkTextureObject_h
25 #define vtkTextureObject_h
26 
27 #include "vtkObject.h"
28 #include "vtkRenderingOpenGL2Module.h" // For export macro
29 #include "vtkWeakPointer.h" // for render context
30 
32 class vtkOpenGLHelper;
36 class vtkShaderProgram;
37 class vtkWindow;
39 
40 class VTKRENDERINGOPENGL2_EXPORT vtkTextureObject : public vtkObject
41 {
42 public:
43  // DepthTextureCompareFunction values.
44  enum
45  {
46  Lequal = 0, // r=R<=Dt ? 1.0 : 0.0
47  Gequal, // r=R>=Dt ? 1.0 : 0.0
48  Less, // r=R<D_t ? 1.0 : 0.0
49  Greater, // r=R>Dt ? 1.0 : 0.0
50  Equal, // r=R==Dt ? 1.0 : 0.0
51  NotEqual, // r=R!=Dt ? 1.0 : 0.0
52  AlwaysTrue, // r=1.0 // WARNING "Always" is macro defined in X11/X.h...
53  Never, // r=0.0
54  NumberOfDepthTextureCompareFunctions
55  };
56 
57 // ClampToBorder is not supported in ES 2.0
58 // Wrap values.
59 #ifndef GL_ES_VERSION_3_0
60  enum { ClampToEdge = 0, Repeat, MirroredRepeat, ClampToBorder, NumberOfWrapModes };
61 #else
62  enum
63  {
64  ClampToEdge = 0,
65  Repeat,
66  MirroredRepeat,
67  NumberOfWrapModes
68  };
69 #endif
70 
71  // MinificationFilter values.
72  enum
73  {
74  Nearest = 0,
80  NumberOfMinificationModes
81  };
82 
83  // depth/color format
84  enum
85  {
86  Native = 0, // will try to match with the depth buffer format.
93  NumberOfDepthFormats
94  };
95 
96  static vtkTextureObject* New();
97  vtkTypeMacro(vtkTextureObject, vtkObject);
98  void PrintSelf(ostream& os, vtkIndent indent) override;
99 
101 
113 
115 
119  vtkGetMacro(Width, unsigned int);
120  vtkGetMacro(Height, unsigned int);
121  vtkGetMacro(Depth, unsigned int);
122  vtkGetMacro(Samples, unsigned int);
123  vtkGetMacro(Components, int);
124  unsigned int GetTuples() { return this->Width * this->Height * this->Depth; }
126 
127  vtkGetMacro(NumberOfDimensions, int);
128 
129  // for MSAA textures set the number of samples
130  vtkSetMacro(Samples, unsigned int);
131 
133 
136  vtkGetMacro(Target, unsigned int);
138 
140 
143  vtkGetMacro(Handle, unsigned int);
145 
150 
152 
157  void Bind();
159 
163  virtual void Activate();
164 
168  void Deactivate();
169 
174 
179  bool IsBound();
180 
188 
190 
194  vtkSetMacro(AutoParameters, int);
195  vtkGetMacro(AutoParameters, int);
196  vtkBooleanMacro(AutoParameters, int);
198 
204  unsigned int width, unsigned int height, int numComps, int dataType, void* data);
205 
212  unsigned int width, unsigned int height, int internalFormat, int rawType, void* raw);
213 
219  unsigned int numValues, int numComps, int dataType, vtkOpenGLBufferObject* bo);
220 
227  unsigned int width, unsigned int height, int numComps, int dataType, void* data[6]);
228 
229 // 1D textures are not supported in ES 2.0 or 3.0
230 #ifndef GL_ES_VERSION_3_0
231 
242  bool Create1D(int numComps, vtkPixelBufferObject* pbo, bool shaderSupportsTextureInt);
243 
247  bool Create1DFromRaw(unsigned int width, int numComps, int dataType, void* data);
248 #endif
249 
256  bool Create2D(unsigned int width, unsigned int height, int numComps, vtkPixelBufferObject* pbo,
257  bool shaderSupportsTextureInt);
258 
265  bool Create3D(unsigned int width, unsigned int height, unsigned int depth, int numComps,
266  vtkPixelBufferObject* pbo, bool shaderSupportsTextureInt);
267 
272  bool Create3DFromRaw(unsigned int width, unsigned int height, unsigned int depth, int numComps,
273  int dataType, void* data);
274 
281  bool AllocateProxyTexture3D(unsigned int const width, unsigned int const height,
282  unsigned int const depth, int const numComps, int const dataType);
283 
291  vtkPixelBufferObject* Download(unsigned int target, unsigned int level);
292 
298  unsigned int width, unsigned int height, int internalFormat, vtkPixelBufferObject* pbo);
299 
303  bool AllocateDepth(unsigned int width, unsigned int height, int internalFormat);
304 
308  bool AllocateDepthStencil(unsigned int width, unsigned int height);
309 
314  bool Allocate1D(unsigned int width, int numComps, int vtkType);
315 
321  unsigned int width, unsigned int height, int numComps, int vtkType, int level = 0);
322 
328  unsigned int width, unsigned int height, unsigned int depth, int numComps, int vtkType);
329 
331 
334  bool Create2D(unsigned int width, unsigned int height, int numComps, int vtktype, bool)
335  {
336  return this->Allocate2D(width, height, numComps, vtktype);
337  }
338  bool Create3D(
339  unsigned int width, unsigned int height, unsigned int depth, int numComps, int vtktype, bool)
340  {
341  return this->Allocate3D(width, height, depth, numComps, vtktype);
342  }
344 
349 
351 
354  int GetDataType(int vtk_scalar_type);
355  void SetDataType(unsigned int glType);
356  int GetDefaultDataType(int vtk_scalar_type);
358 
360 
365  unsigned int GetInternalFormat(int vtktype, int numComps, bool shaderSupportsTextureInt);
366  void SetInternalFormat(unsigned int glInternalFormat);
367  unsigned int GetDefaultInternalFormat(int vtktype, int numComps, bool shaderSupportsTextureInt);
369 
371 
376  unsigned int GetFormat(int vtktype, int numComps, bool shaderSupportsTextureInt);
377  void SetFormat(unsigned int glFormat);
378  unsigned int GetDefaultFormat(int vtktype, int numComps, bool shaderSupportsTextureInt);
380 
390 
391  unsigned int GetMinificationFilterMode(int vtktype);
392  unsigned int GetMagnificationFilterMode(int vtktype);
393  unsigned int GetWrapSMode(int vtktype);
394  unsigned int GetWrapTMode(int vtktype);
395  unsigned int GetWrapRMode(int vtktype);
396 
398 
404  vtkSetMacro(RequireDepthBufferFloat, bool);
405  vtkGetMacro(RequireDepthBufferFloat, bool);
406  vtkGetMacro(SupportsDepthBufferFloat, bool);
408 
410 
416  vtkSetMacro(RequireTextureFloat, bool);
417  vtkGetMacro(RequireTextureFloat, bool);
418  vtkGetMacro(SupportsTextureFloat, bool);
420 
422 
428  vtkSetMacro(RequireTextureInteger, bool);
429  vtkGetMacro(RequireTextureInteger, bool);
430  vtkGetMacro(SupportsTextureInteger, bool);
432 
434 
444  vtkGetMacro(WrapS, int);
445  vtkSetMacro(WrapS, int);
447 
449 
459  vtkGetMacro(WrapT, int);
460  vtkSetMacro(WrapT, int);
462 
464 
474  vtkGetMacro(WrapR, int);
475  vtkSetMacro(WrapR, int);
477 
479 
492  vtkGetMacro(MinificationFilter, int);
493  vtkSetMacro(MinificationFilter, int);
495 
497 
504  vtkGetMacro(MagnificationFilter, int);
505  vtkSetMacro(MagnificationFilter, int);
507 
512  void SetLinearMagnification(bool val) { this->SetMagnificationFilter(val ? Linear : Nearest); }
513 
514  bool GetLinearMagnification() { return this->MagnificationFilter == Linear; }
515 
517 
522  vtkSetVector4Macro(BorderColor, float);
523  vtkGetVector4Macro(BorderColor, float);
525 
527 
531  vtkSetMacro(MinLOD, float);
532  vtkGetMacro(MinLOD, float);
534 
536 
540  vtkSetMacro(MaxLOD, float);
541  vtkGetMacro(MaxLOD, float);
543 
545 
550  vtkSetMacro(BaseLevel, int);
551  vtkGetMacro(BaseLevel, int);
553 
555 
560  vtkSetMacro(MaxLevel, int);
561  vtkGetMacro(MaxLevel, int);
563 
565 
575  vtkGetMacro(DepthTextureCompare, bool);
576  vtkSetMacro(DepthTextureCompare, bool);
578 
580 
600  vtkGetMacro(DepthTextureCompareFunction, int);
601  vtkSetMacro(DepthTextureCompareFunction, int);
603 
605 
610  vtkGetMacro(GenerateMipmap, bool);
611  vtkSetMacro(GenerateMipmap, bool);
613 
615 
620  vtkSetMacro(MaximumAnisotropicFiltering, float);
621  vtkGetMacro(MaximumAnisotropicFiltering, float);
623 
625 
636 
644 
650  static bool IsSupported(vtkOpenGLRenderWindow*, bool /* requireTexFloat */,
651  bool /* requireDepthFloat */, bool /* requireTexInt */)
652  {
653  return true;
654  }
655 
659  static bool IsSupported(vtkOpenGLRenderWindow*) { return true; }
660 
662 
668  // part of a texture to part of a viewport, scaling as needed
669  void CopyToFrameBuffer(int srcXmin, int srcYmin, int srcXmax, int srcYmax, int dstXmin,
670  int dstYmin, int dstXmax, int dstYmax, int dstSizeX, int dstSizeY, vtkShaderProgram* program,
672  // copy part of a texure to part of a viewport, no scalaing
673  void CopyToFrameBuffer(int srcXmin, int srcYmin, int srcXmax, int srcYmax, int dstXmin,
674  int dstYmin, int dstSizeX, int dstSizeY, vtkShaderProgram* program,
676  // copy a texture to a quad using the provided tcoords and verts
678  float* tcoords, float* verts, vtkShaderProgram* program, vtkOpenGLVertexArrayObject* vao);
680 
693  int srcXmin, int srcYmin, int dstXmin, int dstYmin, int width, int height);
694 
707  void GetShiftAndScale(float& shift, float& scale);
708 
709  // resizes an existing texture, any existing
710  // data values are lost
711  void Resize(unsigned int width, unsigned int height);
712 
714 
720  vtkGetMacro(UseSRGBColorSpace, bool);
721  vtkSetMacro(UseSRGBColorSpace, bool);
722  vtkBooleanMacro(UseSRGBColorSpace, bool);
724 
733  void AssignToExistingTexture(unsigned int handle, unsigned int target);
734 
735 protected:
737  ~vtkTextureObject() override;
738 
740 
745 
750 
752  unsigned int Width;
753  unsigned int Height;
754  unsigned int Depth;
755  unsigned int Samples;
757 
759 
760  unsigned int Target; // GLenum
761  unsigned int Format; // GLenum
762  unsigned int InternalFormat; // GLenum
763  unsigned int Type; // GLenum
765 
767  unsigned int Handle;
768  bool OwnHandle;
775 
776  int WrapS;
777  int WrapT;
778  int WrapR;
781 
782  float MinLOD;
783  float MaxLOD;
785  int MaxLevel;
786  float BorderColor[4];
787 
790 
792 
795 
796  // used for copying to framebuffer
798 
799  // for texturebuffers we hold on to the Buffer
801 
802 private:
803  vtkTextureObject(const vtkTextureObject&) = delete;
804  void operator=(const vtkTextureObject&) = delete;
805 };
806 
807 #endif
vtkTextureObject::DepthTextureCompare
bool DepthTextureCompare
Definition: vtkTextureObject.h:788
vtkTextureObject::CopyToFrameBuffer
void CopyToFrameBuffer(int srcXmin, int srcYmin, int srcXmax, int srcYmax, int dstXmin, int dstYmin, int dstXmax, int dstYmax, int dstSizeX, int dstSizeY, vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
vtkTextureObject::UseSRGBColorSpace
bool UseSRGBColorSpace
Definition: vtkTextureObject.h:756
vtkTextureObject::AlwaysTrue
@ AlwaysTrue
Definition: vtkTextureObject.h:52
vtkTextureObject::GetDefaultInternalFormat
unsigned int GetDefaultInternalFormat(int vtktype, int numComps, bool shaderSupportsTextureInt)
vtkTextureObject::ResourceCallback
vtkGenericOpenGLResourceFreeCallback * ResourceCallback
Definition: vtkTextureObject.h:739
vtkTextureObject::Create3DFromRaw
bool Create3DFromRaw(unsigned int width, unsigned int height, unsigned int depth, int numComps, int dataType, void *data)
Create a 3D texture from client memory numComps must be in [1-4].
vtkTextureObject::Linear
@ Linear
Definition: vtkTextureObject.h:75
vtkTextureObject::Create1D
bool Create1D(int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
Create a 1D texture using the PBO.
vtkTextureObject::BufferObject
vtkOpenGLBufferObject * BufferObject
Definition: vtkTextureObject.h:800
vtkTextureObject::Samples
unsigned int Samples
Definition: vtkTextureObject.h:755
vtkTextureObject::CreateCubeFromRaw
bool CreateCubeFromRaw(unsigned int width, unsigned int height, int numComps, int dataType, void *data[6])
Create a cube texture from 6 buffers from client memory.
vtkTextureObject::Depth
unsigned int Depth
Definition: vtkTextureObject.h:754
vtkTextureObject::CopyToFrameBuffer
void CopyToFrameBuffer(int srcXmin, int srcYmin, int srcXmax, int srcYmax, int dstXmin, int dstYmin, int dstSizeX, int dstSizeY, vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
vtkTextureObject::CopyToFrameBuffer
void CopyToFrameBuffer(float *tcoords, float *verts, vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
vtkOpenGLBufferObject
OpenGL buffer object.
Definition: vtkOpenGLBufferObject.h:34
vtkTextureObject::AllocateProxyTexture3D
bool AllocateProxyTexture3D(unsigned int const width, unsigned int const height, unsigned int const depth, int const numComps, int const dataType)
Create a 3D texture using the GL_PROXY_TEXTURE_3D target.
vtkX3D::scale
@ scale
Definition: vtkX3D.h:235
vtkTextureObject::Gequal
@ Gequal
Definition: vtkTextureObject.h:47
vtkTextureObject::CreateTextureBuffer
bool CreateTextureBuffer(unsigned int numValues, int numComps, int dataType, vtkOpenGLBufferObject *bo)
Create a texture buffer basically a 1D texture that can be very large for passing data into the fragm...
vtkTextureObject::NumberOfDimensions
int NumberOfDimensions
Definition: vtkTextureObject.h:751
vtkTextureObject::Create3D
bool Create3D(unsigned int width, unsigned int height, unsigned int depth, int numComps, int vtktype, bool)
Definition: vtkTextureObject.h:338
vtkTextureObject::SendParametersTime
vtkTimeStamp SendParametersTime
Definition: vtkTextureObject.h:794
vtkTextureObject::Never
@ Never
Definition: vtkTextureObject.h:53
vtkX3D::data
@ data
Definition: vtkX3D.h:321
vtkTextureObject::LinearMipmapLinear
@ LinearMipmapLinear
Definition: vtkTextureObject.h:79
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:33
vtkTextureObject::Download
vtkPixelBufferObject * Download()
This is used to download raw data from the texture into a pixel buffer.
vtkTextureObject::RequireTextureFloat
bool RequireTextureFloat
Definition: vtkTextureObject.h:771
vtkTextureObject::~vtkTextureObject
~vtkTextureObject() override
vtkTextureObject::Target
unsigned int Target
Definition: vtkTextureObject.h:760
vtkTextureObject::WrapR
int WrapR
Definition: vtkTextureObject.h:778
vtkTextureObject::Fixed16
@ Fixed16
Definition: vtkTextureObject.h:88
vtkTextureObject::MagnificationFilter
int MagnificationFilter
Definition: vtkTextureObject.h:780
vtkTextureObject::SetFormat
void SetFormat(unsigned int glFormat)
vtkTextureObject::SetContext
void SetContext(vtkOpenGLRenderWindow *)
Get/Set the context.
vtkTextureObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:54
vtkTextureObject::GenerateMipmap
bool GenerateMipmap
Definition: vtkTextureObject.h:791
vtkTextureObject::SupportsTextureInteger
bool SupportsTextureInteger
Definition: vtkTextureObject.h:770
vtkTextureObject::GetMaximumTextureSize
static int GetMaximumTextureSize(vtkOpenGLRenderWindow *context)
Query and return maximum texture size (dimension) supported by the OpenGL driver for a particular con...
vtkTextureObject::SupportsDepthBufferFloat
bool SupportsDepthBufferFloat
Definition: vtkTextureObject.h:774
vtkTextureObject::SetInternalFormat
void SetInternalFormat(unsigned int glInternalFormat)
vtkTextureObject::OwnHandle
bool OwnHandle
Definition: vtkTextureObject.h:768
vtkTextureObject::Less
@ Less
Definition: vtkTextureObject.h:48
vtkTextureObject::GetFormat
unsigned int GetFormat(int vtktype, int numComps, bool shaderSupportsTextureInt)
Get/Set format (OpenGL internal format) that should be used.
vtkTextureObject::AllocateDepth
bool AllocateDepth(unsigned int width, unsigned int height, int internalFormat)
Create a 2D depth texture but does not initialize its values.
vtkPolyData_detail::Target
Target
Definition: vtkPolyDataInternals.h:81
vtkTextureObject::GetVTKDataType
int GetVTKDataType()
Get the data type for the texture as a vtk type int i.e.
vtkTextureObject::AssignToExistingTexture
void AssignToExistingTexture(unsigned int handle, unsigned int target)
Assign the TextureObject to a externally provided Handle and Target.
vtkTextureObject::GetLinearMagnification
bool GetLinearMagnification()
Definition: vtkTextureObject.h:514
vtkTextureObject::vtkTextureObject
vtkTextureObject()
vtkTextureObject::LinearMipmapNearest
@ LinearMipmapNearest
Definition: vtkTextureObject.h:78
vtkTextureObject::Allocate2D
bool Allocate2D(unsigned int width, unsigned int height, int numComps, int vtkType, int level=0)
Create a 2D color texture but does not initialize its values.
vtkTextureObject::GetTextureUnit
int GetTextureUnit()
Return the texture unit used for this texture.
vtkTextureObject::Float16
@ Float16
Definition: vtkTextureObject.h:91
vtkTextureObject::NotEqual
@ NotEqual
Definition: vtkTextureObject.h:51
vtkTextureObject::Activate
virtual void Activate()
Activate and Bind the texture.
vtkTextureObject::MaxLevel
int MaxLevel
Definition: vtkTextureObject.h:785
vtkTextureObject::GetShiftAndScale
void GetShiftAndScale(float &shift, float &scale)
Get the shift and scale required in the shader to return the texture values to their original range.
vtkTextureObject::CreateDepth
bool CreateDepth(unsigned int width, unsigned int height, int internalFormat, vtkPixelBufferObject *pbo)
Create a 2D depth texture using a PBO.
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkTextureObject::Context
vtkWeakPointer< vtkOpenGLRenderWindow > Context
Definition: vtkTextureObject.h:766
vtkTextureObject::GetInternalFormat
unsigned int GetInternalFormat(int vtktype, int numComps, bool shaderSupportsTextureInt)
Get/Set internal format (OpenGL internal format) that should be used.
vtkTextureObject::AllocateDepthStencil
bool AllocateDepthStencil(unsigned int width, unsigned int height)
Create a 2D septh stencil texture but does not initialize its values.
vtkTextureObject::GetMinificationFilterMode
unsigned int GetMinificationFilterMode(int vtktype)
vtkTextureObject::GetMagnificationFilterMode
unsigned int GetMagnificationFilterMode(int vtktype)
vtkTextureObject::Fixed24
@ Fixed24
Definition: vtkTextureObject.h:89
vtkTextureObject::MinificationFilter
int MinificationFilter
Definition: vtkTextureObject.h:779
vtkX3D::level
@ level
Definition: vtkX3D.h:401
target
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Definition: vtkBoostGraphAdapter.h:965
vtkTextureObject::Fixed8
@ Fixed8
Definition: vtkTextureObject.h:87
vtkTextureObject::GetTuples
unsigned int GetTuples()
Definition: vtkTextureObject.h:124
vtkTextureObject::RequireDepthBufferFloat
bool RequireDepthBufferFloat
Definition: vtkTextureObject.h:773
vtkTextureObject::GetDefaultFormat
unsigned int GetDefaultFormat(int vtktype, int numComps, bool shaderSupportsTextureInt)
vtkTextureObject::CreateTexture
void CreateTexture()
Creates a texture handle if not already created.
vtkTextureObject::ShaderProgram
vtkOpenGLHelper * ShaderProgram
Definition: vtkTextureObject.h:797
vtkTextureObject::GetWrapRMode
unsigned int GetWrapRMode(int vtktype)
vtkTextureObject::Repeat
@ Repeat
Definition: vtkTextureObject.h:60
vtkX3D::height
@ height
Definition: vtkX3D.h:260
vtkTextureObject::Fixed32
@ Fixed32
Definition: vtkTextureObject.h:90
vtkTextureObject::Resize
void Resize(unsigned int width, unsigned int height)
vtkShaderProgram
The ShaderProgram uses one or more Shader objects.
Definition: vtkShaderProgram.h:45
vtkTextureObject::IsSupported
static bool IsSupported(vtkOpenGLRenderWindow *)
Check for feature support, without any optional features.
Definition: vtkTextureObject.h:659
vtkGenericOpenGLResourceFreeCallback
Definition: vtkOpenGLResourceFreeCallback.h:26
vtkTextureObject::Components
int Components
Definition: vtkTextureObject.h:764
vtkOpenGLHelper
Definition: vtkOpenGLHelper.h:31
vtkTextureObject::RequireTextureInteger
bool RequireTextureInteger
Definition: vtkTextureObject.h:769
vtkTextureObject::Deactivate
void Deactivate()
Deactivate and UnBind the texture.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkTextureObject
abstracts an OpenGL texture object.
Definition: vtkTextureObject.h:41
vtkTextureObject::Download
vtkPixelBufferObject * Download(unsigned int target, unsigned int level)
vtkTextureObject::New
static vtkTextureObject * New()
vtkTextureObject::Width
unsigned int Width
Definition: vtkTextureObject.h:752
vtkTextureObject::CopyFromFrameBuffer
void CopyFromFrameBuffer(int srcXmin, int srcYmin, int dstXmin, int dstYmin, int width, int height)
Copy a sub-part of a logical buffer of the framebuffer (color or depth) to the texture object.
vtkTextureObject::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *win)
Deactivate and UnBind the texture.
vtkTextureObject::Create3D
bool Create3D(unsigned int width, unsigned int height, unsigned int depth, int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
Create a 3D texture using the PBO.
vtkWeakPointer.h
vtkTextureObject::ResetFormatAndType
void ResetFormatAndType()
Reset format, internal format, and type of the texture.
vtkTextureObject::GetContext
vtkOpenGLRenderWindow * GetContext()
vtkTextureObject::Allocate1D
bool Allocate1D(unsigned int width, int numComps, int vtkType)
Create a 1D color texture but does not initialize its values.
vtkTextureObject::SetDataType
void SetDataType(unsigned int glType)
vtkObject.h
vtkTextureObject::MaxLOD
float MaxLOD
Definition: vtkTextureObject.h:783
vtkTextureObject::SendParameters
void SendParameters()
Send all the texture object parameters to the hardware if not done yet.
vtkTextureObject::Equal
@ Equal
Definition: vtkTextureObject.h:50
vtkTextureObject::Allocate3D
bool Allocate3D(unsigned int width, unsigned int height, unsigned int depth, int numComps, int vtkType)
Create a 3D color texture but does not initialize its values.
vtkTextureObject::NearestMipmapNearest
@ NearestMipmapNearest
Definition: vtkTextureObject.h:76
vtkTextureObject::Create2D
bool Create2D(unsigned int width, unsigned int height, int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
Create a 2D texture using the PBO.
vtkTextureObject::Create1DFromRaw
bool Create1DFromRaw(unsigned int width, int numComps, int dataType, void *data)
Create 1D texture from client memory.
vtkTextureObject::SupportsTextureFloat
bool SupportsTextureFloat
Definition: vtkTextureObject.h:772
vtkTextureObject::WrapS
int WrapS
Definition: vtkTextureObject.h:776
vtkTextureObject::Handle
unsigned int Handle
Definition: vtkTextureObject.h:767
vtkTextureObject::IsBound
bool IsBound()
Tells if the texture object is bound to the active texture image unit.
vtkTextureObject::GetDataType
int GetDataType(int vtk_scalar_type)
Get the data type for the texture as GLenum type.
vtkTextureObject::AutoParameters
int AutoParameters
Definition: vtkTextureObject.h:793
vtkTextureObject::GetMaximumTextureSize3D
int GetMaximumTextureSize3D()
Overload which uses the internal context to query the maximum 3D texture size.
vtkTextureObject::GetDefaultDataType
int GetDefaultDataType(int vtk_scalar_type)
vtkTextureObject::Height
unsigned int Height
Definition: vtkTextureObject.h:753
vtkTextureObject::CopyToFrameBuffer
void CopyToFrameBuffer(vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
Copy the texture (src) in the current framebuffer.
vtkTextureObject::GetWrapSMode
unsigned int GetWrapSMode(int vtktype)
vtkTextureObject::CreateDepthFromRaw
bool CreateDepthFromRaw(unsigned int width, unsigned int height, int internalFormat, int rawType, void *raw)
Create a 2D depth texture using a raw pointer.
vtkTextureObject::Greater
@ Greater
Definition: vtkTextureObject.h:49
vtkTextureObject::Format
unsigned int Format
Definition: vtkTextureObject.h:761
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:52
vtkTextureObject::Float32
@ Float32
Definition: vtkTextureObject.h:92
vtkTextureObject::Bind
void Bind()
Bind the texture, must have been created using Create().
vtkTextureObject::Create2D
bool Create2D(unsigned int width, unsigned int height, int numComps, int vtktype, bool)
Create texture without uploading any data.
Definition: vtkTextureObject.h:334
vtkTextureObject::GetWrapTMode
unsigned int GetWrapTMode(int vtktype)
vtkTextureObject::WrapT
int WrapT
Definition: vtkTextureObject.h:777
vtkTextureObject::GetMaximumTextureSize3D
static int GetMaximumTextureSize3D(vtkOpenGLRenderWindow *context)
vtkTextureObject::Create2DFromRaw
bool Create2DFromRaw(unsigned int width, unsigned int height, int numComps, int dataType, void *data)
Create a 2D texture from client memory numComps must be in [1-4].
vtkTextureObject::SetLinearMagnification
void SetLinearMagnification(bool val)
Tells if the magnification mode is linear (true) or nearest (false).
Definition: vtkTextureObject.h:512
vtkTextureObject::DestroyTexture
void DestroyTexture()
Destroy the texture.
vtkTextureObject::DepthTextureCompareFunction
int DepthTextureCompareFunction
Definition: vtkTextureObject.h:789
vtkOpenGLVertexArrayObject
The VertexArrayObject class uses, or emulates, vertex array objects.
Definition: vtkOpenGLVertexArrayObject.h:37
vtkTextureObject::IsSupported
static bool IsSupported(vtkOpenGLRenderWindow *, bool, bool, bool)
Returns if the context supports the required extensions.
Definition: vtkTextureObject.h:650
vtkTextureObject::BaseLevel
int BaseLevel
Definition: vtkTextureObject.h:784
vtkTextureObject::Type
unsigned int Type
Definition: vtkTextureObject.h:763
vtkPixelBufferObject
abstracts an OpenGL pixel buffer object.
Definition: vtkPixelBufferObject.h:44
vtkWeakPointer< vtkOpenGLRenderWindow >
vtkTextureObject::InternalFormat
unsigned int InternalFormat
Definition: vtkTextureObject.h:762
vtkTextureObject::NearestMipmapLinear
@ NearestMipmapLinear
Definition: vtkTextureObject.h:77
vtkTextureObject::MaximumAnisotropicFiltering
float MaximumAnisotropicFiltering
Definition: vtkTextureObject.h:758
vtkTextureObject::MinLOD
float MinLOD
Definition: vtkTextureObject.h:782