Ignore:
Timestamp:
11/03/06 09:51:53 (18 years ago)
Author:
szirmay
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreConvolvedCubeMapRenderTechnique.cpp

    r874 r1711  
    88                                                                                                                unsigned int cubeMapResolution, 
    99                                                                                                                unsigned int reducedCubeMapResolution, 
    10                                                                                                                 unsigned char reducedTexID, 
     10                                                                                                                unsigned char texID, 
    1111                                                                                                                bool useDistCalc, 
    1212                                                                                                                bool useFaceAngleCalc, 
     
    1414                                                                                                                float angleTolerance, 
    1515                                                                                                                bool updateAllFace, 
     16                                                                                                                bool renderSelf, 
    1617                                                                                                                Pass* pass, 
    1718                                                                                                                OgreRenderable* parentRenderable, 
    1819                                                                                                                OgreTechniqueGroup* parentTechniqueGroup) 
    19                                                         :OgreRenderTechnique( pass, parentRenderable, parentTechniqueGroup), 
    20                                                         ConvolvedCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, reducedCubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, parentRenderable, parentTechniqueGroup), 
     20                                                        : 
     21                                                        OgreCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, texID, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, pass, parentRenderable, parentTechniqueGroup), 
     22                                                        CubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, parentRenderable, parentTechniqueGroup), 
     23                                                        ConvolvedCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, reducedCubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, parentRenderable, parentTechniqueGroup), 
    2124                                                        RenderTechnique(parentRenderable, parentTechniqueGroup)  
    2225{        
    23         this->reducedTexID = reducedTexID; 
    24                  
    2526        if(sharedRuns->getRun(ILLUMRUN_COLOR_CUBEMAP) == 0) 
    2627                sharedRuns->addRun(ILLUMRUN_COLOR_CUBEMAP, createColorCubeMapRun()); 
     
    4950        String cubemapname = cuberun->getReducedCubeMapTextureName(); 
    5051         
    51         pass->getTextureUnitState(reducedTexID)->setTextureName(cubemapname); 
     52        pass->getTextureUnitState(texID)->setTextureName(cubemapname); 
    5253} 
    5354 
     
    9495namespace ConvolvedCubemapParsers 
    9596{ 
    96         void parseStartFrame(String& params, RenderTechniqueFactory* factory) 
    97         { 
    98                 OgreConvoledCubeMapRenderTechniqueFactory* f = (OgreConvoledCubeMapRenderTechniqueFactory*) factory; 
    99                 f->startFrame =  StringConverter::parseUnsignedLong(params); 
    100         } 
    101         void parseCubeMapUpdateInterval(String& params, RenderTechniqueFactory* factory) 
    102         { 
    103                 OgreConvoledCubeMapRenderTechniqueFactory* f = (OgreConvoledCubeMapRenderTechniqueFactory*) factory; 
    104                 f->cubeMapUpdateInterval =  StringConverter::parseUnsignedLong(params); 
    105         } 
    106  
    107         void parseCubeMapResolution(String& params, RenderTechniqueFactory* factory) 
    108         { 
    109                 OgreConvoledCubeMapRenderTechniqueFactory* f = (OgreConvoledCubeMapRenderTechniqueFactory*) factory; 
    110                 f->cubeMapResolution =  StringConverter::parseUnsignedInt(params); 
    111         } 
    112  
    11397        void parseReducedCubeMapResolution(String& params, RenderTechniqueFactory* factory) 
    11498        { 
    11599                OgreConvoledCubeMapRenderTechniqueFactory* f = (OgreConvoledCubeMapRenderTechniqueFactory*) factory; 
    116100                f->reducedCubeMapResolution =  StringConverter::parseUnsignedInt(params); 
    117         } 
    118  
    119         void parseTexID(String& params, RenderTechniqueFactory* factory) 
    120         { 
    121                 OgreConvoledCubeMapRenderTechniqueFactory* f = (OgreConvoledCubeMapRenderTechniqueFactory*) factory; 
    122                 f->texID =  StringConverter::parseUnsignedInt(params); 
    123         } 
    124  
    125         void parseUseDistCalc(String& params, RenderTechniqueFactory* factory) 
    126         { 
    127                 OgreConvoledCubeMapRenderTechniqueFactory* f = (OgreConvoledCubeMapRenderTechniqueFactory*) factory; 
    128                 // format: on/off tolerance(float) 
    129                 StringVector vecparams = StringUtil::split(params, " \t"); 
    130  
    131                 if(StringConverter::parseBool(vecparams[0]))//on 
    132                 { 
    133                         f->useDistCalc = true; 
    134  
    135                         if(vecparams.size()>1) 
    136                         {                        
    137                                 f->distTolerance = StringConverter::parseReal(vecparams[1]); 
    138                         } 
    139                 } 
    140                 else 
    141                 { 
    142                         f->useDistCalc = false; 
    143                 } 
    144         } 
    145  
    146         void parseUseFaceAngleCalc(String& params, RenderTechniqueFactory* factory) 
    147         { 
    148                 OgreConvoledCubeMapRenderTechniqueFactory* f = (OgreConvoledCubeMapRenderTechniqueFactory*) factory; 
    149                 // format: on/off tolerance(float) 
    150                 StringVector vecparams = StringUtil::split(params, " \t"); 
    151  
    152                 if(StringConverter::parseBool(vecparams[0]))//on 
    153                 { 
    154                         f->useFaceAngleCalc = true; 
    155  
    156                         if(vecparams.size()>1) 
    157                         {                        
    158                                 f->angleTolerance = StringConverter::parseReal(vecparams[1]); 
    159                         } 
    160                 } 
    161                 else 
    162                 { 
    163                         f->useFaceAngleCalc = false; 
    164                 } 
    165         } 
    166  
    167         void parseUpdateAllFace(String& params, RenderTechniqueFactory* factory) 
    168         { 
    169                 OgreConvoledCubeMapRenderTechniqueFactory* f = (OgreConvoledCubeMapRenderTechniqueFactory*) factory; 
    170                 f->updateAllFace =  StringConverter::parseBool(params); 
    171         } 
     101        }        
    172102} 
    173103///Technique factory 
     
    177107 
    178108        using namespace ConvolvedCubemapParsers; 
    179         //register parsers 
    180         this->attributeParsers.insert(AttribParserList::value_type("start_frame", (ILLUM_ATTRIBUTE_PARSER) parseStartFrame)); 
    181         this->attributeParsers.insert(AttribParserList::value_type("update_interval", (ILLUM_ATTRIBUTE_PARSER) parseCubeMapUpdateInterval)); 
    182         this->attributeParsers.insert(AttribParserList::value_type("resolution", (ILLUM_ATTRIBUTE_PARSER) parseCubeMapResolution)); 
    183         this->attributeParsers.insert(AttribParserList::value_type("reduced_resolution", (ILLUM_ATTRIBUTE_PARSER) parseReducedCubeMapResolution)); 
    184         this->attributeParsers.insert(AttribParserList::value_type("texture_unit_id", (ILLUM_ATTRIBUTE_PARSER) parseTexID)); 
    185         this->attributeParsers.insert(AttribParserList::value_type("distance_calc", (ILLUM_ATTRIBUTE_PARSER) parseUseDistCalc)); 
    186         this->attributeParsers.insert(AttribParserList::value_type("face_angle_calc", (ILLUM_ATTRIBUTE_PARSER) parseUseFaceAngleCalc)); 
    187         this->attributeParsers.insert(AttribParserList::value_type("update_all_face", (ILLUM_ATTRIBUTE_PARSER) parseUpdateAllFace)); 
    188  
     109        this->attributeParsers.insert(AttribParserList::value_type("reduced_resolution", (ILLUM_ATTRIBUTE_PARSER) parseReducedCubeMapResolution));       
    189110} 
    190111 
     
    195116                                                                                OgreTechniqueGroup* parentTechniqueGroup) 
    196117{        
    197         //reset parameters 
    198         startFrame = 1; 
    199         cubeMapUpdateInterval = 1; 
    200         cubeMapResolution = 256; 
    201118        reducedCubeMapResolution = 8;    
    202         texID = 0; 
    203         useDistCalc = 1; 
    204         useFaceAngleCalc = false; 
    205         distTolerance = 2.0; 
    206         angleTolerance = 2.0; 
    207         updateAllFace = false; 
    208119 
     120        OgreCubeMapRenderTechniqueFactory::resetParams(); 
     121        OgreCubeMapRenderTechniqueFactory::parseParams(params);  
    209122        parseParams(params); 
    210123 
     
    220133                                                                                                angleTolerance, 
    221134                                                                                                updateAllFace, 
     135                                                                                                renderSelf, 
    222136                                                                                                pass, 
    223137                                                                                                parentRenderable, 
Note: See TracChangeset for help on using the changeset viewer.