Changeset 2212 for GTP/trunk


Ignore:
Timestamp:
03/08/07 16:59:38 (18 years ago)
Author:
szirmay
Message:
 
Location:
GTP/trunk/App/Demos/Illum/pathmap
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Illum/pathmap/PathMap.cpp

    r2197 r2212  
    380380        strcpy(prmDirectory, "prm"); 
    381381        strcpy(meshDirectory, "processedMeshes"); 
    382         strcpy(levelFileName, "ss_ironnail.level"); 
    383         strcpy(materialFileName, "ss_ironnail.materials"); 
     382        strcpy(levelFileName, "space.level"); 
     383        strcpy(materialFileName, "space.materials"); 
     384        nClusters = 64; 
     385        nEntryPoints = 4096; 
     386        depthMapResolution = 512; 
    384387 
    385388        char* toki; 
  • GTP/trunk/App/Demos/Illum/pathmap/PathMapEffect.cpp

    r2197 r2212  
    147147 
    148148        //initialize camera 
    149         camera->SetViewParams( &D3DXVECTOR3(0.0f, 0.0f, 4.0f), &D3DXVECTOR3(0.0f, 0.0f, 0.0f)); 
     149//      camera->SetViewParams( &D3DXVECTOR3(0.0f, 0.0f, 4.0f), &D3DXVECTOR3(0.0f, 0.0f, 0.0f)); 
     150        camera->SetViewParams( &D3DXVECTOR3(0.0f, 0.0f, 0.0f), &D3DXVECTOR3(0.0f, 0.0f, 1.0f)); 
    150151        D3DSURFACE_DESC fbdesc; 
    151152        frameColorBuffer->GetDesc(&fbdesc); 
     
    200201        device->CreateTexture(4096, NRADIONS / 4096, 1, 0, D3DFMT_R32F, D3DPOOL_SYSTEMMEM, &sysMemWeightsTexture, NULL); 
    201202        sysMemWeightsTexture->GetSurfaceLevel(0, &sysMemWeightsSurface); 
     203 
     204        //create aggr weights render target 
     205        device->CreateTexture(MAXNCLUSTERS, 1, 1, D3DUSAGE_RENDERTARGET, D3DFMT_R32F, D3DPOOL_DEFAULT, &aggrWeightsTexture, NULL); 
     206        aggrWeightsTexture->GetSurfaceLevel(0, &aggrWeightsSurface); 
    202207 
    203208        //create a vertex buffer to be able to visualize entry radion positions 
     
    230235        weightsTexture->Release(); 
    231236        weightsSurface->Release(); 
     237        aggrWeightsTexture->Release(); 
     238        aggrWeightsSurface->Release(); 
    232239        radionTexture->Release(); 
    233240        radionSurface->Release(); 
     
    13081315                                { 
    13091316                                        sceneFile >> keyword; 
    1310                                         strcpy(prmFileName, LC::c-this->prmDirectory); 
    1311                                         strcat(prmFileName, "\\"); 
    1312                                         strcat(prmFileName, keyword); 
     1317                                        strcpy(prmFileName, keyword); 
    13131318                                } 
    13141319                                if(strcmp(keyword, "mesh") == 0) 
  • GTP/trunk/App/Demos/Illum/pathmap/PathMapEffect.h

    r2197 r2212  
    6565        LPDIRECT3DTEXTURE9              radionTexture;                                  //!< texture containing entry point data, input for weight computation 
    6666        LPDIRECT3DSURFACE9              radionSurface;                                  //!< entry point texture's surface 
     67 
     68        LPDIRECT3DTEXTURE9              aggrWeightsTexture; 
     69        LPDIRECT3DSURFACE9              aggrWeightsSurface; 
    6770 
    6871        KDTree* kdtree;         //!< the kd-tree that contains the scene geometry in raytraceable format 
  • GTP/trunk/App/Demos/Illum/pathmap/SubEntity.cpp

    r2197 r2212  
    274274{ 
    275275        char prmFileName[300]; 
    276         sprintf(prmFileName, "%s_%d.hdr", parent->prmFileName, subMesh->subsetId); 
    277         D3DXSaveSurfaceToFile(L::l+prmFileName, D3DXIFF_HDR, prmSurface, NULL, NULL); 
     276        sprintf(prmFileName, "%s/%s_%d.dds", LC::c-subMesh->parent->pathMapEffect->prmDirectory, parent->prmFileName, subMesh->subsetId); 
     277        D3DXSaveSurfaceToFile(L::l+prmFileName, D3DXIFF_DDS, prmSurface, NULL, NULL); 
    278278} 
    279279 
     
    281281{ 
    282282        char prmFileName[300]; 
    283         sprintf(prmFileName, "%s_%d.hdr", parent->prmFileName, subMesh->subsetId); 
     283        sprintf(prmFileName, "%s/%s_%d.dds", LC::c-subMesh->parent->pathMapEffect->prmDirectory, parent->prmFileName, subMesh->subsetId); 
    284284        D3DXLoadSurfaceFromFile(prmSurface, NULL, NULL, L::l+prmFileName, NULL, D3DX_DEFAULT, 0, NULL); 
    285285} 
  • GTP/trunk/App/Demos/Illum/pathmap/computeWeights.fx

    r2197 r2212  
    8484    } 
    8585} 
     86/* 
     87float4 
     88        psAggregateWeights(vsOutputComputeWeights input, in int rid : VPOS) : COLOR0 
     89{ 
     90        float sumWeight = 0.0; 
     91        float sumProb = 0.0000001; 
     92         
     93        int iRadion = clusterStarts[rid]; 
     94        float2 wTex = float2((iRadion / 4096 + 0.5) * dataColumnWidth, 
     95                                                 (iRadion % 4096  + 0.5) / 4096.0) ); 
     96        while(iRadion < clusterStarts[rid+1]) 
     97        { 
     98                sumWeight += tex2Dlod(weightSampler, float4(wTex, 0, 1)); 
     99                float sumProb += 1.0; 
     100                wTex.y += 1.0 / 4096.0; 
     101        } 
     102        return (sumWeight / sumProb).xxxx; 
     103} 
     104 
     105technique AggregateWeights{ 
     106        pass P0 
     107    { 
     108        VertexShader = compile vs_3_0 vsComputeWeights(); 
     109        PixelShader  = compile ps_3_0 psAggregateWeights(); 
     110    } 
     111} 
     112*/ 
  • GTP/trunk/App/Demos/Illum/pathmap/pathMap.fx

    r2197 r2212  
    122122                        1.0 - (input.texAtlas.y + (iCluster / prmAtlasTiles.x)) / prmAtlasTiles.y) + atlasHalfPixel; 
    123123                float4 weight = weightsa[iCluster/4]; 
    124 //              weight = 0.001; 
     124//              weight = 0.065; 
    125125                float3 val = tex2D(filteredAtlasSampler, prmTexPos); 
    126126                col += val.xyz * weight.x; 
     
    181181                        1.0 - (input.texAtlas.y + (iCluster / prmAtlasTiles.x)) / prmAtlasTiles.y) + atlasHalfPixel; 
    182182                float4 weight = weightsa[iCluster/4]; 
     183//              weight = 0.065; 
    183184                float3 val = tex2D(filteredAtlasSampler, prmTexPos); 
    184185                col += val.xyz * weight.x; 
     
    201202 
    202203        return float4( lightPower * col  * tex2D(brdfMapSampler, input.tex) , 1); 
     204//      return float4( lightPower * col, 1); 
    203205} 
    204206 
Note: See TracChangeset for help on using the changeset viewer.