00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _SO_TEXTURE_COMBINER_
00025 #define _SO_TEXTURE_COMBINER_
00026
00027
00028 #include <Inventor/fields/SoSFEnum.h>
00029 #include <Inventor/nodes/SoNode.h>
00030 #include <Inventor/fields/SoSFFloat.h>
00031 #include <Inventor/fields/SoSFVec4f.h>
00032 #include <Inventor/sys/SoGLType.h>
00033
00034
00035
00096 class SoTextureCombiner : public SoNode {
00097 SO_NODE_HEADER(SoTextureCombiner) ;
00098
00099
00100 public:
00101
00103 enum CombineFunction {
00107 REPLACE = GL_REPLACE,
00111 MODULATE = GL_MODULATE,
00115 ADD = GL_ADD,
00119 ADD_SIGNED = GL_ADD_SIGNED,
00123 INTERPOLATE = GL_INTERPOLATE,
00127 SUBTRACT = GL_SUBTRACT,
00135 DOT3_RGB = GL_DOT3_RGB,
00143 DOT3_RGBA = GL_DOT3_RGBA
00144 };
00145
00147 enum SourceParameter {
00151 CONSTANT = GL_CONSTANT,
00155 PRIMARY_COLOR = GL_PRIMARY_COLOR,
00160 PREVIOUS = GL_PREVIOUS,
00164 TEXTURE = GL_TEXTURE,
00169 TEXTURE0,
00174 TEXTURE1,
00179 TEXTURE2,
00184 TEXTURE3,
00189 TEXTURE4,
00194 TEXTURE5,
00199 TEXTURE6,
00204 TEXTURE7
00205 };
00206
00211 enum OperandRGBA{
00216 SRC_COLOR = GL_SRC_COLOR,
00217
00222 ONE_MINUS_SRC_COLOR = GL_ONE_MINUS_SRC_COLOR,
00223
00227 SRC_ALPHA = GL_SRC_ALPHA,
00228
00232 ONE_MINUS_SRC_ALPHA = GL_ONE_MINUS_SRC_ALPHA
00233
00234 };
00235
00241 SoSFEnum combineRGB;
00247 SoSFEnum combineAlpha;
00252 SoSFEnum source0RGB;
00257 SoSFEnum source1RGB;
00262 SoSFEnum source2RGB;
00263
00268 SoSFEnum source0Alpha;
00273 SoSFEnum source1Alpha;
00278 SoSFEnum source2Alpha;
00279
00284 SoSFEnum operand0RGB;
00289 SoSFEnum operand1RGB;
00294 SoSFEnum operand2RGB;
00295
00301 SoSFEnum operand0Alpha;
00307 SoSFEnum operand1Alpha;
00313 SoSFEnum operand2Alpha;
00317 SoSFFloat scaleRGB;
00321 SoSFFloat scaleAlpha;
00325 SoSFVec4f constantColor;
00326
00330 SoTextureCombiner() ;
00331
00332 private:
00333 virtual void doAction(SoAction *action);
00334 virtual void callback(SoCallbackAction *action) ;
00335 virtual void GLRender(SoGLRenderAction *action) ;
00336
00337
00338
00339
00340 private:
00341 static void initClass();
00342 static void exitClass();
00343
00344 private:
00345
00346 virtual ~SoTextureCombiner() ;
00347 } ;
00348
00349
00350 #endif
00351
00352