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_2D_MULTISAMPLE, // RE_EXT_TEXTURE_MULTISAMPLE
46  RE_TEXTURE_BUFFER // RE_EXT_TEXTURE_BUFFER
47 };
48 
49 // Type of data the texture contains.
50 // Color can be 1-4 channels of any format but FLOAT24 and UINT1,2,4.
51 // Depth can take a single channel of RE_GPU_DEPTH32,24,16
52 // Stencil can take a single channel of RE_GPU_UINT1,2,4,8,16
53 // Integer must be 1-4 channels of RE_GPU_UINT or RE_GPU_INT.
54 // Note: FP and Integer textures require OpenGL support (check extensions
55 // RE_EXT_TEXTURE_FLOAT and RE_EXT_TEXTURE_INTEGER before using)
57 {
58  RE_TEXTURE_DATA_COLOR, // Normal Color texture.
59  RE_TEXTURE_DATA_DEPTH, // For ZDepth framebuffer attachments
60  RE_TEXTURE_DATA_DEPTH_STENCIL, // 24b Z + 8b Stencil FBO attachments
61  RE_TEXTURE_DATA_INTEGER // Shaders read the actual integer values
62 };
63 
64 
66 {
67  RE_FILT_MIN_FILTERS = -1, // this isn't a real filter
68 
75 
76  RE_FILT_MAX_FILTERS // this isn't a real filter
77 };
78 
80 {
85 };
86 
88 {
89  RE_TEX_BORDER_ZERO = 0, // (0,0,0,0)
90  RE_TEX_BORDER_BLACK, // (0,0,0,1)
91  RE_TEX_BORDER_WHITE, // (1,1,1,1)
92  RE_TEX_BORDER_COLOR // user defined
93 };
94 
95 
97 {
99 
100  RE_COMPRESS_NO_FP32, // native, except fp32 converted to fp16
101  RE_COMPRESS_LOW_BIT_DEPTH, // 8b for fixed, 16b FP for FP
102  RE_COMPRESS_8_BIT_DEPTH, // 8b for all types
103  RE_COMPRESS_MIN_BIT_DEPTH, // 4b for fixed, 9:9:9:5e FP for FP
104 
105  RE_COMPRESS_FP24, // 24b FP, usually for Zdepth
106  RE_COMPRESS_BIT, // single bit per pixel
107 
108  RE_COMPRESS_GL_FAST, // Let GL attempt to compress the image.
109  RE_COMPRESS_GL_NICE, // fast for streamed tex, nice for cached
110 
111  // Manual stuff.
112  // 4:1 ratio, interpolated 16b color + 4b alpha
113 // RE_COMPRESS_DXT_SHARP, // sharp alpha changes - not implemented yet
114 // RE_COMPRESS_DXT_GRADUAL // gradual alpha changes - not implemented yet
115 
116  RE_COMPRESS_UNKNOWN // Can't use to specify a compression.
117 };
118 
119 
120 // This controls how multitexturing and the GL base color interact. It acts on
121 // the previous color (for tex unit 0, that is the GL base color)
123 {
124  RE_TEXTURE_MODULATE, // multiply (default)
125  RE_TEXTURE_ADD, // simple add
127  RE_TEXTURE_REPLACE, // discard previous texture, partially probably
128 
129  // GL_BLEND and GL_COMBINE are currently not fully supported through RE.
130  // You probably want to use GLSL rather than thesemore complicated modes.
131 
132  RE_TEXTURE_BLEND, // Blend with previous color
133  RE_TEXTURE_COMBINE, // Combine of up to 3 RGB and 3 A textures.
134 
136 };
137 
139 {
146 
147  RE_TEXTURE_CUBE_ALL_FACES // All faces at once, scans stacked vertically
148 }; // in the order listed above
149 
150 // For buffer textures.
152 {
155 };
156 
158 {
161 
164 
167 };
168 
170 {
172  // Flags whether 2-channel formats use red/green (1,2,x,x) when shading
173  // (RE_EXT_TEXTURE_2CHAN must be supported), instead of lum/alpha (1,1,1,2)
175 
176  // Flags whether 1-channel formats use alpha textures rather than luminance.
178 };
179 
180 // For use with RE_Texture::setTextureSwizzle(). Requires RE_EXT_TEXTURE_SWIZZLE
182 {
189 };
190 
191 #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