HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RE_TextureTypes.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: RE_OGLTexture.h ( RE Library, C++)
7  *
8  * COMMENTS:
9  * Base class for various OpenGL texture types.
10  */
11 #ifndef RE_OGLTextureType_h
12 #define RE_OGLTextureType_h
13 
14 typedef unsigned int RE_TextureID;
15 
16 // The maximum number of texture units we support
17 #define RE_MAX_TEXTURES 48
18 #define RE_MAX_TEXTURE_COORDS 16
19 
20 // The max number of times the texture state can be pushed (not the texture
21 // transform matrix).
22 #define RE_MAX_TEXTURE_STATE_STACK 16
23 
24 #define RE_BAD_UNIFORM_UNIT -1
25 #define RE_ACTIVE_UNIT -2
26 #define RE_ALL_UNITS -3
27 
28 #define RE_TEXTURE_BAD_WRAPPING 3
29 
31 {
32  // uninitlized or invalid texture
34 
35  // Base OpenGL 1.0 textures
38 
39  // These textures require extensions
40  RE_TEXTURE_3D, // RE_EXT_TEXTURE_3D
41  RE_TEXTURE_CUBE, // RE_EXT_TEXTURE_CUBE_MAP
42  RE_TEXTURE_RECTANGLE, // RE_EXT_TEXTURE_RECTANGLE
43  RE_TEXTURE_1D_ARRAY, // RE_EXT_TEXTURE_ARRAY
44  RE_TEXTURE_2D_ARRAY, // RE_EXT_TEXTURE_ARRAY,RE_EXT_TEXTURE_3D
45  RE_TEXTURE_CUBE_ARRAY, // RE_EXT_TEXTURE_CUBE_MAP_ARRAY
46  RE_TEXTURE_2D_MULTISAMPLE, // RE_EXT_TEXTURE_MULTISAMPLE
47  RE_TEXTURE_BUFFER // RE_EXT_TEXTURE_BUFFER
48 };
49 
50 // Type of data the texture contains.
51 // Color can be 1-4 channels of any format but FLOAT24 and UINT1,2,4.
52 // Depth can take a single channel of RE_GPU_DEPTH32,24,16
53 // Stencil can take a single channel of RE_GPU_UINT1,2,4,8,16
54 // Integer must be 1-4 channels of RE_GPU_UINT or RE_GPU_INT.
55 // Note: FP and Integer textures require OpenGL support (check extensions
56 // RE_EXT_TEXTURE_FLOAT and RE_EXT_TEXTURE_INTEGER before using)
58 {
59  RE_TEXTURE_DATA_COLOR, // Normal Color texture.
60  RE_TEXTURE_DATA_DEPTH, // For ZDepth framebuffer attachments
61  RE_TEXTURE_DATA_DEPTH_STENCIL, // 24b Z + 8b Stencil FBO attachments
62  RE_TEXTURE_DATA_INTEGER // Shaders read the actual integer values
63 };
64 
65 
67 {
68  RE_FILT_MIN_FILTERS = -1, // this isn't a real filter
69 
76 
77  RE_FILT_MAX_FILTERS // this isn't a real filter
78 };
79 
81 {
86 };
87 
89 {
90  RE_TEX_BORDER_ZERO = 0, // (0,0,0,0)
91  RE_TEX_BORDER_BLACK, // (0,0,0,1)
92  RE_TEX_BORDER_WHITE, // (1,1,1,1)
93  RE_TEX_BORDER_COLOR // user defined
94 };
95 
96 
98 {
100 
101  RE_COMPRESS_NO_FP32, // native, except fp32 converted to fp16
102  RE_COMPRESS_LOW_BIT_DEPTH, // 8b for fixed, 16b FP for FP
103  RE_COMPRESS_8_BIT_DEPTH, // 8b for all types
104  RE_COMPRESS_MIN_BIT_DEPTH, // 4b for fixed, 9:9:9:5e FP for FP
105 
106  RE_COMPRESS_FP24, // 24b FP, usually for Zdepth
107  RE_COMPRESS_BIT, // single bit per pixel
108 
109  RE_COMPRESS_GL_FAST, // Let GL attempt to compress the image.
110  RE_COMPRESS_GL_NICE, // fast for streamed tex, nice for cached
111 
112  // Manual stuff.
113  // 4:1 ratio, interpolated 16b color + 4b alpha
114 // RE_COMPRESS_DXT_SHARP, // sharp alpha changes - not implemented yet
115 // RE_COMPRESS_DXT_GRADUAL // gradual alpha changes - not implemented yet
116 
117  RE_COMPRESS_UNKNOWN // Can't use to specify a compression.
118 };
119 
120 
121 // This controls how multitexturing and the GL base color interact. It acts on
122 // the previous color (for tex unit 0, that is the GL base color)
124 {
125  RE_TEXTURE_MODULATE, // multiply (default)
126  RE_TEXTURE_ADD, // simple add
128  RE_TEXTURE_REPLACE, // discard previous texture, partially probably
129 
130  // GL_BLEND and GL_COMBINE are currently not fully supported through RE.
131  // You probably want to use GLSL rather than thesemore complicated modes.
132 
133  RE_TEXTURE_BLEND, // Blend with previous color
134  RE_TEXTURE_COMBINE, // Combine of up to 3 RGB and 3 A textures.
135 
137 };
138 
140 {
147 
148  RE_TEXTURE_CUBE_ALL_FACES // All faces at once, scans stacked vertically
149 }; // in the order listed above
150 
151 // For buffer textures.
153 {
156 };
157 
159 {
162 
165 
168 };
169 
171 {
173  // Flags whether 2-channel formats use red/green (1,2,x,x) when shading
174  // (RE_EXT_TEXTURE_2CHAN must be supported), instead of lum/alpha (1,1,1,2)
176 
177  // Flags whether 1-channel formats use alpha textures rather than luminance.
179 };
180 
181 // For use with RE_Texture::setTextureSwizzle(). Requires RE_EXT_TEXTURE_SWIZZLE
183 {
190 };
191 
192 #endif
RE_TextureCubeFace
RE_TextureMode
RE_TextureSwizzle
RE_TextureDimension
RE_TexFiltType
unsigned int RE_TextureID
RE_TextureFormatExtra
RE_TexClampType
RE_TextureBorder
RE_TextureBufferMode
RE_TextureDataType
RE_TextureCompress
RE_TextureCompare