Ignore:
Timestamp:
03/07/07 17:34:13 (17 years ago)
Author:
szirmay
Message:
 
File:
1 edited

Legend:

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

    r2189 r2200  
    4343                tm[i].dir[1] = EP->normal.y; 
    4444                tm[i].dir[2] = EP->normal.z; 
    45                 tm[i].dir[3] = 1.0; 
     45                tm[i].dir[3] = EP->prob; 
    4646        }        
    4747 
    4848        PixelBox lockBox(width, height, 1, PF_FLOAT32_RGBA, tm); 
    4949        entryPointTexture->getBuffer()->blitFromMemory(lockBox); 
     50 
     51        delete[] tm; 
     52 
     53        int clusterCount = OgreIlluminationManager::getSingleton().getPathMapClusterLengthsSize(); 
     54        width = clusterCount; 
     55        height = 2; 
     56        texPtr = Ogre::TextureManager::getSingleton().createManual(name + "_CL",  
     57                                                                                                                                                "default", 
     58                                                                                                                                                TEX_TYPE_2D, 
     59                                                                                                                                                width, 
     60                                                                                                                                                height, 
     61                                                                                                                                                0, 
     62                                                                                                                                                0, 
     63                                                                                                                                                PF_FLOAT32_R, 
     64                                                                                                                                                TU_RENDERTARGET); 
     65        clusterLengthTexture = texPtr.getPointer(); 
     66 
     67        float* data = new float[clusterCount * 2]; 
     68        unsigned int entryPointCount = 0; 
     69        for(int i = 0; i < clusterCount; i++) 
     70        { 
     71                unsigned int clusterSize = OgreIlluminationManager::getSingleton().getPathMapClusterLength(i); 
     72                data[i] = clusterSize;//clustercount 
     73                data[clusterCount + i] = entryPointCount; 
     74                entryPointCount += clusterSize; 
     75        } 
     76 
     77        PixelBox lockBox2(width, height, 1, PF_FLOAT32_R, data); 
     78        clusterLengthTexture->getBuffer()->blitFromMemory(lockBox2); 
     79 
     80        delete[] data; 
    5081} 
    5182 
Note: See TracChangeset for help on using the changeset viewer.