MeVisLab Resolution Independence API
Toggle main menu visibility
Loading...
Searching...
No Matches
SoSampler.h
Go to the documentation of this file.
1
/*************************************************************************************
2
**
3
** Copyright 2007, MeVis Medical Solutions AG
4
**
5
** The user may use this file in accordance with the license agreement provided with
6
** the Software or, alternatively, in accordance with the terms contained in a
7
** written agreement between the user and MeVis Medical Solutions AG.
8
**
9
** For further information use the contact form at https://www.mevislab.de/contact
10
**
11
**************************************************************************************/
12
13
#ifndef SO_SAMPLER_H
14
#define SO_SAMPLER_H
15
16
18
19
#include "
SoShaderSystem.h
"
20
#include "
Inventor/nodes/SoUniformShaderParameter.h
"
21
#include "
Inventor/elements/SoSamplerInfoElement.h
"
22
#include <Inventor/fields/SoSFUInt32.h>
23
#include <Inventor/fields/SoSFEnum.h>
24
#include <Inventor/fields/SoSFBool.h>
25
#include <Inventor/fields/SoSFVec4f.h>
26
#include <GL/glew.h>
27
29
SoEXTENDER
class
INVENTOR_SHADER_API
SoSampler
:
public
SoUniformShaderParameter
30
{
31
typedef
SoUniformShaderParameter
inherited;
32
33
SO_NODE_ABSTRACT_HEADER(
SoSampler
);
34
35
public
:
37
enum
TexGenMode
{
38
NORMAL_MAP
= GL_NORMAL_MAP_EXT,
39
REFLECTION_MAP
= GL_REFLECTION_MAP_EXT
40
};
41
43
enum
Wrap
{
44
REPEAT
= GL_REPEAT,
// Not supported by GL_TEXTURE_RECTANGLE_ARB
45
CLAMP
= GL_CLAMP,
46
CLAMP_TO_EDGE
= GL_CLAMP_TO_EDGE,
// OpenGL 1.2
47
CLAMP_TO_BORDER
= GL_CLAMP_TO_BORDER,
// OpenGL 1.3
48
MIRRORED_REPEAT
= GL_MIRRORED_REPEAT
// OpenGL 1.4, not supported by GL_TEXTURE_RECTANGLE_ARB
49
};
50
52
enum
Filter
{
53
NEAREST
= GL_NEAREST,
54
LINEAR
= GL_LINEAR,
55
NEAREST_MIPMAP_NEAREST
= GL_NEAREST_MIPMAP_NEAREST,
// GL_TEXTURE_MIN_FILTER only
56
NEAREST_MIPMAP_LINEAR
= GL_NEAREST_MIPMAP_LINEAR,
// GL_TEXTURE_MIN_FILTER only
57
LINEAR_MIPMAP_NEAREST
= GL_LINEAR_MIPMAP_NEAREST,
// GL_TEXTURE_MIN_FILTER only
58
LINEAR_MIPMAP_LINEAR
= GL_LINEAR_MIPMAP_LINEAR
// GL_TEXTURE_MIN_FILTER only
59
};
60
62
SoSFEnum
wrapS
;
63
65
SoSFBool
enableBorder
;
66
68
SoSFVec4f
borderColor
;
69
71
SoSFEnum
minFilter
;
72
74
SoSFEnum
magFilter
;
75
77
SoSFBool
use16BitFloat
;
78
80
SoSFBool
needsTextureCoordinates
;
81
82
SoEXTENDER public :
83
85
void
updateParameter
(
SoUniformParameterBase
* uniformBase, SoState* state)
override
;
86
87
SoINTERNAL public :
88
90
static
void
initClass
();
91
92
protected
:
93
~SoSampler
()
override
;
94
96
SbBool
_hasTextureFloat
;
97
99
SbString
_sizeUniformName
;
100
102
unsigned
int
_textureComponents
;
104
GLenum
_textureDataType
;
105
107
SoSampler
();
108
110
GLint
getInternalFormat
(GLenum glDataType);
111
113
const
char
*
getTextureFormatName
(GLenum internalFormat);
114
115
SbSamplerInfo::TextureType
getTextureTypeFromGLFormat
(GLenum internalFormat);
116
118
void
postTextureFormatInfo
(GLenum target, GLint format);
119
121
void
postTextureSizeInfo
(GLenum target);
122
124
virtual
void
nameChanged
(SoField* field);
125
127
virtual
void
texConfigChanged
(SoField*
/*field*/
) {};
128
};
129
130
#endif
// _SO_SAMPLER_
SoSamplerInfoElement.h
SoShaderSystem.h
INVENTOR_SHADER_API
#define INVENTOR_SHADER_API
Define class export specifier.
Definition
SoShaderSystem.h:20
SoUniformShaderParameter.h
SbSamplerInfo::TextureType
TextureType
Texture type.
Definition
SoSamplerInfoElement.h:29
SoSampler::minFilter
SoSFEnum minFilter
Minification filter mode. Default is LINEAR.
Definition
SoSampler.h:71
SoSampler::getTextureFormatName
const char * getTextureFormatName(GLenum internalFormat)
Return texture format name.
SoSampler::_textureDataType
GLenum _textureDataType
Definition
SoSampler.h:104
SoSampler::use16BitFloat
SoSFBool use16BitFloat
Use 16 Bit floating point for the texture format.
Definition
SoSampler.h:77
SoSampler::_textureComponents
unsigned int _textureComponents
Definition
SoSampler.h:102
SoSampler::_hasTextureFloat
SbBool _hasTextureFloat
TRUE if GL_xxx_texture_float extension is present.
Definition
SoSampler.h:96
SoSampler::_sizeUniformName
SbString _sizeUniformName
name of the uniform ?_size parameter
Definition
SoSampler.h:99
SoSampler::getInternalFormat
GLint getInternalFormat(GLenum glDataType)
Return specialized texture format for GL data type.
SoSampler::Filter
Filter
Filter methods for minification and magnification.
Definition
SoSampler.h:52
SoSampler::LINEAR_MIPMAP_LINEAR
@ LINEAR_MIPMAP_LINEAR
Definition
SoSampler.h:58
SoSampler::LINEAR
@ LINEAR
Definition
SoSampler.h:54
SoSampler::NEAREST
@ NEAREST
Definition
SoSampler.h:53
SoSampler::NEAREST_MIPMAP_NEAREST
@ NEAREST_MIPMAP_NEAREST
Definition
SoSampler.h:55
SoSampler::LINEAR_MIPMAP_NEAREST
@ LINEAR_MIPMAP_NEAREST
Definition
SoSampler.h:57
SoSampler::NEAREST_MIPMAP_LINEAR
@ NEAREST_MIPMAP_LINEAR
Definition
SoSampler.h:56
SoSampler::updateParameter
void updateParameter(SoUniformParameterBase *uniformBase, SoState *state) override
Assigns or updates the parameter's value.
SoSampler::enableBorder
SoSFBool enableBorder
Enable border to be part of the texture. Default is FALSE.
Definition
SoSampler.h:65
SoSampler::TexGenMode
TexGenMode
Texture gen mode.
Definition
SoSampler.h:37
SoSampler::REFLECTION_MAP
@ REFLECTION_MAP
Definition
SoSampler.h:39
SoSampler::NORMAL_MAP
@ NORMAL_MAP
Definition
SoSampler.h:38
SoSampler::SoSampler
SoSampler()
Constructor.
SoSampler::postTextureSizeInfo
void postTextureSizeInfo(GLenum target)
Prints the size of the bound texture.
SoSampler::wrapS
SoSFEnum wrapS
Wrapping mode. Default is REPEAT.
Definition
SoSampler.h:62
SoSampler::nameChanged
virtual void nameChanged(SoField *field)
Called when sampler name has changed.
SoSampler::Wrap
Wrap
Texture wrap type.
Definition
SoSampler.h:43
SoSampler::CLAMP_TO_BORDER
@ CLAMP_TO_BORDER
Definition
SoSampler.h:47
SoSampler::MIRRORED_REPEAT
@ MIRRORED_REPEAT
Definition
SoSampler.h:48
SoSampler::CLAMP
@ CLAMP
Definition
SoSampler.h:45
SoSampler::REPEAT
@ REPEAT
Definition
SoSampler.h:44
SoSampler::CLAMP_TO_EDGE
@ CLAMP_TO_EDGE
Definition
SoSampler.h:46
SoSampler::needsTextureCoordinates
SoSFBool needsTextureCoordinates
Enable this if the sampler needs the standard inventor texture coordinates.
Definition
SoSampler.h:80
SoSampler::postTextureFormatInfo
void postTextureFormatInfo(GLenum target, GLint format)
Prints channel depths for given target and format.
SoSampler::getTextureTypeFromGLFormat
SbSamplerInfo::TextureType getTextureTypeFromGLFormat(GLenum internalFormat)
SoSampler::borderColor
SoSFVec4f borderColor
Border color used to for border texture filtering. Only used if 'enableBorder' is FALSE....
Definition
SoSampler.h:68
SoSampler::magFilter
SoSFEnum magFilter
Magnification filter mode. Default is LINEAR.
Definition
SoSampler.h:74
SoSampler::initClass
static void initClass()
Initialize class with runtime type system.
SoSampler::~SoSampler
~SoSampler() override
SoSampler::texConfigChanged
virtual void texConfigChanged(SoField *)
Called when texture configuration (e.g. filter mode) has changed.
Definition
SoSampler.h:127
SoUniformParameterBase
Base class for uniform shader parameters.
Definition
SoUniformParameterBase.h:30
SoUniformShaderParameter::SoUniformShaderParameter
SoUniformShaderParameter()
Constructor.
MeVisLab
Standard
Sources
Inventor
SoShader
Inventor
nodes
SoSampler.h
Generated by
1.18.0