source: OGRE/trunk/ogre_changes/Ogre1.2/OgreMain/include/OgrePass.h @ 1053

Revision 1053, 59.2 KB checked in by szirmay, 18 years ago (diff)
Line 
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4(Object-oriented Graphics Rendering Engine)
5For the latest info, see http://ogre.sourceforge.net/
6
7Copyright (c) 2000-2005 The OGRE Team
8Also see acknowledgements in Readme.html
9
10This program is free software; you can redistribute it and/or modify it under
11the terms of the GNU Lesser General Public License as published by the Free Software
12Foundation; either version 2 of the License, or (at your option) any later
13version.
14
15This program is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
18
19You should have received a copy of the GNU Lesser General Public License along with
20this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21Place - Suite 330, Boston, MA 02111-1307, USA, or go to
22http://www.gnu.org/copyleft/lesser.txt.
23-----------------------------------------------------------------------------
24*/
25#ifndef __Pass_H__
26#define __Pass_H__
27
28#include "OgrePrerequisites.h"
29#include "OgreGpuProgram.h"
30#include "OgreColourValue.h"
31#include "OgreBlendMode.h"
32#include "OgreCommon.h"
33#include "OgreLight.h"
34
35namespace Ogre {
36
37#ifdef GAMETOOLS_ILLUMINATION_MODULE
38       
39        class _OgreExport IllumTechniqueParams
40        {
41                String techniqueType;
42                NameValuePairList params;
43
44                public:
45
46                void setTypeName(String& type){ techniqueType = type;}
47                void addParam(String& param, String& value)
48                {
49                        params[param] = value;
50                }
51
52                String& getTypeName(){return techniqueType;}
53                NameValuePairList& getParams(){return params;}
54        };
55
56#endif
57    /** Class defining a single pass of a Technique (of a Material), ie
58        a single rendering call.
59    @remarks
60        Rendering can be repeated with many passes for more complex effects.
61        Each pass is either a fixed-function pass (meaning it does not use
62        a vertex or fragment program) or a programmable pass (meaning it does
63        use either a vertex and fragment program, or both).
64    @par
65        Programmable passes are complex to define, because they require custom
66        programs and you have to set all constant inputs to the programs (like
67        the position of lights, any base material colours you wish to use etc), but
68        they do give you much total flexibility over the algorithms used to render your
69        pass, and you can create some effects which are impossible with a fixed-function pass.
70        On the other hand, you can define a fixed-function pass in very little time, and
71        you can use a range of fixed-function effects like environment mapping very
72        easily, plus your pass will be more likely to be compatible with older hardware.
73        There are pros and cons to both, just remember that if you use a programmable
74        pass to create some great effects, allow more time for definition and testing.
75    */
76    class _OgreExport Pass
77    {
78    protected:
79        Technique* mParent;
80        unsigned short mIndex; // pass index
81        String mName; // optional name for the pass
82        uint32 mHash; // pass hash
83        //-------------------------------------------------------------------------
84        // Colour properties, only applicable in fixed-function passes
85        ColourValue mAmbient;
86        ColourValue mDiffuse;
87        ColourValue mSpecular;   
88        ColourValue mEmissive;
89        Real mShininess;
90        TrackVertexColourType mTracking;
91        //-------------------------------------------------------------------------
92
93        //-------------------------------------------------------------------------
94        // Blending factors
95        SceneBlendFactor mSourceBlendFactor;   
96        SceneBlendFactor mDestBlendFactor;
97        //-------------------------------------------------------------------------
98
99        //-------------------------------------------------------------------------   
100        // Depth buffer settings
101        bool mDepthCheck;
102        bool mDepthWrite;
103        CompareFunction mDepthFunc;
104        ushort mDepthBias;
105
106        // Colour buffer settings
107        bool mColourWrite;
108               
109                // Alpha reject settings
110                CompareFunction mAlphaRejectFunc;
111                unsigned char mAlphaRejectVal;
112        //-------------------------------------------------------------------------   
113
114        //-------------------------------------------------------------------------
115        // Culling mode
116        CullingMode mCullMode;
117        ManualCullingMode mManualCullMode;
118        //-------------------------------------------------------------------------
119
120        /// Lighting enabled?
121        bool mLightingEnabled;
122        /// Max simultaneous lights
123        unsigned short mMaxSimultaneousLights;
124                /// Run this pass once per light?
125                bool mIteratePerLight;
126        // Should it only be run for a certain light type?
127        bool mRunOnlyForOneLightType;
128        Light::LightTypes mOnlyLightType;
129
130        /// Shading options
131        ShadeOptions mShadeOptions;
132                /// Polygon mode
133                PolygonMode mPolygonMode;
134
135        //-------------------------------------------------------------------------   
136        // Fog
137        bool mFogOverride;
138        FogMode mFogMode;
139        ColourValue mFogColour;
140        Real mFogStart;
141        Real mFogEnd;
142        Real mFogDensity;
143        //-------------------------------------------------------------------------   
144
145        /// Storage of texture unit states
146        typedef std::vector<TextureUnitState*> TextureUnitStates;
147        TextureUnitStates mTextureUnitStates;   
148
149                // Vertex program details
150                GpuProgramUsage *mVertexProgramUsage;
151        // Vertex program details
152        GpuProgramUsage *mShadowCasterVertexProgramUsage;
153        // Vertex program details
154        GpuProgramUsage *mShadowReceiverVertexProgramUsage;
155                // Fragment program details
156                GpuProgramUsage *mFragmentProgramUsage;
157                // Fragment program details
158                GpuProgramUsage *mShadowReceiverFragmentProgramUsage;
159        // Is this pass queued for deletion?
160        bool mQueuedForDeletion;
161        // number of pass iterations to perform
162        size_t mPassIterationCount;
163                // point size, applies when not using per-vertex point size
164                Real mPointSize;
165                Real mPointMinSize;
166                Real mPointMaxSize;
167                bool mPointSpritesEnabled;
168                bool mPointAttenuationEnabled;
169                // constant, linear, quadratic coeffs
170                Real mPointAttenuationCoeffs[3];
171        public:
172                typedef std::set<Pass*> PassSet;
173    protected:
174                /// List of Passes whose hashes need recalculating
175                static PassSet msDirtyHashList;
176        /// The place where passes go to die
177        static PassSet msPassGraveyard;
178    public:
179        /// Default constructor
180                Pass(Technique* parent, unsigned short index);
181        /// Copy constructor
182        Pass(Technique* parent, unsigned short index, const Pass& oth );
183        /// Operator = overload
184        Pass& operator=(const Pass& oth);
185        ~Pass();
186
187        /// Returns true if this pass is programmable ie includes either a vertex or fragment program.
188        bool isProgrammable(void) const { return mVertexProgramUsage || mFragmentProgramUsage; }
189        /// Returns true if this pass uses a programmable vertex pipeline
190        bool hasVertexProgram(void) const { return mVertexProgramUsage != NULL; }
191        /// Returns true if this pass uses a programmable fragment pipeline
192        bool hasFragmentProgram(void) const { return mFragmentProgramUsage != NULL; }
193        /// Returns true if this pass uses a shadow caster vertex program
194        bool hasShadowCasterVertexProgram(void) const { return mShadowCasterVertexProgramUsage != NULL; }
195        /// Returns true if this pass uses a shadow receiver vertex program
196        bool hasShadowReceiverVertexProgram(void) const { return mShadowReceiverVertexProgramUsage != NULL; }
197        /// Returns true if this pass uses a shadow receiver fragment program
198        bool hasShadowReceiverFragmentProgram(void) const { return mShadowReceiverFragmentProgramUsage != NULL; }
199
200
201        /// Gets the index of this Pass in the parent Technique
202        unsigned short getIndex(void) const { return mIndex; }
203        /* Set the name of the pass
204        @remarks
205        The name of the pass is optional.  Its usefull in material scripts where a material could inherit
206        from another material and only want to modify a particalar pass.
207        */
208        void setName(const String& name);
209        /// get the name of the pass
210        const String& getName(void) const { return mName; }
211
212        /** Sets the ambient colour reflectance properties of this pass.
213        @remarks
214        The base colour of a pass is determined by how much red, green and blue light is reflects
215        (provided texture layer #0 has a blend mode other than LBO_REPLACE). This property determines how
216        much ambient light (directionless global light) is reflected. The default is full white, meaning
217        objects are completely globally illuminated. Reduce this if you want to see diffuse or specular light
218        effects, or change the blend of colours to make the object have a base colour other than white.
219        @note
220        This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
221        or if this is a programmable pass.
222        */
223        void setAmbient(Real red, Real green, Real blue);
224
225        /** Sets the ambient colour reflectance properties of this pass.
226        @remarks
227        The base colour of a pass is determined by how much red, green and blue light is reflects
228        (provided texture layer #0 has a blend mode other than LBO_REPLACE). This property determines how
229        much ambient light (directionless global light) is reflected. The default is full white, meaning
230        objects are completely globally illuminated. Reduce this if you want to see diffuse or specular light
231        effects, or change the blend of colours to make the object have a base colour other than white.
232        @note
233        This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
234        or if this is a programmable pass.
235        */
236
237        void setAmbient(const ColourValue& ambient);
238
239        /** Sets the diffuse colour reflectance properties of this pass.
240        @remarks
241        The base colour of a pass is determined by how much red, green and blue light is reflects
242        (provided texture layer #0 has a blend mode other than LBO_REPLACE). This property determines how
243        much diffuse light (light from instances of the Light class in the scene) is reflected. The default
244        is full white, meaning objects reflect the maximum white light they can from Light objects.
245        @note
246        This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
247        or if this is a programmable pass.
248        */
249        void setDiffuse(Real red, Real green, Real blue, Real alpha);
250
251        /** Sets the diffuse colour reflectance properties of this pass.
252        @remarks
253        The base colour of a pass is determined by how much red, green and blue light is reflects
254        (provided texture layer #0 has a blend mode other than LBO_REPLACE). This property determines how
255        much diffuse light (light from instances of the Light class in the scene) is reflected. The default
256        is full white, meaning objects reflect the maximum white light they can from Light objects.
257        @note
258        This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
259        or if this is a programmable pass.
260        */
261        void setDiffuse(const ColourValue& diffuse);
262
263        /** Sets the specular colour reflectance properties of this pass.
264        @remarks
265        The base colour of a pass is determined by how much red, green and blue light is reflects
266        (provided texture layer #0 has a blend mode other than LBO_REPLACE). This property determines how
267        much specular light (highlights from instances of the Light class in the scene) is reflected.
268        The default is to reflect no specular light.
269        @note
270        The size of the specular highlights is determined by the separate 'shininess' property.
271        @note
272        This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
273        or if this is a programmable pass.
274        */
275        void setSpecular(Real red, Real green, Real blue, Real alpha);
276
277        /** Sets the specular colour reflectance properties of this pass.
278        @remarks
279        The base colour of a pass is determined by how much red, green and blue light is reflects
280        (provided texture layer #0 has a blend mode other than LBO_REPLACE). This property determines how
281        much specular light (highlights from instances of the Light class in the scene) is reflected.
282        The default is to reflect no specular light.
283        @note
284        The size of the specular highlights is determined by the separate 'shininess' property.
285        @note
286        This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
287        or if this is a programmable pass.
288        */
289        void setSpecular(const ColourValue& specular);
290
291        /** Sets the shininess of the pass, affecting the size of specular highlights.
292        @note
293        This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
294        or if this is a programmable pass.
295        */
296        void setShininess(Real val);
297
298        /** Sets the amount of self-illumination an object has.
299        @remarks
300        If an object is self-illuminating, it does not need external sources to light it, ambient or
301        otherwise. It's like the object has it's own personal ambient light. This property is rarely useful since
302        you can already specify per-pass ambient light, but is here for completeness.
303        @note
304        This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
305        or if this is a programmable pass.
306        */
307        void setSelfIllumination(Real red, Real green, Real blue);
308
309        /** Sets the amount of self-illumination an object has.
310        @remarks
311        If an object is self-illuminating, it does not need external sources to light it, ambient or
312        otherwise. It's like the object has it's own personal ambient light. This property is rarely useful since
313        you can already specify per-pass ambient light, but is here for completeness.
314        @note
315        This setting has no effect if dynamic lighting is disabled (see Pass::setLightingEnabled),
316        or if this is a programmable pass.
317        */
318        void setSelfIllumination(const ColourValue& selfIllum);
319
320        /** Sets which material properties follow the vertex colour
321         */
322        void setVertexColourTracking(TrackVertexColourType tracking);
323
324        /** Gets the point size of the pass.
325                @remarks
326                        This property determines what point size is used to render a point
327                        list.
328        */
329        Real getPointSize(void) const;
330
331                /** Sets the point size of this pass.
332                @remarks
333                        This setting allows you to change the size of points when rendering
334                        a point list, or a list of point sprites. The interpretation of this
335                        command depends on the Pass::setPointSizeAttenuation option - if it
336                        is off (the default), the point size is in screen pixels, if it is on,
337                        it expressed as normalised screen coordinates (1.0 is the height of
338                        the screen) when the point is at the origin.
339                @note
340                        Some drivers have an upper limit on the size of points they support
341                        - this can even vary between APIs on the same card! Don't rely on
342                        point sizes that cause the point sprites to get very large on screen,
343                        since they may get clamped on some cards. Upper sizes can range from
344                        64 to 256 pixels.
345                */
346                void setPointSize(Real ps);
347               
348                /** Sets whether or not rendering points using OT_POINT_LIST will
349                        render point sprites (textured quads) or plain points (dots).
350                @param enabled True enables point sprites, false returns to normal
351                        point rendering.
352                */     
353                void setPointSpritesEnabled(bool enabled);
354
355                /** Returns whether point sprites are enabled when rendering a
356                        point list.
357                */
358                bool getPointSpritesEnabled(void) const;
359
360                /** Sets how points are attenuated with distance.
361                @remarks
362                        When performing point rendering or point sprite rendering,
363                        point size can be attenuated with distance. The equation for
364                        doing this is attenuation = 1 / (constant + linear * dist + quadratic * d^2).
365                @par
366                        For example, to disable distance attenuation (constant screensize)
367                        you would set constant to 1, and linear and quadratic to 0. A
368                        standard perspective attenuation would be 0, 1, 0 respectively.
369                @note
370                        The resulting size is clamped to the minimum and maximum point
371                        size.
372                @param enabled Whether point attenuation is enabled
373                @param constant, linear, quadratic Parameters to the attentuation
374                        function defined above
375                */
376                void setPointAttenuation(bool enabled,
377                        Real constant = 0.0f, Real linear = 1.0f, Real quadratic = 0.0f);
378
379                /** Returns whether points are attenuated with distance. */
380                bool isPointAttenuationEnabled(void) const;
381
382                /** Returns the constant coefficient of point attenuation. */
383                Real getPointAttenuationConstant(void) const;
384                /** Returns the linear coefficient of point attenuation. */
385                Real getPointAttenuationLinear(void) const;
386                /** Returns the quadratic coefficient of point attenuation. */
387                Real getPointAttenuationQuadratic(void) const;
388
389                /** Set the minimum point size, when point attenuation is in use. */
390                void setPointMinSize(Real min);
391                /** Get the minimum point size, when point attenuation is in use. */
392                Real getPointMinSize(void) const;
393                /** Set the maximum point size, when point attenuation is in use.
394                @remarks Setting this to 0 indicates the max size supported by the card.
395                */
396                void setPointMaxSize(Real max);
397                /** Get the maximum point size, when point attenuation is in use.
398                @remarks 0 indicates the max size supported by the card.
399                */
400                Real getPointMaxSize(void) const;
401
402                /** Gets the ambient colour reflectance of the pass.
403        */
404        const ColourValue& getAmbient(void) const;
405
406        /** Gets the diffuse colour reflectance of the pass.
407        */
408        const ColourValue& getDiffuse(void) const;
409
410        /** Gets the specular colour reflectance of the pass.
411        */
412        const ColourValue& getSpecular(void) const;
413
414        /** Gets the self illumination colour of the pass.
415        */
416        const ColourValue& getSelfIllumination(void) const;
417
418        /** Gets the 'shininess' property of the pass (affects specular highlights).
419        */
420        Real getShininess(void) const;
421       
422        /** Gets which material properties follow the vertex colour
423         */
424        TrackVertexColourType getVertexColourTracking(void) const;
425
426        /** Inserts a new TextureUnitState object into the Pass.
427        @remarks
428        This unit is is added on top of all previous units.
429        */
430        TextureUnitState* createTextureUnitState(void);
431        /** Inserts a new TextureUnitState object into the Pass.
432        @remarks
433        This unit is is added on top of all previous units.
434        @param
435        name The basic name of the texture e.g. brickwall.jpg, stonefloor.png
436        @param
437        texCoordSet The index of the texture coordinate set to use.
438        @note
439        Applies to both fixed-function and programmable passes.
440        */
441        TextureUnitState* createTextureUnitState( const String& textureName, unsigned short texCoordSet = 0);
442                /** Adds the passed in TextureUnitState, to the existing Pass.
443        @param
444        state The Texture Unit State to be attached to this pass.  It must not be attached to another pass.
445        @note
446            Throws an exception if the TextureUnitState is attached to another Pass.*/
447                void addTextureUnitState(TextureUnitState* state);
448        /** Retrieves a pointer to a texture unit state so it may be modified.
449        */
450        TextureUnitState* getTextureUnitState(unsigned short index);
451        /** Retrieves the Texture Unit State matching name.
452            Returns 0 if name match is not found.
453        */
454        TextureUnitState* getTextureUnitState(const String& name);
455                /** Retrieves a const pointer to a texture unit state.
456                */
457                const TextureUnitState* getTextureUnitState(unsigned short index) const;
458                /** Retrieves the Texture Unit State matching name.
459                Returns 0 if name match is not found.
460                */
461                const TextureUnitState* getTextureUnitState(const String& name) const;
462
463        /**  Retrieve the index of the Texture Unit State in the pass.
464        @param
465        state The Texture Unit State this is attached to this pass.
466        @note
467            Throws an exception if the state is not attached to the pass.
468        */
469        unsigned short getTextureUnitStateIndex(const TextureUnitState* state);
470
471        typedef VectorIterator<TextureUnitStates> TextureUnitStateIterator;
472        /** Get an iterator over the TextureUnitStates contained in this Pass. */
473        TextureUnitStateIterator getTextureUnitStateIterator(void);
474
475                typedef ConstVectorIterator<TextureUnitStates> ConstTextureUnitStateIterator;
476                /** Get an iterator over the TextureUnitStates contained in this Pass. */
477                ConstTextureUnitStateIterator getTextureUnitStateIterator(void) const;
478
479                /** Removes the indexed texture unit state from this pass.
480        @remarks
481            Note that removing a texture which is not the topmost will have a larger performance impact.
482        */
483        void removeTextureUnitState(unsigned short index);
484
485        /** Removes all texture unit settings.
486        */
487        void removeAllTextureUnitStates(void);
488
489        /** Returns the number of texture unit settings.
490        */
491        size_t getNumTextureUnitStates(void) const
492        {
493            return mTextureUnitStates.size();
494        }
495
496        /** Sets the kind of blending this pass has with the existing contents of the scene.
497        @remarks
498        Wheras the texture blending operations seen in the TextureUnitState class are concerned with
499        blending between texture layers, this blending is about combining the output of the Pass
500        as a whole with the existing contents of the rendering target. This blending therefore allows
501        object transparency and other special effects. If all passes in a technique have a scene
502        blend, then the whole technique is considered to be transparent.
503        @par
504        This method allows you to select one of a number of predefined blending types. If you require more
505        control than this, use the alternative version of this method which allows you to specify source and
506        destination blend factors.
507        @note
508        This method is applicable for both the fixed-function and programmable pipelines.
509        @param
510        sbt One of the predefined SceneBlendType blending types
511        */
512        void setSceneBlending( const SceneBlendType sbt );
513
514        /** Allows very fine control of blending this Pass with the existing contents of the scene.
515        @remarks
516        Wheras the texture blending operations seen in the TextureUnitState class are concerned with
517        blending between texture layers, this blending is about combining the output of the material
518        as a whole with the existing contents of the rendering target. This blending therefore allows
519        object transparency and other special effects.
520        @par
521        This version of the method allows complete control over the blending operation, by specifying the
522        source and destination blending factors. The result of the blending operation is:
523        <span align="center">
524        final = (texture * sourceFactor) + (pixel * destFactor)
525        </span>
526        @par
527        Each of the factors is specified as one of a number of options, as specified in the SceneBlendFactor
528        enumerated type.
529        @param
530        sourceFactor The source factor in the above calculation, i.e. multiplied by the texture colour components.
531        @param
532        destFactor The destination factor in the above calculation, i.e. multiplied by the pixel colour components.
533        @note
534        This method is applicable for both the fixed-function and programmable pipelines.
535        */
536        void setSceneBlending( const SceneBlendFactor sourceFactor, const SceneBlendFactor destFactor);
537
538        /** Retrieves the source blending factor for the material (as set using Materiall::setSceneBlending).
539        */
540        SceneBlendFactor getSourceBlendFactor() const;
541
542        /** Retrieves the destination blending factor for the material (as set using Materiall::setSceneBlending).
543        */
544        SceneBlendFactor getDestBlendFactor() const;
545
546                /** Returns true if this pass has some element of transparency. */
547                bool isTransparent(void) const;
548
549                /** Sets whether or not this pass renders with depth-buffer checking on or not.
550        @remarks
551        If depth-buffer checking is on, whenever a pixel is about to be written to the frame buffer
552        the depth buffer is checked to see if the pixel is in front of all other pixels written at that
553        point. If not, the pixel is not written.
554        @par
555        If depth checking is off, pixels are written no matter what has been rendered before.
556        Also see setDepthFunction for more advanced depth check configuration.
557        @see
558        setDepthFunction
559        */
560        void setDepthCheckEnabled(bool enabled);
561
562        /** Returns whether or not this pass renders with depth-buffer checking on or not.
563        @see
564        setDepthCheckEnabled
565        */
566        bool getDepthCheckEnabled(void) const;
567
568        /** Sets whether or not this pass renders with depth-buffer writing on or not.
569        @remarks
570        If depth-buffer writing is on, whenever a pixel is written to the frame buffer
571        the depth buffer is updated with the depth value of that new pixel, thus affecting future
572        rendering operations if future pixels are behind this one.
573        @par
574        If depth writing is off, pixels are written without updating the depth buffer Depth writing should
575        normally be on but can be turned off when rendering static backgrounds or when rendering a collection
576        of transparent objects at the end of a scene so that they overlap each other correctly.
577        */
578        void setDepthWriteEnabled(bool enabled);
579
580        /** Returns whether or not this pass renders with depth-buffer writing on or not.
581        @see
582        setDepthWriteEnabled
583        */
584        bool getDepthWriteEnabled(void) const;
585
586        /** Sets the function used to compare depth values when depth checking is on.
587        @remarks
588        If depth checking is enabled (see setDepthCheckEnabled) a comparison occurs between the depth
589        value of the pixel to be written and the current contents of the buffer. This comparison is
590        normally CMPF_LESS_EQUAL, i.e. the pixel is written if it is closer (or at the same distance)
591        than the current contents. If you wish you can change this comparison using this method.
592        */
593        void setDepthFunction( CompareFunction func );
594        /** Returns the function used to compare depth values when depth checking is on.
595        @see
596        setDepthFunction
597        */
598        CompareFunction getDepthFunction(void) const;
599
600                /** Sets whether or not colour buffer writing is enabled for this Pass.
601                @remarks
602                        For some effects, you might wish to turn off the colour write operation
603                        when rendering geometry; this means that only the depth buffer will be
604                        updated (provided you have depth buffer writing enabled, which you
605                        probably will do, although you may wish to only update the stencil
606                        buffer for example - stencil buffer state is managed at the RenderSystem
607                        level only, not the Material since you are likely to want to manage it
608                        at a higher level).
609                */
610                void setColourWriteEnabled(bool enabled);
611                /** Determines if colour buffer writing is enabled for this pass. */
612                bool getColourWriteEnabled(void) const;
613
614        /** Sets the culling mode for this pass  based on the 'vertex winding'.
615        @remarks
616        A typical way for the rendering engine to cull triangles is based on the 'vertex winding' of
617        triangles. Vertex winding refers to the direction in which the vertices are passed or indexed
618        to in the rendering operation as viewed from the camera, and will wither be clockwise or
619        anticlockwise (that's 'counterclockwise' for you Americans out there ;) The default is
620        CULL_CLOCKWISE i.e. that only triangles whose vertices are passed/indexed in anticlockwise order
621        are rendered - this is a common approach and is used in 3D studio models for example. You can
622        alter this culling mode if you wish but it is not advised unless you know what you are doing.
623        @par
624        You may wish to use the CULL_NONE option for mesh data that you cull yourself where the vertex
625        winding is uncertain.
626        */
627        void setCullingMode( CullingMode mode );
628
629        /** Returns the culling mode for geometry rendered with this pass. See setCullingMode for more information.
630        */
631        CullingMode getCullingMode(void) const;
632
633        /** Sets the manual culling mode, performed by CPU rather than hardware.
634        @pemarks
635        In some situations you want to use manual culling of triangles rather than sending the
636        triangles to the hardware and letting it cull them. This setting only takes effect on SceneManager's
637        that use it (since it is best used on large groups of planar world geometry rather than on movable
638        geometry since this would be expensive), but if used can cull geometry before it is sent to the
639        hardware.
640        @note
641        The default for this setting is MANUAL_CULL_BACK.
642        @param
643        mode The mode to use - see enum ManualCullingMode for details
644
645        */
646        void setManualCullingMode( ManualCullingMode mode );
647
648        /** Retrieves the manual culling mode for this pass
649        @see
650        setManualCullingMode
651        */
652        ManualCullingMode getManualCullingMode(void) const;
653
654        /** Sets whether or not dynamic lighting is enabled.
655        @param
656        enabled
657        If true, dynamic lighting is performed on geometry with normals supplied, geometry without
658        normals will not be displayed.
659        @par
660        If false, no lighting is applied and all geometry will be full brightness.
661        */
662        void setLightingEnabled(bool enabled);
663
664        /** Returns whether or not dynamic lighting is enabled.
665        */
666        bool getLightingEnabled(void) const;
667
668        /** Sets the maximum number of lights to be used by this pass.
669        @remarks
670            During rendering, if lighting is enabled (or if the pass uses an automatic
671            program parameter based on a light) the engine will request the nearest lights
672            to the object being rendered in order to work out which ones to use. This
673            parameter sets the limit on the number of lights which should apply to objects
674            rendered with this pass.
675        */
676        void setMaxSimultaneousLights(unsigned short maxLights);
677        /** Gets the maximum number of lights to be used by this pass. */
678        unsigned short getMaxSimultaneousLights(void) const;
679
680        /** Sets the type of light shading required
681        @note
682        The default shading method is Gouraud shading.
683        */
684        void setShadingMode( ShadeOptions mode );
685
686        /** Returns the type of light shading to be used.
687        */
688        ShadeOptions getShadingMode(void) const;
689
690                /** Sets the type of polygon rendering required
691                @note
692                The default shading method is Solid
693                */
694                void setPolygonMode( PolygonMode mode );
695
696                /** Returns the type of light shading to be used.
697                */
698                PolygonMode getPolygonMode(void) const;
699
700        /** Sets the fogging mode applied to this pass.
701        @remarks
702        Fogging is an effect that is applied as polys are rendered. Sometimes, you want
703        fog to be applied to an entire scene. Other times, you want it to be applied to a few
704        polygons only. This pass-level specification of fog parameters lets you easily manage
705        both.
706        @par
707        The SceneManager class also has a setFog method which applies scene-level fog. This method
708        lets you change the fog behaviour for this pass compared to the standard scene-level fog.
709        @param
710        overrideScene If true, you authorise this pass to override the scene's fog params with it's own settings.
711        If you specify false, so other parameters are necessary, and this is the default behaviour for passs.
712        @param
713        mode Only applicable if overrideScene is true. You can disable fog which is turned on for the
714        rest of the scene by specifying FOG_NONE. Otherwise, set a pass-specific fog mode as
715        defined in the enum FogMode.
716        @param
717        colour The colour of the fog. Either set this to the same as your viewport background colour,
718        or to blend in with a skydome or skybox.
719        @param
720        expDensity The density of the fog in FOG_EXP or FOG_EXP2 mode, as a value between 0 and 1.
721        The default is 0.001.
722        @param
723        linearStart Distance in world units at which linear fog starts to encroach.
724        Only applicable if mode is FOG_LINEAR.
725        @param
726        linearEnd Distance in world units at which linear fog becomes completely opaque.
727        Only applicable if mode is FOG_LINEAR.
728        */
729        void setFog(
730            bool overrideScene,
731            FogMode mode = FOG_NONE,
732            const ColourValue& colour = ColourValue::White,
733            Real expDensity = 0.001, Real linearStart = 0.0, Real linearEnd = 1.0 );
734
735        /** Returns true if this pass is to override the scene fog settings.
736        */
737        bool getFogOverride(void) const;
738
739        /** Returns the fog mode for this pass.
740        @note
741        Only valid if getFogOverride is true.
742        */
743        FogMode getFogMode(void) const;
744
745        /** Returns the fog colour for the scene.
746        */
747        const ColourValue& getFogColour(void) const;
748
749        /** Returns the fog start distance for this pass.
750        @note
751        Only valid if getFogOverride is true.
752        */
753        Real getFogStart(void) const;
754
755        /** Returns the fog end distance for this pass.
756        @note
757        Only valid if getFogOverride is true.
758        */
759        Real getFogEnd(void) const;
760
761        /** Returns the fog density for this pass.
762        @note
763        Only valid if getFogOverride is true.
764        */
765        Real getFogDensity(void) const;
766
767        /** Sets the depth bias to be used for this material.
768        @remarks
769        When polygons are coplanar, you can get problems with 'depth fighting' where
770        the pixels from the two polys compete for the same screen pixel. This is particularly
771        a problem for decals (polys attached to another surface to represent details such as
772        bulletholes etc.).
773        @par
774        A way to combat this problem is to use a depth bias to adjust the depth buffer value
775        used for the decal such that it is slightly higher than the true value, ensuring that
776        the decal appears on top.
777        @param bias The bias value, should be between 0 and 16.
778        */
779        void setDepthBias(ushort bias);
780
781        /** Retrieves the depth bias value as set by setDepthValue. */
782        ushort getDepthBias(void) const;
783
784        /** Sets the way the pass will have use alpha to totally reject pixels from the pipeline.
785        @remarks
786                        The default is CMPF_ALWAYS_PASS i.e. alpha is not used to reject pixels.
787        @param func The comparison which must pass for the pixel to be written.
788        @param value 1 byte value against which alpha values will be tested(0-255)
789        @note
790                        This option applies in both the fixed function and the programmable pipeline.
791        */
792        void setAlphaRejectSettings(CompareFunction func, unsigned char value);
793
794                /** Sets the alpha reject function. See setAlphaRejectSettings for more information.
795                */
796                void setAlphaRejectFunction(CompareFunction func);
797
798                /** Gets the alpha reject value. See setAlphaRejectSettings for more information.
799                */
800                void setAlphaRejectValue(unsigned char val);
801
802                /** Gets the alpha reject function. See setAlphaRejectSettings for more information.
803        */
804                CompareFunction getAlphaRejectFunction(void) const { return mAlphaRejectFunc; }
805
806        /** Gets the alpha reject value. See setAlphaRejectSettings for more information.
807        */
808                unsigned char getAlphaRejectValue(void) const { return mAlphaRejectVal; }
809        /** Sets whether or not this pass should iterate per light which
810                    can affect the object being rendered.
811                @remarks
812                        The default behaviour for a pass (when this option is 'false'), is
813                        for a pass to be rendered only once (or the number of times set in
814                        setPassIterationCount), with all the lights which could
815                        affect this object set at the same time (up to the maximum lights
816                        allowed in the render system, which is typically 8).
817                @par
818                        Setting this option to 'true' changes this behaviour, such that
819                        instead of trying to issue render this pass once per object, it
820                        is run <b>per light</b> which can affect this object, the number of
821                        times set in setPassIterationCount (default is once). In
822                        this case, only light index 0 is ever used, and is a different light
823                        every time the pass is issued, up to the total number of lights
824                        which is affecting this object. This has 2 advantages:
825                        <ul><li>There is no limit on the number of lights which can be
826                        supported</li>
827                        <li>It's easier to write vertex / fragment programs for this because
828                        a single program can be used for any number of lights</li>
829                        </ul>
830                        However, this technique is a lot more expensive, and typically you
831                        will want an additional ambient pass, because if no lights are
832                        affecting the object it will not be rendered at all, which will look
833                        odd even if ambient light is zero (imagine if there are lit objects
834                        behind it - the objects silhouette would not show up). Therefore,
835                        use this option with care, and you would be well advised to provide
836                        a less expensive fallback technique for use in the distance.
837                @note
838                        The number of times this pass runs is still limited by the maximum
839                        number of lights allowed as set in setMaxSimultaneousLights, so
840                        you will never get more passes than this.
841        @param enabled Whether this feature is enabled
842        @param onlyForOneLightType If true, the pass will only be run for a single type
843            of light, other light types will be ignored.
844        @param lightType The single light type which will be considered for this pass
845                */
846        void setIteratePerLight(bool enabled,
847            bool onlyForOneLightType = true, Light::LightTypes lightType = Light::LT_POINT);
848
849        /** Does this pass run once for every light in range? */
850                bool getIteratePerLight(void) const { return mIteratePerLight; }
851        /** Does this pass run only for a single light type (if getIteratePerLight is true). */
852        bool getRunOnlyForOneLightType(void) const { return mRunOnlyForOneLightType; }
853        /** Gets the single light type this pass runs for if  getIteratePerLight and
854            getRunOnlyForOneLightType are both true. */
855        Light::LightTypes getOnlyLightType() const { return mOnlyLightType; }
856               
857                /// Gets the parent Technique
858        Technique* getParent(void) { return mParent; }
859
860                /// Gets the resource group of the ultimate parent Material
861                const String& getResourceGroup(void) const;
862
863                /** Sets the details of the vertex program to use.
864                @remarks
865                        Only applicable to programmable passes, this sets the details of
866                        the vertex program to use in this pass. The program will not be
867                        loaded until the parent Material is loaded.
868                @param name The name of the program - this must have been
869                        created using GpuProgramManager by the time that this Pass
870                        is loaded. If this parameter is blank, any vertex program in this pass is disabled.
871        @param resetParams
872            If true, this will create a fresh set of parameters from the
873            new program being linked, so if you had previously set parameters
874            you will have to set them again. If you set this to false, you must
875            be absolutely sure that the parameters match perfectly, and in the
876            case of named parameters refers to the indexes underlying them,
877            not just the names.
878                */
879                void setVertexProgram(const String& name, bool resetParams = true);
880                /** Sets the vertex program parameters.
881                @remarks
882                        Only applicable to programmable passes, and this particular call is
883                        designed for low-level programs; use the named parameter methods
884                        for setting high-level program parameters.
885                */
886                void setVertexProgramParameters(GpuProgramParametersSharedPtr params);
887                /** Gets the name of the vertex program used by this pass. */
888                const String& getVertexProgramName(void) const;
889        /** Gets the vertex program parameters used by this pass. */
890        GpuProgramParametersSharedPtr getVertexProgramParameters(void) const;
891                /** Gets the vertex program used by this pass, only available after _load(). */
892                const GpuProgramPtr& getVertexProgram(void) const;
893
894
895        /** Sets the details of the vertex program to use when rendering as a
896        shadow caster.
897        @remarks
898        Texture-based shadows require that the caster is rendered to a texture
899        in a solid colour (the shadow colour in the case of modulative texture
900        shadows). Whilst Ogre can arrange this for the fixed function
901        pipeline, passes which use vertex programs might need the vertex
902        programs still to run in order to preserve any deformation etc
903        that it does. However, lighting calculations must be a lot simpler,
904        with only the ambient colour being used (which the engine will ensure
905        is bound to the shadow colour).
906        @par
907        Therefore, it is up to implemetors of vertex programs to provide an
908        alternative vertex program which can be used to render the object
909        to a shadow texture. Do all the same vertex transforms, but set the
910        colour of the vertex to the ambient colour, as bound using the
911        standard auto parameter binding mechanism.
912        @note
913        Some vertex programs will work without doing this, because Ogre ensures
914        that all lights except for ambient are set black. However, the chances
915        are that your vertex program is doing a lot of unnecessary work in this
916        case, since the other lights are having no effect, and it is good practice
917        to supply an alternative.
918        @note
919        This is only applicable to programmable passes.
920        @par
921        The default behaviour is for Ogre to switch to fixed-function
922        rendering if an explict vertex program alternative is not set.
923        */
924        void setShadowCasterVertexProgram(const String& name);
925        /** Sets the vertex program parameters for rendering as a shadow caster.
926        @remarks
927        Only applicable to programmable passes, and this particular call is
928        designed for low-level programs; use the named parameter methods
929        for setting high-level program parameters.
930        */
931        void setShadowCasterVertexProgramParameters(GpuProgramParametersSharedPtr params);
932        /** Gets the name of the vertex program used by this pass when rendering shadow casters. */
933        const String& getShadowCasterVertexProgramName(void) const;
934        /** Gets the vertex program parameters used by this pass when rendering shadow casters. */
935        GpuProgramParametersSharedPtr getShadowCasterVertexProgramParameters(void) const;
936        /** Gets the vertex program used by this pass when rendering shadow casters,
937            only available after _load(). */
938        const GpuProgramPtr& getShadowCasterVertexProgram(void) const;
939
940        /** Sets the details of the vertex program to use when rendering as a
941            shadow receiver.
942        @remarks
943            Texture-based shadows require that the shadow receiver is rendered using
944            a projective texture. Whilst Ogre can arrange this for the fixed function
945            pipeline, passes which use vertex programs might need the vertex
946            programs still to run in order to preserve any deformation etc
947            that it does. So in this case, we need a vertex program which does the
948            appropriate vertex transformation, but generates projective texture
949            coordinates.
950        @par
951            Therefore, it is up to implemetors of vertex programs to provide an
952            alternative vertex program which can be used to render the object
953            as a shadow receiver. Do all the same vertex transforms, but generate
954            <strong>2 sets</strong> of texture coordinates using the auto parameter
955            ACT_TEXTURE_VIEWPROJ_MATRIX, which Ogre will bind to the parameter name /
956            index you supply as the second parameter to this method. 2 texture
957            sets are needed because Ogre needs to use 2 texture units for some
958            shadow effects.
959        @note
960            This is only applicable to programmable passes.
961        @par
962            The default behaviour is for Ogre to switch to fixed-function
963            rendering if an explict vertex program alternative is not set.         
964        */
965        void setShadowReceiverVertexProgram(const String& name);
966        /** Sets the vertex program parameters for rendering as a shadow receiver.
967        @remarks
968        Only applicable to programmable passes, and this particular call is
969        designed for low-level programs; use the named parameter methods
970        for setting high-level program parameters.
971        */
972        void setShadowReceiverVertexProgramParameters(GpuProgramParametersSharedPtr params);
973
974                /** This method allows you to specify a fragment program for use when
975                        rendering a texture shadow receiver.
976                @remarks
977                        Texture shadows are applied by rendering the receiver. Modulative texture
978                        shadows are performed as a post-render darkening pass, and as such
979                        fragment programs are generally not required per-object. Additive
980                        texture shadows, however, are applied by accumulating light masked
981                        out using a texture shadow (black & white by default, unless you
982                        customise this using SceneManager::setCustomShadowCasterMaterial).
983                        OGRE can do this for you for most materials, but if you use a custom
984                        lighting program (e.g. per pixel lighting) then you'll need to provide
985                        a custom version for receiving shadows. You don't need to provide
986                        this for shadow casters if you don't use self-shadowing since they
987                        will never be shadow receivers too.
988                @par
989                        The shadow texture is always bound to texture unit 0 when rendering
990                        texture shadow passes. Therefore your custom shadow receiver program
991                        may well just need to shift it's texture unit usage up by one unit,
992                        and take the shadow texture into account in its calculations.
993                */
994                void setShadowReceiverFragmentProgram(const String& name);
995        /** Sets the fragment program parameters for rendering as a shadow receiver.
996        @remarks
997        Only applicable to programmable passes, and this particular call is
998        designed for low-level programs; use the named parameter methods
999        for setting high-level program parameters.
1000        */
1001        void setShadowReceiverFragmentProgramParameters(GpuProgramParametersSharedPtr params);
1002
1003        /** Gets the name of the vertex program used by this pass when rendering shadow receivers. */
1004        const String& getShadowReceiverVertexProgramName(void) const;
1005        /** Gets the vertex program parameters used by this pass when rendering shadow receivers. */
1006        GpuProgramParametersSharedPtr getShadowReceiverVertexProgramParameters(void) const;
1007        /** Gets the vertex program used by this pass when rendering shadow receivers,
1008        only available after _load(). */
1009        const GpuProgramPtr& getShadowReceiverVertexProgram(void) const;
1010
1011                /** Gets the name of the fragment program used by this pass when rendering shadow receivers. */
1012                const String& getShadowReceiverFragmentProgramName(void) const;
1013                /** Gets the fragment program parameters used by this pass when rendering shadow receivers. */
1014                GpuProgramParametersSharedPtr getShadowReceiverFragmentProgramParameters(void) const;
1015                /** Gets the fragment program used by this pass when rendering shadow receivers,
1016                only available after _load(). */
1017                const GpuProgramPtr& getShadowReceiverFragmentProgram(void) const;
1018
1019                /** Sets the details of the fragment program to use.
1020                @remarks
1021                        Only applicable to programmable passes, this sets the details of
1022                        the fragment program to use in this pass. The program will not be
1023                        loaded until the parent Material is loaded.
1024                @param name The name of the program - this must have been
1025                        created using GpuProgramManager by the time that this Pass
1026                        is loaded. If this parameter is blank, any fragment program in this pass is disabled.
1027        @param resetParams
1028            If true, this will create a fresh set of parameters from the
1029            new program being linked, so if you had previously set parameters
1030            you will have to set them again. If you set this to false, you must
1031            be absolutely sure that the parameters match perfectly, and in the
1032            case of named parameters refers to the indexes underlying them,
1033            not just the names.
1034                */
1035                void setFragmentProgram(const String& name, bool resetParams = true);
1036                /** Sets the vertex program parameters.
1037                @remarks
1038                        Only applicable to programmable passes.
1039                */
1040                void setFragmentProgramParameters(GpuProgramParametersSharedPtr params);
1041                /** Gets the name of the fragment program used by this pass. */
1042                const String& getFragmentProgramName(void) const;
1043                /** Gets the vertex program parameters used by this pass. */
1044                GpuProgramParametersSharedPtr getFragmentProgramParameters(void) const;
1045                /** Gets the vertex program used by this pass, only available after _load(). */
1046                const GpuProgramPtr& getFragmentProgram(void) const;
1047
1048                /** Splits this Pass to one which can be handled in the number of
1049                        texture units specified.
1050                @remarks
1051                        Only works on non-programmable passes, programmable passes cannot be
1052                        split, it's up to the author to ensure that there is a fallback Technique
1053                        for less capable cards.
1054                @param numUnits The target number of texture units
1055                @returns A new Pass which contains the remaining units, and a scene_blend
1056                                setting appropriate to approximate the multitexture. This Pass will be
1057                                attached to the parent Technique of this Pass.
1058                */
1059                Pass* _split(unsigned short numUnits);
1060
1061                /** Internal method to adjust pass index. */
1062                void _notifyIndex(unsigned short index);
1063
1064                /** Internal method for loading this pass. */
1065                void _load(void);
1066                /** Internal method for unloading this pass. */
1067                void _unload(void);
1068        // Is this loaded?
1069        bool isLoaded(void) const;
1070
1071        /** Gets the 'hash' of this pass, ie a precomputed number to use for sorting
1072        @remarks
1073            This hash is used to sort passes, and for this reason the pass is hashed
1074            using firstly its index (so that all passes are rendered in order), then
1075            by the textures which it's TextureUnitState instances are using.
1076        */
1077        uint32 getHash(void) const;
1078                /// Mark the hash as dirty
1079                void _dirtyHash(void);
1080        /** Internal method for recalculating the hash.
1081                @remarks
1082                        Do not call this unless you are sure the old hash is not still being
1083                        used by anything. If in doubt, call _dirtyHash if you want to force
1084                        recalculation of the has next time.
1085                */
1086        void _recalculateHash(void);
1087        /** Tells the pass that it needs recompilation. */
1088        void _notifyNeedsRecompile(void);
1089
1090        /** Update any automatic parameters (except lights) on this pass */
1091        void _updateAutoParamsNoLights(const AutoParamDataSource& source) const;
1092        /** Update any automatic light parameters on this pass */
1093        void _updateAutoParamsLightsOnly(const AutoParamDataSource& source) const;
1094
1095        /** Set texture filtering for every texture unit
1096        @note
1097            This property actually exists on the TextureUnitState class
1098            For simplicity, this method allows you to set these properties for
1099            every current TeextureUnitState, If you need more precision, retrieve the 
1100            TextureUnitState instance and set the property there.
1101        @see TextureUnitState::setTextureFiltering
1102        */
1103        void setTextureFiltering(TextureFilterOptions filterType);
1104        /** Sets the anisotropy level to be used for all textures.
1105        @note
1106            This property has been moved to the TextureUnitState class, which is accessible via the
1107            Technique and Pass. For simplicity, this method allows you to set these properties for
1108            every current TeextureUnitState, If you need more precision, retrieve the Technique,
1109            Pass and TextureUnitState instances and set the property there.
1110        @see TextureUnitState::setTextureAnisotropy
1111        */
1112        void setTextureAnisotropy(unsigned int maxAniso);
1113                /** Static method to retrieve all the Passes which need their
1114                    hash values recalculated.
1115                */
1116                static const PassSet& getDirtyHashList(void)
1117                { return msDirtyHashList; }
1118        /** Static method to retrieve all the Passes which are pending deletion.
1119        */
1120        static const PassSet& getPassGraveyard(void)
1121        { return msPassGraveyard; }
1122                /** Static method to reset the list of passes which need their hash
1123                    values recalculated.
1124                @remarks
1125                        For performance, the dirty list is not updated progressively as
1126                        the hashes are recalculated, instead we expect the processor of the
1127                        dirty hash list to clear the list when they are done.
1128                */
1129                static void clearDirtyHashList(void) { msDirtyHashList.clear(); }
1130
1131        /** Process all dirty and pending deletion passes. */
1132        static void processPendingPassUpdates(void);
1133
1134        /** Queue this pass for deletion when appropriate. */
1135        void queueForDeletion(void);
1136
1137        /** Returns whether this pass is ambient only.
1138        */
1139        bool isAmbientOnly(void) const;
1140
1141        /** set the number of iterations that this pass
1142        should perform when doing fast multi pass operation.
1143        @remarks
1144            Only applicable for programmable passes.
1145        @param count number of iterations to perform fast multi pass operations.
1146            A value greater than 0 will cause the pass to be executed count number of
1147            times without changing the render state.  This is very usefull for passes
1148            that use programmable shaders that have to iterate more than once but don't
1149            need a render state change.  Using multi pass can dramatically speed up rendering
1150            for materials that do things like fur, blur.
1151            A value of 0 turns off multi pass operation and the pass does
1152            the normal pass operation.
1153        */
1154        void setPassIterationCount(const size_t count) { mPassIterationCount = count; }
1155
1156        /** Gets the multi pass count value.
1157        */
1158        size_t getPassIterationCount(void) const { return mPassIterationCount; }
1159
1160        /** Applies texture names to Texture Unit State with matching texture name aliases.
1161            All Texture Unit States within the pass are checked.
1162            If matching texture aliases are found then true is returned.
1163
1164        @param
1165            aliasList is a map container of texture alias, texture name pairs
1166        @param
1167            apply set true to apply the texture aliases else just test to see if texture alias matches are found.
1168        @return
1169            True if matching texture aliases were found in the pass.
1170        */
1171        bool applyTextureAliases(const AliasTextureNamePairList& aliasList, const bool apply = true) const;
1172   
1173               
1174#ifdef GAMETOOLS_ILLUMINATION_MODULE
1175                public:
1176
1177                        void setActive(bool active){mActive = active;}
1178                        bool isActive() const {return mActive;}
1179
1180                        void addIllumTechniqueParams(IllumTechniqueParams* params)
1181                        {
1182                                illumTechniques.push_back(params);
1183                        }
1184                        std::vector<IllumTechniqueParams*>& getIllumTechniques()
1185                        {
1186                                return illumTechniques;
1187                        }
1188                        void setAlphaSourceBlendFactor(SceneBlendFactor f){mAlphaSourceBlendFactor = f;}
1189                        void setAlphaDestBlendFactor(SceneBlendFactor f){mAlphaDestBlendFactor = f;}
1190                        void setSeparateAlphaBlend(bool s){mSeparateAlpha = s;}
1191                        void setSceneBlendOperation(SceneBlendOperation op){mBlendOperation = op;}
1192                        void setSceneAlphaBlendOperation(SceneBlendOperation op){mAlphaBlendOperation = op;}
1193                        void setAlphaSceneBlending(SceneBlendType sbt);
1194                        void setAlphaSceneBlending(SceneBlendFactor sourceFactor, SceneBlendFactor destFactor);
1195                       
1196                        bool getSeparateAlphaBlend() const{return mSeparateAlpha;}
1197                        SceneBlendOperation getSceneBlendOperation() const{return mBlendOperation;}
1198                        SceneBlendOperation getSceneBlendOperationAlpha() const{return mAlphaBlendOperation;}
1199                        SceneBlendFactor getAlphaSceneBlendingSrcFactor() const{return mAlphaSourceBlendFactor;}
1200                        SceneBlendFactor getAlphaSceneBlendingDestFactor() const{return mAlphaDestBlendFactor;}
1201
1202                protected:
1203
1204                        bool mActive;
1205
1206                        std::vector<IllumTechniqueParams*> illumTechniques;
1207                        bool mSeparateAlpha;
1208                        SceneBlendFactor mAlphaSourceBlendFactor;   
1209                        SceneBlendFactor mAlphaDestBlendFactor;
1210                        SceneBlendOperation mBlendOperation;
1211                        SceneBlendOperation mAlphaBlendOperation;
1212#endif
1213    };
1214
1215    enum IlluminationStage
1216    {
1217        /// Part of the rendering which occurs without any kind of direct lighting
1218        IS_AMBIENT,
1219        /// Part of the rendering which occurs per light
1220        IS_PER_LIGHT,
1221        /// Post-lighting rendering
1222        IS_DECAL
1223    };
1224    /** Struct recording a pass which can be used for a specific illumination stage.
1225    @remarks
1226        This structure is used to record categorised passes which fit into a
1227        number of distinct illumination phases - ambient, diffuse / specular
1228        (per-light) and decal (post-lighting texturing).
1229        An original pass may fit into one of these categories already, or it
1230        may require splitting into its component parts in order to be categorised
1231        properly.
1232    */
1233    struct IlluminationPass
1234    {
1235        IlluminationStage stage;
1236        /// The pass to use in this stage
1237        Pass* pass;
1238        /// Whether this pass is one which should be deleted itself
1239        bool destroyOnShutdown;
1240        /// The original pass which spawned this one
1241        Pass* originalPass;
1242    };
1243
1244    typedef std::vector<IlluminationPass*> IlluminationPassList;
1245
1246
1247}
1248
1249#endif
Note: See TracBrowser for help on using the repository browser.