VTK  9.1.0
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 =========================================================================*/
43 #ifndef vtkTextureObject_h
44 #define vtkTextureObject_h
45 
46 #include "vtkObject.h"
47 #include "vtkRenderingOpenGL2Module.h" // For export macro
48 #include "vtkWeakPointer.h" // for render context
49 
51 class vtkOpenGLHelper;
55 class vtkShaderProgram;
56 class vtkWindow;
58 
59 class VTKRENDERINGOPENGL2_EXPORT vtkTextureObject : public vtkObject
60 {
61 public:
62  // DepthTextureCompareFunction values.
63  enum
64  {
65  Lequal = 0, // r=R<=Dt ? 1.0 : 0.0
66  Gequal, // r=R>=Dt ? 1.0 : 0.0
67  Less, // r=R<D_t ? 1.0 : 0.0
68  Greater, // r=R>Dt ? 1.0 : 0.0
69  Equal, // r=R==Dt ? 1.0 : 0.0
70  NotEqual, // r=R!=Dt ? 1.0 : 0.0
71  AlwaysTrue, // r=1.0 // WARNING "Always" is macro defined in X11/X.h...
72  Never, // r=0.0
73  NumberOfDepthTextureCompareFunctions
74  };
75 
76 // ClampToBorder is not supported in ES 2.0
77 // Wrap values.
78 #ifndef GL_ES_VERSION_3_0
79  enum { ClampToEdge = 0, Repeat, MirroredRepeat, ClampToBorder, NumberOfWrapModes };
80 #else
81  enum
82  {
83  ClampToEdge = 0,
84  Repeat,
85  MirroredRepeat,
86  NumberOfWrapModes
87  };
88 #endif
89 
90  // MinificationFilter values.
91  enum
92  {
93  Nearest = 0,
99  NumberOfMinificationModes
100  };
101 
102  // depth/color format
103  enum
104  {
105  Native = 0, // will try to match with the depth buffer format.
112  NumberOfDepthFormats
113  };
114 
116  vtkTypeMacro(vtkTextureObject, vtkObject);
117  void PrintSelf(ostream& os, vtkIndent indent) override;
118 
120 
132 
134 
138  vtkGetMacro(Width, unsigned int);
139  vtkGetMacro(Height, unsigned int);
140  vtkGetMacro(Depth, unsigned int);
141  vtkGetMacro(Samples, unsigned int);
142  vtkGetMacro(Components, int);
143  unsigned int GetTuples() { return this->Width * this->Height * this->Depth; }
145 
146  vtkGetMacro(NumberOfDimensions, int);
147 
148  // for MSAA textures set the number of samples
149  vtkSetMacro(Samples, unsigned int);
150 
152 
155  vtkGetMacro(Target, unsigned int);
157 
159 
162  vtkGetMacro(Handle, unsigned int);
164 
169 
171 
176  void Bind();
178 
182  virtual void Activate();
183 
187  void Deactivate();
188 
193 
198  bool IsBound();
199 
207 
209 
213  vtkSetMacro(AutoParameters, int);
214  vtkGetMacro(AutoParameters, int);
215  vtkBooleanMacro(AutoParameters, int);
217 
223  unsigned int width, unsigned int height, int numComps, int dataType, void* data);
224 
231  unsigned int width, unsigned int height, int internalFormat, int rawType, void* raw);
232 
238  unsigned int numValues, int numComps, int dataType, vtkOpenGLBufferObject* bo);
239 
246  unsigned int width, unsigned int height, int numComps, int dataType, void* data[6]);
247 
258  bool Create1D(int numComps, vtkPixelBufferObject* pbo, bool shaderSupportsTextureInt);
259 
263  bool Create1DFromRaw(unsigned int width, int numComps, int dataType, void* data);
264 
271  bool Create2D(unsigned int width, unsigned int height, int numComps, vtkPixelBufferObject* pbo,
272  bool shaderSupportsTextureInt);
273 
280  bool Create3D(unsigned int width, unsigned int height, unsigned int depth, int numComps,
281  vtkPixelBufferObject* pbo, bool shaderSupportsTextureInt);
282 
287  bool Create3DFromRaw(unsigned int width, unsigned int height, unsigned int depth, int numComps,
288  int dataType, void* data);
289 
296  bool AllocateProxyTexture3D(unsigned int const width, unsigned int const height,
297  unsigned int const depth, int const numComps, int const dataType);
298 
306  vtkPixelBufferObject* Download(unsigned int target, unsigned int level);
307 
313  unsigned int width, unsigned int height, int internalFormat, vtkPixelBufferObject* pbo);
314 
318  bool AllocateDepth(unsigned int width, unsigned int height, int internalFormat);
319 
323  bool AllocateDepthStencil(unsigned int width, unsigned int height);
324 
329  bool Allocate1D(unsigned int width, int numComps, int vtkType);
330 
336  unsigned int width, unsigned int height, int numComps, int vtkType, int level = 0);
337 
343  unsigned int width, unsigned int height, unsigned int depth, int numComps, int vtkType);
344 
346 
349  bool Create2D(unsigned int width, unsigned int height, int numComps, int vtktype, bool)
350  {
351  return this->Allocate2D(width, height, numComps, vtktype);
352  }
353  bool Create3D(
354  unsigned int width, unsigned int height, unsigned int depth, int numComps, int vtktype, bool)
355  {
356  return this->Allocate3D(width, height, depth, numComps, vtktype);
357  }
359 
364 
366 
369  int GetDataType(int vtk_scalar_type);
370  void SetDataType(unsigned int glType);
371  int GetDefaultDataType(int vtk_scalar_type);
373 
375 
380  unsigned int GetInternalFormat(int vtktype, int numComps, bool shaderSupportsTextureInt);
381  void SetInternalFormat(unsigned int glInternalFormat);
382  unsigned int GetDefaultInternalFormat(int vtktype, int numComps, bool shaderSupportsTextureInt);
384 
386 
391  unsigned int GetFormat(int vtktype, int numComps, bool shaderSupportsTextureInt);
392  void SetFormat(unsigned int glFormat);
393  unsigned int GetDefaultFormat(int vtktype, int numComps, bool shaderSupportsTextureInt);
395 
405 
406  unsigned int GetMinificationFilterMode(int vtktype);
407  unsigned int GetMagnificationFilterMode(int vtktype);
408  unsigned int GetWrapSMode(int vtktype);
409  unsigned int GetWrapTMode(int vtktype);
410  unsigned int GetWrapRMode(int vtktype);
411 
413 
419  vtkSetMacro(RequireDepthBufferFloat, bool);
420  vtkGetMacro(RequireDepthBufferFloat, bool);
421  vtkGetMacro(SupportsDepthBufferFloat, bool);
423 
425 
431  vtkSetMacro(RequireTextureFloat, bool);
432  vtkGetMacro(RequireTextureFloat, bool);
433  vtkGetMacro(SupportsTextureFloat, bool);
435 
437 
443  vtkSetMacro(RequireTextureInteger, bool);
444  vtkGetMacro(RequireTextureInteger, bool);
445  vtkGetMacro(SupportsTextureInteger, bool);
447 
449 
459  vtkGetMacro(WrapS, int);
460  vtkSetMacro(WrapS, int);
462 
464 
474  vtkGetMacro(WrapT, int);
475  vtkSetMacro(WrapT, int);
477 
479 
489  vtkGetMacro(WrapR, int);
490  vtkSetMacro(WrapR, int);
492 
494 
507  vtkGetMacro(MinificationFilter, int);
508  vtkSetMacro(MinificationFilter, int);
510 
512 
519  vtkGetMacro(MagnificationFilter, int);
520  vtkSetMacro(MagnificationFilter, int);
522 
527  void SetLinearMagnification(bool val) { this->SetMagnificationFilter(val ? Linear : Nearest); }
528 
529  bool GetLinearMagnification() { return this->MagnificationFilter == Linear; }
530 
532 
537  vtkSetVector4Macro(BorderColor, float);
538  vtkGetVector4Macro(BorderColor, float);
540 
542 
546  vtkSetMacro(MinLOD, float);
547  vtkGetMacro(MinLOD, float);
549 
551 
555  vtkSetMacro(MaxLOD, float);
556  vtkGetMacro(MaxLOD, float);
558 
560 
565  vtkSetMacro(BaseLevel, int);
566  vtkGetMacro(BaseLevel, int);
568 
570 
575  vtkSetMacro(MaxLevel, int);
576  vtkGetMacro(MaxLevel, int);
578 
580 
590  vtkGetMacro(DepthTextureCompare, bool);
591  vtkSetMacro(DepthTextureCompare, bool);
593 
595 
615  vtkGetMacro(DepthTextureCompareFunction, int);
616  vtkSetMacro(DepthTextureCompareFunction, int);
618 
620 
625  vtkGetMacro(GenerateMipmap, bool);
626  vtkSetMacro(GenerateMipmap, bool);
628 
630 
635  vtkSetMacro(MaximumAnisotropicFiltering, float);
636  vtkGetMacro(MaximumAnisotropicFiltering, float);
638 
640 
651 
659 
665  static bool IsSupported(vtkOpenGLRenderWindow*, bool /* requireTexFloat */,
666  bool /* requireDepthFloat */, bool /* requireTexInt */)
667  {
668  return true;
669  }
670 
674  static bool IsSupported(vtkOpenGLRenderWindow*) { return true; }
675 
677 
683  // part of a texture to part of a viewport, scaling as needed
684  void CopyToFrameBuffer(int srcXmin, int srcYmin, int srcXmax, int srcYmax, int dstXmin,
685  int dstYmin, int dstXmax, int dstYmax, int dstSizeX, int dstSizeY, vtkShaderProgram* program,
687  // copy part of a texure to part of a viewport, no scalaing
688  void CopyToFrameBuffer(int srcXmin, int srcYmin, int srcXmax, int srcYmax, int dstXmin,
689  int dstYmin, int dstSizeX, int dstSizeY, vtkShaderProgram* program,
691  // copy a texture to a quad using the provided tcoords and verts
693  float* tcoords, float* verts, vtkShaderProgram* program, vtkOpenGLVertexArrayObject* vao);
695 
708  int srcXmin, int srcYmin, int dstXmin, int dstYmin, int width, int height);
709 
722  void GetShiftAndScale(float& shift, float& scale);
723 
724  // resizes an existing texture, any existing
725  // data values are lost
726  void Resize(unsigned int width, unsigned int height);
727 
729 
735  vtkGetMacro(UseSRGBColorSpace, bool);
736  vtkSetMacro(UseSRGBColorSpace, bool);
737  vtkBooleanMacro(UseSRGBColorSpace, bool);
739 
748  void AssignToExistingTexture(unsigned int handle, unsigned int target);
749 
750 protected:
752  ~vtkTextureObject() override;
753 
755 
760 
765 
767  unsigned int Width;
768  unsigned int Height;
769  unsigned int Depth;
770  unsigned int Samples;
772 
774 
775  unsigned int Target; // GLenum
776  unsigned int Format; // GLenum
777  unsigned int InternalFormat; // GLenum
778  unsigned int Type; // GLenum
780 
782  unsigned int Handle;
783  bool OwnHandle;
790 
791  int WrapS;
792  int WrapT;
793  int WrapR;
796 
797  float MinLOD;
798  float MaxLOD;
800  int MaxLevel;
801  float BorderColor[4];
802 
805 
807 
810 
811  // used for copying to framebuffer
813 
814  // for texturebuffers we hold on to the Buffer
816 
817 private:
818  vtkTextureObject(const vtkTextureObject&) = delete;
819  void operator=(const vtkTextureObject&) = delete;
820 };
821 
822 #endif
vtkTextureObject::DepthTextureCompare
bool DepthTextureCompare
Definition: vtkTextureObject.h:803
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)
Copy the texture (src) in the current framebuffer.
vtkTextureObject::Equal
@ Equal
Definition: vtkTextureObject.h:69
vtkTextureObject::LinearMipmapLinear
@ LinearMipmapLinear
Definition: vtkTextureObject.h:98
vtkTextureObject::UseSRGBColorSpace
bool UseSRGBColorSpace
Definition: vtkTextureObject.h:771
vtkTextureObject::GetDefaultInternalFormat
unsigned int GetDefaultInternalFormat(int vtktype, int numComps, bool shaderSupportsTextureInt)
Get/Set internal format (OpenGL internal format) that should be used.
vtkTextureObject::ResourceCallback
vtkGenericOpenGLResourceFreeCallback * ResourceCallback
Definition: vtkTextureObject.h:754
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::Create1D
bool Create1D(int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
Create a 1D texture using the PBO.
vtkTextureObject::BufferObject
vtkOpenGLBufferObject * BufferObject
Definition: vtkTextureObject.h:815
vtkTextureObject::Samples
unsigned int Samples
Definition: vtkTextureObject.h:770
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:769
vtkTextureObject::CopyToFrameBuffer
void CopyToFrameBuffer(int srcXmin, int srcYmin, int srcXmax, int srcYmax, int dstXmin, int dstYmin, int dstSizeX, int dstSizeY, vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
Copy the texture (src) in the current framebuffer.
vtkTextureObject::CopyToFrameBuffer
void CopyToFrameBuffer(float *tcoords, float *verts, vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
Copy the texture (src) in the current framebuffer.
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::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:766
vtkTextureObject::Create3D
bool Create3D(unsigned int width, unsigned int height, unsigned int depth, int numComps, int vtktype, bool)
Create texture without uploading any data.
Definition: vtkTextureObject.h:353
vtkTextureObject::SendParametersTime
vtkTimeStamp SendParametersTime
Definition: vtkTextureObject.h:809
vtkX3D::data
@ data
Definition: vtkX3D.h:321
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:52
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:786
vtkTextureObject::~vtkTextureObject
~vtkTextureObject() override
vtkTextureObject::Target
unsigned int Target
Definition: vtkTextureObject.h:775
vtkTextureObject::Linear
@ Linear
Definition: vtkTextureObject.h:94
vtkTextureObject::WrapR
int WrapR
Definition: vtkTextureObject.h:793
vtkTextureObject::MagnificationFilter
int MagnificationFilter
Definition: vtkTextureObject.h:795
vtkTextureObject::Fixed16
@ Fixed16
Definition: vtkTextureObject.h:107
vtkTextureObject::SetFormat
void SetFormat(unsigned int glFormat)
Get/Set format (OpenGL internal format) that should be used.
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:82
vtkTextureObject::GenerateMipmap
bool GenerateMipmap
Definition: vtkTextureObject.h:806
vtkTextureObject::NearestMipmapLinear
@ NearestMipmapLinear
Definition: vtkTextureObject.h:96
vtkTextureObject::Fixed24
@ Fixed24
Definition: vtkTextureObject.h:108
vtkTextureObject::SupportsTextureInteger
bool SupportsTextureInteger
Definition: vtkTextureObject.h:785
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:789
vtkTextureObject::SetInternalFormat
void SetInternalFormat(unsigned int glInternalFormat)
Get/Set internal format (OpenGL internal format) that should be used.
vtkTextureObject::OwnHandle
bool OwnHandle
Definition: vtkTextureObject.h:783
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::Float32
@ Float32
Definition: vtkTextureObject.h:111
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:529
vtkTextureObject::vtkTextureObject
vtkTextureObject()
vtkTextureObject::Gequal
@ Gequal
Definition: vtkTextureObject.h:66
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::Greater
@ Greater
Definition: vtkTextureObject.h:68
vtkTextureObject::Activate
virtual void Activate()
Activate and Bind the texture.
vtkTextureObject::MaxLevel
int MaxLevel
Definition: vtkTextureObject.h:800
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::AlwaysTrue
@ AlwaysTrue
Definition: vtkTextureObject.h:71
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:39
vtkTextureObject::Context
vtkWeakPointer< vtkOpenGLRenderWindow > Context
Definition: vtkTextureObject.h:781
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::Never
@ Never
Definition: vtkTextureObject.h:72
vtkTextureObject::GetMinificationFilterMode
unsigned int GetMinificationFilterMode(int vtktype)
vtkTextureObject::GetMagnificationFilterMode
unsigned int GetMagnificationFilterMode(int vtktype)
vtkTextureObject::Repeat
@ Repeat
Definition: vtkTextureObject.h:79
vtkTextureObject::MinificationFilter
int MinificationFilter
Definition: vtkTextureObject.h:794
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:1004
vtkTextureObject::GetTuples
unsigned int GetTuples()
Get the texture dimensions.
Definition: vtkTextureObject.h:143
vtkTextureObject::RequireDepthBufferFloat
bool RequireDepthBufferFloat
Definition: vtkTextureObject.h:788
vtkTextureObject::NotEqual
@ NotEqual
Definition: vtkTextureObject.h:70
vtkTextureObject::GetDefaultFormat
unsigned int GetDefaultFormat(int vtktype, int numComps, bool shaderSupportsTextureInt)
Get/Set format (OpenGL internal format) that should be used.
vtkTextureObject::Less
@ Less
Definition: vtkTextureObject.h:67
vtkTextureObject::CreateTexture
void CreateTexture()
Creates a texture handle if not already created.
vtkTextureObject::ShaderProgram
vtkOpenGLHelper * ShaderProgram
Definition: vtkTextureObject.h:812
vtkTextureObject::GetWrapRMode
unsigned int GetWrapRMode(int vtktype)
vtkX3D::height
@ height
Definition: vtkX3D.h:260
vtkTextureObject::Resize
void Resize(unsigned int width, unsigned int height)
vtkShaderProgram
The ShaderProgram uses one or more Shader objects.
Definition: vtkShaderProgram.h:124
vtkTextureObject::IsSupported
static bool IsSupported(vtkOpenGLRenderWindow *)
Check for feature support, without any optional features.
Definition: vtkTextureObject.h:674
vtkGenericOpenGLResourceFreeCallback
Definition: vtkOpenGLResourceFreeCallback.h:26
vtkTextureObject::Components
int Components
Definition: vtkTextureObject.h:779
vtkOpenGLHelper
Definition: vtkOpenGLHelper.h:31
vtkTextureObject::RequireTextureInteger
bool RequireTextureInteger
Definition: vtkTextureObject.h:784
vtkTextureObject::Deactivate
void Deactivate()
Deactivate and UnBind the texture.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkTextureObject
abstracts an OpenGL texture object.
Definition: vtkTextureObject.h:60
vtkTextureObject::Download
vtkPixelBufferObject * Download(unsigned int target, unsigned int level)
vtkTextureObject::New
static vtkTextureObject * New()
vtkTextureObject::Width
unsigned int Width
Definition: vtkTextureObject.h:767
vtkTextureObject::NearestMipmapNearest
@ NearestMipmapNearest
Definition: vtkTextureObject.h:95
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()
Get/Set the context.
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)
Get the data type for the texture as GLenum type.
vtkObject.h
vtkTextureObject::MaxLOD
float MaxLOD
Definition: vtkTextureObject.h:798
vtkTextureObject::SendParameters
void SendParameters()
Send all the texture object parameters to the hardware if not done yet.
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::Create2D
bool Create2D(unsigned int width, unsigned int height, int numComps, vtkPixelBufferObject *pbo, bool shaderSupportsTextureInt)
Create a 2D texture using the PBO.
vtkTextureObject::Fixed32
@ Fixed32
Definition: vtkTextureObject.h:109
vtkTextureObject::Float16
@ Float16
Definition: vtkTextureObject.h:110
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:787
vtkTextureObject::WrapS
int WrapS
Definition: vtkTextureObject.h:791
vtkTextureObject::Fixed8
@ Fixed8
Definition: vtkTextureObject.h:106
vtkTextureObject::Handle
unsigned int Handle
Definition: vtkTextureObject.h:782
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:808
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)
Get the data type for the texture as GLenum type.
vtkTextureObject::Height
unsigned int Height
Definition: vtkTextureObject.h:768
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::Format
unsigned int Format
Definition: vtkTextureObject.h:776
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:83
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:349
vtkTextureObject::GetWrapTMode
unsigned int GetWrapTMode(int vtktype)
vtkTextureObject::LinearMipmapNearest
@ LinearMipmapNearest
Definition: vtkTextureObject.h:97
vtkTextureObject::WrapT
int WrapT
Definition: vtkTextureObject.h:792
vtkTextureObject::GetMaximumTextureSize3D
static int GetMaximumTextureSize3D(vtkOpenGLRenderWindow *context)
Query and return maximum texture size (dimension) supported by the OpenGL driver for a particular con...
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:527
vtkTextureObject::DestroyTexture
void DestroyTexture()
Destroy the texture.
vtkTextureObject::DepthTextureCompareFunction
int DepthTextureCompareFunction
Definition: vtkTextureObject.h:804
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:665
vtkTextureObject::BaseLevel
int BaseLevel
Definition: vtkTextureObject.h:799
vtkTextureObject::Type
unsigned int Type
Definition: vtkTextureObject.h:778
vtkPixelBufferObject
abstracts an OpenGL pixel buffer object.
Definition: vtkPixelBufferObject.h:44
vtkWeakPointer< vtkOpenGLRenderWindow >
vtkTextureObject::InternalFormat
unsigned int InternalFormat
Definition: vtkTextureObject.h:777
vtkTextureObject::MaximumAnisotropicFiltering
float MaximumAnisotropicFiltering
Definition: vtkTextureObject.h:773
vtkTextureObject::MinLOD
float MinLOD
Definition: vtkTextureObject.h:797