Ignore:
Timestamp:
09/11/06 15:30:44 (18 years ago)
Author:
szirmay
Message:
 
File:
1 edited

Legend:

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

    r1062 r1330  
    1414                                                                                                                bool useOwnMaterial, 
    1515                                                                                                                String impostorMaterialName, 
     16                                                                                                                bool useVParam, 
     17                                                                                                                String VParamRadius, 
     18                                                                                                                bool useFParam, 
     19                                                                                                                String FParamRadius, 
    1620                                                                                                                Pass* pass, 
    1721                                                                                                                OgreRenderable* parentRenderable, 
     
    2529        this->impostorMaterialName = impostorMaterialName; 
    2630        this->useOwnMaterial = useOwnMaterial; 
     31        this->VParamRadius = VParamRadius; 
     32        this->FParamRadius = FParamRadius; 
     33        this->useVParam = useVParam; 
     34        this->useFParam = useFParam; 
    2735         
    2836        //create the Particle system 
     
    3644                sharedRuns->addRun(ILLUMRUN_HPP_IMPOSTOR, createChildPSysRenderingRun());        
    3745 
     46        ((OgreChildPSystemRenderingRun*) sharedRuns->getRun(ILLUMRUN_HPP_IMPOSTOR)->asOgreRenderingRun())->setNode(node); 
    3847        impostorChanged(sharedRuns->getRun(ILLUMRUN_HPP_IMPOSTOR)); 
    3948} 
     
    6574} 
    6675 
     76void OgreHierarchicalParticleSystemTechnique::update(unsigned long frameNum) 
     77{ 
     78        HierarchicalParticleSystemTechnique::update(frameNum); 
     79 
     80        OgreChildPSystemRenderingRun* r = (OgreChildPSystemRenderingRun*)  
     81                                                                                        sharedRuns->getRun(ILLUMRUN_HPP_IMPOSTOR)->asOgreRenderingRun(); 
     82        float radius = r->getSmallSysRadius(); 
     83        if(useVParam) 
     84                pass->getVertexProgramParameters()->setNamedConstant(VParamRadius, radius); 
     85        if(useFParam) 
     86                pass->getFragmentProgramParameters()->setNamedConstant(FParamRadius, radius); 
     87} 
     88 
    6789///Technique Parsers 
    6890namespace HPSParsers 
     
    129151                f->childPSysScriptName = params; 
    130152        } 
     153        void parseVparamRadius(String& params, RenderTechniqueFactory* factory) 
     154        { 
     155                OgreHierarchicalParticleSystemTechniqueFactory* f = (OgreHierarchicalParticleSystemTechniqueFactory*) factory; 
     156                f->VParamRadius = params; 
     157        } 
     158        void parseFparamRadius(String& params, RenderTechniqueFactory* factory) 
     159        { 
     160                OgreHierarchicalParticleSystemTechniqueFactory* f = (OgreHierarchicalParticleSystemTechniqueFactory*) factory; 
     161                f->FParamRadius = params; 
     162        } 
    131163 
    132164         
     
    148180        this->attributeParsers.insert(AttribParserList::value_type("particle_script", (ILLUM_ATTRIBUTE_PARSER) parseScriptName)); 
    149181        this->attributeParsers.insert(AttribParserList::value_type("material", (ILLUM_ATTRIBUTE_PARSER) parseMaterialName)); 
     182        this->attributeParsers.insert(AttribParserList::value_type("vparam_radius", (ILLUM_ATTRIBUTE_PARSER) parseFparamRadius)); 
     183        this->attributeParsers.insert(AttribParserList::value_type("fparam_radius", (ILLUM_ATTRIBUTE_PARSER) parseVparamRadius)); 
    150184         
    151185} 
     
    165199        impostorMaterialName = ""; 
    166200        childPSysScriptName = ""; 
    167         bool useOwnMaterial = true; 
     201        useOwnMaterial = true; 
     202        VParamRadius = ""; 
     203        FParamRadius = ""; 
     204        useVParam = false; 
     205        useFParam = false; 
    168206 
    169207        parseParams(params); 
     
    179217                                                                                                useOwnMaterial, 
    180218                                                                                                impostorMaterialName, 
     219                                                                                                useVParam, 
     220                                                                                                VParamRadius, 
     221                                                                                                useFParam, 
     222                                                                                                FParamRadius, 
    181223                                                                                                pass, 
    182224                                                                                                parentRenderable, 
Note: See TracChangeset for help on using the changeset viewer.