Ignore:
Timestamp:
06/26/06 09:52:08 (19 years ago)
Author:
szirmay
Message:
 
Location:
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques
Files:
2 added
4 edited

Legend:

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

    r949 r1055  
    1515                                                                                                                                bool updateAllFace, 
    1616                                                                                                                                bool useDistance, 
     17                                                                                                                                float attenuation, 
    1718                                                                                                                                Pass* pass, 
    1819                                                                                                                                OgreRenderable* parentRenderable, 
     
    2223                                                        RenderTechnique( parentRenderable, parentTechniqueGroup) 
    2324{        
     25        this->attenuation = attenuation; 
    2426        this->photonMapMaterialName = photonMapMaterialName; 
    2527         
     
    103105                                                                                                causticMapMaterialName, 
    104106                                                                                                photonMapTexID, 
    105                                                                                                 updateAllFace 
     107                                                                                                updateAllFace, 
     108                                                                                                attenuation 
    106109                                                                                                ); 
    107110 
     
    185188                OgreCausticCasterRenderTechniqueFactory* f = (OgreCausticCasterRenderTechniqueFactory*) factory; 
    186189                f->causticMapMaterialName =  params; 
     190        } 
     191 
     192        void parseAttenuation(String& params, RenderTechniqueFactory* factory) 
     193        { 
     194                OgreCausticCasterRenderTechniqueFactory* f = (OgreCausticCasterRenderTechniqueFactory*) factory; 
     195                f->attenuation =  StringConverter::parseReal(params); 
    187196        } 
    188197} 
     
    206215        this->attributeParsers.insert(AttribParserList::value_type("distance_impostor", (ILLUM_ATTRIBUTE_PARSER) parseUseDistance)); 
    207216        this->attributeParsers.insert(AttribParserList::value_type("update_all_face", (ILLUM_ATTRIBUTE_PARSER) parseUpdateAllFace)); 
    208  
     217        this->attributeParsers.insert(AttribParserList::value_type("attenuation", (ILLUM_ATTRIBUTE_PARSER) parseAttenuation)); 
     218         
    209219} 
    210220 
     
    216226{        
    217227        //reset parameters 
     228        attenuation = 1.0; 
    218229        startFrame = 1; 
    219230        photonMapUpdateInterval = 1; 
     
    237248                                                                                                photonMapTexID, 
    238249                                                                                                updateAllFace, 
    239                                                                                                 useDistance,                                             
     250                                                                                                useDistance, 
     251                                                                                                attenuation, 
    240252                                                                                                pass, 
    241253                                                                                                parentRenderable, 
  • GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCausticRecieverRenderTechnique.cpp

    r949 r1055  
    106106                        Fparams->setNamedConstant("cubeMapCameraPosition", 
    107107                                causticCasters.at(i)->getRootPosition(ILLUMRUN_CAUSTIC_CUBEMAP)); 
     108                        Fparams->setNamedConstant("attenuation", cauCubeRun->getAttenuation()); 
    108109                        passes.at(i)->setActive(true); 
    109110                }        
     
    135136                f->causticFragmentProgram =  params; 
    136137        } 
     138         
    137139} 
    138140OgreCausticRecieverRenderTechniqueFactory::OgreCausticRecieverRenderTechniqueFactory() 
     
    145147        this->attributeParsers.insert(AttribParserList::value_type("vertex_program_name", (ILLUM_ATTRIBUTE_PARSER) parseVertexProgram)); 
    146148        this->attributeParsers.insert(AttribParserList::value_type("fragment_program_name", (ILLUM_ATTRIBUTE_PARSER) parseFragmentProgram)); 
     149         
    147150} 
    148151 
  • GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDepthShadowRecieverRenderTechnique.cpp

    r949 r1055  
    5252                TextureUnitState* st = newpass->createTextureUnitState();                
    5353                st->setTextureFiltering(TFO_BILINEAR);           
     54                st = newpass->createTextureUnitState();          
     55                st->setTextureFiltering(TFO_BILINEAR);           
    5456 
    5557                newpass->setSceneBlending(SBT_MODULATE); 
    56                 newpass->setDepthBias(5); 
     58                newpass->setDepthBias(7); 
    5759                techn->movePass(lastpass, index);                        
    5860        } 
     
    9395                                         
    9496                        passes.at(i)->getTextureUnitState(0)->setTextureName( 
    95                                 depthRun->getDepthMapTextureName()); 
     97                                depthRun->getDepthMapTextureName(0)); 
     98                        passes.at(i)->getTextureUnitState(1)->setTextureName( 
     99                                depthRun->getDepthMapTextureName(1)); 
    96100 
    97101                        //TODO: set matrices 
    98102                        GpuProgramParametersSharedPtr fpParams = passes.at(i)->getFragmentProgramParameters(); 
    99                         fpParams->setNamedConstant("lightView", depthRun->getLightViewMatrix());  
    100                         fpParams->setNamedConstant("lightViewProj", depthRun->getLightViewProjMatrix());  
     103                        fpParams->setNamedConstant("lightView", depthRun->getLightViewMatrix(0));  
     104                        fpParams->setNamedConstant("lightViewProj", depthRun->getLightViewProjMatrix(0));  
     105                        fpParams->setNamedConstant("lightView2", depthRun->getLightViewMatrix(1));  
     106                        fpParams->setNamedConstant("lightViewProj2", depthRun->getLightViewProjMatrix(1));  
    101107                         
    102108                        passes.at(i)->setActive(true); 
  • GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreSBBRenderTechnique.cpp

    r874 r1055  
    1313{ 
    1414        this->depthTexID = depthTexID; 
    15         OgreIlluminationManager::getSingleton().createGlobalRun(ILLUMRUN_SCENE_CAMERA_DEPTH); 
    1615         
     16        OgreIlluminationManager::getSingleton().createGlobalRun(ILLUMRUN_SCENE_CAMERA_DEPTH);    
    1717         
    1818        OgreSceneCameraDepthRenderingRun* run = (OgreSceneCameraDepthRenderingRun*) 
    1919                OgreIlluminationManager::getSingleton().getGlobalRun(ILLUMRUN_SCENE_CAMERA_DEPTH)->asOgreRenderingRun(); 
     20 
     21        Root::getSingleton().addFrameListener(this); 
     22        OgreIlluminationManager::getSingleton().getMainViewport() 
     23                                                                ->getTarget()->addListener(this); 
     24        OgreIlluminationManager::getSingleton().addUpdateListener(this); 
    2025         
    2126        pass->getTextureUnitState(depthTexID)->setTextureName(run->getDepthTextureName()); 
    2227         
     28} 
     29 
     30void OgreSBBRenderTechnique::preAllUpdates() 
     31{ 
     32        lastVisibility = parentOgreRenderable->isVisible(); 
     33        parentOgreRenderable->setVisible(false); 
     34} 
     35void  OgreSBBRenderTechnique::preRenderTargetUpdate (const RenderTargetEvent &evt) 
     36{ 
     37        //parentOgreRenderable->setVisible(lastVisibility);      
     38} 
     39void  OgreSBBRenderTechnique::postRenderTargetUpdate (const RenderTargetEvent &evt) 
     40{ 
     41        //parentOgreRenderable->setVisible(false); 
     42} 
     43bool  OgreSBBRenderTechnique::frameEnded (const FrameEvent &evt) 
     44{ 
     45         
     46        return true; 
     47} 
     48void  OgreSBBRenderTechnique::postAllUpdates() 
     49{ 
     50        parentOgreRenderable->setVisible(lastVisibility);        
    2351} 
    2452 
Note: See TracChangeset for help on using the changeset viewer.