Ignore:
Timestamp:
03/09/07 10:32:11 (17 years ago)
Author:
szirmay
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePMWeightComputeRenderingRun.cpp

    r2214 r2218  
    22#include "OgreIlluminationManager.h" 
    33#include "OgrePMEntryPointMapRenderingRun.h" 
     4#include "OgreDepthShadowMapRenderingRun.h" 
    45 
    56OgrePMWeightComputeRenderingRun::OgrePMWeightComputeRenderingRun(String name, String LightName) 
     
    7475        if(light->getType() == Light::LT_SPOTLIGHT) 
    7576        { 
     77                OgreIlluminationManager::getSingleton().createPerLightRun(light->getName(), ILLUMRUN_DEPTH_SHADOWMAP); 
     78                OgreIlluminationManager::getSingleton().updatePerLightRun(light->getName(), ILLUMRUN_DEPTH_SHADOWMAP, frameNum); 
     79                OgreDepthShadowMapRenderingRun* SMrun = (OgreDepthShadowMapRenderingRun*) OgreIlluminationManager::getSingleton() 
     80                        .getPerLightRun(light->getName(), ILLUMRUN_DEPTH_SHADOWMAP)->asOgreRenderingRun();  
     81                 
    7682                MaterialPtr mat = MaterialManager::getSingleton().getByName("GTP/PathMap_ComputeWeights"); 
    77  
    7883                GpuProgramParameters* Fparams = mat->getTechnique(0)->getPass(0)->getFragmentProgramParameters().getPointer(); 
    7984                         
     
    8287                //      Radian lightAngle = light->getSpotlightOuterAngle(); 
    8388                         
    84                         //Fparams->setNamedConstant("lightTransform", lightMatrix); 
    8589                        Fparams->setNamedConstant("nRadionColumns", col); 
    8690                        Fparams->setNamedConstant("lightPos", lightPos); 
    8791                        Fparams->setNamedConstant("lightDir", lightDir); 
     92                        Fparams->setNamedConstant("lightViewProj", SMrun->getLightViewProjMatrix()); 
     93                        Fparams->setNamedConstant("lightFarPlane", SMrun->getLightFarPlane()); 
    8894                         
    8995                        mat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName( 
    9096                                                PMEPrun->getEntryPointTextureName()); 
     97                        mat->getTechnique(0)->getPass(0)->getTextureUnitState(1)->setTextureName( 
     98                                                SMrun->getDepthMapTextureName()); 
    9199                                 
    92100                        RenderTarget* rt = allWeightsTexture->getBuffer().getPointer()->getRenderTarget(); 
    93101                        renderFullscreenQuad(mat->getName(), rt); 
    94102 
    95                         rt->writeContentsToFile("allweights.bmp"); 
     103                //      rt->writeContentsToFile("allweights.bmp"); 
    96104                //      rt->writeContentsToFile("allweights.dds"); 
    97105                         
    98                         float* allweights = new float[entryPointCnt / 4096 * 4096]; 
     106                /*      float* allweights = new float[entryPointCnt / 4096 * 4096]; 
    99107                        PixelBox lockBox(entryPointCnt / 4096, 4096, 1, PF_FLOAT32_R, allweights); 
    100108                        allWeightsTexture->getBuffer()->blitToMemory(lockBox); 
     
    126134                        } 
    127135 
    128                         delete[] allweights; 
     136                        delete[] allweights;*/ 
    129137 
    130138///////////////// 
     
    153161        //rt->writeContentsToFile("weights.bmp");        
    154162        //rt->writeContentsToFile("weights.dds"); 
    155  
     163/* 
    156164        float* weights = new float[clustercount]; 
    157165        PixelBox lockBox(clustercount, 1, 1, PF_FLOAT32_R, weights); 
    158         allWeightsTexture->getBuffer()->blitToMemory(lockBox); 
     166        weightTexture->getBuffer()->blitToMemory(lockBox); 
    159167 
    160         delete[] weights; 
     168        delete[] weights;*/ 
    161169} 
    162170 
Note: See TracChangeset for help on using the changeset viewer.