Ignore:
Timestamp:
07/02/07 04:12:36 (17 years ago)
Author:
szirmay
Message:
 
File:
1 edited

Legend:

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

    r2460 r2475  
    2121                                                                                                int startTextureUnitID, 
    2222                                                                                                bool nearestLightsFromCamera, 
     23                                                                                                bool bindToVertexShader, 
    2324                                                                                                Pass* pass, 
    2425                                                                                                OgreRenderable* parentRenderable, 
     
    2829                                                        DepthShadowReceiverRenderTechnique(parentRenderable, parentTechniqueGroup) 
    2930{ 
     31        this->bindToVertexShader = bindToVertexShader; 
    3032        this->passBlendingSRC = passBlendingSRC; 
    3133        this->passBlendingDEST = passBlendingDEST; 
     
    99101        Vector3 center = OgreIlluminationManager::getSingleton().getMainCamera()->getWorldPosition(); 
    100102        if(!nearestLightsFromCamera) 
    101                 center = ((OgreSharedRuns*) sharedRuns)->getRootPosition(); 
     103                center = ((OgreSharedRuns*) sharedRuns)->getRootRenderable()->getParentSceneNode()->_getDerivedPosition(); 
     104                //center = ((OgreSharedRuns*) sharedRuns)->getRootPosition(); 
    102105        Root::getSingleton()._getCurrentSceneManager()->_populateLightList( 
    103106                                                        center, 
     
    149152                                GpuProgramParametersSharedPtr fpParams = passToSet->getFragmentProgramParameters(); 
    150153                                GpuProgramParametersSharedPtr vpParams = passToSet->getVertexProgramParameters(); 
     154                                GpuProgramParametersSharedPtr variableSetParams = fpParams; 
     155                                if(bindToVertexShader) 
     156                                        variableSetParams = vpParams; 
    151157 
    152158                                String LightViewProjParamName = lightViewProjParamName; 
     
    165171                                        vpParams->setNamedConstant(LightViewProjParamName, depthRun->getLightViewProjMatrix()); 
    166172                                        else 
    167                                         fpParams->setNamedConstant(LightViewProjParamName, depthRun->getLightViewProjMatrix()); 
     173                                        variableSetParams->setNamedConstant(LightViewProjParamName, depthRun->getLightViewProjMatrix()); 
    168174                                } 
    169175                                if(setLightViewMatrix) 
     
    172178                                        vpParams->setNamedConstant(LightViewParamName, depthRun->getLightViewMatrix()); 
    173179                                        else 
    174                                         fpParams->setNamedConstant(LightViewParamName, depthRun->getLightViewMatrix()); 
     180                                        variableSetParams->setNamedConstant(LightViewParamName, depthRun->getLightViewMatrix()); 
    175181                                } 
    176182                                if(setLightProjFarPlane) 
     
    347353                f->nearestLightsFromCamera = StringConverter::parseBool(params); 
    348354        } 
     355        void parseBindToVertexShader(String& params, RenderTechniqueFactory* factory) 
     356        { 
     357                OgreDepthShadowReceiverRenderTechniqueFactory* f = (OgreDepthShadowReceiverRenderTechniqueFactory*) factory; 
     358                f->bindToVertexShader = StringConverter::parseBool(params); 
     359        } 
    349360} 
    350361 
     
    370381        this->attributeParsers.insert(AttribParserList::value_type("start_tex_id", (ILLUM_ATTRIBUTE_PARSER) parseStartTexID));   
    371382        this->attributeParsers.insert(AttribParserList::value_type("nearest_from_camera", (ILLUM_ATTRIBUTE_PARSER) parseNearestFromCamera));     
     383        this->attributeParsers.insert(AttribParserList::value_type("bind_to_vertex_shader", (ILLUM_ATTRIBUTE_PARSER) parseBindToVertexShader));  
    372384} 
    373385 
     
    394406        createNewPasses = true; 
    395407        startTextureUnitID = 0; 
    396         nearestLightsFromCamera = true; 
    397          
     408        nearestLightsFromCamera = false; 
     409        bindToVertexShader = false; 
     410 
    398411        parseParams(params); 
    399412 
     
    415428                                                                                                startTextureUnitID, 
    416429                                                                                                nearestLightsFromCamera, 
     430                                                                                                bindToVertexShader, 
    417431                                                                                                pass, 
    418432                                                                                                parentRenderable, 
Note: See TracChangeset for help on using the changeset viewer.