Changeset 2420


Ignore:
Timestamp:
06/06/07 19:20:26 (17 years ago)
Author:
szirmay
Message:
 
Location:
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreIlluminationManager.h

    r2397 r2420  
    4848        */ 
    4949        float prob; 
     50        int clusterID; 
    5051}; 
    5152 
  • GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePMEntryPointMapRenderingRun.cpp

    r2321 r2420  
    6666 
    6767        float* data = new float[clusterCount * 2]; 
    68         unsigned int entryPointCount = 0; 
     68        unsigned int clusterStartEntryPoint = 0; 
    6969        for(int i = 0; i < clusterCount; i++) 
    7070        { 
    7171                unsigned int clusterSize = OgreIlluminationManager::getSingleton().getPathMapClusterLength(i); 
    7272                data[i] = clusterSize;//clustercount 
    73                 data[clusterCount + i] = entryPointCount; 
    74                 entryPointCount += clusterSize; 
     73                data[clusterCount + i] = clusterStartEntryPoint; 
     74                for(int j = 0; j < clusterSize; j++) 
     75                { 
     76                        PathMapEntryPoint* EP = &OgreIlluminationManager::getSingleton().getPathMapEntryPoints().at(clusterStartEntryPoint + j); 
     77                        EP->clusterID = i; 
     78                } 
     79                clusterStartEntryPoint += clusterSize; 
    7580        } 
    7681 
     
    7984 
    8085        delete[] data; 
     86 
     87        if(false) 
     88        { 
     89                SceneManager* sm = Root::getSingleton()._getCurrentSceneManager(); 
     90                BillboardSet* bbs = sm->createBillboardSet("WEIGHT_DEBUG", 4096); 
     91                bbs->setDefaultDimensions(0.1, 0.1); 
     92                for(int i= 0; i < entryPointCnt;i++) 
     93                { 
     94                  PathMapEntryPoint* EP = &OgreIlluminationManager::getSingleton().getPathMapEntryPoints().at(i); 
     95                  int r = i / 256; 
     96                  int g = i - r * 256; 
     97                  float rr = (float) r / 256.0; 
     98                  float gg = (float) g / 256.0; 
     99                   
     100                  ColourValue c;                   
     101                  c = ColourValue(rr, gg, 0); 
     102                  /*c = ColourValue( 
     103                          Math::Ceil(Math::Floor(EP->position.x)), 
     104                          Math::Ceil(Math::Floor(EP->position.y)), 
     105                          Math::Ceil(Math::Floor(EP->position.z)));*/ 
     106                  //c = ColourValue(0,0,1,0); 
     107                  bbs->createBillboard(Vector3(EP->position.x, i, EP->position.z), c); 
     108                } 
     109                bbs->setPointRenderingEnabled(true); 
     110                bbs->setMaterialName("GTP/PM/EPBillboards"); 
     111                sm->getRootSceneNode()->createChildSceneNode("WEIGHT_DEBUG_SN")->attachObject(bbs); 
     112        } 
    81113} 
    82114 
  • GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePMWeightComputeRenderingRun.cpp

    r2410 r2420  
    6767                v->setOverlaysEnabled(false); 
    6868                rt->setAutoUpdated(false);               
    69         } 
     69        }        
    7070} 
    7171 
     
    161161                         
    162162                                renderFullscreenQuad(mat->getName(), rt); 
     163 
     164                //rt->writeContentsToFile("allweights.dds"); 
    163165                         
    164166        } 
     
    189191         
    190192        renderFullscreenQuad(mat->getName(), rt); 
     193 
     194        //rt->writeContentsToFile("clusterweights.bmp"); 
    191195} 
    192196 
Note: See TracChangeset for help on using the changeset viewer.