Ignore:
Timestamp:
06/26/06 09:52:08 (18 years ago)
Author:
szirmay
Message:
 
Location:
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include
Files:
4 added
10 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreIlluminationManager.h

    r949 r1055  
    1313#include "OgreDepthShadowMapRenderingRun.h" 
    1414#include "OgreDepthShadowRecieverRenderTechnique.h" 
     15#include "OgreFireRenderTechnique.h" 
    1516 
    1617 
     
    5152        */ 
    5253        BillboardSet* findRenderableInParticleSystem(ParticleSystem* system); 
     54        void preAllUpdates(); 
     55        void postAllUpdates(); 
    5356 
    5457        /** 
     
    6265        */ 
    6366        float maxRad; 
     67        std::map<RenderingRunType,float> maxRads; 
    6468        /** 
    6569                @brief The camera attached to the player. 
     
    106110        std::map<String, OgreSharedRuns*> perLightRuns; 
    107111 
    108          
     112        std::map<GlobalTargetType, GlobalUseRenderTarget*> globalTargets; 
     113 
     114        std::vector<UpdateListener*> updateListeners; 
     115 
    109116public: 
    110117 
     118        void addUpdateListener(UpdateListener* l){updateListeners.push_back(l);} 
    111119        /** 
    112120                @brief registers a RenderTechniqueFactory 
     
    120128        */ 
    121129        float getMaxJoinRadius(){return maxRad;} 
     130        float getMaxJoinRadius(RenderingRunType type){return maxRads[type];} 
    122131        /** 
    123132                @brief sets the maximum bounding sphere radius with two SharedRuns can be joined. 
    124133        */ 
    125         void setMaxJoinRadius(float rad){maxRad = rad;} 
     134        void setMaxJoinRadius(float rad) 
     135        { 
     136                std::map<RenderingRunType,float> ::iterator it = maxRads.begin(); 
     137                std::map<RenderingRunType,float> ::iterator itend = maxRads.end(); 
     138                 
     139                maxRad = rad; 
     140         
     141                while(it != itend) 
     142                { 
     143                        (*it).second = maxRad; 
     144                        it++; 
     145                } 
     146                 
     147        } 
     148        void setMaxJoinRadius(RenderingRunType type, float rad){maxRads[type] = rad;} 
    126149        /** 
    127150                @brief Returns the one and only OgreIlluminationManager instance. 
     
    146169        */ 
    147170        void initTechniques(Entity* e); 
     171        /** 
     172                @brief searches for RenderTechniques in materials and creates them for a Billboardset. 
     173        */ 
     174        void initTechniques(BillboardSet* bbs, ParticleSystem* sys); 
    148175        /** 
    149176                @brief Returns a pointer to the player camera. 
     
    224251        */ 
    225252        RenderingRun* getGlobalRun(RenderingRunType runType); 
     253 
     254        GlobalUseRenderTarget* getGlobalTarget(GlobalTargetType type); 
     255        void addGlobalTarget(GlobalTargetType type, GlobalUseRenderTarget* target); 
    226256        /** 
    227257                @brief Updates a global RenderingRun with the given type. 
  • GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreRenderTechnique.h

    r836 r1055  
    55 
    66class OgreTechniqueGroup; 
     7 
     8class UpdateListener 
     9{ 
     10public: 
     11        virtual void preAllUpdates(){} 
     12        virtual void postAllUpdates(){} 
     13}; 
    714 
    815/** 
  • GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreRenderable.h

    r790 r1055  
    4545                @param billboardset the BillboardSet to wrap 
    4646        */ 
    47         OgreRenderable(BillboardSet* billboardset); 
     47        OgreRenderable(BillboardSet* billboardset, ParticleSystem* sys = 0); 
    4848        /** 
    4949                @brief Destructor. 
     
    149149        */ 
    150150        BillboardSet* billboardSetRenderable; 
     151        ParticleSystem* parentParticleSystem; 
    151152 
    152153        /** 
  • GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreRenderingRun.h

    r808 r1055  
    3030        */ 
    3131        OgreRenderingRun* asOgreRenderingRun(){return this;} 
     32 
     33        virtual bool canJoin(OgreRenderingRun* run){return true;} 
    3234 
    3335protected: 
     
    6668                @see renderPixelSprites 
    6769        */ 
    68         SpriteSet* pixelSprites; 
     70        BillboardSet* pixelSprites; 
    6971        /** 
    7072                @brief unique name of the SpriteSet used in pixel sprite rendering 
  • GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreSharedRuns.h

    r790 r1055  
    66using namespace Ogre; 
    77 
     8enum GlobalTargetType 
     9{ 
     10        ILLUM_GLOBAL_TARGET_FIREPARTICLES 
     11}; 
     12 
     13class GlobalUseRenderTarget 
     14{ 
     15public: 
     16        GlobalUseRenderTarget(){lastUpdated = 0; renderTarget = 0;} 
     17         
     18        unsigned long lastUpdated; 
     19        RenderTarget* renderTarget; 
     20}; 
    821/** 
    922        @brief Class of SharedRuns used in an OGRE environment.  
     
    112125                @param r2 pointer to the other SharedRuns instance 
    113126        */ 
    114         static bool haveCommonRuns(SharedRuns* r1, SharedRuns* r2); 
     127        static bool haveCommonRuns(SharedRuns* r1, SharedRuns* r2, std::vector<RenderingRunType>& commonruns); 
    115128        /** 
    116129                @brief Checks if this node has a resource with the given type. 
     
    170183        //inherited 
    171184        void destroy(); 
     185        void runUpdated(RenderingRunType runType, RenderingRun* run); 
     186        void runChanged(RenderingRunType runType, RenderingRun* run); 
     187        virtual void addTechniqueGroup(TechniqueGroup* group){childTechniqueGroups.push_back(group);} 
    172188         
    173189protected: 
     190        /** 
     191                @brief child TechniqueGroup instance. 
     192 
     193                If this SharedRuns node is a leaf, it containes a reference to a TechniqueGroup instance. 
     194                All messages will be transfered to this object,  
     195                and bounding information will be retrieved from this TechniqueGroup 
     196        */ 
     197        std::vector<TechniqueGroup*> childTechniqueGroups; 
    174198        /** 
    175199                @brief map of contained RenderingRuns 
  • GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCausticCasterRenderTechnique.h

    r949 r1055  
    4343                                                        bool updateAllFace, 
    4444                                                        bool useDistance, 
     45                                                        float attenuation, 
    4546                                                        Pass* pass, 
    4647                                                        OgreRenderable* parentRenderable, 
     
    5758        */ 
    5859        String& getCausticCubeMapName(); 
     60        float getAttenuation(){return attenuation;} 
    5961 
    6062protected: 
    61  
     63         
    6264        /** 
    6365                @brief name of the created photon hit map texture 
     
    7274        */ 
    7375        unsigned char photonMapTexID; 
     76        float attenuation; 
    7477         
    7578        //inherited 
    76         virtual void photonMapRunChanged(RenderingRun* run); 
     79        void photonMapRunChanged(RenderingRun* run); 
    7780        //inherited      
    78         virtual void causticCubeMapRunChanged(RenderingRun* run); 
     81        void causticCubeMapRunChanged(RenderingRun* run); 
    7982        //inherited 
    80         virtual void distanceCubeMapRunChanged(RenderingRun* run); 
     83        void distanceCubeMapRunChanged(RenderingRun* run); 
    8184        //inherited 
    8285        void distanceCubeMapRunUpdated(RenderingRun* run); 
    8386        //inherited 
    84         virtual RenderingRun* createPhotonMapRun(); 
     87        RenderingRun* createPhotonMapRun(); 
    8588        //inherited 
    86         virtual RenderingRun* createCausticCubeMapRun(); 
     89        RenderingRun* createCausticCubeMapRun(); 
    8790        //inherited 
    88         virtual RenderingRun* createDistanceCubeMapRun(); 
     91        RenderingRun* createDistanceCubeMapRun(); 
    8992}; 
    9093 
     
    102105 
    103106 
     107        float attenuation; 
    104108        unsigned long startFrame; 
    105109        unsigned long photonMapUpdateInterval; 
  • GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreSBBRenderTechnique.h

    r836 r1055  
    1818*/ 
    1919class OgreSBBRenderTechnique : public OgreRenderTechnique, 
    20                                                                                 public SBBRenderTechnique 
     20                                                                                public SBBRenderTechnique, 
     21                                                                                public RenderTargetListener, 
     22                                                                                public FrameListener, 
     23                                                                                public UpdateListener 
    2124{ 
    2225public: 
     
    3942        //inherited 
    4043        virtual void update(unsigned long frameNum); 
     44 
     45        void  preRenderTargetUpdate (const RenderTargetEvent &evt); 
     46        void  postRenderTargetUpdate (const RenderTargetEvent &evt); 
     47        bool  frameEnded (const FrameEvent &evt); 
     48        void preAllUpdates(); 
     49        void postAllUpdates(); 
    4150         
    4251protected:       
     
    4554        */ 
    4655        unsigned char depthTexID; 
     56 
     57        bool lastVisibility; 
    4758         
    4859}; 
  • GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreCausticCubeMapRenderingRun.h

    r790 r1055  
    4040                                                                 String materialName, 
    4141                                                                 unsigned char photonMapTexId, 
    42                                                                  bool updateAllFace 
     42                                                                 bool updateAllFace, 
     43                                                                 float attenuation 
    4344                                                                 ); 
    4445        /** 
     
    4950        //inherited 
    5051        void photonMapChanged(RenderingRun* run); 
     52        float getAttenuation(){return attenuation;} 
    5153         
     54        bool canJoin(OgreRenderingRun* run) 
     55        { 
     56                OgreCausticCubeMapRenderingRun* r = (OgreCausticCubeMapRenderingRun*) run; 
     57                if(r->materialName == materialName) 
     58                        return true; 
     59                return false; 
     60        } 
     61 
    5262protected: 
    5363        /** 
     
    7181        */ 
    7282        String materialName; 
     83        float attenuation; 
    7384         
    7485        //inherited 
  • GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreDepthShadowMapRenderingRun.h

    r790 r1055  
    4141                @brief returns the depth shadow map texture created by this run 
    4242        */ 
    43         String getDepthMapTextureName(){return name;} 
     43        String getDepthMapTextureName(int i){return names[i];} 
    4444        /** 
    4545                @brief Refreshes light camera matrices, called in each update. 
     
    4949                @brief retuns the view matrix of the camera from which the depth shadow map was created 
    5050        */ 
    51         Matrix4 getLightViewMatrix(); 
     51        Matrix4 getLightViewMatrix(int i); 
    5252        /** 
    5353                @brief retuns the concatenation of the view and projection matrices of the camera from which the depth shadow map was created 
    5454        */ 
    55         Matrix4 getLightViewProjMatrix(); 
     55        Matrix4 getLightViewProjMatrix(int i); 
    5656 
    5757protected:       
     
    6363                @brief pointer to the camera of the lightsource 
    6464        */ 
    65         Camera* depthMapCamera; 
     65        Camera* depthMapCameras[2]; 
    6666        /** 
    6767                @brief the name of the material to be used when rendering the depth shadow map 
     
    7575                @brief the name of the depth shadow map texture that was created by this run 
    7676        */ 
    77         String name; 
     77        String names[2]; 
    7878        /** 
    7979                @brief a pointer to the depth shadow texture that was created by this run 
    8080        */ 
    81         Texture* depthMapTexture; 
     81        Texture* depthMapTextures[2]; 
    8282         
    8383        //inherited 
  • GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgrePhotonMapRenderingRun.h

    r949 r1055  
    4848        void refreshLight(); 
    4949 
    50          
     50        bool canJoin(OgreRenderingRun* run) 
     51        { 
     52                OgrePhotonMapRenderingRun* r = (OgrePhotonMapRenderingRun*) run; 
     53                if(r->materialName == materialName) 
     54                        return true; 
     55                return false; 
     56        } 
    5157        void distanceCubeMapChanged(RenderingRun* run); 
    5258         
Note: See TracChangeset for help on using the changeset viewer.