Changeset 2214


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

Legend:

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

    r2209 r2214  
    2929                                                                                                                                                0, 
    3030                                                                                                                                                0, 
    31                                                                                                                                                 PF_FLOAT16_RGBA, 
     31                                                                                                                                                PF_FLOAT32_R, 
    3232                                                                                                                                                TU_RENDERTARGET); 
    3333         allWeightsTexture = texPtr.getPointer(); 
     
    5050                                                                                                                                0, 
    5151                                                                                                                                0, 
    52                                                                                                                                 PF_FLOAT16_RGBA, 
     52                                                                                                                                PF_FLOAT32_R, 
    5353                                                                                                                                TU_RENDERTARGET); 
    5454         weightTexture = texPtr.getPointer(); 
     
    9393                        renderFullscreenQuad(mat->getName(), rt); 
    9494 
    95                         rt->writeContentsToFile("allweights.bmp");                       
     95                        rt->writeContentsToFile("allweights.bmp"); 
    9696                //      rt->writeContentsToFile("allweights.dds"); 
     97                         
     98                        float* allweights = new float[entryPointCnt / 4096 * 4096]; 
     99                        PixelBox lockBox(entryPointCnt / 4096, 4096, 1, PF_FLOAT32_R, allweights); 
     100                        allWeightsTexture->getBuffer()->blitToMemory(lockBox); 
    97101 
    98  
    99 ///////////////////DEBUG 
     102                        ///////////////////DEBUG 
    100103                        static BillboardSet* entryPointBBSet = 0; 
    101104                        if(entryPointBBSet == 0) 
     
    110113                                        PathMapEntryPoint EP = OgreIlluminationManager::getSingleton().getPathMapEntryPoints().at(i); 
    111114                                        Vector3 billboardPosition = EP.position; 
    112                                         float uCoord = ((float) (i % col) + 0.5f) / (float) col; 
    113                                         float vCoord = ((float)(i / col) + 0.5f) / 4096.0f; 
     115                                         
     116                                        float uCoord = allweights[i]; 
     117                                        float  vCoord = 0; 
     118                                        //float uCoord = ((float) (i % col) + 0.5f) / (float) col; 
     119                                        //float vCoord = ((float)(i / col) + 0.5f) / 4096.0f; 
    114120                                        entryPointBBSet->createBillboard(billboardPosition, ColourValue(uCoord, vCoord, 0, 0)); 
    115121                                } 
     
    119125                                sm->getRootSceneNode()->createChildSceneNode()->attachObject(entryPointBBSet); 
    120126                        } 
     127 
     128                        delete[] allweights; 
     129 
    121130///////////////// 
    122131        } 
     
    125134                ///not implemented 
    126135        } 
    127 /* 
     136 
    128137        unsigned int clustercount = OgreIlluminationManager::getSingleton().getPathMapClusterLengthsSize(); 
    129138 
     
    142151        renderFullscreenQuad(mat->getName(), rt); 
    143152 
    144         rt->writeContentsToFile("weights.bmp");  
    145         rt->writeContentsToFile("weights.dds"); */ 
     153        //rt->writeContentsToFile("weights.bmp");        
     154        //rt->writeContentsToFile("weights.dds"); 
     155 
     156        float* weights = new float[clustercount]; 
     157        PixelBox lockBox(clustercount, 1, 1, PF_FLOAT32_R, weights); 
     158        allWeightsTexture->getBuffer()->blitToMemory(lockBox); 
     159 
     160        delete[] weights; 
    146161} 
    147162 
Note: See TracChangeset for help on using the changeset viewer.