Changeset 2212 for GTP/trunk/App
- Timestamp:
- 03/08/07 16:59:38 (17 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/pathmap
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/pathmap/PathMap.cpp
r2197 r2212 380 380 strcpy(prmDirectory, "prm"); 381 381 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; 384 387 385 388 char* toki; -
GTP/trunk/App/Demos/Illum/pathmap/PathMapEffect.cpp
r2197 r2212 147 147 148 148 //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)); 150 151 D3DSURFACE_DESC fbdesc; 151 152 frameColorBuffer->GetDesc(&fbdesc); … … 200 201 device->CreateTexture(4096, NRADIONS / 4096, 1, 0, D3DFMT_R32F, D3DPOOL_SYSTEMMEM, &sysMemWeightsTexture, NULL); 201 202 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); 202 207 203 208 //create a vertex buffer to be able to visualize entry radion positions … … 230 235 weightsTexture->Release(); 231 236 weightsSurface->Release(); 237 aggrWeightsTexture->Release(); 238 aggrWeightsSurface->Release(); 232 239 radionTexture->Release(); 233 240 radionSurface->Release(); … … 1308 1315 { 1309 1316 sceneFile >> keyword; 1310 strcpy(prmFileName, LC::c-this->prmDirectory); 1311 strcat(prmFileName, "\\"); 1312 strcat(prmFileName, keyword); 1317 strcpy(prmFileName, keyword); 1313 1318 } 1314 1319 if(strcmp(keyword, "mesh") == 0) -
GTP/trunk/App/Demos/Illum/pathmap/PathMapEffect.h
r2197 r2212 65 65 LPDIRECT3DTEXTURE9 radionTexture; //!< texture containing entry point data, input for weight computation 66 66 LPDIRECT3DSURFACE9 radionSurface; //!< entry point texture's surface 67 68 LPDIRECT3DTEXTURE9 aggrWeightsTexture; 69 LPDIRECT3DSURFACE9 aggrWeightsSurface; 67 70 68 71 KDTree* kdtree; //!< the kd-tree that contains the scene geometry in raytraceable format -
GTP/trunk/App/Demos/Illum/pathmap/SubEntity.cpp
r2197 r2212 274 274 { 275 275 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); 278 278 } 279 279 … … 281 281 { 282 282 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); 284 284 D3DXLoadSurfaceFromFile(prmSurface, NULL, NULL, L::l+prmFileName, NULL, D3DX_DEFAULT, 0, NULL); 285 285 } -
GTP/trunk/App/Demos/Illum/pathmap/computeWeights.fx
r2197 r2212 84 84 } 85 85 } 86 /* 87 float4 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 105 technique 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 122 122 1.0 - (input.texAtlas.y + (iCluster / prmAtlasTiles.x)) / prmAtlasTiles.y) + atlasHalfPixel; 123 123 float4 weight = weightsa[iCluster/4]; 124 // weight = 0.0 01;124 // weight = 0.065; 125 125 float3 val = tex2D(filteredAtlasSampler, prmTexPos); 126 126 col += val.xyz * weight.x; … … 181 181 1.0 - (input.texAtlas.y + (iCluster / prmAtlasTiles.x)) / prmAtlasTiles.y) + atlasHalfPixel; 182 182 float4 weight = weightsa[iCluster/4]; 183 // weight = 0.065; 183 184 float3 val = tex2D(filteredAtlasSampler, prmTexPos); 184 185 col += val.xyz * weight.x; … … 201 202 202 203 return float4( lightPower * col * tex2D(brdfMapSampler, input.tex) , 1); 204 // return float4( lightPower * col, 1); 203 205 } 204 206
Note: See TracChangeset
for help on using the changeset viewer.